Skip to content

Commit 053bb91

Browse files
authored
Merge pull request #904 from OAAK125/hover-animation
adding hover animation
2 parents 9020f6e + e11069c commit 053bb91

File tree

3 files changed

+85
-0
lines changed

3 files changed

+85
-0
lines changed

Hover Cards/index.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Hover Expand Card</title>
7+
<link rel="stylesheet" href="style.css" />
8+
</head>
9+
<body>
10+
11+
<div class="card">
12+
<p><span>Hover Over Me</span></p>
13+
<p><span>Hover Over Me</span></p>
14+
<p><span>Hover Over Me</span></p>
15+
</div>
16+
17+
</body>
18+
</html>

Hover Cards/style.css

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
2+
* {
3+
box-sizing: border-box;
4+
}
5+
6+
body {
7+
height: 100vh;
8+
margin: 0;
9+
display: flex;
10+
justify-content: center;
11+
align-items: center;
12+
background-color: #f4f7fb;
13+
font-family: 'Poppins', sans-serif;
14+
}
15+
16+
/* ====== CARD CONTAINER ====== */
17+
.card {
18+
width: 400px;
19+
height: 400px;
20+
border-radius: 8px;
21+
background: #f4f7fb;
22+
display: flex;
23+
gap: 6px;
24+
padding: 2em;
25+
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
26+
}
27+
28+
/* ====== PANELS ====== */
29+
.card p {
30+
height: 100%;
31+
flex: 1;
32+
overflow: hidden;
33+
cursor: pointer;
34+
border-radius: 4px;
35+
transition: all 0.5s ease;
36+
background: #1a1a2e;
37+
border: 1px solid #6c63ff;
38+
display: flex;
39+
justify-content: center;
40+
align-items: center;
41+
}
42+
43+
/* Expand on hover */
44+
.card p:hover {
45+
flex: 4;
46+
background: #2f2fa2;
47+
}
48+
49+
/* ====== TEXT ====== */
50+
.card p span {
51+
min-width: 14em;
52+
padding: 0.5em;
53+
text-align: center;
54+
transform: rotate(-90deg);
55+
transition: all 0.5s ease;
56+
text-transform: uppercase;
57+
color: #6c63ff;
58+
letter-spacing: 0.1em;
59+
font-weight: 500;
60+
}
61+
62+
/* Rotate text on hover */
63+
.card p:hover span {
64+
transform: rotate(0);
65+
color: #ffffff;
66+
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Please be aware that the demos may exhibit significant accessibility issues, suc
6565
- [Gradient Animation](#gradient-animation)
6666
- [Growing Flower](#growing-flower)
6767
- [Horizontal image slider](#horizontal-image-slider)
68+
- [Hover Animation](#hover-animation)
6869
- [Image Gallery](#image-gallery)
6970
- [Image Hover Effect]()
7071
- [Image Comparison Slider](#image-comparison-slider)

0 commit comments

Comments
 (0)