Skip to content

Commit b46d495

Browse files
committed
revise: fix dark mode rendering on home page
1 parent c159445 commit b46d495

File tree

3 files changed

+32
-53
lines changed

3 files changed

+32
-53
lines changed

Diff for: app.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div>
2+
<div class="dark:bg-slate-950">
33
<NuxtLayout>
44
<NuxtPage />
55
</NuxtLayout>

Diff for: components/FrontPageCard.vue

+24-34
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,33 @@
11
<template>
2-
<div
3-
class="front-page-card relative group"
4-
:class="checked ? 'checked' : ''"
5-
@click="cardClicked"
6-
>
2+
<div class="front-page-card relative group" :class="checked ? 'checked' : ''" @click="cardClicked">
73
<div class="relative checkbox">
8-
<span
9-
class="absolute transition-opacity duration-300 ease-out"
10-
:class="{ 'opacity-0': checked, 'opacity-100 delay-500': !checked }"
11-
>
4+
<span class="absolute transition-opacity duration-300 ease-out"
5+
:class="{ 'opacity-0': checked, 'opacity-100 delay-500': !checked }">
126
{{ step }}
137
</span>
14-
<Icon
15-
class="w-7 h-7 bg-white transition-opacity duration-300 ease-out"
16-
:class="{ 'opacity-0': !checked, 'opacity-100 delay-500': checked }"
17-
name="heroicons:check-20-solid"
18-
></Icon>
8+
<Icon class="w-7 h-7 bg-white transition-opacity duration-300 ease-out"
9+
:class="{ 'opacity-0': !checked, 'opacity-100 delay-500': checked }" name="heroicons:check-20-solid"></Icon>
1910
</div>
2011
<div class="content">
2112
<h3 class="relative">
2213
{{ title }}
23-
<span
24-
class="absolute left-0 top-1/2 transform -translate-y-1/2 transition-all bg-slate-400 duration-300"
25-
:class="checked ? 'w-full h-1 opacity-100' : 'w-0 opacity-0'"
26-
></span>
14+
<span class="absolute left-0 top-1/2 transform -translate-y-1/2 transition-all bg-slate-400 duration-300"
15+
:class="checked ? 'w-full h-1 opacity-100' : 'w-0 opacity-0'"></span>
2716
</h3>
2817
<p class="text-sm relative">
2918
{{ description }}
3019
<span
3120
class="absolute left-0 top-1/2 transform -translate-y-1/2 transition-all bg-slate-400 delay-100 duration-300"
32-
:class="checked ? 'w-full h-1 opacity-100' : 'w-0 opacity-0'"
33-
></span>
21+
:class="checked ? 'w-full h-1 opacity-100' : 'w-0 opacity-0'"></span>
3422
</p>
3523
</div>
3624
<div v-if="!checked" class="overlay opacity-0 group-hover:opacity-100">
3725
<div class="overlay-content not-prose">
3826
<h3>{{ overlay.title }}</h3>
3927
<p>{{ overlay.description }}</p>
4028
</div>
41-
<Icon
42-
class="w-8 h-8 bg-white transition-opacity duration-300 ease-out"
43-
name="icon-park-outline:double-right"
44-
></Icon>
29+
<Icon class="w-8 h-8 bg-white transition-opacity duration-300 ease-out" name="icon-park-outline:double-right">
30+
</Icon>
4531
</div>
4632
</div>
4733
</template>
@@ -88,21 +74,19 @@ let cardClicked = () => {
8874
@apply dark:text-slate-50;
8975
9076
@apply border;
91-
@apply border-gray-100;
92-
@apply dark:border-gray-950;
77+
@apply border-slate-200;
78+
@apply dark:border-slate-800;
9379
9480
@apply rounded-lg;
95-
@apply shadow-sm;
96-
@apply hover:shadow-slate-200;
9781
9882
@apply text-pretty;
9983
10084
.overlay {
10185
@apply flex items-center justify-between space-x-2 absolute inset-0 px-10;
102-
@apply bg-gradient-to-r from-cyan-500 to-blue-500;
86+
@apply bg-gradient-to-r from-orange-500 to-amber-500;
10387
@apply h-full w-full;
10488
@apply rounded-md;
105-
@apply transition-opacity duration-300 ease-in-out;
89+
@apply transition-opacity duration-100 ease-in-out;
10690
10791
h3 {
10892
@apply text-white text-2xl font-bold;
@@ -114,22 +98,22 @@ let cardClicked = () => {
11498
}
11599
116100
.checkbox {
117-
@apply transition-colors duration-300 ease-in delay-300;
118101
@apply flex items-center justify-center;
119102
@apply font-mono font-bold text-slate-300 text-2xl;
120103
@apply w-12 h-12;
121104
@apply rounded-full;
122-
@apply bg-slate-100;
123-
@apply border-2 border-slate-200;
105+
@apply bg-slate-100 dark:bg-slate-950;
106+
@apply border-2 border-slate-200 dark:border-slate-800;
124107
}
125108
126109
.content {
127110
@apply ml-6;
128-
@apply text-slate-500;
111+
@apply text-slate-500 dark:text-slate-400;
129112
130113
h3 {
131114
@apply m-0;
132115
@apply text-slate-900;
116+
@apply dark:text-slate-200;
133117
}
134118
135119
p {
@@ -138,6 +122,12 @@ let cardClicked = () => {
138122
}
139123
}
140124
125+
&:not(.checked) {
126+
@apply shadow-sm;
127+
@apply hover:shadow-amber-200;
128+
@apply dark:hover:shadow-amber-800;
129+
}
130+
141131
&.checked {
142132
.content {
143133
@apply text-slate-400;

Diff for: pages/index.vue

+7-18
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,17 @@
99
</p>
1010

1111
<div class="get-involved">
12-
<FrontPageCard
13-
:step="1"
14-
title="Organizing and indexing what needs building."
15-
description="Though our RFC process, we nominate crates to be created
16-
and decide who will build them."
17-
url="https://example.com"
18-
:overlay="{
12+
<FrontPageCard :step="1" title="Organizing and indexing what needs building." description="Though our RFC process, we nominate crates to be created
13+
and decide who will build them." url="https://example.com" :overlay="{
1914
title: 'Learn how we do it!',
2015
description: 'Click here to learn about our RFC process.',
21-
}"
22-
>
16+
}">
2317
</FrontPageCard>
24-
<FrontPageCard
25-
:step="2"
26-
title="Bringing the community together on Zulip."
27-
description="Foo bar baz quux qil."
28-
url="https://rustseq.zulipchat.com/join/coxb7c7b3bbahlfx7poeqqrd"
29-
:overlay="{
18+
<FrontPageCard :step="2" title="Bringing the community together on Zulip." description="Foo bar baz quux qil."
19+
url="https://rustseq.zulipchat.com/join/coxb7c7b3bbahlfx7poeqqrd" :overlay="{
3020
title: 'Join us!',
3121
description: 'Click here to join the Zulip server.',
32-
}"
33-
></FrontPageCard>
22+
}"></FrontPageCard>
3423
</div>
3524
</main>
3625
</div>
@@ -48,7 +37,7 @@ main {
4837
.get-involved {
4938
@apply flex flex-col space-y-8 justify-center;
5039
@apply py-6 my-2;
51-
@apply border-t border-slate-100;
40+
@apply border-t border-slate-100 dark:border-slate-800;
5241
}
5342
}
5443
</style>

0 commit comments

Comments
 (0)