Compare commits
4 commits
f9a19d60c3
...
0a50728469
| Author | SHA1 | Date | |
|---|---|---|---|
| 0a50728469 | |||
| 38d9ed0f9f | |||
| b911b51812 | |||
| 27a3e473ec |
3 changed files with 23 additions and 20 deletions
|
|
@ -32,9 +32,9 @@ export function timeAgo(unixTimestamp: number): string {
|
||||||
return Math.floor(seconds) + " seconds ago";
|
return Math.floor(seconds) + " seconds ago";
|
||||||
}
|
}
|
||||||
|
|
||||||
export function randomStr(length: number): string {
|
export function randomStr(length: number, withNumbers = true): string {
|
||||||
let result = '';
|
let result = '';
|
||||||
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789'.toUpperCase();
|
const characters = ('ABCDEFGHIJKLMNOPQRSTUVWXYZ' + (withNumbers ? '123456789' : '')).toUpperCase();
|
||||||
const charactersLength = characters.length;
|
const charactersLength = characters.length;
|
||||||
let counter = 0;
|
let counter = 0;
|
||||||
while (counter < length) {
|
while (counter < length) {
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
<title>{data.title}</title>
|
<title>{data.title}</title>
|
||||||
<meta name="description" content={data.description} />
|
<meta name="description" content={data.quote} />
|
||||||
<meta name="theme-color" content="#00e1ff" />
|
<!-- <meta name="theme-color" content="#00e1ff" /> -->
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
{#if loaded}
|
{#if loaded}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from "$app/stores";
|
|
||||||
import { getTimeIn, randomStr } from "$lib";
|
import { getTimeIn, randomStr } from "$lib";
|
||||||
import { onMount } from "svelte";
|
import { onMount } from "svelte";
|
||||||
import type { PageData } from "./$types";
|
import type { PageData } from "./$types";
|
||||||
|
|
@ -20,8 +19,6 @@
|
||||||
let time = $derived(getTimeIn(data.timezone));
|
let time = $derived(getTimeIn(data.timezone));
|
||||||
let charAmount = $state(0);
|
let charAmount = $state(0);
|
||||||
|
|
||||||
let webring = $page.url.searchParams.has('webring');
|
|
||||||
|
|
||||||
let audio: HTMLAudioElement;
|
let audio: HTMLAudioElement;
|
||||||
let showNotification = $state(false);
|
let showNotification = $state(false);
|
||||||
|
|
||||||
|
|
@ -48,9 +45,22 @@
|
||||||
|
|
||||||
<audio bind:this={audio} src="/hk-white-palace-ost.mp3" loop></audio>
|
<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">←</a>
|
||||||
|
<a href="https://nixwebr.ing/rand" class="no-underline text-ctp-text">⚂</a>
|
||||||
|
<a href="https://nixwebr.ing/next/satr14" class="no-underline text-ctp-text">→</a>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
{#if showNotification}
|
{#if showNotification}
|
||||||
<div class="z-50 fixed top-6 right-6 left-6 flex justify-center items-center">
|
<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>
|
<span class="text-lg">♪</span>
|
||||||
<div class="text-sm">
|
<div class="text-sm">
|
||||||
<p class="m-0 font-medium">Now Playing</p>
|
<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">
|
<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">
|
<nav class="py-2 px-4 backdrop-blur rounded-t-3xl border-ctp-base hover:border-ctp-sky">
|
||||||
{#if webring}
|
<p class="animate-pulse italic text-base text-center">
|
||||||
<a href="https://nixwebr.ing" class="no-underline">nixwebr.ing:</a>
|
<span>"{data.quote}"</span><br>
|
||||||
<a href="https://nixwebr.ing/prev/satr14" class="no-underline">←</a>
|
<span class="hidden sm:block">Press [Space] to continue.</span>
|
||||||
<a href="https://nixwebr.ing/rand" class="no-underline">?</a>
|
<span class="sm:hidden">Scroll to continue.</span>
|
||||||
<a href="https://nixwebr.ing/next/satr14" class="no-underline">→</a>
|
</p>
|
||||||
{: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>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue