2022-09-16 18:14:04 +08:00
|
|
|
|
<template>
|
|
|
|
|
<div id="indexPage">
|
2022-09-16 19:06:06 +08:00
|
|
|
|
<h1>🐟 鱼了个鱼</h1>
|
|
|
|
|
<div style="margin-bottom: 16px">低配版羊了个羊小游戏,仅供消遣</div>
|
|
|
|
|
<a-button
|
|
|
|
|
block
|
|
|
|
|
style="margin-bottom: 16px"
|
|
|
|
|
@click="toGamePage(easyGameConfig)"
|
|
|
|
|
>
|
|
|
|
|
简单模式
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-button
|
|
|
|
|
block
|
|
|
|
|
style="margin-bottom: 16px"
|
|
|
|
|
@click="toGamePage(middleGameConfig)"
|
|
|
|
|
>
|
|
|
|
|
中等模式
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-button
|
|
|
|
|
block
|
|
|
|
|
style="margin-bottom: 16px"
|
|
|
|
|
@click="toGamePage(hardGameConfig)"
|
|
|
|
|
>
|
|
|
|
|
困难模式
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-button
|
|
|
|
|
block
|
|
|
|
|
style="margin-bottom: 16px"
|
|
|
|
|
@click="toGamePage(lunaticGameConfig)"
|
|
|
|
|
>
|
2022-09-16 22:41:26 +08:00
|
|
|
|
地狱模式
|
2022-09-16 19:06:06 +08:00
|
|
|
|
</a-button>
|
2022-09-16 22:17:31 +08:00
|
|
|
|
<a-button block style="margin-bottom: 16px" @click="toGamePage(null)">
|
|
|
|
|
自定义
|
2022-09-16 19:06:06 +08:00
|
|
|
|
</a-button>
|
2022-09-16 22:41:26 +08:00
|
|
|
|
<a href="https://github.com/liyupi/yulegeyu" target="_blank">
|
|
|
|
|
<div style="background: rgba(0, 0, 0, 0.8); padding: 12px">
|
|
|
|
|
<github-outlined />
|
|
|
|
|
代码完全开源,欢迎 star
|
|
|
|
|
</div>
|
|
|
|
|
</a>
|
2022-09-16 18:14:04 +08:00
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2022-09-16 19:06:06 +08:00
|
|
|
|
import { useRouter } from "vue-router";
|
2022-09-16 22:41:26 +08:00
|
|
|
|
import { GithubOutlined } from "@ant-design/icons-vue";
|
2022-09-16 19:06:06 +08:00
|
|
|
|
import {
|
|
|
|
|
easyGameConfig,
|
|
|
|
|
middleGameConfig,
|
|
|
|
|
hardGameConfig,
|
|
|
|
|
lunaticGameConfig,
|
|
|
|
|
} from "../core/gameConfig";
|
|
|
|
|
import { useGlobalStore } from "../core/globalStore";
|
2022-09-16 18:14:04 +08:00
|
|
|
|
|
2022-09-16 19:06:06 +08:00
|
|
|
|
const router = useRouter();
|
2022-09-16 18:14:04 +08:00
|
|
|
|
|
2022-09-16 19:06:06 +08:00
|
|
|
|
const { setGameConfig } = useGlobalStore();
|
2022-09-16 18:14:04 +08:00
|
|
|
|
|
2022-09-16 19:06:06 +08:00
|
|
|
|
const toGamePage = (config?: GameConfig) => {
|
|
|
|
|
if (config) {
|
|
|
|
|
setGameConfig(config);
|
2022-09-16 22:17:31 +08:00
|
|
|
|
router.push("/game");
|
|
|
|
|
} else {
|
|
|
|
|
router.push("/config");
|
2022-09-16 19:06:06 +08:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
2022-09-16 18:14:04 +08:00
|
|
|
|
|
2022-09-16 19:06:06 +08:00
|
|
|
|
<style scoped>
|
|
|
|
|
#indexPage {
|
2022-09-16 18:14:04 +08:00
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
</style>
|