difk
This commit is contained in:
parent
79876ab3ac
commit
120efff6c1
|
@ -7,9 +7,13 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<div>
|
<div>
|
||||||
<div v-if="game.ready" :class="$style.game">
|
<div v-if="game.ready" :class="$style.game">
|
||||||
<div :class="$style.cps" class="">{{ number(cps) }}cps</div>
|
<div :class="$style.cps" class="">{{ number(cps) }}cps</div>
|
||||||
<div :class="$style.count" class=""><i class="ti ti-cookie" style="font-size: 70%;"></i> {{ number(cookies) }}</div>
|
<div :class="$style.count" class=""><img :class="[$style.icon,{[$style.dark]:darkMode}]" alt="Cosaque daihuku"
|
||||||
|
src="https://media.discordapp.net/attachments/1153099592863334431/1162139796647448576/AfovawbDhjHYAAAAAElFTkSuQmCC.png"/>
|
||||||
|
{{ number(cookies) }}
|
||||||
|
</div>
|
||||||
<button v-click-anime class="_button" @click="onClick">
|
<button v-click-anime class="_button" @click="onClick">
|
||||||
<img src="/client-assets/cookie.png" :class="$style.img">
|
<img src="https://cdn.discordapp.com/attachments/1153099592863334431/1160169965568143391/dihk_cossack.gif"
|
||||||
|
:class="$style.img">
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
|
@ -26,7 +30,9 @@ import { useInterval } from '@/scripts/use-interval.js';
|
||||||
import * as game from '@/scripts/clicker-game.js';
|
import * as game from '@/scripts/clicker-game.js';
|
||||||
import number from '@/filters/number.js';
|
import number from '@/filters/number.js';
|
||||||
import {claimAchievement} from '@/scripts/achievements.js';
|
import {claimAchievement} from '@/scripts/achievements.js';
|
||||||
|
import {defaultStore} from "@/store.js";
|
||||||
|
|
||||||
|
const darkMode = computed(defaultStore.makeGetterSetter('darkMode'));
|
||||||
const saveData = game.saveData;
|
const saveData = game.saveData;
|
||||||
const cookies = computed(() => saveData.value?.cookies);
|
const cookies = computed(() => saveData.value?.cookies);
|
||||||
let cps = $ref(0);
|
let cps = $ref(0);
|
||||||
|
@ -92,4 +98,16 @@ onUnmounted(() => {
|
||||||
.img {
|
.img {
|
||||||
max-width: 90px;
|
max-width: 90px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$color-scheme: var(--color-scheme);
|
||||||
|
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 1.3em;
|
||||||
|
vertical-align: -24%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dark {
|
||||||
|
filter: invert(1);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -17,8 +17,8 @@ import MkClickerGame from '@/components/MkClickerGame.vue';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||||
|
|
||||||
definePageMetadata({
|
definePageMetadata({
|
||||||
title: '🍪👈',
|
title: '●👈',
|
||||||
icon: 'ti ti-cookie',
|
icon: 'ti ti-circle',
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -272,6 +272,10 @@ export const defaultStore = markRaw(new Storage('base', {
|
||||||
where: 'device',
|
where: 'device',
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
|
gamingType: {
|
||||||
|
where: 'device',
|
||||||
|
default: 'dark',
|
||||||
|
},
|
||||||
bannerUrl:{
|
bannerUrl:{
|
||||||
where: 'device',
|
where: 'device',
|
||||||
default: bannerDark
|
default: bannerDark
|
||||||
|
@ -442,6 +446,7 @@ export const defaultStore = markRaw(new Storage('base', {
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
// TODO: 他のタブと永続化されたstateを同期
|
// TODO: 他のタブと永続化されたstateを同期
|
||||||
|
|
||||||
const PREFIX = 'miux:' as const;
|
const PREFIX = 'miux:' as const;
|
||||||
|
|
|
@ -60,8 +60,8 @@ export function openInstanceMenu(ev: MouseEvent) {
|
||||||
}, {
|
}, {
|
||||||
type: 'link',
|
type: 'link',
|
||||||
to: '/clicker',
|
to: '/clicker',
|
||||||
text: '🍪👈',
|
text: '●👈',
|
||||||
icon: 'ti ti-cookie',
|
icon: 'ti ti-circle',
|
||||||
}, ($i && ($i.isAdmin || $i.policies.canManageCustomEmojis)) ? {
|
}, ($i && ($i.isAdmin || $i.policies.canManageCustomEmojis)) ? {
|
||||||
type: 'link',
|
type: 'link',
|
||||||
to: '/custom-emojis-manager',
|
to: '/custom-emojis-manager',
|
||||||
|
|
|
@ -5,7 +5,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<MkContainer :showHeader="widgetProps.showHeader" class="mkw-clicker">
|
<MkContainer :showHeader="widgetProps.showHeader" class="mkw-clicker">
|
||||||
<template #icon><i class="ti ti-cookie"></i></template>
|
<template #icon><img :class="[$style.icon,{[$style.dark]:darkMode}]" alt="Cosaque daihuku"
|
||||||
|
src="https://media.discordapp.net/attachments/1153099592863334431/1162139796647448576/AfovawbDhjHYAAAAAElFTkSuQmCC.png"/></template>
|
||||||
<template #header>Clicker</template>
|
<template #header>Clicker</template>
|
||||||
<MkClickerGame/>
|
<MkClickerGame/>
|
||||||
</MkContainer>
|
</MkContainer>
|
||||||
|
@ -16,7 +17,9 @@ import { useWidgetPropsManager, Widget, WidgetComponentEmits, WidgetComponentExp
|
||||||
import { GetFormResultType } from '@/scripts/form.js';
|
import { GetFormResultType } from '@/scripts/form.js';
|
||||||
import MkContainer from '@/components/MkContainer.vue';
|
import MkContainer from '@/components/MkContainer.vue';
|
||||||
import MkClickerGame from '@/components/MkClickerGame.vue';
|
import MkClickerGame from '@/components/MkClickerGame.vue';
|
||||||
|
import {computed} from "vue";
|
||||||
|
import {defaultStore} from "@/store.js";
|
||||||
|
const darkMode = computed(defaultStore.makeGetterSetter('darkMode'));
|
||||||
const name = 'clicker';
|
const name = 'clicker';
|
||||||
|
|
||||||
const widgetPropsDef = {
|
const widgetPropsDef = {
|
||||||
|
@ -43,3 +46,15 @@ defineExpose<WidgetComponentExpose>({
|
||||||
id: props.widget ? props.widget.id : null,
|
id: props.widget ? props.widget.id : null,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<style lang="scss" module>
|
||||||
|
.icon {
|
||||||
|
width: 1.3em;
|
||||||
|
vertical-align: -24%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dark {
|
||||||
|
filter: invert(1);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue