sheep/src/pages/IndexPage.vue

100 lines
2.1 KiB
Vue
Raw Normal View History

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-17 12:09:46 +08:00
<div class="footer">
鱼了个鱼 ©2022 by
<a href="https://github.com/liyupi" target="_blank" style="color: #fff">
程序员鱼皮
</a>
|
<a
href="https://github.com/liyupi/yulegeyu"
target="_blank"
style="color: #fff"
>
代码开源
</a>
</div>
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-17 12:09:46 +08:00
const toGamePage = (config?: GameConfigType) => {
2022-09-16 19:06:06 +08:00
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;
}
2022-09-17 12:09:46 +08:00
.footer {
background: rgba(0, 0, 0, 0.6);
color: #fff;
padding: 12px;
text-align: center;
position: fixed;
bottom: 0;
left: 0;
right: 0;
}
2022-09-16 18:14:04 +08:00
</style>