kawaii mode

This commit is contained in:
taskylizard 2024-05-02 17:28:13 +05:30
parent 08471acb06
commit 59e9fa0b4a
No known key found for this signature in database
GPG Key ID: A0D132861BFEE7FA
3 changed files with 222 additions and 1 deletions

View File

@ -42,3 +42,39 @@ features:
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!
---
<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>

View File

@ -1,7 +1,7 @@
{
"name": "fmhy",
"type": "module",
"packageManager": "pnpm@8.15.1",
"packageManager": "pnpm@9.0.4",
"scripts": {
"docs:dev": "vitepress dev",
"docs:build": "vitepress build",

185
public/logo-uwu.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 86 KiB