-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,20 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Floating Ghost</title> | ||
<link rel="stylesheet" href="style.css" /> | ||
</head> | ||
<body> | ||
<div class="flex"> | ||
<div class="ghost-body"> | ||
<div class="ghost-lower-body"> | ||
<div class="ghost-feet"></div> | ||
<div class="ghost-feet"></div> | ||
<div class="ghost-feet"></div> | ||
</div> | ||
</div> | ||
</div> | ||
</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,87 @@ | ||
html, | ||
body { | ||
height: 100%; | ||
} | ||
body { | ||
background-color: hsl(209, 23%, 23%); | ||
overflow: hidden; | ||
margin: 0; | ||
} | ||
.flex { | ||
display: -webkit-box; | ||
display: -ms-flexbox; | ||
display: flex; | ||
-webkit-box-orient: vertical; | ||
-webkit-box-direction: normal; | ||
-ms-flex-direction: column; | ||
flex-direction: column; | ||
height: 100vh; | ||
-webkit-box-align: center; | ||
-ms-flex-align: center; | ||
align-items: center; | ||
-webkit-box-pack: center; | ||
-ms-flex-pack: center; | ||
justify-content: center; | ||
} | ||
.ghost-body { | ||
width: 8.75rem; | ||
height: 10.5rem; | ||
background-color: hsl(0, 0%, 95%); | ||
border-radius: 70px 70px 0 0; | ||
-webkit-box-shadow: 0 0 20px 5px hsl(0, 0%, 95%); | ||
box-shadow: 0 0 20px 5px hsl(0, 0%, 95%); | ||
position: relative; | ||
-webkit-animation: floating 3s infinite ease-in-out; | ||
animation: floating 3s infinite ease-in-out; | ||
} | ||
.ghost-body::before { | ||
content: ''; | ||
width: 1rem; | ||
height: 1rem; | ||
border-radius: 50%; | ||
display: block; | ||
background-color: hsl(0, 100%, 50%); | ||
position: absolute; | ||
top: 3.125rem; | ||
left: 2.5rem; | ||
} | ||
.ghost-body::after { | ||
content: ''; | ||
width: 1rem; | ||
height: 1rem; | ||
border-radius: 50%; | ||
display: block; | ||
background-color: hsl(0, 100%, 50%); | ||
position: absolute; | ||
top: 3.125rem; | ||
right: 2.5rem; | ||
} | ||
.ghost-lower-body { | ||
display: -webkit-box; | ||
display: -ms-flexbox; | ||
display: flex; | ||
-webkit-box-pack: justify; | ||
-ms-flex-pack: justify; | ||
justify-content: space-between; | ||
width: 8.75rem; | ||
position: absolute; | ||
bottom: -1rem; | ||
} | ||
.ghost-feet { | ||
background-color: hsl(0, 0%, 95%); | ||
width: 2.9rem; | ||
height: 2.5rem; | ||
border-radius: 50%; | ||
} | ||
@-webkit-keyframes floating { | ||
50% { | ||
-webkit-transform: translateY(-30px); | ||
transform: translateY(-30px); | ||
} | ||
} | ||
@keyframes floating { | ||
50% { | ||
-webkit-transform: translateY(-30px); | ||
transform: translateY(-30px); | ||
} | ||
} |
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