This commit is contained in:
Christofer 2023-09-13 23:29:01 +04:00
parent 660eb6f0bb
commit 6777fad41a
7 changed files with 40 additions and 32 deletions

View file

@ -95,3 +95,7 @@ export function getIsMobile() {
export function getBlurredPath(path) { export function getBlurredPath(path) {
return `${path.substring(0, path.lastIndexOf('/'))}/generated_${path.split('/').at(-1)}` return `${path.substring(0, path.lastIndexOf('/'))}/generated_${path.split('/').at(-1)}`
} }
export function getRandom(array) {
return array.at(Math.floor(Math.random() * array.length))
}

13
src/lib/components/Quotes.js Executable file
View file

@ -0,0 +1,13 @@
export const quotes = [
`Lt. Dixon Piper:
Why did he do it? Why did Cunth kill your wife?
MacGruber:
To this day, I have no idea. We actually all went to college together. Believe it or not, we were very close friends. \nThen after graduation, he got engaged to her. He asked me to be his best man and right about that time, I started banging her and mowing her box. \nShe was actually the first person I felt comfortable enough around to let eat out my butt. \nAnyway, shortly thereafter, she left him for me. She was actually carrying his child at the time. I asked her to terminate it, obviously, so we could start fresh. And she agreed. We were so in love. \nAnd he took that from me.
Lt. Dixon Piper:
That's really f***ed up.
MacGruber:
Thanks.`
]

View file

@ -1,9 +1,17 @@
<script> <script>
import Footer from '$lib/components/Footer.svelte' import Footer from '$lib/components/Footer.svelte'
import { onMount } from 'svelte'
import Navbar from './Navbar.svelte' import Navbar from './Navbar.svelte'
import './styles.css' import './styles.css'
import '@fontsource-variable/work-sans' import '@fontsource-variable/work-sans'
import '@fontsource/ibm-plex-mono/500.css' import '@fontsource/ibm-plex-mono/500.css'
import { quotes } from '$lib/components/Quotes'
onMount(() => {
if (import.meta.env.PROD) {
console.log(quotes.at(Math.floor(Math.random() * quotes.length)))
}
})
</script> </script>
<Navbar /> <Navbar />

View file

@ -5,25 +5,8 @@
import Hero from './Hero.svelte' import Hero from './Hero.svelte'
import InstallSlice from './InstallSlice.svelte' import InstallSlice from './InstallSlice.svelte'
import PreviewRiceSlice from './PreviewRiceSlice.svelte' import PreviewRiceSlice from './PreviewRiceSlice.svelte'
import { onMount } from 'svelte'
export let data export let data
onMount(() => {
import.meta.env.DEV &&
console.log(`
Lt. Dixon Piper:
Why did he do it? Why did Cunth kill your wife?
MacGruber:
To this day, I have no idea. We actually all went to college together. Believe it or not, we were very close friends. \nThen after graduation, he got engaged to her. He asked me to be his best man and right about that time, I started banging her and mowing her box. \nShe was actually the first person I felt comfortable enough around to let eat out my butt. \nAnyway, shortly thereafter, she left him for me. She was actually carrying his child at the time. I asked her to terminate it, obviously, so we could start fresh. And she agreed. We were so in love. \nAnd he took that from me.
Lt. Dixon Piper:
That's really f***ed up.
MacGruber:
Thanks.`)
})
</script> </script>
<svelte:head> <svelte:head>

View file

@ -45,6 +45,7 @@
function onViewEnter() { function onViewEnter() {
setTimeout(() => (hasEnteredView = true), 550) setTimeout(() => (hasEnteredView = true), 550)
// Only load the library if the element entered the view, to improve performance
import('interactjs').then(({ default: interact }) => { import('interactjs').then(({ default: interact }) => {
interactionjs = interact(imageElement).draggable({ interactionjs = interact(imageElement).draggable({
inertia: { resistance: lerp(5, 200, relativeSize) }, inertia: { resistance: lerp(5, 200, relativeSize) },
@ -115,10 +116,7 @@
/> />
{#if quote} {#if quote}
<div <div class="quote" aria-hidden="true">
class="pointer-events-none absolute -top-6 left-1/2 -translate-x-1/2 select-none rounded bg-slate-800/50 px-2 py-1 text-sm font-medium tracking-wide opacity-0 duration-150 group-hover:opacity-100"
aria-hidden="true"
>
{quote} {quote}
</div> </div>
{/if} {/if}
@ -139,6 +137,10 @@
} }
} }
.quote {
@apply pointer-events-none absolute -top-6 left-1/2 -translate-x-1/2 select-none rounded bg-slate-800/50 px-2 py-1 text-sm font-medium tracking-wide opacity-0 duration-150 group-hover:opacity-100;
}
@keyframes reveal { @keyframes reveal {
from { from {
opacity: 0%; opacity: 0%;

View file

@ -5,7 +5,7 @@
import clsx from 'clsx' import clsx from 'clsx'
import { getIsMobile } from '$lib/Helper.mjs' import { getIsMobile } from '$lib/Helper.mjs'
// Idea: Boid behavior // Currently this is unused. I left it in here, in case it would be useful in the future
const maxSize = 24 const maxSize = 24
const minSize = 7 const minSize = 7
@ -21,9 +21,6 @@
let x = 0 let x = 0
let y = 0 let y = 0
// TODO add mouse following behaviour - flock behaviour
// A couple following the mouse throughout the website
onMount(() => { onMount(() => {
x = window.innerWidth / (Math.random() * 4) - maxSize * 6 x = window.innerWidth / (Math.random() * 4) - maxSize * 6
y = window.innerHeight / (Math.random() * 4) + 100 y = window.innerHeight / (Math.random() * 4) + 100

View file

@ -5,16 +5,16 @@
import colors from 'tailwindcss/colors' import colors from 'tailwindcss/colors'
const wisdoms = [ const wisdoms = [
'炊き込みご飯', '罰は米の硬さによる',
'米どころでの休日', '米どころでの休日',
'マッサージライス', 'フォーバイデン米術',
'天国の米', '天国の米',
'ジーンズの中には何キロもの米が入っているから、毎日がトレーニングなんだ。', 'ジーンズの中には何キロもの米が入っているから、毎日がトレーニングなんだ。',
'田んぼで撃たれたんだ!', '田んぼで撃たれたんだ!',
'田んぼでの作業', 'タイ式マッサージライス 秘伝のソース添え',
'国の保護による田んぼでの仕事', '国の保護による田んぼでの仕事',
'巨大な米ベースの子猫用フードがある。', '巨大な米ベースの子猫用フードがある。',
'スパイシー米麺', '私たちは田んぼで一生懸命働いている。',
'激辛炊飯器', '激辛炊飯器',
'絶対にご飯を炊いた' '絶対にご飯を炊いた'
] ]
@ -140,8 +140,6 @@
width: 100%; width: 100%;
margin-bottom: min(-10vh, -6rem); margin-bottom: min(-10vh, -6rem);
background: radial-gradient(70% 50% at 50% 0%, theme(colors.cyan.500 / 50%), transparent); background: radial-gradient(70% 50% at 50% 0%, theme(colors.cyan.500 / 50%), transparent);
animation: enter 1200ms ease-in-out;
} }
.japanese { .japanese {
@ -152,7 +150,8 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
user-select: none; user-select: none;
animation: enter 1200ms ease-in-out; animation: enter 200ms ease-in-out both;
z-index: -10;
} }
.rice-symbol { .rice-symbol {
@ -173,12 +172,14 @@
gap: 1rem; gap: 1rem;
z-index: -10; z-index: -10;
opacity: 0.6; opacity: 0.6;
margin-top: -2rem;
/* font-size: 1.5rem; */ /* font-size: 1.5rem; */
} }
.wisdom { .wisdom {
width: max-content; width: max-content;
height: max-content; height: max-content;
/* max-height: 15ch; */
text-align: center; text-align: center;
color: theme(colors.cyan.700); color: theme(colors.cyan.700);
text-shadow: 0px 0px 8px blue; text-shadow: 0px 0px 8px blue;