cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              - var vb_w = 1600, vb_h = .5*vb_w, vb_x = -.58*vb_w, vb_y = -.3*vb_h;
- var line_xtra = .16*vb_w, half_xtra = .5*line_xtra, line_thck = .032*line_xtra, line_thin = .5*line_thck;
- var pt_r = 1.25*line_thck, f = 4, fs = .05*vb_w;
- var x2 = .25*vb_w, rect_crnr = (f + 1)*line_thck, xe = x2 + half_xtra;
- var rr = +(half_xtra*Math.sqrt(2)).toFixed(1);

section
	svg(viewBox=[vb_x, vb_y, vb_w, vb_h].join(' '))
		style svg { font: #{fs}px consolas; fill: #333; stroke-width: #{line_thin}px }
			| rect { fill: khaki }
			| [d], [d] + [r] { fill: none; stroke: grey }
			| g [d] { stroke-width: #{line_xtra}px; stroke: rgba(200, 200, 200, .5) }
			| [d] + [d], line { stroke-width: #{line_thck}px }
			| line { stroke: #e18728 }
			| [d] + [d] { stroke: #be4c39 }
		text(x=(fs + vb_x) y=fs) ▲
			tspan(dx=-1.5*fs dy=fs) TOP
			tspan(dx=-2.5*fs dy=fs) EDGE
		rect(x=vb_x y=vb_y width=vb_w height=-vb_y)
		path(d=`M${vb_x} 0H${-vb_x}M0${vb_y}V${vb_h}`)
		circle(r=rr)
		g#strip
			path(d=`M0-${half_xtra}V${xe}`)
			path(d=`M-${half_xtra}-${half_xtra} 0 0 ${half_xtra}-${half_xtra}`)
			line(y2=x2)
			circle(r=pt_r)
			circle(r=pt_r)
			circle(r=pt_r cy=x2)
			circle(r=pt_r cx=-half_xtra cy=-half_xtra)
			circle(r=pt_r cx=half_xtra cy=-half_xtra)
			text(x=.1*fs y=.8*fs) E
			text(x=(half_xtra + .2*fs) y=-(half_xtra + .1*fs)) A
			text(x=-(half_xtra + .6*fs) y=-(half_xtra + .1*fs)) B
	form
		input#angle(type='range' min='-90' max='90')
            
          
!
            
              $ctrl-hl: #e18728;
$ctrl-ll: #aaa;
$track-w: 14em;
$track-h: .25em;
$thumb-d: 1.25em;

body {
	display: flex;
	justify-content: center;
	align-items: center;
	margin: 0;
	height: 100vh;
}

section {
	position: relative;
	width: 100em; height: 50em;
	font-size: 2vh;
  
  @media (max-aspect-ratio: 10/7) { font-size: 1vw }
}

/* FORM */

@mixin track() {
	width: $track-w; height: $track-h;
	background: $ctrl-ll;
}

@mixin fill() { background: $ctrl-hl; }

@mixin thumb() {
	border: none;
	width: $thumb-d; height: $thumb-d;
	border-radius: 50%;
	background: $ctrl-hl;
}

form {
	position: absolute;
	top: 0; left: 0;
	padding: 0 .25em;
	background: rgba(#222, .9);
	text-align: center;
	font: 1rem trebuchet ms, sans-serif;
}

[type='range'] {
	border: solid 0 transparent;
	border-width: 0 1em;
	padding: 0;
	width: $track-w; height: $track-h + 2em;
	background: none;
	font-size: 1em;
	cursor: pointer;
	
	&, 
	&::-webkit-slider-runnable-track, 
	&::-webkit-slider-thumb {
		-webkit-appearance: none;
	}
	
	&::-webkit-slider-runnable-track {
		@include track();
	}
	&::-moz-range-track {
		@include track();
	}
	&::-ms-track {
		border: none;
		@include track();
		color: transparent;
	}
	
	&::-moz-range-progress {
		@include fill();
	}
	&::-ms-fill-lower {
		@include fill();
	}
	
	&::-webkit-slider-thumb {
		margin-top: .5*($track-h - $thumb-d);
		@include thumb();
	}
	&::-moz-range-thumb {
		@include thumb();
	}
	&::-ms-thumb {
		@include thumb();
	}
	
	&:focus {
		outline: solid 1px $ctrl-hl;
	}
	
	+ output { order: 0; }
}
            
          
!
            
              const _STRIP = document.getElementById('strip'), 
			_ANGLE = document.getElementById('angle');

let curr_angle = 0;

function update(deg, flag) {
	curr_angle = deg;
	_STRIP.setAttribute(`transform`, `rotate(${deg})`);
	
	if(!flag) _ANGLE.value = deg;
};

function input() {
	if(curr_angle != _ANGLE.value) update(+_ANGLE.value, 1);
}

_ANGLE.addEventListener('input', input, false);
_ANGLE.addEventListener('change', input, false);
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console