Newer
Older
<template>
<div id="sky" class="absolute inset-0 h-screen">
<div v-if="$colorMode.value !== 'dark'" id="clouds">
<div v-for="cloud in 5" :key="cloud" :class="'x' + cloud">
<div class="cloud" />
</div>
</div>
<div v-else>
<div class="stars absolute inset-0 h-screen z-0" />
<div class="twinkling absolute inset-0 h-screen z-1 opacity-75" />
</div>
</div>
</template>
<script>
export default {}
</script>
<style lang="postcss" scoped>
#clouds {
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
}
/* Day */
@keyframes animateCloud {
0% {
margin-left: -1000px;
}
100% {
margin-left: 100%;
}
}
.x1 {
animation: animateCloud 70s linear infinite;
transform: scale(0.65);
}
.x2 {
animation: animateCloud 40s linear infinite;
transform: scale(0.3) rotateY(180deg);
}
.x3 {
animation: animateCloud 60s linear infinite;
transform: scale(0.5);
opacity: 0.7;
}
.x4 {
animation: animateCloud 36s linear infinite;
transform: scale(0.4);
opacity: 0.5;
}
.x5 {
animation: animateCloud 50s linear infinite;
transform: scale(0.55) rotateY(180deg);
}
.cloud {
background: #fff;
border-radius: 100px;
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
position: relative;
width: 350px;
}
.cloud:after,
.cloud:before {
background: #fff;
content: '';
position: absolute;
z-index: -1;
}
.cloud:after {
border-radius: 100px;
height: 100px;
left: 50px;
top: -50px;
width: 100px;
}
.cloud:before {
border-radius: 200px;
width: 180px;
height: 180px;
right: 50px;
top: -90px;
}
/* Night */
@keyframes move-twink-back {
from {
background-position: 0 0;
}
to {
background-position: -10000px 5000px;
}
}
@-webkit-keyframes move-twink-back {
from {
background-position: 0 0;
}
to {
background-position: -10000px 5000px;
}
}
@-moz-keyframes move-twink-back {
from {
background-position: 0 0;
}
to {
background-position: -10000px 5000px;
}
}
@-ms-keyframes move-twink-back {
from {
background-position: 0 0;
}
to {
background-position: -10000px 5000px;
}
}
.stars {
background: black url(/particles/stars.png) repeat top center;
}
.twinkling {
background: transparent url(/particles/twinkling.png) repeat top center;
animation: move-twink-back 200s linear infinite;
}
</style>