feat:神秘彩蛋

This commit is contained in:
2026-09-13 18:16:18 +08:00
parent 71a8e65085
commit f81a89adc9
5 changed files with 232 additions and 0 deletions

View File

@ -8,6 +8,7 @@ import {
} from '@modrinth/assets'
import { Avatar, defineMessages, NewButton as Button, useVIntl } from '@modrinth/ui'
import { getVersion } from '@tauri-apps/api/app'
import { openUrl } from '@tauri-apps/plugin-opener'
import { inject, nextTick, onScopeDispose, ref, shallowRef } from 'vue'
import EasterEggContributorsModal from '@/components/ui/easteregg/EasterEggContributorsModal.vue'
import EasterEggGameModal from '@/components/ui/easteregg/EasterEggGameModal.vue'
@ -80,6 +81,7 @@ const contributorsModal = ref<InstanceType<typeof EasterEggContributorsModal> |
let typedBuffer = ''
const secretCodes = ['starlight']
const YUANSHEN_URL = 'https://ys.mihoyo.com/cloud/'
const konamiSequence = [
'ArrowUp',
@ -101,6 +103,11 @@ function handleEasterEggKeydown(event: KeyboardEvent) {
if (typedBuffer.length > maxCodeLen) {
typedBuffer = typedBuffer.slice(-maxCodeLen)
}
if (typedBuffer.endsWith('yuanshen')) {
typedBuffer = ''
openUrl(YUANSHEN_URL).catch(() => {})
return
}
if (secretCodes.some((code) => typedBuffer.endsWith(code))) {
typedBuffer = ''
gameModal.value?.show()