Skip to content

Commit 4bb58b1

Browse files
committed
feat: update design theme
1 parent b32d3d3 commit 4bb58b1

File tree

19 files changed

+109
-70
lines changed

19 files changed

+109
-70
lines changed

index.html

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,38 @@
66
<link rel="icon" href="/favicon.ico">
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
88
<title>%VITE_PUBLIC_TITLE%</title>
9+
<style>
10+
#app-loading {
11+
position: fixed;
12+
top: 0;
13+
left: 0;
14+
z-index: 9999;
15+
display: flex;
16+
flex-direction: column;
17+
align-items: center;
18+
justify-content: center;
19+
width: 100%;
20+
height: 100%;
21+
overflow: hidden;
22+
background-color: #fafafa;
23+
color: #020817;
24+
}
25+
26+
#app-loading img {
27+
margin-bottom: 2rem;
28+
}
29+
30+
.dark #app-loading {
31+
background-color: #020817;
32+
color: #fff;
33+
}
34+
</style>
935
</head>
1036

1137
<body>
1238
<div id="app">
13-
<div class="app-loading" align="center" style="position: fixed; transform: translateY(-50%); top: 50%; width: 100vw; height: 100%vh">
14-
<img src="/logo.png" alt="Logo Image" width="80px">
15-
<p style="margin: 20px;">
16-
<b>A thousand mile trip begins with one step</b>
17-
</p>
18-
<p style="margin: 20px;">
19-
<b>千里之行,始于足下</b>
20-
</p>
39+
<div id="app-loading">
40+
<img src="/logo.png" alt="Logo Image" width="100px">
2141
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24">
2242
<g>
2343
<circle cx="12" cy="2.5" r="1.5" fill="currentColor" opacity=".14" />
@@ -35,6 +55,10 @@
3555
</div>
3656
</div>
3757
<script type="module" src="/src/main.ts"></script>
58+
<script>
59+
var theme = localStorage.getItem('color-scheme');
60+
document.documentElement.classList.toggle('dark', /dark/.test(theme))
61+
</script>
3862
</body>
3963

4064
</html>

public/favicon.ico

0 Bytes
Binary file not shown.

public/logo.png

33.4 KB
Loading

src/assets/not-found.svg

Lines changed: 1 addition & 1 deletion
Loading

src/components/TheButton.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<script lang="ts" setup>
22
defineProps<{
33
loading?: boolean
4+
disabled?: boolean
45
}>()
56
</script>
67

78
<template>
8-
<button text-sm px-4 py-1 rd-1.5 inline-block bg-primary text-hex-f0f0f0 dark:text-hex-020617 cursor-pointer hover:op-75 disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50 border-none flex items-center py-2 v-bind="$attrs">
9+
<button flex="~ items-center" :disabled text-sm px-4 py-2 rd-1.5 inline-block bg-hex-0d1828 text-hex-f8fafc cursor-pointer hover:op-75 disabled:cursor-default disabled:op-50 border-none v-bind="$attrs">
910
<svg v-if="loading" mr-2 xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24">
1011
<g>
1112
<circle cx="12" cy="2.5" r="1.5" fill="currentColor" opacity=".14" />
@@ -21,7 +22,6 @@ defineProps<{
2122
/>
2223
</g>
2324
</svg>
24-
2525
<slot />
2626
</button>
2727
</template>

src/components/TheCard.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div transition-all hover:border-color-primary-color box-border w-full rounded-xl bg-transparent border-1 border-color-hex-849ab1 dark:border-color-hex-1e293b p-4 sm:p-6 md:p-8 lg:p-10>
3+
<slot />
4+
</div>
5+
</template>

src/composables/dark.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
*
44
* @see https://vueuse.org/core/useDark/
55
*/
6-
export const isDark = useDark()
6+
export const isDark = useDark({
7+
storageKey: `color-scheme`,
8+
})
79

810
/**
911
* Toggle dark mode

src/constants/constants.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ export const APP_VERSION = version
1515
*/
1616
export const APP_STORAGE_KEY = `${APP_KEY}-v${APP_VERSION}`
1717

18+
/**
19+
* The url of the author.
20+
*/
21+
export const AUTHOR_URL = 'https://github.com/kieranwv'
22+
1823
/**
1924
* The url of the GitHub repository.
2025
*/

src/layouts/default.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<main w-screen h-screen>
2+
<main>
33
<RouterView />
44
</main>
55
</template>

src/layouts/page.vue

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ function openGithub() {
1919
</script>
2020

2121
<template>
22-
<main w-full h-full>
23-
<header py-10 px-4 text-center>
24-
<img v-if="headerLogo" alt="Logo Image" src="/logo.png" w-20 m-auto>
25-
<p text-6 font-bold my-5>
22+
<main px-4>
23+
<header py-8 text-center>
24+
<img v-if="headerLogo" mx-auto alt="Logo Image" src="/logo.png" w-20>
25+
<h1>
2626
<span mr-2 font-800>{{ t('app.title') }}</span>
2727
<sup><i>v{{ APP_VERSION }}</i></sup>
28-
</p>
29-
<p flex flex-wrap gap-2 justify-center>
28+
</h1>
29+
<div flex="~ wrap gap-2 justify-center">
3030
<TheButton v-if="route.path === '/about'" @click="goPage('/')">
3131
{{ t('button.index-page') }}
3232
</TheButton>
@@ -45,15 +45,15 @@ function openGithub() {
4545
<TheButton @click="openGithub()">
4646
<i i="carbon-logo-github" />
4747
</TheButton>
48-
</p>
48+
</div>
4949
</header>
50-
<main m-auto min-h-32 max-w-full px-4 sm:max-w-2xl>
50+
<main m-auto min-h-32 max-w-full sm:max-w-2xl>
5151
<RouterView />
5252
</main>
53-
<footer py-10 px-4 text-center>
54-
<a :href="LICENSE_URL" target="_blank">MIT License</a> © {{ new Date().getFullYear() }} <a
55-
href="https://github.com/kieranwv" target="_blank"
56-
>Kieran Wang</a>
53+
<footer flex="~ items-center justify-center gap-2" py-8>
54+
<a :href="LICENSE_URL" target="_blank">MIT License</a>
55+
<span> © {{ new Date().getFullYear() }} </span>
56+
<a :href="AUTHOR_URL" target="_blank">Kieran Wang</a>
5757
</footer>
5858
</main>
5959
</template>

0 commit comments

Comments
 (0)