Skip to content

Commit

Permalink
Card Flip Animation (#2364)
Browse files Browse the repository at this point in the history
Co-authored-by: Sophia Brandt <16630701+sophiabrandt@users.noreply.github.com>
  • Loading branch information
DhanushNehru and sophiabrandt authored Oct 27, 2023
1 parent 5be0b11 commit 18cd04b
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 0 deletions.
Binary file added Art/DhanushNehru/card_flip.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions Art/DhanushNehru/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<title>Card Flip</title>
<head>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<div class="container">
<div class="object">
<div class="card">
<div class="front-side"></div>
<div class="back-side"></div>
</div>
</div>
</div>
</body>
</html>
55 changes: 55 additions & 0 deletions Art/DhanushNehru/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
html, body {
height: 100%;
background: #000;
margin: 0;
overflow: hidden;
}

.container {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}

.object {
width: 300px;
height: 420px;
position: relative;
animation: flip 2s alternate infinite ease-in-out;
transform-style: preserve-3d;
}

.card {
width: 300px;
height: 420px;
position: absolute;
transform-style: preserve-3d;
animation: flip 2s alternate infinite ease-in-out;
backface-visibility: hidden;
}

@keyframes flip {
0% { transform: rotateY(0deg); }
100% { transform: rotateY(180deg); }
}

.front-side {
width: 100%;
height: 100%;
position: absolute;
backface-visibility: hidden;
background: #3498db; /* Blue color on the front side */
transform: rotateY(0deg);
}

.back-side {
width: 100%;
height: 100%;
position: absolute;
backface-visibility: hidden;
background: #FF5733; /* Red color on the back side */
transform: rotateY(180deg);
}

7 changes: 7 additions & 0 deletions include.js
Original file line number Diff line number Diff line change
Expand Up @@ -2468,6 +2468,13 @@ const cards = [
author: 'Bhavna',
githubLink: 'https://github.com/Bhavna2003'
},
{
artName: 'Card Flip Animation',
pageLink: './Art/DhanushNehru/index.html',
imageLink: './Art/DhanushNehru/card_flip.gif',
author: 'Dhanush',
githubLink: 'https://github.com/DhanushNehru'
},
{
artName: 'Wave Animation',
pageLink: '.Art/runtimeerror11/index.html',
Expand Down

0 comments on commit 18cd04b

Please sign in to comment.