css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              -3.times do
	.col
		.wrap
			-4.times do
				.circle
					.triangle
            
          
!
            
              $n: 4
$s: 150
$a: 360deg

@function sqrt($r)
	$x0: 1
	$solution: false
	@for $i from 1 through 10
		@if abs(2 * $x0) < 0,00000000000001
			$solution: false
		$x1: $x0 - ($x0 * $x0 - abs($r)) / (2 * $x0) !global
		@if ( abs($x1 - $x0) / abs($x1)) < 0,0000001
			$solution: true
		$x0: $x1
	@if $solution == true
		@if $r < 0
			@return $x1 #{i}
		@else
			@return $x1
	@else
		@return "No solution"

body
	overflow: hidden
	height: 100vh
	perspective: 600px
div
	transform-style: preserve-3d
	box-sizing: border-box
.col
	width: calc(100%/3)
	height: 100%
	float: left
.wrap
	width: $s + px
	height: $s + px
	position: absolute
	top: calc(50% - #{$s + px} / 2)
	left: calc(50% - #{$s + px} / 2)
	animation: animation_rotate_wrap 15s linear infinite

.circle
	width: $s + px
	height: $s + px
	position: absolute
	top: calc(50% - #{$s + px} / 2)
	left: calc(50% - #{$s + px} / 2)
	border-radius: 50%
	border: 2px solid black
	transform-origin: 50% 0%
	@supports(clip: rect(70px, 9999px, 45px, 0))
		&:after,
		&:before
			content: ''
			position: absolute
			top: 0
			width: 100%
			height: 100%
			border-radius: 50%
		&:after
			left: 2px
			border: 2px solid black
			animation: glitch-anim-1 5s infinite ease-out alternate-reverse
		&:before
			left: -2px
			border: 3px solid rgba(red, .4)
			animation: glitch-anim-2 5s infinite ease-in alternate

	@for $i from 1 to $n
		&:nth-child(#{$i})
			transform: rotatey($a/($n - 1)*$i)  translatez(1px) rotatex(-20deg)
	
	&:nth-child(4)
		transform-origin: center center
		transform: rotatey($a) translatey($s/5 + px) rotatex(-90deg)

.triangle
	position: absolute
	width: $s/2 + px
	height: $s/2 + px
	border-radius: 50%
	top: calc(50% - #{$s/2 + px} / 2)
	left: calc(50% - #{$s/2 + px} / 2)
	border: 2px solid black
	&:before
		$l: ceil(sqrt(3) / 2 * $s)
		content: ''
		width: $l + px
		height: ceil(sqrt($l*$l - $l*$l/4)) + px
		position: absolute
		bottom: 0
		left: 50%
		transform: translatex(-50%)
		background: rgba(red, .3)
		clip-path: polygon(50% 0, 0 100%, 100% 100%)
		-webkit-clip-path: polygon(50% 0, 0 100%, 100% 100%)
	
@keyframes animation_rotate_wrap
	to
		transform: rotatey(1turn) rotatex(1turn)

@for $l from 1 through 2
	@keyframes glitch-anim-#{$l}
		$steps: 10*($l*2)
		@for $i from 0 through $steps
			#{percentage($i*(1/$steps))}
				clip: rect(random(100)+px, 9999px, random(100)+px, 0)
				
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console