Skip to content

Commit

Permalink
add typewriter
Browse files Browse the repository at this point in the history
  • Loading branch information
Firisy committed Jul 3, 2024
1 parent 5a8b119 commit 1227a70
Show file tree
Hide file tree
Showing 78 changed files with 14,735 additions and 5,416 deletions.
37 changes: 37 additions & 0 deletions docs/javascripts/typewriter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
document.addEventListener("DOMContentLoaded", function() {
function typeWriter(element, text, speed, callback) {
let i = 0;
function type() {
if (i < text.length) {
element.innerHTML += text.charAt(i).replace('\n', '<br>'); // Replace newline with <br> for line breaks
i++;
setTimeout(type, speed);
} else {
console.log('Typing complete, pausing cursor animation for', element); // Debug output
if (callback) callback();
}
}
type();
}

const headerElement = document.querySelector('.hero_header');
const taglineElement = document.querySelector('.tagline');

const headerText = 'JY-HF Learning Site___';
const headerHTML = 'JY-HF <span class="light">Learning Site___</span>';
const taglineText = 'Share the knowledge to you and Us';
const taglineHTML = 'Share the knowledge to you and <span class="blue">Us</span>';

headerElement.textContent = '';
taglineElement.textContent = '';

typeWriter(headerElement, headerText, 300, () => {
headerElement.innerHTML = headerHTML;
headerElement.style.animationPlayState = 'paused'; // Pause the cursor animation
headerElement.style.borderRightColor = 'transparent'; // Make the cursor transparent
typeWriter(taglineElement, taglineText, 300, () => {
taglineElement.innerHTML = taglineHTML;

});
});
});
37 changes: 37 additions & 0 deletions docs/stylesheets/singlePageTemplate.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/* Hero Section */
.hero {
background-color: #CBE3F7;
padding-top: 150px;
padding-bottom: 150px;
text-align: center;
}

.pink {
color: #3693CD;
}

.light {
font-weight: bold;
color: #0B3ADC;
}

.tagline {
color: #16273d;
margin-top: 4px;
font-weight: lighter;
text-transform: uppercase;
letter-spacing: 1px;
}

.typewriter {
display: inline-block;
overflow: hidden;
border-right: solid black; /* Cursor effect */
animation: blink-caret 0.75s step-end infinite;
word-wrap: break-word; /* Ensure words break and wrap correctly */
}

@keyframes blink-caret {
from, to { border-color: transparent; }
50% { border-color: black; }
}
24 changes: 16 additions & 8 deletions material/overrides/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,22 @@

@media screen and (min-width:76.25em) {
.md-sidebar--primary {
display: none
display: none·
}
}
</style>
<section class="mdx-container">
<div class="md-grid md-typeset">
<div class="mdx-hero">
<div class="mdx-hero__image">
<img
src="https://upload-bbs.miyoushe.com/upload/2023/11/05/11316600/63cb78f6e4b55900d5c80a3b5f54de65_8615193900844086.png?x-oss-process=image/auto-orient,0/interlace,1/format,png"
alt="" width="1659" height="819.37" draggable="false">
</div>
<link href="stylesheets/singlePageTemplate.css" rel="stylesheet" type="text/css">
<section class="hero" id="hero">
<h2 class="typewriter hero_header" id="typewriter-header">JY-HF <span class="light">Learning Site___</span>
</h2>
<br>
<p class="typewriter tagline" id="typewriter-tagline">Share the knowledge to you and <span
class="blue">Us</span></p>
</section>
<script src="/javascripts/typewriter.js"></script>
<div class="mdx-hero__content">
<h1 style="color: antiquewhite;font-family: 'Courier New', Courier, monospace;font-weight: 1000;">Welcome to the
coding space of JY-HF!</h1>
Expand All @@ -55,10 +59,14 @@ <h1 style="color: antiquewhite;font-family: 'Courier New', Courier, monospace;fo
style="display: inline-block;margin: 10px;">
Get Insiders
</a>

</div>
</div>
</div>
</section>
{% endblock %}
{% block content %}{% endblock %}
{% block footer %}{% endblock %}
{% block content %}
{% endblock %}
{% block footer %}
{{ super() }}
{% endblock %}
81 changes: 74 additions & 7 deletions site/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@


