-
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.
* Create CubeAnimation.html * "Uploaded a css file and gif" * Update include.js * fix syntax error in include.js --------- Co-authored-by: Sophia Brandt <16630701+sophiabrandt@users.noreply.github.com>
- Loading branch information
1 parent
a36f9d0
commit c7da44b
Showing
4 changed files
with
99 additions
and
1 deletion.
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,28 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport"> | ||
<title>Cube CSS Animation with Bootstrap</title> | ||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
<div class="container mt-5"> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<div class="scene"> | ||
<div class="cube"> | ||
<div class="face front">Front</div> | ||
<div class="face back">Back</div> | ||
<div class="face left">Left</div> | ||
<div class="face right">Right</div> | ||
<div class="face top">Top</div> | ||
<div class="face bottom">Bottom</div> | ||
</div> | ||
</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,63 @@ | ||
body { | ||
background: #333; | ||
margin: 0; | ||
padding: 0; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
overflow: hidden; | ||
} | ||
|
||
.scene { | ||
perspective: 1200px; | ||
width: 200px; | ||
height: 200px; | ||
animation: spin 10s linear infinite; | ||
} | ||
|
||
.cube { | ||
width: 200px; | ||
height: 200px; | ||
position: relative; | ||
transform-style: preserve-3d; | ||
animation: rotate 10s linear infinite, change-color 5s infinite alternate; | ||
margin: 0 auto; | ||
} | ||
|
||
.face { | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
font-size: 24px; | ||
color: #fff; | ||
background: var(--face-color); | ||
} | ||
|
||
.front { transform: rotateY(0deg) translateZ(100px); } | ||
.back { transform: rotateY(180deg) translateZ(100px); } | ||
.left { transform: rotateY(-90deg) translateZ(100px); } | ||
.right { transform: rotateY(90deg) translateZ(100px); } | ||
.top { transform: rotateX(90deg) translateZ(100px); } | ||
.bottom { transform: rotateX(-90deg) translateZ(100px); } | ||
|
||
@keyframes rotate { | ||
0% { transform: rotateY(0deg) translateZ(0); } | ||
100% { transform: rotateY(360deg) translateZ(0); } | ||
} | ||
|
||
@keyframes spin { | ||
0% { transform: rotate(0deg) translateZ(0); } | ||
100% { transform: rotate(360deg) translateZ(200px); } | ||
} | ||
|
||
@keyframes change-color { | ||
0%, 100% { --face-color: #007bff; } | ||
20% { --face-color: #ff6f61; } | ||
40% { --face-color: #ffd166; } | ||
60% { --face-color: #6b4226; } | ||
80% { --face-color: #50b5e9; } | ||
} |
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