Skip to content

Commit fcdda03

Browse files
committed
3 lawer btn effect
1 parent 4923216 commit fcdda03

File tree

3 files changed

+103
-2
lines changed

3 files changed

+103
-2
lines changed

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<button class="button-6">Hover Me</button>
2323
<button class="button-7">Hover Me</button>
2424
<button class="button-8">Hover Me</button>
25+
<button class="button-9">Hover Me</button>
2526
</div>
2627
</body>
2728
</html>

sass/style.scss

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,65 @@ body {
289289
transition: 0.5s;
290290
}
291291

292-
.button-8:hover{
292+
.button-8:hover {
293293
color: #fff;
294294
}
295295

296296
.button-8:hover::before {
297297
border-radius: 0%;
298298
transform: translateY(0);
299299
}
300+
301+
.button-9 {
302+
// overflow: hidden;
303+
background-color: #f1c40f;
304+
border: none;
305+
color: #fff;
306+
307+
}
308+
309+
.button-9:before {
310+
display: flex;
311+
align-items: center;
312+
justify-content: center;
313+
content: "Hover Me";
314+
position: absolute;
315+
top: 0;
316+
left: 0;
317+
background-color: #2ecc71;
318+
height: 100%;
319+
width: 100%;
320+
z-index: 3;
321+
transform: rotateX(270deg);
322+
transform-origin: top;
323+
transition: 0.3s;
324+
}
325+
326+
.button-9:after {
327+
display: flex;
328+
align-items: center;
329+
justify-content: center;
330+
content: "Hover Me";
331+
position: absolute;
332+
top: 0;
333+
left: 0;
334+
background-color: red;
335+
height: 100%;
336+
width: 100%;
337+
transform: rotateX(270deg);
338+
transform-origin: top;
339+
transition: 0.3s;
340+
transition-delay: 0.3s;
341+
z-index: 4;
342+
}
343+
344+
.button-9:hover:before {
345+
transform: rotateX(0deg);
346+
}
347+
348+
.button-9:hover:after {
349+
transform: rotateX(0deg);
350+
}
300351
}
301352

302353
// .button-1 {
@@ -314,5 +365,5 @@ body {
314365
// transition: 1s;
315366
// }
316367

317-
// .button-1:hover::before {
368+
// .button-1:hover:before {
318369
// }

style/style.css

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,3 +297,52 @@ body {
297297
border-radius: 0%;
298298
transform: translateY(0);
299299
}
300+
301+
.button-container .button-9 {
302+
background-color: #f1c40f;
303+
border: none;
304+
color: #fff;
305+
}
306+
307+
.button-container .button-9:before {
308+
display: flex;
309+
align-items: center;
310+
justify-content: center;
311+
content: "Hover Me";
312+
position: absolute;
313+
top: 0;
314+
left: 0;
315+
background-color: #2ecc71;
316+
height: 100%;
317+
width: 100%;
318+
z-index: 3;
319+
transform: rotateX(270deg);
320+
transform-origin: top;
321+
transition: 0.3s;
322+
}
323+
324+
.button-container .button-9:after {
325+
display: flex;
326+
align-items: center;
327+
justify-content: center;
328+
content: "Hover Me";
329+
position: absolute;
330+
top: 0;
331+
left: 0;
332+
background-color: red;
333+
height: 100%;
334+
width: 100%;
335+
transform: rotateX(270deg);
336+
transform-origin: top;
337+
transition: 0.3s;
338+
transition-delay: 0.3s;
339+
z-index: 4;
340+
}
341+
342+
.button-container .button-9:hover:before {
343+
transform: rotateX(0deg);
344+
}
345+
346+
.button-container .button-9:hover:after {
347+
transform: rotateX(0deg);
348+
}

0 commit comments

Comments
 (0)