Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions components/flip-card.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flip Card Component</title>
<link rel="stylesheet" href="../css/style.css">
</head>
<body>
<div class="container">
<div class="flip-card">
<div class="flip-card__inner">
<div class="flip-card__front">
<h2>Front Side</h2>
<p>Hover me to see the back!</p>
</div>
<div class="flip-card__back">
<h2>Back Side</h2>
<p>This is the back of the card.</p>
</div>
</div>
</div>
</div>
</body>
</html>
64 changes: 64 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,70 @@ body{
background: var(--background-color);
}

/* Flip Card Styles */
.flip-card {
width: 300px;
height: 200px;
perspective: 1000px;
margin: 20px;
}

.flip-card__inner {
position: relative;
width: 100%;
height: 100%;
text-align: center;
transition: transform 0.6s;
transform-style: preserve-3d;
}

.flip-card:hover .flip-card__inner {
transform: rotateY(180deg);
}

.flip-card__front,
.flip-card__back {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border-radius: var(--radius);
padding: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.flip-card__front {
background-color: var(--surface-2-color);
color: var(--text-color);
}

.flip-card__back {
background-color: var(--primary-color);
color: var(--primary-contrast);
transform: rotateY(180deg);
}

.flip-card h2 {
margin: 0 0 15px 0;
font-size: 24px;
}

.flip-card p {
margin: 0;
font-size: 16px;
}

@media (max-width: 320px) {
.flip-card {
width: 260px;
height: 180px;
}
}

h1 {
font-family: Georgia, "Times New Roman", Times, serif;
text-decoration: underline;
Expand Down