<li class="md-tabs__item">
<a href="/JY_FENG/1%20%E7%94%B5%E8%B7%AF%E7%94%B5%E5%AD%90%E6%8A%80%E6%9C%AFI%E5%AE%9E%E9%AA%8C/preview/" class="md-tabs__link">
<a href="/JY_FENG/JY-Feng/" class="md-tabs__link">


Jy Feng EE
Expand Down Expand Up @@ -1523,7 +1523,7 @@


<span class="md-ellipsis">
1 电路电子技术I实验(爱迪生班)
Preview
</span>


Expand All @@ -1532,6 +1532,73 @@

<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_1_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5_1">
<span class="md-nav__icon md-icon"></span>
Preview
</label>
<ul class="md-nav__list" data-md-scrollfix>







<li class="md-nav__item">
<a href="/JY_FENG/JY-Feng/" class="md-nav__link">


<span class="md-ellipsis">
Preview
</span>


</a>
</li>




</ul>
</nav>

</li>

















<li class="md-nav__item md-nav__item--nested">



<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_2" >


<label class="md-nav__link" for="__nav_5_2" id="__nav_5_2_label" tabindex="0">


<span class="md-ellipsis">
1 电路电子技术I实验(爱迪生班)
</span>


<span class="md-nav__icon md-icon"></span>
</label>

<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5_2">
<span class="md-nav__icon md-icon"></span>
1 电路电子技术I实验(爱迪生班)
</label>
Expand Down Expand Up @@ -1877,10 +1944,10 @@



<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_2" >
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_3" >


<label class="md-nav__link" for="__nav_5_2" id="__nav_5_2_label" tabindex="0">
<label class="md-nav__link" for="__nav_5_3" id="__nav_5_3_label" tabindex="0">


<span class="md-ellipsis">
Expand All @@ -1891,8 +1958,8 @@
<span class="md-nav__icon md-icon"></span>
</label>

<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5_2">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5_3">
<span class="md-nav__icon md-icon"></span>
2 电路电子技术II实验(爱迪生班)
</label>
Expand Down Expand Up @@ -2442,7 +2509,7 @@ <h1>404 - Not found</h1>
</div>


