Skip to content

Commit ffa4ee9

Browse files
committed
khogadetem
1 parent 5b29995 commit ffa4ee9

File tree

1 file changed

+37
-8
lines changed

1 file changed

+37
-8
lines changed

src/views/Home.vue

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,24 @@ const handleScroll = (): void => {
4949
isScrolled.value = window.scrollY > 20;
5050
};
5151
52+
const fullText = 'Gõ không gạch chân cực mượt';
53+
const displayText = ref<string>('');
54+
const typingSpeed = 100;
55+
56+
const startTyping = () => {
57+
let i = 0;
58+
displayText.value = '';
59+
const timer = setInterval(() => {
60+
if (i < fullText.length) {
61+
displayText.value += fullText.charAt(i);
62+
i++;
63+
} else {
64+
clearInterval(timer);
65+
setTimeout(startTyping, 3000);
66+
}
67+
}, typingSpeed);
68+
};
69+
5270
onMounted(() => {
5371
const savedTheme = localStorage.getItem('catppuccin-theme');
5472
if (savedTheme && catppuccinThemes.includes(savedTheme as CatppuccinTheme)) {
@@ -64,6 +82,7 @@ onMounted(() => {
6482
6583
document.documentElement.setAttribute('data-theme', currentTheme.value);
6684
window.addEventListener('scroll', handleScroll);
85+
startTyping();
6786
});
6887
6988
onUnmounted(() => window.removeEventListener('scroll', handleScroll));
@@ -366,16 +385,14 @@ const copyToClipboard = async (text: string | undefined): Promise<void> => {
366385
<span class="dot dot-red"></span>
367386
<span class="dot dot-yellow"></span>
368387
<span class="dot dot-green"></span>
369-
<span class="term-title">user@linux:~</span>
388+
<span class="term-title">khoga@detem:~</span>
370389
</div>
371390
<div class="term-body">
372-
<p><span class="prompt">❯</span> fcitx5-lotus --status</p>
391+
<p><span class="prompt">🪷 ❯</span> fcitx5-lotus --status</p>
373392
<p class="info">[INFO] Lotus Server is running (PID: 1337)</p>
374-
<p>
375-
<span class="prompt">❯</span> echo "Gõ không gạch chân cực mượt"
376-
</p>
393+
<p><span class="prompt">🪷 ❯</span> echo "{{ fullText }}"</p>
377394
<p class="typing">
378-
Gõ không gạch chân cực mượt<span class="cursor"></span>
395+
{{ displayText }}<span class="cursor"></span>
379396
</p>
380397
</div>
381398
</div>
@@ -1683,11 +1700,23 @@ body {
16831700
.typing {
16841701
display: flex;
16851702
align-items: center;
1703+
min-height: 1.2em;
1704+
color: var(--ctp-text);
1705+
font-family: monospace;
1706+
}
1707+
@keyframes blink {
1708+
0%,
1709+
100% {
1710+
opacity: 1;
1711+
}
1712+
50% {
1713+
opacity: 0;
1714+
}
16861715
}
16871716
.cursor {
16881717
display: inline-block;
1689-
width: 8px;
1690-
height: 16px;
1718+
width: 10px;
1719+
height: 1.2em;
16911720
background-color: var(--ctp-green);
16921721
margin-left: 4px;
16931722
animation: blink 1s step-end infinite;

0 commit comments

Comments
 (0)