Skip to content

Commit

Permalink
colorful rotating 3d cube (horizontal rotating) (#2331)
Browse files Browse the repository at this point in the history
* colorful rotating 3d cube (horizontal rotating)

* changed the folder name to github id name
  • Loading branch information
Abhika3021 committed Oct 29, 2023
1 parent f706977 commit 714711f
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 0 deletions.
Binary file added Art/Abhika3021/Cube.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions Art/Abhika3021/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Rotating 3D Cube</title>
<link rel="stylesheet" type="text/css" href="style.css">
<body>
<div class="cube">
<div class="face"></div>
<div class="face"></div>
<div class="face"></div>
<div class="face"></div>
<div class="face"></div>
<div class="face"></div>
</div>
</body>
</html>
53 changes: 53 additions & 0 deletions Art/Abhika3021/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
body {
background-color: #121212;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
perspective: 1200px;
}

.cube {
width: 100px;
height: 100px;
position: relative;
transform-style: preserve-3d;
animation: rotate 5s linear infinite;
}

.face {
position: absolute;
width: 100px;
height: 100px;
background: linear-gradient(-45deg, #fc5c7d, #6a82fb, #05dfd7, #a8d8ea);
opacity: 0.8;
}

.face:nth-child(1) {
transform: rotateY(0deg) translateZ(50px);
}
.face:nth-child(2) {
transform: rotateY(90deg) translateZ(50px);
}
.face:nth-child(3) {
transform: rotateY(180deg) translateZ(50px);
}
.face:nth-child(4) {
transform: rotateY(-90deg) translateZ(50px);
}
.face:nth-child(5) {
transform: rotateX(90deg) translateZ(50px);
}
.face:nth-child(6) {
transform: rotateX(-90deg) translateZ(50px);
}

@keyframes rotate {
0% {
transform: rotateY(0deg);
}
100% {
transform: rotateY(360deg);
}
}
7 changes: 7 additions & 0 deletions include.js
Original file line number Diff line number Diff line change
Expand Up @@ -2279,6 +2279,13 @@ let cards = [
author: 'psykat1116',
githubLink: 'https://github.com/psykat1116'
},
{
artName: 'Rotating 3D Cube',
pageLink: './Art/Abhika3021/index.html',
imageLink: './Art/Abhika3021/Cube.gif',
author: 'Abhika Mittal',
githubLink: 'https://github.com/Abhika3021'
},
{
artName: 'Breaking news',
pageLink: './Art/parthrc/index.html',
Expand Down

0 comments on commit 714711f

Please sign in to comment.