<script id="__config" type="application/json">{"base": "/", "features": ["header.autohide", "navigation.instant", "navigation.tracking", "content.code.annotate", "toc.integrate", "toc.follow", "navigation.path", "navigation.top", "navigation.tabs", "navigation.footer", "content.code.copy"], "search": "/assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "\u5df2\u590d\u5236", "clipboard.copy": "\u590d\u5236", "search.result.more.one": "\u5728\u8be5\u9875\u4e0a\u8fd8\u6709 1 \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.more.other": "\u5728\u8be5\u9875\u4e0a\u8fd8\u6709 # \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.none": "\u6ca1\u6709\u627e\u5230\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.one": "\u627e\u5230 1 \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.other": "# \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.placeholder": "\u952e\u5165\u4ee5\u5f00\u59cb\u641c\u7d22", "search.result.term.missing": "\u7f3a\u5c11", "select.version": "\u9009\u62e9\u5f53\u524d\u7248\u672c"}}</script>
<script id="__config" type="application/json">{"base": "/", "features": ["header.autohide", "navigation.instant", "navigation.tracking", "content.code.annotate", "toc.integrate", "toc.follow", "navigation.path", "navigation.top", "navigation.tabs", "navigation.footer", "content.code.copy", "content.code.select"], "search": "/assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "\u5df2\u590d\u5236", "clipboard.copy": "\u590d\u5236", "search.result.more.one": "\u5728\u8be5\u9875\u4e0a\u8fd8\u6709 1 \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.more.other": "\u5728\u8be5\u9875\u4e0a\u8fd8\u6709 # \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.none": "\u6ca1\u6709\u627e\u5230\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.one": "\u627e\u5230 1 \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.other": "# \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.placeholder": "\u952e\u5165\u4ee5\u5f00\u59cb\u641c\u7d22", "search.result.term.missing": "\u7f3a\u5c11", "select.version": "\u9009\u62e9\u5f53\u524d\u7248\u672c"}}</script>


<script src="/assets/javascripts/bundle.ad660dcc.min.js"></script>
Expand Down
87 changes: 77 additions & 10 deletions site/JY_FENG/1 电路电子技术I实验/Final/Final/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@


<li class="md-tabs__item md-tabs__item--active">
<a href="../../preview/" class="md-tabs__link">
<a href="../../../JY-Feng/" class="md-tabs__link">


Jy Feng EE
Expand Down Expand Up @@ -1516,6 +1516,73 @@












<li class="md-nav__item md-nav__item--nested">



<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_1" >


<label class="md-nav__link" for="__nav_5_1" id="__nav_5_1_label" tabindex="0">


<span class="md-ellipsis">
Preview
</span>


<span class="md-nav__icon md-icon"></span>
</label>

<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_1_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5_1">
<span class="md-nav__icon md-icon"></span>
Preview
</label>
<ul class="md-nav__list" data-md-scrollfix>







<li class="md-nav__item">
<a href="../../../JY-Feng/" class="md-nav__link">


<span class="md-ellipsis">
Preview
</span>


</a>
</li>




</ul>
</nav>

</li>











Expand All @@ -1531,10 +1598,10 @@



<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_1" checked>
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_2" checked>


<label class="md-nav__link" for="__nav_5_1" id="__nav_5_1_label" tabindex="0">
<label class="md-nav__link" for="__nav_5_2" id="__nav_5_2_label" tabindex="0">


<span class="md-ellipsis">
Expand All @@ -1545,8 +1612,8 @@
<span class="md-nav__icon md-icon"></span>
</label>

<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_1_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_5_1">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_2_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_5_2">
<span class="md-nav__icon md-icon"></span>
1 电路电子技术I实验(爱迪生班)
</label>
Expand Down Expand Up @@ -1900,10 +1967,10 @@



<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_2" >
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_3" >


<label class="md-nav__link" for="__nav_5_2" id="__nav_5_2_label" tabindex="0">
<label class="md-nav__link" for="__nav_5_3" id="__nav_5_3_label" tabindex="0">


<span class="md-ellipsis">
Expand All @@ -1914,8 +1981,8 @@
<span class="md-nav__icon md-icon"></span>
</label>

<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5_2">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5_3">
<span class="md-nav__icon md-icon"></span>
2 电路电子技术II实验(爱迪生班)
</label>
Expand Down Expand Up @@ -2555,7 +2622,7 @@ <h1>WLab Final</h1>
</div>


<script id="__config" type="application/json">{"base": "../../../..", "features": ["header.autohide", "navigation.instant", "navigation.tracking", "content.code.annotate", "toc.integrate", "toc.follow", "navigation.path", "navigation.top", "navigation.tabs", "navigation.footer", "content.code.copy"], "search": "../../../../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "\u5df2\u590d\u5236", "clipboard.copy": "\u590d\u5236", "search.result.more.one": "\u5728\u8be5\u9875\u4e0a\u8fd8\u6709 1 \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.more.other": "\u5728\u8be5\u9875\u4e0a\u8fd8\u6709 # \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.none": "\u6ca1\u6709\u627e\u5230\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.one": "\u627e\u5230 1 \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.other": "# \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.placeholder": "\u952e\u5165\u4ee5\u5f00\u59cb\u641c\u7d22", "search.result.term.missing": "\u7f3a\u5c11", "select.version": "\u9009\u62e9\u5f53\u524d\u7248\u672c"}}</script>
<script id="__config" type="application/json">{"base": "../../../..", "features": ["header.autohide", "navigation.instant", "navigation.tracking", "content.code.annotate", "toc.integrate", "toc.follow", "navigation.path", "navigation.top", "navigation.tabs", "navigation.footer", "content.code.copy", "content.code.select"], "search": "../../../../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "\u5df2\u590d\u5236", "clipboard.copy": "\u590d\u5236", "search.result.more.one": "\u5728\u8be5\u9875\u4e0a\u8fd8\u6709 1 \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.more.other": "\u5728\u8be5\u9875\u4e0a\u8fd8\u6709 # \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.none": "\u6ca1\u6709\u627e\u5230\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.one": "\u627e\u5230 1 \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.other": "# \u4e2a\u7b26\u5408\u6761\u4ef6\u7684\u7ed3\u679c", "search.result.placeholder": "\u952e\u5165\u4ee5\u5f00\u59cb\u641c\u7d22", "search.result.term.missing": "\u7f3a\u5c11", "select.version": "\u9009\u62e9\u5f53\u524d\u7248\u672c"}}</script>


<script src="../../../../assets/javascripts/bundle.ad660dcc.min.js"></script>
Expand Down
Loading

0 comments on commit 1227a70

Please sign in to comment.