-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
438 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,21 @@ | ||
export const secToMs = (sec: number) => sec * 1000; | ||
export const secToMs = (sec: number): number => sec * 1000; | ||
|
||
export const choose = <T>(arr: T[]): T => arr[Math.floor(Math.random() * arr.length)]; | ||
|
||
export const base64 = { | ||
encode: (input: string): string => { | ||
try { | ||
return btoa(input); | ||
} catch (e) { | ||
throw new Error('Failed to encode: ' + e); | ||
} | ||
}, | ||
|
||
decode: (input: string): string => { | ||
try { | ||
return atob(input); | ||
} catch (e) { | ||
throw new Error('Failed to decode: ' + e); | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script lang="ts"> | ||
import { onMount } from 'svelte'; | ||
import { car } from '@/stores'; | ||
import Neko from '@/components/Neko.svelte'; | ||
onMount(() => { | ||
try { | ||
Object.defineProperty(window, 'OMG_CARRRRRR', { | ||
get: () => { | ||
car.set(!$car); | ||
if ($car) console.log('%cmeow meow 😼', 'font-size: 3rem; color: #f0f;'); | ||
} | ||
}); | ||
} catch {} | ||
}); | ||
</script> | ||
|
||
{#if $car} | ||
<Neko /> | ||
{/if} | ||
|
||
<slot /> |
Oops, something went wrong.