Compare commits

..

4 commits

Author SHA1 Message Date
0a50728469 random str option 2026-03-23 22:12:02 +07:00
38d9ed0f9f webring layout changes 2026-03-23 22:11:45 +07:00
b911b51812 add some border 2026-03-23 21:36:21 +07:00
27a3e473ec update embed and add orph flag 2026-03-23 20:32:29 +07:00
3 changed files with 23 additions and 20 deletions

View file

@ -32,9 +32,9 @@ export function timeAgo(unixTimestamp: number): string {
return Math.floor(seconds) + " seconds ago";
}
export function randomStr(length: number): string {
export function randomStr(length: number, withNumbers = true): string {
let result = '';
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789'.toUpperCase();
const characters = ('ABCDEFGHIJKLMNOPQRSTUVWXYZ' + (withNumbers ? '123456789' : '')).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.description} />
<meta name="theme-color" content="#00e1ff" />
<meta name="description" content={data.quote} />
<!-- <meta name="theme-color" content="#00e1ff" /> -->
</svelte:head>
{#if loaded}

View file

@ -1,5 +1,4 @@
<script lang="ts">
import { page } from "$app/stores";
import { getTimeIn, randomStr } from "$lib";
import { onMount } from "svelte";
import type { PageData } from "./$types";
@ -20,8 +19,6 @@
let time = $derived(getTimeIn(data.timezone));
let charAmount = $state(0);
let webring = $page.url.searchParams.has('webring');
let audio: HTMLAudioElement;
let showNotification = $state(false);
@ -48,9 +45,22 @@
<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" 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 border border-ctp-sky" 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>
@ -92,18 +102,11 @@
<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">
{#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>