Skip to content

Commit

Permalink
new: setup bouncy cube
Browse files Browse the repository at this point in the history
  • Loading branch information
lezette committed Oct 4, 2024
1 parent 3c7d186 commit 493660d
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 2 deletions.
20 changes: 20 additions & 0 deletions bouncyCube/index.html
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>Document</title>
<link rel="stylesheet" href="style.css">
</head>

<body>

<div class="stage">
<div class="floor"></div>
<div class="cube"></div>
<div class="ball"></div>
</div>
</body>

</html>
51 changes: 51 additions & 0 deletions bouncyCube/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
:root {
--boxColor: #0ff7;
}

body {
background-color: black;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
font-size: 75px;
perspective: 10em;
perspective-origin: 50% calc(50% - 2em);
}




.stage {
position: relative;
transform-style: preserve-3d;
}

.ball {
width: 1em;
height: 1em;
border-radius: 50%;
background-color: white;
position: absolute;
left: -.5em;
bottom: 1em;
}

.cube {
width: 2em;
height: 2em;
background-color: var(--boxColor);
position: absolute;
top: -1em;
left: -1em;
}

.floor {
position: absolute;
top: 1em;
width: 15em;
height: 15em;
transform: translate(-50%, -50%) rotateX(90deg);
background-image: repeating-conic-gradient(from 45deg, #111 0deg 90deg, #222 90deg 180deg);
background-size: 1em 1em;
}
3 changes: 1 addition & 2 deletions portal/style.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
body {
background-color: #efe8dd;
overflow: hidden;
/* background: linear-gradient(#ced5d3, #ced5d3 144px, #efe8dd 144px, #efe8dd 100%); */
background-color: black;
background: linear-gradient(#ced5d3, #ced5d3 144px, #efe8dd 144px, #efe8dd 100%);
width: 90%;
}

Expand Down

0 comments on commit 493660d

Please sign in to comment.