Compare commits

..

No commits in common. "0a50728469191516283a4da288d0b05efae2957c" and "f9a19d60c3657e700803557de59411489cf4dcc0" have entirely different histories.

3 changed files with 20 additions and 23 deletions

View file

@ -32,9 +32,9 @@ export function timeAgo(unixTimestamp: number): string {
return Math.floor(seconds) + " seconds ago";
}
export function randomStr(length: number, withNumbers = true): string {
export function randomStr(length: number): string {
let result = '';
const characters = ('ABCDEFGHIJKLMNOPQRSTUVWXYZ' + (withNumbers ? '123456789' : '')).toUpperCase();
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789'.toUpperCase();
const charactersLength = characters.length;
let counter = 0;
while (counter < length) {

View file

@ -19,8 +19,8 @@
<svelte:head>
<title>{data.title}</title>
<meta name="description" content={data.quote} />
<!-- <meta name="theme-color" content="#00e1ff" /> -->
<meta name="description" content={data.description} />
<meta name="theme-color" content="#00e1ff" />
</svelte:head>
{#if loaded}

View file

@ -1,4 +1,5 @@
<script lang="ts">
import { page } from "$app/stores";
import { getTimeIn, randomStr } from "$lib";
import { onMount } from "svelte";
import type { PageData } from "./$types";
@ -19,6 +20,8 @@
let time = $derived(getTimeIn(data.timezone));
let charAmount = $state(0);
let webring = $page.url.searchParams.has('webring');
let audio: HTMLAudioElement;
let showNotification = $state(false);
@ -45,22 +48,9 @@
<audio bind:this={audio} src="/hk-white-palace-ost.mp3" loop></audio>
<a href="https://hackclub.com" target="_blank" class="z-50 fixed top-24 sm:top-12 md:top-4 -left-2 hover:left-0">
<img src="https://assets.hackclub.com/flag-orpheus-left.svg" alt="Hack Club Orpheus Flag" class="h-16">
</a>
<nav class="flex flex-col gap-0 items-center z-50 fixed top-24 sm:top-12 md:top-4 right-0 font-semibold bg-ctp-surface0 pr-4 pl-2 py-1 rounded-l-xl border-y border-l border-ctp-sky">
<a href="https://nixwebr.ing" class="no-underline text-sm text-ctp-text">nix-webring</a>
<div class="text-2xl">
<a href="https://nixwebr.ing/prev/satr14" class="no-underline text-ctp-text">&larr;</a>
<a href="https://nixwebr.ing/rand" class="no-underline text-ctp-text">&#9858;</a>
<a href="https://nixwebr.ing/next/satr14" class="no-underline text-ctp-text">&rarr;</a>
</div>
</nav>
{#if showNotification}
<div class="z-50 fixed top-6 right-6 left-6 flex justify-center items-center">
<div class="flex items-center gap-3 bg-ctp-surface0 text-ctp-text px-4 py-3 rounded-xl shadow-lg border border-ctp-sky" transition:fly={{ y: 20, duration: 300, easing: cubicOut }}>
<div class="flex items-center gap-3 bg-ctp-surface0 text-ctp-text px-4 py-3 rounded-xl shadow-lg" transition:fly={{ y: 20, duration: 300, easing: cubicOut }}>
<span class="text-lg"></span>
<div class="text-sm">
<p class="m-0 font-medium">Now Playing</p>
@ -102,11 +92,18 @@
<div class="fixed top-0 left-0 w-full text-base flex justify-center items-center">
<nav class="py-2 px-4 backdrop-blur rounded-t-3xl border-ctp-base hover:border-ctp-sky">
<p class="animate-pulse italic text-base text-center">
<span>"{data.quote}"</span><br>
<span class="hidden sm:block">Press [Space] to continue.</span>
<span class="sm:hidden">Scroll to continue.</span>
</p>
{#if webring}
<a href="https://nixwebr.ing" class="no-underline">nixwebr.ing:</a>
<a href="https://nixwebr.ing/prev/satr14" class="no-underline">&larr;</a>
<a href="https://nixwebr.ing/rand" class="no-underline">?</a>
<a href="https://nixwebr.ing/next/satr14" class="no-underline">&rarr;</a>
{:else}
<p class="animate-pulse italic text-base text-center">
<span>"{data.quote}"</span><br>
<span class="hidden sm:block">Press [Space] to continue.</span>
<span class="sm:hidden">Scroll to continue.</span>
</p>
{/if}
</nav>
</div>