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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                // Based on the following print:
// https://collections.vam.ac.uk/item/O221321/schotter-print-nees-georg/
- var cells = 11 * 19 // $cells * $rows on SCSS
div(class="canvas")
	each el in Array(cells)
		div(class="square")
		  
	p(class="title") COMPUTERGRAFIK MIT SIEMENS - SYSTEM 4004
		span(class="author") 1968 - Georg Nees

              
            
!

CSS

              
                $cells: 11;
$rows: 19;
$size: 4vh;
$time: 6s;

$clrBg: black;
$clrPaint: white;  

* {
	box-sizing: inherit;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
	background: $clrBg;
	color: $clrPaint;
	
	/*@media (prefers-color-scheme: light) {
		background: $clrBg;
		color: $clrPaint;
	}*/
};

.canvas {
	display: flex;
	width: $cells*$size;
	flex-wrap: wrap;
	margin: $size*1.5 auto 0;
	align-content: flex-start;
}

@mixin generateSquare {	
	transform:
		rotate(var(--rotate))
		scale(var(--scale))
		translate3d(var(--translate), 0)
	;
} 

@keyframes breath {
	0%, 20%, 100% { transform: rotate(0) scale(1) translate3d(0, 0, 0); };
	50%, 70% { @include generateSquare };
}

.square {
	width: $size;
	height: $size;
	outline: 1px solid;
	transform-origin: 0 50%; 
	@include generateSquare;
	animation: breath $time infinite ease-in-out;
	
	// --------------
	$rowsToLoop: $rows - 1; 
	$centerCell: ceil($cells/2);
	$interval: 1; // interval of randomness
	// exponencial "disorder" that increases in each loop.
	$randomFreq: 0.4;
	$translateFreq: 0.3;
	$scaleFreq: 0.0015;
	$scaleMin: 0.9;
	$total: $rowsToLoop*$cells;

	@for $row from 0 through $rowsToLoop {
      @for $i from 1 through $cells {
			// A random exponencial number to shake the squares
			$ra: round($interval*$interval*$randomFreq+1);
			// Polo negative or positive - Used to randomize directions of rotations
			$poloA: if(random(2) == 2, 1, -1);
			$poloB: if(random(2) == 2, 1, -1);
			// The closer to the center, the bigger the disorder
			$centerPower: ($centerCell - abs(($centerCell - $i))) / 4;
			$translatePower: $translateFreq * $centerPower*1.1;

			$rotate: (random($ra) - $interval);
			// so it doesn't rotate too much, it's weird to the eyes...
			$adjustedRotate: if($rotate < 45, $rotate, 45 - $rotate);
				
			&:nth-child(#{$i+($cells*$row)}) {
				//border: $centerPower+px solid $clrPaint; // Extra sugar to the eyes
				opacity: $centerPower*1.25;
				animation-delay: $interval*-45ms;

				--rotate: #{ $adjustedRotate*$poloA+deg };
				--scale: #{ abs(random(round($ra))*$scaleFreq + $scaleMin*$poloB) }; 
				--translate: #{
					(random($ra) - $interval)*($poloA*$translatePower)+px,
					(random($ra) - $interval)*(1.5*$translatePower)+px // no need for $polo, it's always down...
				};
				
				// At each row completed,
				// increase the interval of possible outcomes from the random
				@if $i%$cells == 0 {
					//background: white; // debug purposes
					$interval: $interval + 1;
				}
			} 
  		}
   }
}

.title {
	margin-top: $size*2.5;
	font-size: 0.6rem;
	width: 100%;
	text-align: right;
	line-height: 1.5;
	opacity: 0.8;
}

.author {
	display: block;
}
              
            
!

JS

              
                // Not this time
              
            
!
999px

Console