forked from DevComp/ssh-portfolio
feat: website landing
This commit is contained in:
parent
e492e2b275
commit
d9632a02b1
1 changed files with 87 additions and 2 deletions
|
@ -1,2 +1,87 @@
|
|||
<h1>Welcome to SvelteKit</h1>
|
||||
<p>Visit <a href="https://svelte.dev/docs/kit">svelte.dev/docs/kit</a> to read the documentation</p>
|
||||
<script lang="ts">
|
||||
import CheckIcon from '$lib/components/checkIcon.svelte';
|
||||
import CopyIcon from '$lib/components/copyIcon.svelte';
|
||||
import { onMount } from 'svelte';
|
||||
import { crossfade, fade } from 'svelte/transition';
|
||||
|
||||
const command = 'ssh devcomp.xyz';
|
||||
const cursor = '█'
|
||||
|
||||
let showCheckmark = $state(false);
|
||||
let animationFinished = $state(false);
|
||||
let commandText = $state(cursor);
|
||||
|
||||
function copy(event: MouseEvent) {
|
||||
event.preventDefault();
|
||||
|
||||
navigator.clipboard.writeText(command);
|
||||
showCheckmark = true;
|
||||
|
||||
setTimeout(() => (showCheckmark = false), 1000);
|
||||
}
|
||||
|
||||
function blinkCursor() {
|
||||
return setInterval(() => {
|
||||
if (commandText.charAt(commandText.length - 1) === cursor) {
|
||||
commandText = command + ' ';
|
||||
} else {
|
||||
commandText = command + cursor;
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
await new Promise((res) => setTimeout(res, 500));
|
||||
|
||||
const animation = setInterval(() => {
|
||||
if (commandText.length - 1 < command.length) {
|
||||
commandText = command.substring(0, commandText.length) + cursor;
|
||||
} else {
|
||||
animationFinished = true;
|
||||
clearInterval(animation);
|
||||
blinkCursor();
|
||||
}
|
||||
}, 200);
|
||||
});
|
||||
</script>
|
||||
|
||||
<main class="flex h-screen w-screen items-center justify-center">
|
||||
<div class="border-accent/50 relative flex h-[300px] w-[700px] flex-col rounded-lg border-2 p-4">
|
||||
<div class="flex items-center space-x-2">
|
||||
<pre class="text-primary inline font-bold"><span class="text-primary/50 select-none">$ </span>{commandText}</pre>
|
||||
{#if animationFinished}
|
||||
<button class="text-accent/50 hover:text-accent font-normal transition-all hover:cursor-pointer" onclick={copy} transition:fade={{delay: 500}}>
|
||||
{#if showCheckmark}
|
||||
<CheckIcon />
|
||||
{:else}
|
||||
<CopyIcon />
|
||||
{/if}
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{#if animationFinished}
|
||||
<div class="flex flex-col ml-4" transition:fade={{delay: 500}}>
|
||||
<code class="text-accent/50"><span class="select-none"># </span><q> <ctrl-d> <ctrl-c> <esc> - quit</code>
|
||||
<code class="text-accent/50"><span class="select-none"># </span><ctrl-z> - suspend</code>
|
||||
<code class="text-accent/50"><span class="select-none"># </span><right> - next tab</code>
|
||||
<code class="text-accent/50"><span class="select-none"># </span><left> - prev tab</code>
|
||||
<code class="text-accent/50"><span class="select-none"># </span><down> - next option</code>
|
||||
<code class="text-accent/50"><span class="select-none"># </span><up> - prev option</code>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="group absolute -bottom-6 right-0">
|
||||
<span class="group-hover:animate-sleep-z absolute -left-4 top-8 opacity-0">z</span>
|
||||
<span class="group-hover:animate-sleep-z absolute -left-3 top-8 opacity-0" style="animation-delay:0.3s;">z</span>
|
||||
<span class="group-hover:animate-sleep-z absolute -left-2 top-8 opacity-0" style="animation-delay:0.6s;">z</span>
|
||||
|
||||
<pre>
|
||||
|\__/,| (`\
|
||||
|_ _ |.--.) )
|
||||
( T ) /
|
||||
(((^_(((/(((_>
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
|
Loading…
Add table
Reference in a new issue