From 28d70d96c118618935a2e98e06136c00002b0c20 Mon Sep 17 00:00:00 2001 From: YuzeTT Date: Mon, 20 Nov 2023 01:08:22 +0800 Subject: [PATCH] chore: add index message --- src/pages/index.tsx | 47 +++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 54f8755..22f8a3c 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -10,32 +10,37 @@ export default function index() { const navigate = useNavigate(); const jumpBefore = (url: string) => { - // if(localStorage.getItem("isFollowMe")!=='true'){ - // Modal.info({ - // title: '使用必读', - // icon: null, - // content: ( - //
- // - //
- // ), - // onOk() { - // localStorage.setItem("isFollowMe", 'true') - // jump(url) - // }, - // okText: '已关注且不再弹出', - // }); - // } else { - - // } - jump(url) - } const jump = (url: string) => { navigate(url) } + + // const h = 0 + const h = new Date().getHours() + + + const time_list = [ + '夜已深,注意休息哦!', // 0,1,2 + '快去睡觉吧!', // 3,4,5 + '早安呀!', // 6,7,8 + '早生蚝!', // 9,10,11 + '记得按时吃饭哦!', // 12,13,14 + '下午好!', // 15,16,17 + '吃了嘛!!', // 18,19,20 + '累了一天,该休息啦~', // 21,22,23 + ] + + const getMsg = () => { + switch (h) { + case 15: + return '三点几嘞!' + default: + return time_list[Math.floor(h / 3)] + } + } + return (
@@ -43,7 +48,7 @@ export default function index() {
logo -
早生蚝!
+
{getMsg()}
欢迎来到大贴纸的全新站点~