kawaii mode
This commit is contained in:
parent
08471acb06
commit
59e9fa0b4a
36
index.md
36
index.md
@ -42,3 +42,39 @@ features:
|
|||||||
link: /readingpiracyguide
|
link: /readingpiracyguide
|
||||||
details: Whether you're a bookworm, otaku or comic book fan, you'll be able to find your favourite pieces of literature here for free!
|
details: Whether you're a bookworm, otaku or comic book fan, you'll be able to find your favourite pieces of literature here for free!
|
||||||
---
|
---
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { onMounted } from 'vue'
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
var preferredKawaii
|
||||||
|
try {
|
||||||
|
preferredKawaii = localStorage.getItem('uwu')
|
||||||
|
} catch (err) {}
|
||||||
|
const urlParams = new URLSearchParams(window.location.search)
|
||||||
|
const kawaii = urlParams.get('uwu')
|
||||||
|
const setKawaii = () => {
|
||||||
|
const images = document.querySelectorAll('.VPImage.image-src')
|
||||||
|
images.forEach((img) => {
|
||||||
|
img.src = '/logo-uwu.svg'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (kawaii === 'true') {
|
||||||
|
try {
|
||||||
|
localStorage.setItem('uwu', true)
|
||||||
|
} catch (err) {}
|
||||||
|
console.log('uwu mode enabled. Disable with "?uwu=false".');
|
||||||
|
setKawaii()
|
||||||
|
} else if (kawaii === 'false') {
|
||||||
|
try {
|
||||||
|
localStorage.removeItem('uwu', false)
|
||||||
|
} catch (err) {}
|
||||||
|
const images = document.querySelectorAll('.VPImage.image-src')
|
||||||
|
images.forEach((img) => {
|
||||||
|
img.src = '/test.png'
|
||||||
|
})
|
||||||
|
} else if (preferredKawaii) {
|
||||||
|
setKawaii()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "fmhy",
|
"name": "fmhy",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"packageManager": "pnpm@8.15.1",
|
"packageManager": "pnpm@9.0.4",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"docs:dev": "vitepress dev",
|
"docs:dev": "vitepress dev",
|
||||||
"docs:build": "vitepress build",
|
"docs:build": "vitepress build",
|
||||||
|
185
public/logo-uwu.svg
Normal file
185
public/logo-uwu.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 86 KiB |
Loading…
Reference in New Issue
Block a user