Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

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.

+ add another resource

Packages

Add Packages

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.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                - for (i = 0; i < 400; i++)
	.cam
.content
	.base
		.exterior.top
			- for (t = 1; t < 31; t++)
				div(class="group top-" + (t))
					.block.horz
						- for (s = 0; s < 6; s++)
							.side
		.exterior.bot
			- for (b = 1; b < 31; b++)
				div(class="group bot-" + (b))
					.block.vert
						- for (s = 0; s < 6; s++)
							.side
		.interior
			- for (b = 1; b < 31; b++)
				div(class="group blue-" + (b))
					.block.vert
						- for (s = 0; s < 6; s++)
							.side
		.biggest
			- for (b = 1; b < 6; b++)
				div(class="group big-" + (b))
					.block.vert
						- for (s = 0; s < 6; s++)
							.side
					.block.vert
						- for (s = 0; s < 6; s++)
							.side
					.block.horz
						- for (s = 0; s < 6; s++)
							.side
		.smallest
			- for (b = 1; b < 20; b++)
				div(class="group blue-" + (b))
					.block.vert
						- for (s = 0; s < 6; s++)
							.side
		.altar
			.block.horz
				- for (s = 0; s < 6; s++)
					.side
              
            
!

CSS

              
                * {
	transform-style: preserve-3d;
}

