Last active
February 7, 2020 09:01
-
-
Save zocom-christoffer-wallenberg/47678355585702101b9513600e2aebb9 to your computer and use it in GitHub Desktop.
Transitions
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<link rel="stylesheet" href="style.css"> | |
<title>Transition - example</title> | |
</head> | |
<body> | |
<section class="box"> | |
<h2>It's Levi-o-sa, not Levio-sar</h2> | |
<h3>-Hermione Granger</h3> | |
</section> | |
</body> | |
</html> |
This file contains hidden or 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
{ | |
"scripts": [], | |
"styles": [] | |
} |
This file contains hidden or 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
|
This file contains hidden or 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
body { | |
margin: 0; | |
padding: 0; | |
height: 100vh; | |
} | |
.box { | |
width: 250px; | |
height: 250px; | |
border: 1px solid #000000; | |
color: #ffffff; | |
transition: background 1s, width 1s, height 1s; | |
display: flex; | |
flex-direction: column; | |
justify-content: center; | |
align-items: center; | |
} | |
.box h2 { | |
transform: translateY(-999px); | |
transition: transform 1s linear 0.5s; | |
} | |
.box h3 { | |
transform: translateX(-999px); | |
transition: transform 1s linear 1.5s; | |
} | |
.box:hover h2 { | |
transform: none; | |
} | |
.box:hover h3 { | |
transform: none; | |
} | |
.box:hover { | |
background: #000000; | |
width: 100%; | |
height: 100%; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment