HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<header>
<h1>
<a target="_top" href="https://codepen.io/josetxu/pen/NWByOzb">
<span class="title-0">3D</span>
<span class="title-1"><strong>P</strong>YRAMID<br><strong>G</strong>ENERATOR</span>
</a>
</h1>
<a class="josetxu-btn" href="https://josetxu.com" target="_blank"></a></div>
<button id="copy-css" onclick="copyCode(this.id)">{ CSS }</button>
<button id="copy-html" onclick="copyCode(this.id)">< HTML ></button>
</header>
<input type="checkbox" id="play-pause" onclick="animatePyramid()" autocomplete="off">
<div class="w-bricks pyramid" id="pyramid">
<span></span>
<span></span>
<span></span>
<span></span>
<div>
<div></div>
</div>
</div>
<div id="hidden-copy-html" class="hidden"><!-- Josetxu's 3D Pyramid Generator - CSS -->
<!-- https://codepen.io/josetxu/pen/NWByOzb -->
<div class="<span id="w-pyramid">w-bricks</span> pyramid <span id="anim">running</span>" style="--width:<span id="cp-width">35</span>; --height:<span id="cp-height">30</span>; --hypo:<span id="cp-hypo">34.73</span>; --alpha:<span id="cp-alpha">59.74deg</span>;">
<span></span>
<span></span>
<span></span>
<span></span>
</div>
</div>
<div id="hidden-copy-css" class="hidden">/*** Josetxu's 3D Pyramid Generator - CSS ***/
/*** https://codepen.io/josetxu/pen/NWByOzb ***/
body {
margin: 0;
padding: 0;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 100vh;
perspective: 100vmin;
}
body * {
box-sizing: border-box;
transform-style: preserve-3d;
}
@keyframes spin {
0% { transform: rotateX(65deg) rotateZ(-160deg); }
100% { transform: rotateX(65deg) rotateZ(200deg); }
}
.pyramid {
width: calc(var(--width) * 1vmin);
height: calc(var(--width) * 1vmin);
transform: rotateX(65deg) rotateZ(-160deg);
margin: 0 0 calc(var(--height) * -0.5vmin) -5vmin;
background: var(--wall-design);
animation: spin 8s linear 0s infinite;
}
.pyramid.running, .pyramid.running span {
animation-play-state: running;
}
.pyramid.paused, .pyramid.paused span {
animation-play-state: paused;
}
.pyramid:before {
content: "";
background: black;
width: 100%;
height: 100%;
position: absolute;
transform: translateZ(-10vmin);
box-shadow: 0 0 2vmin 2vmin #000000;
opacity: 0.1;
}
.pyramid span {
width: 100%;
height: calc(var(--hypo) * 1vmin);
--hypo2: calc(calc(var(--hypo) / 2) * 1vmin);
position: absolute;
box-sizing: border-box;
clip-path: polygon(0% 100%, 50% 0%, 100% 100%);
background: var(--wall-design);
filter: brightness(var(--cx));
animation: shadows 8s ease 0s infinite;
}
.pyramid span:nth-child(1) {
transform-origin: center bottom;
transform: rotateX(calc(var(--alpha) * -1));
bottom: 0;
--cx: 0.65; /*firefox*/
animation-delay: -9s;
}
.pyramid span:nth-child(2) {
transform-origin: right center;
transform: rotateY(calc(var(--alpha) * 1)) rotateZ(-90deg) translate3d(var(--hypo2), calc(var(--hypo2) * -1), 0vmin);
--cx: 0.85; /*firefox*/
animation-delay: -7s;
}
.pyramid span:nth-child(3) {
transform-origin: center top;
transform: rotateX(calc(var(--alpha) * 1)) rotateZ(180deg) translate3d(0vmin, calc(var(--hypo) * -1vmin), 0vmin);
--cx: 1.1; /*firefox*/
animation-delay: -5s;
}
.pyramid span:nth-child(4) {
transform-origin: left center;
transform: rotateY(calc(var(--alpha) * -1)) rotateZ(90deg) translate3d(calc(var(--hypo2) * -1), calc(var(--hypo2) * -1), 0vmin);
--cx: 1.3; /*firefox*/
animation-delay: -3s;
}
/*** Wall Shadows ***/
@property --cx {
syntax: '<number>';
inherits: false;
initial-value: 1;
}
@keyframes shadows {
0% { --cx: 0.6; }
25% { --cx: 1.1; }
50% { --cx: 1.3; }
75% { --cx: 0.8; }
100% { --cx: 0.6; }
}
/************ Wall Designs ************/
/*** You can delete the unused ones ***/
/*** Bricks ***/
.w-bricks.pyramid {
--sz: 4px;
--brick1: #b16c53;
--brick2: #b56c52;
--lines: #873e1a;
--gp-ln: 50%/calc(var(--sz) * 10) calc(var(--sz) * 5);
--gp-cn: 50%/calc(var(--sz) * 5) calc(var(--sz) * 5);
--wall-design:
repeating-conic-gradient(from 90deg at 95% 55%, var(--lines) 0% 25%, #fff0 0% 100%) var(--gp-cn),
repeating-linear-gradient(180deg, var(--lines) 0 5%, #fff0 0 50%, var(--lines) 0 55%, var(--brick2) 0 100%) var(--gp-ln),
repeating-linear-gradient(90deg, var(--brick1) 0 47.5%, var(--lines) 0 50%, var(--brick1) 0 97.5%, var(--lines) 0 100%) var(--gp-ln);
}
/*** Granite ***/
.w-granite.pyramid {
--wall-design:
repeating-conic-gradient(#0004 0%, #fff0 .0003%, #fff0 .0005%, #fff0 .00095%),
repeating-conic-gradient(#fff2 0%, #fff0 .0005%, #fff0 .00015%, #fff0 .0009%) #777;
}
/*** Crystal ***/
.w-crystal.pyramid {
--wall-design:
linear-gradient(45deg, #fff0 55%, #fff1 56% 64%, #fff0 65% 66%, #fff2 67% 69%, #fff0 71% 100%),
linear-gradient(45deg, #2196f380, #ffffff78 56% 64%, #2196f380),
#fff4;
}
/*** Grille ***/
.w-grille.pyramid {
--sz: 4px;
--gp: 50%/ calc(var(--sz) * 2) calc(var(--sz) * 2);
--wall-design:
linear-gradient(290deg, #fff0 25%, #545454 25% 35%, #fff0 35% 100%) var(--gp),
linear-gradient(-290deg, #fff0 25%, #727272 25% 35%, #fff0 35% 100%) var(--gp),
linear-gradient(200deg, #fff0 25%, #545454 25% 35%, #fff0 35% 100%) var(--gp),
linear-gradient(-200deg, #fff0 25%, #727272 25% 35%, #fff0 35% 100%) var(--gp),
#0001;
}
/*** Smooth ***/
.w-smooth.pyramid {
--wall-design: #1d73b7;
}
/*** Puzzle ***/
.w-puzzle.pyramid {
--sz: 3px;
--c1: #8bc34a;
--c2: #3f8d42;
--pz: calc(var(--sz) * 0.65), #fff0 calc(calc(var(--sz) * 0.65) + 1px);
--gp: 50%/ calc(var(--sz) * 10) calc(var(--sz) * 10);
--wall-design:
radial-gradient(circle at 55% 25%, var(--c2) var(--pz)) var(--gp),
radial-gradient(circle at 75% 45%, var(--c2) var(--pz)) var(--gp),
radial-gradient(circle at 5% 75%, var(--c2) var(--pz)) var(--gp),
radial-gradient(circle at 25% 55%, var(--c2) var(--pz)) var(--gp),
radial-gradient(circle at 55% 75%, var(--c1) var(--pz)) var(--gp),
radial-gradient(circle at 75% 95%, var(--c1) var(--pz)) var(--gp),
radial-gradient(circle at 5% 25%, var(--c1) var(--pz)) var(--gp),
radial-gradient(circle at 25% 5%, var(--c1) var(--pz)) var(--gp),
conic-gradient(from 0deg at 50% 50%, var(--c1) 0 25%, var(--c2) 0 50%, var(--c1) 0 75%, var(--c2) 0 100%) var(--gp);
}
/*** ZigZag ***/
.w-zigzag.pyramid {
--sz: 2px;
--c1: #b78cff;
--c2: #9d6fe9;
--c3: #8f64d4;
--c4: #7e59bb;
--gp: 50%/ calc(var(--sz) * 6) calc(var(--sz) * 12);
--wall-design:
conic-gradient(from -45deg at 50% 25%, var(--c2) 0 90deg, #fff0 0 100%) var(--gp),
conic-gradient(from -45deg at 50% 50%, var(--c3) 0 90deg, #fff0 0 100%) var(--gp),
conic-gradient(from -45deg at 50% 75%, var(--c1) 0 90deg, #fff0 0 100%) var(--gp),
conic-gradient(from -45deg at 50% 100%, var(--c4) 0 90deg, #fff0 0 100%) var(--gp),
var(--c2);
}
/*** Woven ***/
.w-woven.pyramid {
--sz: 6px;
--c1: #b1cddb;
--c2: #96b5cb;
--c3: #7d9eaf;
--c4: #6f92a3;
--sh: #0006;
--sh2: #0002;
--gp: 50%/ calc(var(--sz) * 2) calc(var(--sz) * 2);
--wall-design:
repeating-linear-gradient(45deg, #42312f30 calc(var(--sz) * 0.125), #fff0 calc(var(--sz) * 0.25) ),
conic-gradient(from 85deg at 75% 1px, #fff0 0, var(--sh2) 0%, #fff0 5% 100%) var(--gp),
conic-gradient(from -5deg at 0% calc(75% - 1px), #fff0 0, var(--sh) 0%, #fff0 4% 100%) var(--gp),
conic-gradient(from 0deg at 75% calc(75% - 1px), #fff0 0 22%, var(--sh2) 25%, #fff0 25% 100%) var(--gp),
conic-gradient(from 0deg at 75% calc(75% - 1px), var(--c4) 0 25%, #fff0 0 97%, var(--sh) 105%) var(--gp),
linear-gradient(180deg, #fff0 0%, var(--sh) 25%, #fff0 25% 50%, var(--sh) 50%, #fff0 75% 100%) var(--gp),
linear-gradient(180deg, #fff0 25%, var(--c3) 25% 50%, #fff0 50% 100%) var(--gp),
linear-gradient(90deg, #fff0 0%, var(--sh) 25%, #fff0 25% 50%, var(--sh) 50%, #fff0 75% 100%) var(--gp),
linear-gradient(90deg, #fff0 25%, var(--c2) 25% 50%, #fff0 50% 100%) var(--gp),
linear-gradient(180deg, var(--sh) 0%, #fff0 25% 50%, var(--sh) 75%, #fff0 75% 100%) var(--gp),
linear-gradient(180deg, #fff0 75%, var(--c1) 75% 100%) var(--gp),
#42312F25;
}
/*** Basket ***/
.w-basket.pyramid {
--sz: 11px;
--c1: #ffa726;
--c2: #e59319;
--c3: #f1a12c;
--c4: #cf8b26;
--sh: #0006;
--sh2: #0002;
--gp: 50%/ calc(var(--sz) * 2) calc(var(--sz) * 2);
--wall-design:
conic-gradient(from -10deg at 60% 0%, #fff0 0 25%, var(--sh2) 28%, #fff0 31% 100%) var(--gp),
conic-gradient(from -5deg at 0% calc(60% - 1px), #fff0 0, var(--sh) 0%, #fff0 4% 100%) var(--gp),
conic-gradient(from 0deg at 60% calc(60% - 1px), #fff0 0 22%, var(--sh2) 25%, #fff0 25% 100%) var(--gp),
conic-gradient(from 0deg at 60% calc(60% - 1px), var(--c4) 0 25%, #fff0 0 97.5%, var(--sh) 102%) var(--gp),
linear-gradient(180deg, #fff0 0%, var(--sh) 10%, #fff0 10% 50%, var(--sh) 50%, #fff0 60% 101%) var(--gp),
linear-gradient(180deg, #fff0 10%, var(--c3) 10% 50%, #fff0 50% 100%) var(--gp),
linear-gradient(90deg, #fff0 0%, var(--sh) 10%, #fff0 10% 50%, var(--sh) 50%, #fff0 60% 100%) var(--gp),
linear-gradient(90deg, #fff0 10%, var(--c2) 10% 50%, #fff0 50% 100%) var(--gp),
linear-gradient(180deg, #fff0 60%, var(--c1) 60% 100%) var(--gp),
#6a1c0080;
}
/*** Blocks ***/
.w-blocks.pyramid {
--sz: 3px;
--c1: #fdf3e3;
--c2: #dfd2bf;
--c3: #ccc3b2;
--c4: #a79a8a;
--s1: #cfc3ab;
--s2: #ccc0aa;
--s3: #ada38e;
--s4: #ccc0aa;
--d1: #9b9082;
--d2: #ddd9d4;
--gp: 50%/ calc(var(--sz) * 8) calc(var(--sz) * 6);
--bp: calc(var(--sz) * -4) calc(var(--sz) * -3);
--bg:
conic-gradient(from 270deg at 0.65% 50%, var(--d1) 0% 25%, #fff0 0 100%) var(--gp),
linear-gradient(0deg, var(--d1) 0 0.5%, #fff0 0 49.5%, var(--d1) 0 50.5%, #fff0 0 100%) var(--gp),
conic-gradient(from 45deg at 81% 25%, var(--s3) 0%, var(--s4) 25%, #fff0 0 100%) var(--gp),
conic-gradient(from -135deg at 19% 25%, var(--s1) 0%, var(--s2) 25%, #fff0 0 100%) var(--gp),
linear-gradient(180deg, var(--c2), var(--c1) 24%, var(--c4) 26%, var(--c3) 50%, #fff0 0 100%) var(--gp);
--wall-design: var(--bg),var(--bg);
}
.w-blocks.pyramid span {
background-position: var(--bp), var(--bp), var(--bp), var(--bp), var(--bp), 0 0, 0 0, 0 0, 0 0, 0 0;
}
.w-blocks.pyramid span:nth-child(4) {
filter: brightness(1.2);
}
/*** Triangle ***/
.w-triangle.pyramid {
--sz: 2px;
--c1: #7a2222;
--c2: #6a1d1d;
--c3: #521616;
--c4: #340e0e;
--gp: 50%/ calc(var(--sz) * 8.5) calc(var(--sz) * 14.7);
--wall-design:
conic-gradient(from 118deg at 50.5% 85%, var(--c2) 0 125deg, #fff0 0 100%) var(--gp),
conic-gradient(from 30deg at 50% 50%, var(--c4) 0 30deg, var(--c2) 0 60deg, #fff0 0 120deg, var(--c3) 0 150deg, var(--c4) 0 180deg, #fff0 0 241deg, var(--c2) 0 270deg, var(--c3) 0 300deg, #fff0 0 100%) var(--gp),
linear-gradient(180deg, var(--c1) 0 10%, #fff0 0 100%) var(--gp),
var(--c1);
}
/*** Honeycomb ***/
.w-honeycomb.pyramid {
--sz: 1.1px;
--ln: 0.75px;
--c1: #ffb564;
--c2: #ff5903;
--c3: #ffa063;
--ts: 50%/ calc(var(--sz) * 11.8) calc(var(--sz) * 20);
--wall-design:
radial-gradient(circle at 60% 110%, var(--c3) calc(var(--sz) * -3), #fff0 calc(var(--sz) * 5)) var(--ts),
radial-gradient(circle at 60% 10%, var(--c3) calc(var(--sz) * -3), #fff0 calc(var(--sz) * 5)) var(--ts),
radial-gradient(circle at 110% 60%, var(--c3) calc(var(--sz) * -3), #fff0 calc(var(--sz) * 5)) var(--ts),
radial-gradient(circle at 10% 60%, var(--c3) calc(var(--sz) * -3), #fff0 calc(var(--sz) * 5)) var(--ts),
conic-gradient(from 120deg at 50% calc(82.75% + calc(var(--ln) / 1.5)), var(--c2) 0 120deg, #fff0 0 100%) var(--ts),
conic-gradient(from 120deg at 50% calc(82.75% + calc(var(--ln) / 1.5)), var(--c2) 0 120deg, #fff0 0 100%) var(--ts),
conic-gradient(from 120deg at 50% calc(82.5% - calc(var(--ln) * 1.5)), var(--c1) 0 120deg, #fff0 0 100%) var(--ts),
conic-gradient(from 120deg at 50% calc(82.5% - calc(var(--ln) * 1.5)), var(--c1) 0 120deg, #fff0 0 100%) var(--ts),
conic-gradient(from 60deg at calc(50% + var(--ln)) 50.5%, var(--c2) 0 120deg, #fff0 0 100%) var(--ts),
conic-gradient(from 60deg at calc(50% + var(--ln)) 50.5%, var(--c2) 0 120deg, #fff0 0 100%) var(--ts),
conic-gradient(from 180deg at calc(50% - var(--ln)) 50.5%, var(--c2) 0 120deg, #fff0 0 100%) var(--ts),
conic-gradient(from 180deg at calc(50% - var(--ln)) 50.5%, var(--c2) 0 120deg, #fff0 0 100%) var(--ts),
conic-gradient(from 0deg at calc(100% - var(--ln)) 37.75%, var(--c1) 0 90deg, #fff0 0 100%) var(--ts),
conic-gradient(from 0deg at calc(100% - var(--ln)) 37.75%, var(--c1) 0 90deg, #fff0 0 100%) var(--ts),
conic-gradient(from -90deg at var(--ln) 37.75%, var(--c1) 0 90deg, #fff0 0 100%) var(--ts),
conic-gradient(from -90deg at var(--ln) 37.75%, var(--c1) 0 90deg, #fff0 0 100%) var(--ts),
conic-gradient(from -60deg at 50% calc(50% - calc(var(--ln) * 1.5)), var(--c2) 0 120deg, #fff0 0 100%) var(--ts),
conic-gradient(from -60deg at 50% calc(50% - calc(var(--ln) * 1.5)), var(--c2) 0 120deg, #fff0 0 100%) var(--ts),
var(--c1);
}
</div>
<button id="info-btn" class="info-btn" onclick="hideInfo()">∡</button>
<div class="info" id="info-panel">
<div class="base-width" id="base-width">35</div>
<div class="apex-height" id="apex-height">30</div>
<div class="hypotenuse" id="hypotenuse">34.73</div>
<div class="alpha-angle" id="alpha-angle">59.74</div>
</div>
<footer>
<div class="slider">
<input id="base" type="range" min="5" max="50" value="35" step="1" oninput="setBase(this.value)" onchange="setBase(this.value)" autocomplete="off">
<div class="slider-value">35</div>
</div>
<div class="slider">
<input id="apex" type="range" min="5" max="50" value="30" step="1" oninput="setApex(this.value)" onchange="setApex(this.value)" autocomplete="off">
<div class="slider-value">30</div>
</div>
<div class="wall-design">
<input type="radio" name="wall" id="w-bricks" oninput="setWall(this.id)" onchange="setWall(this.id)" autocomplete="off" checked><label for="w-bricks"></label>
<input type="radio" name="wall" id="w-granite" oninput="setWall(this.id)" onchange="setWall(this.id)" autocomplete="off"><label for="w-granite"></label>
<input type="radio" name="wall" id="w-crystal" oninput="setWall(this.id)" onchange="setWall(this.id)" autocomplete="off"><label for="w-crystal"></label>
<input type="radio" name="wall" id="w-grille" oninput="setWall(this.id)" onchange="setWall(this.id)" autocomplete="off"><label for="w-grille"></label>
<input type="radio" name="wall" id="w-smooth" oninput="setWall(this.id)" onchange="setWall(this.id)" autocomplete="off"><label for="w-smooth"></label>
<button id="w-more" onclick="moreWalls()"></button>
<div class="w-more down" id="w-mores">
<input type="radio" name="wall" id="w-honeycomb" oninput="setWall(this.id)" onchange="setWall(this.id)" autocomplete="off"><label for="w-honeycomb"></label>
<input type="radio" name="wall" id="w-triangle" oninput="setWall(this.id)" onchange="setWall(this.id)" autocomplete="off"><label for="w-triangle"></label>
<input type="radio" name="wall" id="w-blocks" oninput="setWall(this.id)" onchange="setWall(this.id)" autocomplete="off"><label for="w-blocks"></label>
<input type="radio" name="wall" id="w-basket" oninput="setWall(this.id)" onchange="setWall(this.id)" autocomplete="off"><label for="w-basket"></label>
<input type="radio" name="wall" id="w-woven" oninput="setWall(this.id)" onchange="setWall(this.id)" autocomplete="off"><label for="w-woven"></label>
<input type="radio" name="wall" id="w-zigzag" oninput="setWall(this.id)" onchange="setWall(this.id)" autocomplete="off"><label for="w-zigzag"></label>
<input type="radio" name="wall" id="w-puzzle" oninput="setWall(this.id)" onchange="setWall(this.id)" autocomplete="off"><label for="w-puzzle"></label>
</div>
</div>
<label for="play-pause"></label>
<span></span>
</footer>
<textarea id="hidden-copy-text" value=""></textarea>
:root {
--width: 35;
--height: 30;
--hypo: 34.73;
--alpha: 59.74deg;
--dark: #282828;
--data: hsl(0deg 100% 40%);
}
html {
width: 100vw;
height: 100vh;
overflow: hidden;
}
body {
margin: 0;
padding: 0;
background:
repeating-linear-gradient(150deg, #fff0 0 49px, #fff1 50px, #fff0 51px),
repeating-linear-gradient(31deg, #fff0 0 49px, #fff1 50px, #fff0 51px),
radial-gradient(circle at 100% 100%, #fff , #999);
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 100vh;
perspective: 100vmin;
font-family: Arial, Helvetica, serif;
}
body * { box-sizing: border-box; }
/*** PYRAMID ***/
@keyframes spin {
0% { transform: rotateX(65deg) rotateZ(-160deg); }
100% { transform: rotateX(65deg) rotateZ(200deg); }
}
#play-pause:checked ~ .pyramid,
#play-pause:checked ~ .pyramid span {
animation-play-state: paused;
}
.pyramid {
width: calc(var(--width) * 1vmin);
height: calc(var(--width) * 1vmin);
transform: rotateX(65deg) rotateZ(-160deg);
transform-style: preserve-3d;
animation: spin 8s linear 0s infinite;
margin: 0 0 calc(var(--height) * -0.5vmin) -5vmin;
background: var(--wall-design);
}
.pyramid:before {
content: "";
background: black;
width: 100%;
height: 100%;
position: absolute;
transform: translateZ(-10vmin);
box-shadow: 0 0 2vmin 2vmin #000000;
opacity: 0.1;
}
.pyramid span {
width: 100%;
height: calc(var(--hypo) * 1vmin);
--hypo2: calc(calc(var(--hypo) / 2) * 1vmin);
position: absolute;
box-sizing: border-box;
clip-path: polygon(0% 100%, 50% 0%, 100% 100%);
background: var(--wall-design);
filter: brightness(var(--cx));
animation: shadows 8s ease 0s infinite;
}
.pyramid span:nth-child(1) {
transform-origin: center bottom;
transform: rotateX(calc(var(--alpha) * -1));
bottom: 0;
--cx: 0.65; /*firefox*/
animation-delay: -9s;
}
.pyramid span:nth-child(2) {
transform-origin: right center;
transform: rotateY(calc(var(--alpha) * 1)) rotateZ(-90deg) translate3d(var(--hypo2), calc(var(--hypo2) * -1), 0vmin);
--cx: 0.85; /*firefox*/
animation-delay: -7s;
}
.pyramid span:nth-child(3) {
transform-origin: center top;
transform: rotateX(calc(var(--alpha) * 1)) rotateZ(180deg) translate3d(0vmin, calc(var(--hypo) * -1vmin), 0vmin);
--cx: 1.1; /*firefox*/
animation-delay: -5s;
}
.pyramid span:nth-child(4) {
transform-origin: left center;
transform: rotateY(calc(var(--alpha) * -1)) rotateZ(90deg) translate3d(calc(var(--hypo2) * -1), calc(var(--hypo2) * -1), 0vmin);
--cx: 1.3; /*firefox*/
animation-delay: -3s;
}
/*** Wall Shadow ***/
@property --cx {
syntax: '<number>';
inherits: false;
initial-value: 1;
}
@keyframes shadows {
0% { --cx: 0.6; }
25% { --cx: 1.1; }
50% { --cx: 1.3; }
75% { --cx: 0.8; }
100% { --cx: 0.6; }
}
/*** HEADER ***/
header {
padding: 10px;
background: var(--dark);
height: 60px;
position: fixed;
width: 100%;
z-index: 1;
top: 0;
box-shadow: #00000030 0px 2px 6px, #00000040 0px 2px 6px;
}
header:after {
content: "";
border-right: 1px solid #000;
position: absolute;
right: 250px;
height: 40px;
width: 1px;
background: linear-gradient(90deg, #fff0 calc(100% - 1px), #fff2 100%);
}
h1 {
display: inline-block;
font-weight: normal;
color: #ffffff;
font-size: 15px;
margin: 0;
border-right: 1px solid #000;
float: left;
position: relative;
background: linear-gradient(90deg, #fff0 calc(100% - 1px), #fff2 100%);
height: 40px;
}
h1:before {
content: "";
float: left;
width: 45px;
height: 40px;
background: linear-gradient(-153deg, #fff0 45px, var(--dark) 46px), linear-gradient(151deg, #fff0 44px, var(--dark) 45px), conic-gradient(from 180deg at 42% 1%, #8f8f8f 0 7.5%, #fff0 0 100%), conic-gradient(from 135deg at 47% 1%, #e3e0e0 0 12.5%, #fff0 0 100%);
margin-right: 10px;
position: absolute;
z-index: -1;
}
h1 a {
color: #fff;
text-decoration: none;
display: inline-block;
padding-right: 20px;
padding-left: 50px;
}
h1 a span {
float: left;
}
h1:hover:before {
background: linear-gradient(-153deg, #fff0 45px, var(--dark) 46px), linear-gradient(151deg, #fff0 44px, var(--dark) 45px), conic-gradient(from 180deg at 42% 1%, #0176d5 0 7.5%, #fff0 0 100%), conic-gradient(from 135deg at 47% 1%, #5db7ff 0 12.5%, #fff0 0 100%);
}
h1:hover .title-0:first-letter {
color: #8bc34a;
}
h1:hover .title-0 {
color: #ffa500;
}
h1:hover .title-1 {
color: #709eb5;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-image: linear-gradient( 180deg, #ff1d1d 30%, #8e60df 70% );
}
h1:hover .title-1 strong {
color: #dd1818;
-webkit-text-fill-color: initial;
}
h1:hover .title-1 strong:last-child {
color: #754fb9;
}
.title-0 {
font-size: 50px;
line-height: 40px;
margin-right: 1px;
color: #999;
text-shadow: 1px 1px 1px #00000070, -1px -1px 1px #f1f1f12b;
font-weight: bold;
}
.title-0:first-letter {
color: #bbb;
}
.title-1 {
font-size: 14px;
line-height: 14px;
}
.title-1 strong {
font-size: 28px;
line-height: 15px;
top: 4px;
position: relative;
margin-right: 1px;
color: #fff;
}
.title-1 strong + br + strong {
color: #e3e3e3;
margin-left: 6px;
top: 2px;
}
/*** Created by ***/
a.josetxu-btn {
background: url(https://josetxu.com/wp-content/themes/josetxu-code/images/profile.jpg) no-repeat center center #ffffff;
background-size: calc(36px);
float: left;
width: 40px;
height: 40px;
border-radius: 2px;
margin-left: 20px;
text-align: left;
filter: grayscale(1);
position: relative;
}
a.josetxu-btn:before, a.josetxu-btn:after {
content: "CREATED BY";
font-size: 8px;
color: #b9b9b9;
background: linear-gradient(90deg, #fff0 calc(100% - 1px), #fff2 100%);
min-width: 68px;
border-radius: 0;
margin-left: 40px;
float: left;
padding: 7px 0 3px 6px;
border-right: 1px solid #000;
}
a.josetxu-btn:after {
content: "JOSETXU";
color: #fff;
font-size: 11px;
padding: 2px 0 7px 5px;
min-width: 69px;
}
a.josetxu-btn:hover {
background-image: url(https://assets.codepen.io/256997/internal/avatars/users/default.png?width=40);
filter: none;
}
a.josetxu-btn:hover:before {
color: #ff6600;
}
a.josetxu-btn:hover:after {
color: #ff6600;
}
header button {
--clr: #2196f3;
float: right;
border: 2px solid var(--clr);
background: var(--dark);
color: var(--clr);
padding: 7px 10px;
margin-right: 15px;
margin-left: 10px;
border-radius: 2px;
cursor: pointer;
font-weight: bold;
font-size: 14px;
position: relative;
top: 4px;
min-width: 88px;
}
header button:hover {
background: var(--clr);
color: #000;
padding: 10px 10px 5px 10px;
}
header button:before {
content: "COPY CODE";
font-size: 14px;
font-weight: normal;
position: absolute;
font-size: 9px;
top: -8px;
left: 50%;
background: var(--dark);
padding: 2px 0px;
border-radius: 2px;
transform: translateX(-50%);
width: calc(100% - 10px);
}
header button:hover:before {
background: var(--clr);
font-weight: bold;
border-left: 7px solid var(--clr);
border-right: 7px solid var(--clr);
border-top: 3px solid var(--clr);
}
header #copy-css {
--clr: #ffc107;
}
header button:after {
content: "COPIED";
font-size: 9px;
color: #fff;
position: absolute;
background: var(--dark);
padding: 7px 10px;
left: calc(50%);
transform: translateX(-50%);
top: 41px;
border-radius: 0 0 2px 2px;
top:0;
z-index: -1;
transition: top 1s ease 0.5s;
}
header button:active:after {
top: 41px;
transition: top 0.15s ease 0s;
}
/*** FOOTER ***/
footer {
background: var(--dark);
position: fixed;
bottom: 0;
width: 100%;
height: 60px;
padding: 10px;
box-shadow: rgba(0, 0, 0, 0.16) 0px -2px 6px, rgba(0, 0, 0, 0.25) 0px -2px 6px;
}
.slider {
width: 200px;
height: 40px;
display: inline-block;
position: relative;
margin-left: 25px;
margin-right: 25px;
font-size: 14px;
background: var(--dark);
}
.slider:before {
content: "BASE WIDTH";
position: absolute;
color: #fff;
left: 0;
top: 2px;
}
.slider + .slider:before {
content: "APEX HEIGHT";
}
.slider:after, .wall-design:after {
content: "";
position: absolute;
right: -20px;
border-right: 1px solid #000;
float: left;
border-left: 1px solid #fff2;
height: 40px;
}
.slider-value {
width: 20px;
float: right;
margin: 0;
position: absolute;
right: 0px;
background: #fff;
text-align: center;
border-radius: 3px;
padding: 1px;
}
/*** Range ***/
input[type='range'] {
cursor: pointer;
bottom: 0;
position: absolute;
height: 15px;
width: 100%;
background: #fff0;
margin: 0;
}
input[type='range']:focus {
outline: none;
}
input[type='range'],
input[type='range']::-webkit-slider-runnable-track,
input[type='range']::-webkit-slider-thumb {
-webkit-appearance: none;
}
input[type=range]::-webkit-slider-thumb {
background-color: #1d73b7;
width: 20px;
height: 20px;
border: 3px solid var(--dark);
border-radius: 50%;
margin-top: -9px;
}
input[type=range]::-moz-range-thumb {
background-color: #1d73b7;
width: 15px;
height: 15px;
border: 3px solid var(--dark);
border-radius: 50%;
}
input[type=range]::-ms-thumb {
background-color: #1d73b7;
width: 20px;
height: 20px;
border: 3px solid var(--dark);
border-radius: 50%;
}
input[type=range]::-webkit-slider-runnable-track {
background-color: #777777;
height: 3px;
}
input[type=range]:focus::-webkit-slider-runnable-track {
outline: none;
}
input[type=range]::-moz-range-track {
background-color: #777777;
height: 3px;
}
input[type=range]::-ms-track {
background-color: #777777;
height: 3px;
}
input[type=range] + .slider-value:before {
content: "SET\00a0 WIDTH";
position: absolute;
background: var(--dark);
color: #fff;
font-size: 10px;
position: absolute;
top: -8px;
left: -48px;
padding: 0 7px;
border-radius: 2px 2px 0 0;
line-height: 25px;
max-height: 0;
font-weight: bold;
white-space: pre-wrap;
transition: all 0.25s ease 0s;
z-index: -1;
overflow: hidden;
}
input#apex + .slider-value:before {
content: "SET\00a0 HEIGHT";
}
input[type=range]:hover + .slider-value:before {
max-height: 33px;
top: -33px;
}
/*** Wall Design ***/
.wall-design {
width: 338px;
position: relative;
background: var(--dark);
padding: 0px 0 10px 0;
display: inline-flex;
top: -26px;
}
.wall-design:before {
content: "WALL DESIGN";
text-align: right;
color: #fff;
font-size: 14px;
width: 60px;
float: left;
line-height: 21px;
margin-top: -1px;
margin-right: 8px;
}
.w-bricks.pyramid, .w-bricks.pyramid span, label[for=w-bricks] {
--sz: 4px;
--brick1: #b16c53;
--brick2: #b56c52;
--lines: #873e1a;
--gp-ln: 50%/calc(var(--sz) * 10) calc(var(--sz) * 5);
--gp-cn: 50%/calc(var(--sz) * 5) calc(var(--sz) * 5);
--wall-design:
repeating-conic-gradient(from 90deg at 95% 55%, var(--lines) 0% 25%, #fff0 0% 100%) var(--gp-cn),
repeating-linear-gradient(180deg, var(--lines) 0 5%, #fff0 0 50%, var(--lines) 0 55%, var(--brick2) 0 100% ) var(--gp-ln),
repeating-linear-gradient(90deg, var(--brick1) 0 47.5%, var(--lines) 0 50%, var(--brick1) 0 97.5%, var(--lines) 0 100% ) var(--gp-ln);
}
.w-granite.pyramid , .w-granite.pyramid span, label[for=w-granite] {
--wall-design:
repeating-conic-gradient(#0004 0%, #fff0 .0003%, #fff0 .0005%, #fff0 .00095%),
repeating-conic-gradient(#fff2 0%, #fff0 .0005%, #fff0 .00015%, #fff0 .0009%),
#777;
}
.w-crystal.pyramid, .w-crystal.pyramid span, label[for=w-crystal] {
--wall-design:
linear-gradient(45deg, #fff0 55%, #fff1 56% 64%, #fff0 65% 66%, #fff2 67% 69%, #fff0 71% 100% ),
linear-gradient(45deg, #2196f380, #ffffff78 56% 64%, #2196f380),
#fff4;
}
.w-grille.pyramid, .w-grille.pyramid span, label[for=w-grille] {
--sz: 4px;
--gp: 50%/ calc(var(--sz) * 2) calc(var(--sz) * 2);
--wall-design:
linear-gradient(290deg, #fff0 25%, #545454 25% 35%, #fff0 35% 100%) var(--gp),
linear-gradient(-290deg, #fff0 25%, #727272 25% 35%, #fff0 35% 100%) var(--gp),
linear-gradient(200deg, #fff0 25%, #545454 25% 35%, #fff0 35% 100%) var(--gp),
linear-gradient(-200deg, #fff0 25%, #727272 25% 35%, #fff0 35% 100%) var(--gp),
#0001;
}
.w-smooth.pyramid, .w-smooth.pyramid span, label[for=w-smooth] {
--wall-design: #1d73b7;
}
/*** More Wall Designs ***/
.w-puzzle.pyramid, .w-puzzle.pyramid span, label[for=w-puzzle], footer:has(.w-more input[id=w-puzzle]:checked) #w-more {
--sz: 3px;
--c1: #8bc34a;
--c2: #3f8d42;
--pz: calc(var(--sz) * 0.65), #fff0 calc(calc(var(--sz) * 0.65) + 1px);
--gp: 50%/ calc(var(--sz) * 10) calc(var(--sz) * 10);
--wall-design:
radial-gradient(circle at 55% 25%, var(--c2) var(--pz)) var(--gp),
radial-gradient(circle at 75% 45%, var(--c2) var(--pz)) var(--gp),
radial-gradient(circle at 5% 75%, var(--c2) var(--pz)) var(--gp),
radial-gradient(circle at 25% 55%, var(--c2) var(--pz)) var(--gp),
radial-gradient(circle at 55% 75%, var(--c1) var(--pz)) var(--gp),
radial-gradient(circle at 75% 95%, var(--c1) var(--pz)) var(--gp),
radial-gradient(circle at 5% 25%, var(--c1) var(--pz)) var(--gp),
radial-gradient(circle at 25% 5%, var(--c1) var(--pz)) var(--gp),
conic-gradient(from 0deg at 50% 50%, var(--c1) 0 25%, var(--c2) 0 50%, var(--c1) 0 75%, var(--c2) 0 100%) var(--gp);
}
.w-zigzag.pyramid, .w-zigzag.pyramid span, label[for=w-zigzag], footer:has(.w-more input[id=w-zigzag]:checked) #w-more {
--sz: 2px;
--c1: #b78cff;
--c2: #9d6fe9;
--c3: #8f64d4;
--c4: #7e59bb;
--gp: 50%/ calc(var(--sz) * 6) calc(var(--sz) * 12);
--wall-design:
conic-gradient(from -45deg at 50% 25%, var(--c2) 0 90deg, #fff0 0 100%) var(--gp),
conic-gradient(from -45deg at 50% 50%, var(--c3) 0 90deg, #fff0 0 100%) var(--gp),
conic-gradient(from -45deg at 50% 75%, var(--c1) 0 90deg, #fff0 0 100%) var(--gp),
conic-gradient(from -45deg at 50% 100%, var(--c4) 0 90deg, #fff0 0 100%) var(--gp),
var(--c2);
}
.w-woven.pyramid, .w-woven.pyramid span, label[for=w-woven], footer:has(.w-more input[id=w-woven]:checked) #w-more {
--sz: 6px;
--c1: #b1cddb;
--c2: #96b5cb;
--c3: #7d9eaf;
--c4: #6f92a3;
--sh: #0006;
--sh2: #0002;
--gp: 50%/ calc(var(--sz) * 2) calc(var(--sz) * 2);
--wall-design:
repeating-linear-gradient(45deg, #42312f30 calc(var(--sz) * 0.125), #fff0 calc(var(--sz) * 0.25) ),
conic-gradient(from 85deg at 75% 1px, #fff0 0, var(--sh2) 0%, #fff0 5% 100%) var(--gp),
conic-gradient(from -5deg at 0% calc(75% - 1px), #fff0 0, var(--sh) 0%, #fff0 4% 100%) var(--gp),
conic-gradient(from 0deg at 75% calc(75% - 1px), #fff0 0 22%, var(--sh2) 25%, #fff0 25% 100%) var(--gp),
conic-gradient(from 0deg at 75% calc(75% - 1px), var(--c4) 0 25%, #fff0 0 97%, var(--sh) 105%) var(--gp),
linear-gradient(180deg, #fff0 0%, var(--sh) 25%, #fff0 25% 50%, var(--sh) 50%, #fff0 75% 100%) var(--gp),
linear-gradient(180deg, #fff0 25%, var(--c3) 25% 50%, #fff0 50% 100%) var(--gp),
linear-gradient(90deg, #fff0 0%, var(--sh) 25%, #fff0 25% 50%, var(--sh) 50%, #fff0 75% 100%) var(--gp),
linear-gradient(90deg, #fff0 25%, var(--c2) 25% 50%, #fff0 50% 100%) var(--gp),
linear-gradient(180deg, var(--sh) 0%, #fff0 25% 50%, var(--sh) 75%, #fff0 75% 100%) var(--gp),
linear-gradient(180deg, #fff0 75%, var(--c1) 75% 100%) var(--gp),
#42312F25;
}
.w-basket.pyramid, .w-basket.pyramid span, label[for=w-basket], footer:has(.w-more input[id=w-basket]:checked) #w-more {
--sz: 11px;
--c1: #ffa726;
--c2: #e59319;
--c3: #f1a12c;
--c4: #cf8b26;
--sh: #0006;
--sh2: #0002;
--gp: 50%/ calc(var(--sz) * 2) calc(var(--sz) * 2);
--wall-design:
conic-gradient(from -10deg at 60% 0%, #fff0 0 25%, var(--sh2) 28%, #fff0 31% 100%) var(--gp),
conic-gradient(from -5deg at 0% calc(60% - 1px), #fff0 0, var(--sh) 0%, #fff0 4% 100%) var(--gp),
conic-gradient(from 0deg at 60% calc(60% - 1px), #fff0 0 22%, var(--sh2) 25%, #fff0 25% 100%) var(--gp),
conic-gradient(from 0deg at 60% calc(60% - 1px), var(--c4) 0 25%, #fff0 0 97.5%, var(--sh) 102%) var(--gp),
linear-gradient(180deg, #fff0 0%, var(--sh) 10%, #fff0 10% 50%, var(--sh) 50%, #fff0 60% 101%) var(--gp),
linear-gradient(180deg, #fff0 10%, var(--c3) 10% 50%, #fff0 50% 100%) var(--gp),
linear-gradient(90deg, #fff0 0%, var(--sh) 10%, #fff0 10% 50%, var(--sh) 50%, #fff0 60% 100%) var(--gp),
linear-gradient(90deg, #fff0 10%, var(--c2) 10% 50%, #fff0 50% 100%) var(--gp),
linear-gradient(180deg, #fff0 60%, var(--c1) 60% 100%) var(--gp),
#6a1c0080;
}
.w-blocks.pyramid, .w-blocks.pyramid span, label[for=w-blocks], footer:has(.w-more input[id=w-blocks]:checked) #w-more {
--sz: 3px;
--c1: #fdf3e3;
--c2: #dfd2bf;
--c3: #ccc3b2;
--c4: #a79a8a;
--s1: #cfc3ab;
--s2: #ccc0aa;
--s3: #ada38e;
--s4: #ccc0aa;
--d1: #9b9082;
--d2: #ddd9d4;
--gp: 50%/ calc(var(--sz) * 8) calc(var(--sz) * 6);
--bp: calc(var(--sz) * -4) calc(var(--sz) * -3);
--bg:
conic-gradient(from 270deg at 0.65% 50%, var(--d1) 0% 25%, #fff0 0 100%) var(--gp),
linear-gradient(0deg, var(--d1) 0 0.5%, #fff0 0 49.5%, var(--d1) 0 50.5%, #fff0 0 100%) var(--gp),
conic-gradient(from 45deg at 81% 25%, var(--s3) 0%, var(--s4) 25%, #fff0 0 100%) var(--gp),
conic-gradient(from -135deg at 19% 25%, var(--s1) 0%, var(--s2) 25%, #fff0 0 100%) var(--gp),
linear-gradient(180deg, var(--c2), var(--c1) 24%, var(--c4) 26%, var(--c3) 50%, #fff0 0 100%) var(--gp);
--wall-design: var(--bg),var(--bg);
background-position: var(--bp), var(--bp), var(--bp), var(--bp), var(--bp), 0 0, 0 0, 0 0, 0 0, 0 0 !important;
}
.w-blocks.pyramid span:nth-child(4) {
filter: brightness(1.2);
}
.w-triangle.pyramid, .w-triangle.pyramid span, label[for=w-triangle], footer:has(.w-more input[id=w-triangle]:checked) #w-more {
--sz: 2px;
--c1: #7a2222;
--c2: #6a1d1d;
--c3: #521616;
--c4: #340e0e;
--gp: 50%/ calc(var(--sz) * 8.5) calc(var(--sz) * 14.7);
--wall-design:
conic-gradient(from 118deg at 50.5% 85%, var(--c2) 0 125deg, #fff0 0 100%) var(--gp),
conic-gradient(from 30deg at 50% 50%, var(--c4) 0 30deg, var(--c2) 0 60deg, #fff0 0 120deg, var(--c3) 0 150deg, var(--c4) 0 180deg, #fff0 0 241deg, var(--c2) 0 270deg, var(--c3) 0 300deg, #fff0 0 100%) var(--gp),
linear-gradient(180deg, var(--c1) 0 10%, #fff0 0 100%) var(--gp),
var(--c1);
}
.w-honeycomb.pyramid, .w-honeycomb.pyramid span, label[for=w-honeycomb], footer:has(.w-more input[id=w-honeycomb]:checked) #w-more {
--sz: 1.1px;
--ln: 0.75px;
--c1: #ffb564;
--c2: #ff5903;
--c3: #ffa063;
--ts: 50%/ calc(var(--sz) * 11.8) calc(var(--sz) * 20);
--wall-design:
radial-gradient(circle at 60% 110%, var(--c3) calc(var(--sz) * -3), #fff0 calc(var(--sz) * 5)) var(--ts),
radial-gradient(circle at 60% 10%, var(--c3) calc(var(--sz) * -3), #fff0 calc(var(--sz) * 5)) var(--ts),
radial-gradient(circle at 110% 60%, var(--c3) calc(var(--sz) * -3), #fff0 calc(var(--sz) * 5)) var(--ts),
radial-gradient(circle at 10% 60%, var(--c3) calc(var(--sz) * -3), #fff0 calc(var(--sz) * 5)) var(--ts),
conic-gradient(from 120deg at 50% calc(82.75% + calc(var(--ln) / 1.5)), var(--c2) 0 120deg, #fff0 0 100%) var(--ts),
conic-gradient(from 120deg at 50% calc(82.75% + calc(var(--ln) / 1.5)), var(--c2) 0 120deg, #fff0 0 100%) var(--ts),
conic-gradient(from 120deg at 50% calc(82.5% - calc(var(--ln) * 1.5)), var(--c1) 0 120deg, #fff0 0 100%) var(--ts),
conic-gradient(from 120deg at 50% calc(82.5% - calc(var(--ln) * 1.5)), var(--c1) 0 120deg, #fff0 0 100%) var(--ts),
conic-gradient(from 60deg at calc(50% + var(--ln)) 50.5%, var(--c2) 0 120deg, #fff0 0 100%) var(--ts),
conic-gradient(from 60deg at calc(50% + var(--ln)) 50.5%, var(--c2) 0 120deg, #fff0 0 100%) var(--ts),
conic-gradient(from 180deg at calc(50% - var(--ln)) 50.5%, var(--c2) 0 120deg, #fff0 0 100%) var(--ts),
conic-gradient(from 180deg at calc(50% - var(--ln)) 50.5%, var(--c2) 0 120deg, #fff0 0 100%) var(--ts),
conic-gradient(from 0deg at calc(100% - var(--ln)) 37.75%, var(--c1) 0 90deg, #fff0 0 100%) var(--ts),
conic-gradient(from 0deg at calc(100% - var(--ln)) 37.75%, var(--c1) 0 90deg, #fff0 0 100%) var(--ts),
conic-gradient(from -90deg at var(--ln) 37.75%, var(--c1) 0 90deg, #fff0 0 100%) var(--ts),
conic-gradient(from -90deg at var(--ln) 37.75%, var(--c1) 0 90deg, #fff0 0 100%) var(--ts),
conic-gradient(from -60deg at 50% calc(50% - calc(var(--ln) * 1.5)), var(--c2) 0 120deg, #fff0 0 100%) var(--ts),
conic-gradient(from -60deg at 50% calc(50% - calc(var(--ln) * 1.5)), var(--c2) 0 120deg, #fff0 0 100%) var(--ts),
var(--c1);
}
/*** Radio ***/
input[type=radio] {
display: none;
}
input[type=radio] + label {
width: 40px;
height: 40px;
background: var(--wall-design);
display: inline-flex;
justify-content: center;
align-items: end;
text-transform: uppercase;
font-size: 10px;
cursor: pointer;
padding-bottom: 1px;
color: var(--dark);
font-weight: bold;
border-radius: 1px;
position: relative;
margin-left: 5px;
}
input[type=radio]:checked + label {
box-shadow: 0 0 0 3px #fffd inset, 0 0 50px 0 #0004 inset;
}
input[type=radio]:checked + label:after {
content: "";
width: 12px;
height: 7px;
position: absolute;
border-left: 4px solid #fff;
border-bottom: 4px solid #fff;
transform: rotate(-60deg);
top: 12px;
}
input[type=radio] + label:hover {
filter: brightness(1.25);
}
input[type=radio] + label:hover:before {
filter: brightness(0.8);
}
.wall-design label:before {
content: "BRICKS";
position: absolute;
bottom: 47px;
width: calc(100% + 1vmin);
text-align: center;
background: var(--dark);
color: #fff;
padding: 0 3px;
max-height: 0px;
overflow: hidden;
line-height: 25px;
border-radius: 1px 1px 0 0;
transition: max-height 0.25s ease 0s;
font-size: 10px;
}
.wall-design label:hover:before {
max-height: 30px;
transition: max-height 0.5s ease 0s;
}
.wall-design label[for=w-granite]:before {
content: "GRANITE";
}
.wall-design label[for=w-crystal]:before {
content: "CRYSTAL";
}
.wall-design label[for=w-grille]:before {
content: "GRILLE";
}
.wall-design label[for=w-smooth]:before {
content: "SMOOTH";
}
.wall-design label[for=w-honeycomb]:before {
content: "HONEYCOMB";
width: calc(100% + 30px);
}
.wall-design label[for=w-triangle]:before {
content: "TRIANGLES";
width: calc(100% + 20px);
}
.wall-design label[for=w-blocks]:before {
content: "BLOCKS";
}
.wall-design label[for=w-basket]:before {
content: "BASKET";
}
.wall-design label[for=w-woven]:before {
content: "WOVEN";
}
.wall-design label[for=w-zigzag]:before {
content: "ZIGZAG";
}
.wall-design label[for=w-puzzle]:before {
content: "PUZZLE";
}
/*** More Wall Designs Buttton ***/
#w-more {
float: right;
width: 40px;
height: 40px;
border: 0;
color: var(--dark);
background: #444;
font-size: 40px;
line-height: 0;
margin-left: 5px;
cursor: pointer;
position: relative;
}
#w-more:hover {
background: #777;
}
.w-more {
position: absolute;
bottom: 58px;
background: var(--dark);
border-radius: 2px 2px 0 0;
width: 345px;
right: -10px;
z-index: -1;
padding: 10px 10px 0;
display: inline-flex;
justify-content: end;
transition: bottom 0.5s ease 0s;
}
.w-more.down {
position: absolute;
bottom: 11px;
transition: bottom 0.5s ease 0s;
}
#w-more:before {
content: "\002B";
display: inline-table;
line-height: 18px;
}
#w-more.minus:before {
content: "\2212";
}
#w-more:after {
content: "MORE";
position: absolute;
bottom: 47px;
width: calc(100% + 1vmin);
text-align: center;
background: var(--dark);
color: #fff;
padding: 0 3px;
max-height: 0px;
overflow: hidden;
line-height: 2.5;
border-radius: 1px 1px 0 0;
transition: max-height 0.25s ease 0s;
font-size: 10px;
left: -0.5vmin;
box-sizing: border-box;
font-weight: bold;
}
#w-more:hover:after {
max-height: 30px;
}
#w-more.minus:hover:after {
max-height: 0px;
}
footer:has(.w-more input[type=radio]:checked) #w-more {
box-shadow: 0 0 0 3px #fffd inset;
position: relative;
}
footer:has(.w-more input[type=radio]:checked) #w-more.minus {
box-shadow: none;
}
footer:has(.w-more input[type=radio]:checked) #w-more:after {
content: "";
width: 12px;
height: 7px;
position: absolute;
border-left: 4px solid #fff;
border-bottom: 4px solid #fff;
transform: rotate(-60deg);
top: 12px;
left: 12px;
background: #fff0;
padding: 0;
box-sizing: content-box;
max-height: 7px;
}
footer:has(.w-more input[type=radio]:checked) #w-more.minus:after {
display: none;
}
footer:has(.w-more input[type=radio]:checked) #w-more {
background: var(--wall-design);
}
footer:has(.w-more input[type=radio]:checked) #w-more.minus {
background: #444;
}
footer:has(.w-more input[type=radio]:checked) #w-more:hover:before {
color: #fff;
}
footer:has(.w-more input[type=radio]:checked) #w-more:hover:after {
display: none;
}
/*** Play / Pause ***/
input#play-pause {
display: none;
}
label[for=play-pause] {
width: 40px;
height: 40px;
background: linear-gradient(180deg, var(--dark) 0 7px, #fff0 0 29px, var(--dark) 0 40px), linear-gradient(90deg, #fff0 0 5px, #f44336 0 15px, #fff0 0 21px, #f44336 0 31px, #fff0 0 40px);
cursor: pointer;
z-index: 2;
border: 2px solid #f44336;
border-radius: 2px;
display: inline-block;
margin-left: 100px;
position: relative;
}
label[for=play-pause]:hover {
background: linear-gradient(180deg, #f44336 0 6px, #fff0 0 30px, #f44336 0 40px), linear-gradient(90deg, #fff0 0 5px, var(--dark) 0 15px, #fff0 0 21px, var(--dark) 0 31px, #fff0 0 40px), #f44336;
}
input#play-pause:checked ~ footer label[for=play-pause] {
background: linear-gradient(90deg, var(--dark) 0 25%, #fff0 25% ), linear-gradient(215deg, var(--dark) 0 40%, #fff0 calc(40% + 1px) ), linear-gradient(-35deg, var(--dark) 0 40%, #fff0 calc(40% + 1px) ), #8bc34a;
border-color: #8bc34a;
background-size: 40px 36px;
background-repeat: no-repeat;
background-position: 0px 0px;
}
input#play-pause:checked ~ footer label[for=play-pause]:hover {
background: linear-gradient(90deg, #8bc34a 0 26%, #fff0 26% ), linear-gradient(215deg, #8bc34a 0 36%, #fff0 calc(36% + 1px) ), linear-gradient(-35deg, #8bc34a 0 36%, #fff0 calc(36% + 1px) ), var(--dark);
}
label[for=play-pause]:before {
top: -2px;
left: -82px;
background: var(--dark);
padding: 0px 10px 0 0;
border-radius: 2px;
color: #f44336;
color: #fff;
content: "PLAYING PAUSE";
text-align: right;
font-size: 14px;
width: 70px;
line-height: 21px;
margin-top: -1px;
margin-right: 10px;
position: absolute;
}
label[for=play-pause]:hover:before {
max-height: 30px;
transition: max-height 0.5s ease 0s;
}
input#play-pause:checked ~ footer label[for=play-pause]:before {
content: "PLAY";
color: #8bc34a;
}
label[for=play-pause]:after {
top: 19px;
left: -82px;
background: var(--dark);
padding: 0px 10px 0 0;
border-radius: 2px;
color: #f44336;
content: "PAUSE";
text-align: right;
font-size: 14px;
width: 70px;
line-height: 21px;
margin-top: -1px;
margin-right: 10px;
position: absolute;
}
input#play-pause:checked ~ footer label[for=play-pause]:after {
content: "PAUSED";
color: #FFF;
}
label[for=play-pause] + span {
position: relative;
z-index: 1;
}
label[for=play-pause] + span:before {
content: "PAUSE\00a0 ANIMATION";
position: absolute;
background: var(--dark);
color: #fff;
font-size: 10px;
position: absolute;
top: -33px;
right: -7px;
padding: 0 7px;
border-radius: 2px 2px 0 0;
line-height: 25px;
max-height: 0;
font-weight: bold;
white-space: pre-wrap;
transition: all 0.25s ease 0s;
z-index: -1;
overflow: hidden;
}
label[for=play-pause]:hover + span:before {
max-height: 33px;
top: -58px;
}
input#play-pause:checked ~ footer label[for=play-pause] + span:before {
content: "PLAY\00a0 ANIMATION";
}
/*** INFO ***/
.info {
position: absolute;
width: 215px;
height: 130px;
font-size: 14px;
left: 20px;
top: 80px;
padding: 30px 10px 10px 10px;
background: radial-gradient(circle at 14px 14px, #fff0 0 22px, #00000015 23px);
border-radius: 3px;
transform-origin: 10px 10px;
transition: all 0.5s ease 0s;
}
.info:before {
content: "TRIGONOMETRY DATA";
position: absolute;
background: radial-gradient(circle at -5px 16px, #fff0 22px, #d5d5d5 23px);
padding: 4px 15px 4px 27px;
left: 20px;
top: -0.25vmin;
color: #999999;
border-radius: 0 2px 2px 0;
font-weight: bold;
width: 156px;
}
.info-btn::after {
overflow: hidden;
font-size: 14px;
line-height: 14px;
color: #e6e6e6;
content: "TRIGONOMETRY\00a0 DATA";
content: "\00a0 \00a0 \00a0 \00a0 TRIGONOMETRY\00a0 DATA";
position: absolute;
background: radial-gradient(circle at -16px 16px, #fff0 22px, var(--dark) 23px);
text-align: left;
padding: 5px 0;
left: 37px;
top: 4px;
color: #999999;
border-radius: 0 2px 2px 0;
font-weight: bold;
width: 187px;
max-width: 0;
max-height: 15px;
transition: max-width 0.5s ease 0s;
font-family: Arial, Helvetica, serif;
}
.info-btn:hover:after {
max-width: 187px;
color: #e6e6e6;
transition: max-width 0.5s ease 0s;
}
.info div {
float: right;
background: #fff;
border-radius: 3px;
padding: 1px 2px;
position: absolute;
right: 40px;
text-align: right;
min-width: 40px;
}
.info .apex-height {
margin-top: 22px;
}
.info .hypotenuse {
margin-top: 44px;
}
.info .alpha-angle {
margin-top: 66px;
}
.info div:before {
content: "ALPHA ANGLE";
position: absolute;
width: 110px;
height: 0;
line-height: 1px;
color: #fff;
left: -132px;
border: 6px solid #fff0;
border-right-color: #fff;
top: 3px;
padding-right: 10px;
}
.info .base-width:before {
content: "BASE WIDTH";
}
.info .apex-height:before {
content: "APEX HEIGHT";
}
.info .hypotenuse:before {
content: "HYPOTENUSE";
}
.info div:after {
content: "vmin";
position: absolute;
color: #fff;
font-size: 12px;
right: -50px;
line-height: 20px;
width: 47px;
text-align: left;
}
.info div:hover:after {
background: conic-gradient(from 225deg at 100% 50%, #00000015 0 90deg, #fff0 0 100%);
background-size: 10px;
background-repeat: no-repeat;
background-position: right center;
}
.info .alpha-angle:after {
content: "deg";
}
.info-btn {
background: #d5d5d5;
position: absolute;
width: 40px;
height: 40px;
border-radius: 100%;
text-align: center;
color: #9d9d9d;
top: 74px;
left: 14px;
font-size: 30px;
border: 0;
z-index: 1;
cursor: pointer;
padding: 0 0 2px;
}
.info-btn:hover {
background: #fff0;
}
.info-btn:hover:before {
background: var(--dark);
position: absolute;
width: 40px;
height: 40px;
border-radius: 100%;
left: 0px;
top: 0px;
font-size: 20px;
line-height: 40px;
color: #e6e6e6;
content: "+";
content: "\2716";
transform: rotate(0deg);
transition: all 0.5s ease 0s;
justify-content: center;
display: flex;
align-items: center;
}
.info-btn.hide:hover:before {
transform: rotate(45deg);
transition: all 0.5s ease 0s;
}
.info.hide {
transform: scale(0) rotate(90deg);
transition: all 0.5s ease 0s;
}
.hidden {
display: none;
}
#hidden-copy-text {
position: absolute;
top: 0;
}
/*** Trigonometric Data ***/
/***Width***/
body:has(#base-width:hover) .pyramid > div {
position: absolute;
width: 100%;
height: calc(100% + 4vmin);
border-bottom: 3px dashed var(--data);
border-top: 3px dashed var(--data);
top: -2vmin;
transform-style: preserve-3d;
background: linear-gradient(0deg, #fff 0 3px, #fff0 0 100%), linear-gradient(180deg, #fff 0 3px, #fff0 0 100%);
background-position: 0px 3px, 0px -3px;
background-repeat: no-repeat;
}
body:has(#base-width:hover) .pyramid > div:before,
body:has(#base-width:hover) .pyramid > div:after {
content: "";
position: absolute;
width: 0;
height: calc(var(--width) * 1vmin);
border-right: 3px dashed var(--data);
transform: rotateY(90deg) rotatex(90deg);
left: -1px;
top: -1px;
transform-origin: center top;
background-color: #fff;
}
body:has(#base-width:hover) .pyramid > div:after {
top: calc(calc(calc(var(--width) * 1vmin) + 4vmin) - 5px);
}
/***Height***/
body:has(#apex-height:hover) {
--data: hsl(90deg 80% 40%);
}
body:has(#apex-height:hover) .pyramid div {
position: absolute;
width: 100%;
height: calc(100% + 4vmin);
top: 0vmin;
transform-style: preserve-3d;
}
body:has(#apex-height:hover) .pyramid div:before,
body:has(#apex-height:hover) .pyramid div:after {
content: "";
position: absolute;
width: 0;
height: calc(var(--height) * 1vmin);
border-right: 3px dashed var(--data);
transform: rotatex(90deg);
left: 50%;
top: -2vmin;
transform-origin: center top;
background-color: #fff;
}
body:has(#apex-height:hover) .pyramid div:after {
transform: rotateX(90deg) rotateY(90deg);
}
body:has(#apex-height:hover) .pyramid div div:before,
body:has(#apex-height:hover) .pyramid div div:after {
top: calc(calc(var(--width) * 1vmin) + 2vmin);
}
/***Hypotenuse***/
body:has(#hypotenuse:hover) {
--data: hsl(200deg 100% 40%);
}
body:has(#hypotenuse:hover) .pyramid div {
position: absolute;
width: 100%;
height: calc(100% + 4vmin);
top: 0vmin;
transform-style: preserve-3d;
}
body:has(#hypotenuse:hover) .pyramid div:before,
body:has(#hypotenuse:hover) .pyramid div:after {
content: "";
position: absolute;
width: 0;
height: calc(var(--hypo) * 1vmin);
border-right: 3px dashed var(--data);
transform: rotateX(var(--alpha) );
left: 50%;
top: -2vmin;
transform-origin: center top;
background-color: #fff;
}
body:has(#hypotenuse:hover) .pyramid div:after {
transform: rotateX(var(--alpha)) rotateY(90deg);
}
body:has(#hypotenuse:hover) .pyramid div div:before,
body:has(#hypotenuse:hover) .pyramid div div:after {
top: calc(calc(var(--width) * 1vmin) + 2vmin);
transform: rotateX(calc(180deg - var(--alpha)));
}
body:has(#hypotenuse:hover) .pyramid div div:after {
transform: rotateX(calc(180deg - var(--alpha))) rotateY(90deg);
}
/***Alpha Angle***/
body:has(#alpha-angle:hover) {
--data: hsl(270deg 100% 40%);
}
body:has(#alpha-angle:hover) .pyramid div {
position: absolute;
height: calc(100% + 4vmin);
width: 3px;
background:
linear-gradient(
0deg,
var(--data) 0 5px, #fff 0 7px,
var(--data) 0 12px, #fff 0 14px,
var(--data) 0 19px, #fff 0 21px,
var(--data) 0 26px, #fff 0 28px,
var(--data) 0 33px, #fff 0 35px,
var(--data) 0 40px, #fff0 0 42px
),
linear-gradient(
180deg,
var(--data) 0 5px, #fff 0 7px,
var(--data) 0 12px, #fff 0 14px,
var(--data) 0 19px, #fff 0 21px,
var(--data) 0 26px, #fff 0 28px,
var(--data) 0 33px, #fff 0 35px,
var(--data) 0 40px, #fff0 0 42px
);
left: calc(50% - 2vmin);
top: -2vmin;
transform-style: preserve-3d;
transform: translateX(2vmin) translatez(-1vmin);
}
body:has(#alpha-angle:hover) .pyramid div:before,
body:has(#alpha-angle:hover) .pyramid div:after {
content: "";
position: absolute;
width: 0;
height: 5vmin;
border-right: 3px dashed var(--data);
transform: rotateX(var(--alpha)) translatey(0vmin);
left: calc(50% - 2px);
top: 0vmin;
transform-origin: center top;
background-color: #fff;
}
body:has(#alpha-angle:hover) .pyramid div:after {
top: calc(calc(var(--width) * 1vmin) + 4vmin);
transform: rotateX(calc(180deg - var(--alpha)));
}
body:has(#alpha-angle:hover) .pyramid div div {
transform: rotateY(90deg);
left: 0;
top: 0;
height: 100%;
}
body:has(#alpha-angle:hover) .pyramid div div:before {
transform: rotateZ(var(--alpha));
}
body:has(#alpha-angle:hover) .pyramid div div:after {
transform: rotateZ(calc(180deg - var(--alpha)));
}
.info div:hover {
background: var(--data);
color: #fff;
font-weight: bold;
}
.info div:hover:before {
border-right-color: var(--data);
color: var(--data);
--cd: #fff;
text-shadow: 1px 0px 0px var(--cd), 1px 1px 0px var(--cd), 1px -1px 0px var(--cd), -1px 0px 0px var(--cd), -1px 1px 0px var(--cd), -1px -1px 0px var(--cd), 0px 0px 1px var(--cd), 0px 0px 2px var(--cd), 0px 0px 3px var(--cd), 0px 0px 3px var(--cd);
}
.info:after {
content: "YOUR BROWSER NOT SUPPORT CSS :has() \A \2504 \2504 \2504 \2504 \2504 \2504 \2504 \2504 \2504 \2504 \A SORRY, CANNOT SHOW THE DATA OVER PYRAMID";
position: absolute;
text-align: center;
font-size: 11px;
background: #d5d5d5;
line-height: 14px;
padding: 13px;
left: 230px;
top: 26px;
color: #999999;
border-radius: 0 2px 2px 0;
width: 130px;
white-space: pre-wrap;
opacity: 0;
}
.info:hover:after {
opacity: 1;
}
@supports (-webkit-font-smoothing: antialiased) {
.info:after {
display: none;
}
}
/*** MEDIA QUERIES ***/
@media only screen and (max-width: 1023px) {
.wall-design {
margin-left: 19px;
top: 0px;
}
.w-more {
z-index: 1;
box-shadow: 0 -1vmin 2vmin 1vmin var(--dark);
}
.w-more.down {
z-index: -1;
}
label[for=play-pause] {
bottom: -26px;
}
footer {
height: 130px;
}
footer:before {
content: "";
position: absolute;
width: calc(100% - 75px);
border-top: 1px solid #000;
border-bottom: 1px solid #fff2;
top: 65px;
left: 35px;
}
}
@media only screen and (min-width: 768px) and (max-width: 1023px) {
footer .wall-design {
width: 100%;
}
footer .wall-design .w-more {
left: 3px;
}
footer > .wall-design:after {
margin-left: 365px;
right: inherit;
}
footer label[for=play-pause] {
margin-left: 468px;
bottom: 25px;
}
.wall-design {
top: 26px;
}
}
@media only screen and (max-width: 580px) {
h1 a { padding-right: 10px; }
header:after { display: none;}
header button {
min-width: 0;
position: fixed;
bottom: 18px;
top: initial;
right: 95px;
}
header button:after {
display: none;
}
button#copy-css {
left: initial;
right: 5px;
}
button#copy-html:after {
display: block;
content: "";
position: absolute;
top: -7px;
left: -6.5vmin;
background: #070707;
width: 1px;
height: 38px;
padding: 0;
border-left: 1px solid #454545;
}
a.josetxu-btn {
margin-left: 10px;
}
a.josetxu-btn:before, a.josetxu-btn:after {
border-right: 0;
background: #fff0;
}
footer {
height: 240px;
}
footer .slider, footer .wall-design {
width: calc(100% - 10vmin);
}
footer .wall-design {
width: calc(100% - 4.5vmin);
margin-left: 8px;
}
footer > div:after {
display: none;
}
footer:before {
top: 105px;
}
footer label[for=play-pause] {
margin-left: 81px;
margin-top: 8px;
}
.wall-design {
top: 23px;
}
}
var eps = elem('pyramid').style;
eps.setProperty("--width", '35' );
eps.setProperty("--height", '30' );
eps.setProperty("--hypo", '34.73' );
eps.setProperty("--alpha", '59.74deg' );
function elem(id) {
return document.getElementById(id);
}
function setBase(val) {
eps.setProperty("--width", val );
setAngle();
elem('base').nextElementSibling.innerText=val;
}
function setApex(val) {
eps.setProperty("--height", val );
setAngle();
elem('apex').nextElementSibling.innerText=val;
}
function setAngle() {
var width = eps.getPropertyValue("--width"); //get base width
var height = eps.getPropertyValue("--height"); //get apex height
var hypo = Math.sqrt((width/2 * width/2) + (height * height)); //calculate hypotenuse
var alpha = Math.asin(height / hypo) * (180 / Math.PI) //calculate alpha angle
eps.setProperty("--hypo", hypo); // set hypotenuse
eps.setProperty("--alpha", alpha + 'deg'); //set alpha angle
elem('base-width').innerText=elem('cp-width').innerText=width; //set info width
elem('apex-height').innerText=elem('cp-height').innerText=height; //set info height
elem('hypotenuse').innerText=hypo.toFixed(2); //set info hypotenuse
elem('alpha-angle').innerText=alpha.toFixed(2); //set info alpha
elem('cp-hypo').innerText=hypo; //set code hypotenuse
elem('cp-alpha').innerText=alpha+'deg'; //set code alpha
}
function setWall(id) {
elem('pyramid').className=id+" pyramid";
elem('w-pyramid').innerText=id;
}
function copyCode(id){
elem('hidden-copy-text').value=elem('hidden-'+id).innerText;
elem('hidden-copy-text').select();
document.execCommand("copy");
}
function hideInfo() {
elem('info-panel').classList.toggle('hide');
elem('info-btn').classList.toggle('hide');
}
function animatePyramid(){
(elem("anim").innerText=="running") ? elem("anim").innerText = "paused" : elem("anim").innerText = "running";
}
function moreWalls() {
elem('w-more').classList.toggle('minus');
elem('w-mores').classList.toggle('down');
}
document.body.addEventListener('click', function(e) {
if ( !elem('w-more').contains(e.target) && !elem('w-mores').contains(e.target) ) {
elem('w-mores').classList.add('down');
elem('w-more').classList.remove('minus');
}
})
Also see: Tab Triggers