Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Example for midterm
- Loading branch information
Showing
4 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"liveServer.settings.port": 5501 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="stylesheet" href="style.css" /> | ||
<title>Card Flip</title> | ||
</head> | ||
<body> | ||
<main> | ||
<section class="section-1"> | ||
<div class="container"> | ||
<div class="card"> | ||
<div class="card-face front">Front</div> | ||
<div class="card-face back">Back</div> | ||
</div> | ||
</div> | ||
<h1>Click To Flip</h1> | ||
</section> | ||
</main> | ||
<script src="script.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
var card = document.querySelector('.card'); | ||
card.addEventListener( 'click', function() { | ||
card.classList.toggle('is-flipped'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
body { | ||
font-family: Arial, Helvetica, sans-serif; | ||
} | ||
.section-1 { | ||
width: 100vw; | ||
height: 100vh; | ||
display: flex; | ||
justify-content: center; | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
.container { | ||
width: 200px; | ||
height: 260px; | ||
margin: 40px 0; | ||
perspective: 600px; | ||
} | ||
.card { | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
transition: transform 1.5s ease-in-out; | ||
transform-style: preserve-3d; | ||
cursor: pointer; | ||
} | ||
.card.is-flipped { | ||
transform: rotateY(180deg); | ||
} | ||
.card-face { | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
line-height: 260px; | ||
color: black; | ||
text-align: center; | ||
font-weight: bold; | ||
font-size: 40px; | ||
backface-visibility: hidden; | ||
-webkit-backface-visibility: hidden; | ||
border: 1px solid rgba(0, 0, 0, 0.25); | ||
border-radius: 5px; | ||
} | ||
.front { | ||
background: none; | ||
} | ||
.back { | ||
background: none; | ||
transform: rotateY(180deg); | ||
} |