Skip to content

Commit 3104235

Browse files
committed
Fix desktop shop menu animation overlap
1 parent 92317ea commit 3104235

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

src/components/ShopMenu/ShopMenu.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ const ShopMenu = ({ shopOpen, setShopOpen, onShopClick, onShopKeyDown }) => {
226226
: 'animate-slide-down'
227227
}`}
228228
style={{
229-
top: '104px',
230-
height: 'calc(100vh - 104px)',
229+
top: '106px',
230+
height: 'calc(100vh - 106px)',
231231
backgroundColor: '#F7FAFF',
232232
fontFamily: 'Inter, sans-serif',
233233
}}

src/index.css

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
--color-dark-blue-text: #042650;
2121
--color-hover: #1054ab;
2222

23+
/* Animation Variables */
24+
--slide-distance: -10px;
25+
--slide-duration: 0.3s;
26+
--slide-timing: ease-out;
27+
2328
--animate-fade-slide-up: fade-slide-up 0.8s ease-out 0.3s both;
2429

2530
@keyframes fade-slide-up {
@@ -138,37 +143,37 @@
138143
@keyframes slide-down {
139144
0% {
140145
opacity: 0;
141-
transform: translateY(-20px) scaleY(0.95);
146+
transform: translateY(var(--slide-distance));
142147
}
143148

144149
100% {
145150
opacity: 1;
146-
transform: translateY(0) scaleY(1);
151+
transform: translateY(0);
147152
}
148153
}
149154

150155
@keyframes slide-up {
151156
0% {
152157
opacity: 1;
153-
transform: translateY(0) scaleY(1);
158+
transform: translateY(0);
154159
}
155160

156161
100% {
157162
opacity: 0;
158-
transform: translateY(-20px) scaleY(0.95);
163+
transform: translateY(var(--slide-distance));
159164
}
160165
}
161166

162167
.animate-slide-down {
163-
animation: slide-down 0.5s ease-out forwards;
168+
animation: slide-down var(--slide-duration) var(--slide-timing) forwards;
164169
opacity: 0;
165-
transform: translateY(-20px) scaleY(0.95);
170+
transform: translateY(var(--slide-distance));
166171
}
167172

168173
.animate-slide-up {
169-
animation: slide-up 0.5s ease-in forwards;
174+
animation: slide-up var(--slide-duration) ease-in forwards;
170175
opacity: 1;
171-
transform: translateY(0) scaleY(1);
176+
transform: translateY(0);
172177
}
173178

174179
@keyframes slide-in-right {

0 commit comments

Comments
 (0)