File tree 8 files changed +41
-64
lines changed
8 files changed +41
-64
lines changed Original file line number Diff line number Diff line change @@ -9,14 +9,29 @@ const toggleDarkMode = () => {
9
9
document .documentElement .classList .toggle (' dark' )
10
10
}
11
11
12
+ const setDarkMode = (state = false ) => {
13
+ if (state ) {
14
+ document .documentElement .setAttribute (" data-theme" , " dark" );
15
+ document .documentElement .classList .add (' dark' )
16
+ } else {
17
+ document .documentElement .setAttribute (" data-theme" , " light" );
18
+ document .documentElement .classList .remove (' dark' )
19
+ }
20
+ }
21
+
22
+ onMounted (() => {
23
+ const state = window .matchMedia && window .matchMedia (' (prefers-color-scheme: dark)' ).matches
24
+ setDarkMode (state )
25
+ })
26
+
12
27
</script >
13
28
14
29
<template >
15
30
<nav class =" h-20 flex items-center justify-between" >
16
31
<NuxtLink to =" /" >
17
- <div class =" logo flex" >
18
- <img width =" 48" height =" 48" class =" rounded-md overflow-hidden mr-2 " src =" /logo.png" alt =" earth-worm-logo" >
19
- <h1 class =" w-14 text-md font-black leading-normal text-wrap text-fuchsia-400" >Earth Worm </h1 >
32
+ <div class =" logo flex items-center " >
33
+ <img width =" 48" height =" 48" class =" rounded-md overflow-hidden mr-6 " src =" /logo.png" alt =" earth-worm-logo" >
34
+ <h1 class =" text-2xl leading-none font-black leading-normal text-wrap text-fuchsia-400" >Earthworm </h1 >
20
35
</div >
21
36
</NuxtLink >
22
37
<div >
Original file line number Diff line number Diff line change 1
1
<template >
2
- <div >进度:{{ currentSchedule }}/{{ max }}</ div >
2
+ <progress class = " progress w-56 m-2 " value = " 8 " max = " 100 " ></ progress >
3
3
</template >
4
4
5
5
<script setup lang="ts">
@@ -8,7 +8,7 @@ import { useCoursesStore } from "~/store/courses";
8
8
const coursesStore = useCoursesStore ();
9
9
10
10
const currentSchedule = computed (() => {
11
- return coursesStore .statementIndex + 1 ;
11
+ return coursesStore .statementIndex . value + 1 ;
12
12
});
13
13
14
14
const max = computed (() => {
Original file line number Diff line number Diff line change 1
1
<template >
2
- <div class =" h-full flex justify-center items-center relative " >
3
- <div >
2
+ <div class =" h-full w-full flex flex-col justify-center items-center" >
3
+ <div class = " flex-1 mb-8 " >
4
4
<template v-if =" mode === ' question' " >
5
5
<Question @bingo =" handleBingo" ></Question >
6
6
</template >
7
7
<template v-else-if =" mode === ' answer' " >
8
8
<Answer @next-question =" handleNextQuestion" ></Answer >
9
9
</template >
10
10
</div >
11
- <div class =" absolute bottom-10 mb-10 w-full flex flex-col items-center " >
11
+ <div class =" " >
12
12
<CourseProgress ></CourseProgress >
13
13
<Tips onShowAnswer =" {handleShowAnswer}" ></Tips >
14
14
</div >
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" text-5xl text-center mb-20 mt-10" >
3
3
<div class =" text-fuchsia-500 dark:text-gray-50" >
4
- {{ coursesStore.currentStatement?.chinese }}
4
+ {{ coursesStore.currentStatement?.chinese || '生存还是毁灭,这是一个问题' }}
5
5
</div >
6
6
<div class =" code-box" >
7
7
<template v-for =" i in lineNum " :key =" i " >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
<template >
2
- <div >
3
- <TipItem
4
- text =" tab"
5
- description =" show answer"
6
- keyboardKey =" Tab"
7
- handler =" {handleToAnswer}"
8
- ></TipItem >
9
- <TipItem
10
- text =" control"
11
- description =" play soundmark"
12
- keyboardKey =" Control"
13
- handler =" {playSound}"
14
- ></TipItem >
2
+ <div class =" flex flex-col" >
3
+ <div class =" flex mb-2" >
4
+ <button className =" btn btn-xs" >⇥ Tab</button >
5
+ <p class =" ml-2" >show answer</p >
6
+ </div >
7
+ <div class =" flex" >
8
+ <button className =" btn btn-xs" >⌃ Control</button >
9
+ <p class =" ml-2" >play soundmark</p >
10
+ </div >
15
11
</div >
16
12
</template >
17
13
18
14
<script setup lang="ts">
19
- import TipItem from " ./TipItem.vue" ;
20
15
</script >
21
-
22
- <style scoped></style >
Original file line number Diff line number Diff line change 1
1
<template >
2
- <div class =" flex flex-col h-full" >
3
- <!-- <Header></Header> -->
4
- <main >
5
- <Game ></Game >
6
- </main >
7
- </div >
2
+ <Game ></Game >
8
3
</template >
9
4
10
5
<script setup lang="ts">
Original file line number Diff line number Diff line change 6
6
<div class =" container w-full" >
7
7
<section class =" flex md:flex-row md:justify-between justify-center flex-col py-8" >
8
8
<div class =" w-1/2" >
9
- <div class =" flex mb-12" >
10
- <img width =" 160" height =" 160" class =" rounded-xl overflow-hidden mr-2" src =" /logo.png" alt =" earth-worm-logo" >
11
- <h1 class =" w-48 text-6xl font-black leading-snug text-wrap text-fuchsia-400" >Earth Worm</h1 >
12
- </div >
13
9
<div class =" mb-12 leading-loose text-3xl opacity-80 items-center" >
14
10
<div class =" " >Why aren’t you good at English?</div >
15
- <div class =" align-middle" >It’s because you haven’t used Earthworm yet! 🤪 <i class =" animate-wink inline w-1 h-8 dark:bg-white bg-slate-900 mx-2 text-2xl p-[2px]" ></i ></div >
11
+ <div class =" align-middle" >It’s because you haven’t used < span class = " text-fuchsia-400 font-bold " > Earthworm</ span > yet! 🤪 <i class =" animate-wink inline w-1 h-8 dark:bg-white bg-slate-900 mx-2 text-2xl p-[2px]" ></i ></div >
16
12
</div >
17
13
<a target =" _blank" href =" https://github.com/cuixueshe/earthworm" >
18
14
<button class =" indicator btn btn-outline w-48 hover:text-fuchsia-400 hover:border-fuchsia-400 hover:bg-fuchsia-100 text-fuchsia-300 border-fuchsia-300 mr-4" >
51
47
</template >
52
48
53
49
<style >
50
+
51
+
54
52
.bg-dot {
55
53
aspect-ratio : 1 ;
56
54
position : relative ;
62
60
overflow : hidden ;
63
61
}
64
62
63
+ .dark .bg-dot {
64
+ opacity : 1 ;
65
+ }
66
+
65
67
.bg-dot ::after {
66
68
content : ' ' ;
67
69
position : absolute ;
You can’t perform that action at this time.
0 commit comments