body {
	margin: 0;
	height: 100vh;
	background: linear-gradient(180deg, #111, #673ab7, #ff980094, #009200, #009200);
	overflow: hidden;
	--grad: linear-gradient(0deg, #0002, #fff0);
}

.content {
	width: 100vw;
	height: 100vh;
	margin: 0 auto;
	justify-content: center;
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	align-content: center;
	perspective: 150vmin;
	perspective-origin: center;
	position: absolute;
	z-index: -1;
	transition: all 1s ease 0s;
}


.base {
	width: 90vmin;
	height: 90vmin;
	transform: rotateX(65deg);
	border-radius: 100%;
	transition: all 0.75s ease 0s;
	/*animation: view 5s ease 1s 2 alternate;*/
}


@keyframes view {
	  0%  { transform: rotateX(65deg)  rotateZ(0deg);  }
	 100% { transform: rotateX(55deg)  rotateZ(30deg); }
}
  
.base:before {
	content: "";
	background: radial-gradient(#00b700, #006f04);
	position: absolute;
	width: 300%;
	height: 300%;
	left: -100%;
	top: -100%;
	border-radius: 100%;
	background: 
		radial-gradient(#1c882080 12%, transparent 18%) 0px 0, 
		radial-gradient(#4caf5080 12%, transparent 18%) 3px 4px,
		radial-gradient(rgba(255, 255, 255, 0.1) 12%, transparent 23%) 0 1px, 
		radial-gradient(rgba(255, 255, 255, 0.1) 12%, transparent 23%) 2px 3px,
		linear-gradient(0deg, #8bc34a, #003502);
	background-color: #239016;
	background-size: 4px 5px, 4px 5px, 4px 5px, 4px 5px, 100% 100%;
	box-shadow: 0 0 10vmin -3vmin #00000080, 0 0 15vmin 5vmin #0008;
}

.base:after {
	content: "";
	position: absolute;
	width: 1000%;
	height: 1000%;
	left: -500%;
	top: 150%;
	border-radius: 100%;
	/*background: radial-gradient( circle at 55% 40%, #121212 25%, transparent 55%, transparent 100% );*/
	transform: rotateX(90deg) translateZ(850vmin);
	
	background-image: radial-gradient(2px 2px at 20px 30px, #484341, transparent),
		radial-gradient(2px 2px at 43px 75px, #735454, transparent),
		radial-gradient(2px 1px at 54px 184px, #828282, transparent),
		radial-gradient(2px 2px at 93px 47px, #654b49, transparent),
		radial-gradient(1px 1px at 148px 87px, #3a1919, transparent),
		radial-gradient(2px 2px at 193px 137px, #a26662, transparent),
		radial-gradient(1px 2px at 210px 154px, #805241, transparent),
		radial-gradient(2px 2px at 243px 102px, #866356, transparent),
		radial-gradient(2px 1px at 264px 184px, #794937, transparent),
		radial-gradient(2px 2px at 293px 44px, #735454, transparent),
		radial-gradient(1px 1px at 223px 62px, #ad968e, transparent),
		radial-gradient(2px 2px at 249px 162px, #884228, transparent),
		radial-gradient(2px 2px at 73px 99px, #442e26, transparent),
		radial-gradient(1px 1px at 163px 42px, #403433, transparent),
		radial-gradient( circle at 55% 40%, #121212 25%, transparent 55%, transparent 100% );
	background-repeat:no-repeat, repeat;
	background-size:  333px 263px,  333px 163px,  333px 163px,  333px 163px,  333px 163px,  333px 163px,  333px 163px,  333px 163px,  333px 163px,  333px 163px,  333px 163px,  333px 163px,  333px 163px,  333px 163px, 100% 100%;
	
}








.cam {
	width: 5vw;
	height: 5vh;
	float: left;
	box-sizing: border-box;
  position: relative;
	cursor: zoom-in;	
	transform: translateZ(150vmin);
  /*** 
		Cam System by Yusuke Nakaya from this pen:
		https://codepen.io/YusukeNakaya/pen/GRWZdOb
	***/
  @for $i from 1 through 20 {
    @for $j from 1 through 20 {
      $key: ($i - 1) * 20 + $j;
      &:nth-child(#{$key}) {
        &:hover ~ .content .base {
					transform: 
						rotateX(($i - 8) * 4deg + 28) /* 8deg - 32 */
						rotateZ(($j - 8) * 18deg - 24);
        }
      }
    }
  }
	&:active ~ .content {
		transform: scale3d(2,2,2);
		transition: all 0.75s ease 0s;
	}
}


/*** EXTERIOR ***/
.exterior {
	width: 100%;
	height: 100%;
	border-radius: 100%;
	position: absolute;
}

.exterior.top {
   transform: translateZ(10.75vmin);
}

.exterior.bot {
   transform: translateZ(5.01vmin);
}

/*** 
	Cuboid System by Jhey from this pen:
	https://codepen.io/jh3y/pen/MWJdqBo
***/

.vert {
	--height: 2;
	--width: 5;
	--depth: 10;
	--sat: 0%;
}
	
.horz {
	--height: 2.25;
	--width: 9.425;
	--depth: 1.5;
	--sat: 0%;
	transform: translate3d(0vmin, 0vmin, 0vmin);
	transform-origin: left center;
}

.block {
	--hue: 0;
	height: calc(var(--height) * 1vmin);
	width: calc(var(--width) * 1vmin);
	position: absolute;
	bottom: 0;
}

.side {
	position: absolute;
	top: 50%;
	left: 50%;
	height: 100%;
	width: 100%;
	box-sizing: border-box;
	border-radius: 2px;
}

.side:nth-of-type(1) {
	transform: translate3d(-50%, -50%, calc(var(--depth) * 0.5vmin));
	background: var(--grad), hsl(var(--hue), var(--sat), 50%);
}

.side:nth-of-type(2) {
	transform: translate3d(-50%, -50%, calc(var(--depth) * -0.5vmin)) rotateY(180deg);
	background: var(--grad), hsl(var(--hue), var(--sat), 35%);
}

.side:nth-of-type(3) {
	width: calc(var(--depth) * 1vmin);
	transform: translate(-50%, -50%) rotateY(90deg) translate3d(0, 0, calc(var(--width) * 0.5vmin));
	background: var(--grad), hsl(var(--hue), var(--sat), 40%);
}

.side:nth-of-type(4) {
	width: calc(var(--depth) * 1vmin);
	transform: translate(-50%, -50%) rotateY(-90deg) translate3d(0, 0, calc(var(--width) * 0.5vmin));
	background: var(--grad), hsl(var(--hue), var(--sat), 60%);
}

.side:nth-of-type(5) {
	height: calc(var(--depth) * 1vmin);
	transform: translate(-50%, -50%) rotateX(90deg) translate3d(0, 0, calc(var(--height) * 0.5vmin));
	background: var(--grad), hsl(var(--hue), var(--sat), 70%);
	border: 1px solid hsl(var(--hue), 0%, 50%);
}

.side:nth-of-type(6) {
	height: calc(var(--depth) * 1vmin);
	transform: translate(-50%, -50%) rotateX(-90deg) translate3d(0, 0, calc(var(--height) * 0.5vmin));
	background: var(--grad), hsl(var(--hue), var(--sat), 25%);
}	






.group {
	transform-origin: center top;
	width: 9.425vmin;
	height: 50%;
	position: absolute;
	top: 50%;
	left: calc(50% - 4.71vmin);
}

@for $t from 1 through 30 {
	.top-#{$t} {
			transform: 
				rotate(($t) * 12deg) 
			;
	}
}

.bot .group {
    padding-left: 2.2125vmin;
    box-sizing: border-box;
}

@for $b from 1 through 30 {
	.bot-#{$b} {
			transform: 
				rotate(($b) * 12deg - 6.25) 
			;
	}
}



/*** INTERIOR ***/
.interior {
    width: 80%;
    height: 80%;
    position: absolute;
    left: 10%;
    top: 10%;
    border-radius: 100%;
	transform: translateZ(0.01vmin);
}

.interior .group {
    width: 3vmin;
    left: calc(50% - 1.5vmin);
}

.interior .vert {
    --height: 1;
    --width: 3;
    --depth: 5;
    --hue: 200;
    --sat: 20%;
    transform: translateZ(2.5vmin);
}

@for $i from 1 through 30 {
	.blue-#{$i} {
			transform: 
				rotate(($i) * 12deg - 6) 
			;
	}
}




/*** BIGGEST ***/
.biggest {
	width: 50%;
	height: 50%;
	position: absolute;
	left: 25%;
	top: 23%;
	border-radius: 100% 100% 0 0;
	transform: translateZ(0.01vmin);
}
	
.biggest .group {
  width: 11.5vmin;
	left: calc(50% - 5.75vmin);
}

	
.group.big-1 {
    transform: rotate(180deg);
}

.group.big-2 {
    transform: rotate(115deg);
}

.group.big-3 {
    transform: rotate(245deg);
}

.group.big-4 {
    transform: rotate(85deg);
    top: 75%;
}

.group.big-5 {
    transform: rotate(275deg);
    top: 75%;
}




.biggest .vert {
    --height: 4;
    --width: 5;
    --depth: 15;
    transform: translateZ(7.5vmin);
}

.biggest .vert + .vert {
    transform: translateZ(7.5vmin) translateX(6.5vmin);
}

.biggest .vert + .vert + .horz {
    transform: translateZ(16.2vmin) translateX(-0.25vmin);
    --height: 4;
    --width: 12;
    --depth: 2.5;
}
	
	
	
	
.big-1 .vert {
    --depth: 18;
    transform: translateZ(9vmin);
}

.big-1 .vert + .vert {
    transform: translateZ(9vmin) translateX(6.5vmin);
}

.big-1 .vert + .vert + .horz {
    transform: translateZ(19.2vmin) translateX(-0.25vmin);
}
	
	
	
	
	
	
	
	
	
/*** SMALLEST ***/
.smallest {
    width: 34%;
    height: 36%;
    position: absolute;
    left: 33%;
    top: 31%;
    border-radius: 100% 100% 0 0;
	transform: translateZ(0.01vmin);
    /*background: red;*/
}
	
	
	
.smallest .group {
    width: 2vmin;
    left: calc(50% - 1vmin);
}

.smallest .vert {
    --height: 1;
    --width: 2;
    --depth: 4.5;
    transform: translateZ(2.25vmin);
	--hue: 200;
    --sat: 15%;
}




.smallest .blue-1 { transform: rotate(180deg); }
.smallest .blue-2 { transform: rotate(196deg); }
.smallest .blue-3 { transform: rotate(164deg); }

.smallest .blue-4 { transform: rotate(226deg); }
.smallest .blue-5 { transform: rotate(242deg); }
.smallest .blue-6 { transform: rotate(258deg); }

.smallest .blue-7 { transform: rotate(134deg); }
.smallest .blue-8 { transform: rotate(117deg); }
.smallest .blue-9 { transform: rotate(100deg); }

.smallest .blue-10 { transform: rotate(85deg); top: 67%; }
.smallest .blue-11 { transform: rotate(85deg); top: 81%;  left: calc(50% - 0.5vmin); }
.smallest .blue-12 { transform: rotate(85deg); top: 95%;  left: calc(50% - 0vmin); }

.smallest .blue-13 { transform: rotate(-85deg); top: 67%; }
.smallest .blue-14 { transform: rotate(-85deg); top: 81%;  left: calc(50% - 1.5vmin); }
.smallest .blue-15 { transform: rotate(-85deg); top: 95%;  left: calc(50% - 2vmin); }

.smallest .blue-16 { transform: rotate(-90deg); top: 56%; }
.smallest .blue-17 { transform: rotate(90deg); top: 56%; }
.smallest .blue-18 { transform: rotate(-149deg); }
.smallest .blue-19 { transform: rotate(-211deg); }







/*** ALTAR ***/
.altar {
	width: 30%;
	height: 30%;
	position: absolute;
	left: 35%;
	top: 35%;
	transform: rotate(180deg) translateZ(0.01vmin);
}

.altar .block.horz {
	--height: 4;
	--depth: 3;
	top: 65%;
	left: calc(50% - 5vmin);
	--width: 10;
	transform: translateZ(1.5vmin);
}

/*** MOON ***/
.altar:before {
	content: "";
	background: radial-gradient(circle at 25% 60%, #fff, #e6e6e6, #b7b7b7, #797979);
	width: 120%;
	height: 120%;
	position: absolute;
	border-radius: 100%;
	transform: rotateX(90deg) translateZ(-250vmin) translateY(-20vmin);
	right: -10%;
	box-shadow: 0 0 1vmin 0 #fff;
}

/*** SUN ***/
.altar:after {
	content: "";
	width: 165%;
	height: 165%;
	position: absolute;
	border-radius: 100%;
	transform: rotateX(90deg) translateZ(250vmin) translateY(-0.5vmin);
	right: -30%;
	background: radial-gradient( circle at 50vw 35vh, #ffc107 5%, rgb(255 193 7 / 64%) 10%, rgb(253 50 41 / 50%) 25%, rgb(243 0 0 / 40%) 30%, rgb(93 0 0 / 0%) 100% ), linear-gradient(180deg, #673ab7, #ffb900 80%, #fff0 100% );
	box-shadow: 0 0 1.75vmin 0.25vmin #ff660080;
}


/*** SHADOWS ***/
.block.vert .side:nth-of-type(2), .altar .block .side:nth-of-type(2) {
    box-shadow: 0vmin 0vmin 1.5vmin -0.25vmin #000;
}
              
            
!

JS

              
                
              
            
!
999px

Console