Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

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.

+ 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

Auto Save

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

              
                <section>
	<div>
		<h1>Samuel L. Clippath</h1>
		<small>Click to restart animated clip-path</small>
	</div>
	Well, the way they make shows is, they make one show. That show's called a pilot. Then they show that show to the people who make shows, and on the strength of that one show they decide if they're going to make more shows. Some pilots get picked and become television programs. Some don't, become nothing. She starred in one of the ones that became nothing. <br>
	<img src="https://img.cinemablend.com/filter:scale/quill/8/c/8/c/9/e/8c8c9eb922f1b22165d9a50d231f9db689e4d969.jpg?mw=300" /><br>

	Well, the way they make shows is, they make one show. That show's called a pilot. Then they show that show to the people who make shows, and on the strength of that one show they decide if they're going to make more shows. Some pilots get picked and become television programs. Some don't, become nothing. She starred in one of the ones that became nothing.<br><br>

	Normally, both your asses would be dead as fucking fried chicken, but you happen to pull this shit while I'm in a transitional period so I don't wanna kill you, I wanna help you. But I can't give you this case, it don't belong to me. Besides, I've already been through too much shit this morning over this case to hand it over to your dumb ass.<br><br>

	You think water moves fast? You should see ice. It moves like it has a mind. Like it knows it killed the world once and got a taste for murder. After the avalanche, it took us a week to climb out. Now, I don't know exactly when we turned on each other, but I know that seven of us survived the slide... and only five made it out. Now we took an oath, that I'm breaking now. We said we'd say it was the snow that killed the other two, but it wasn't. Nature is lethal but it doesn't hold a candle to man.<br><br>

	Well, the way they make shows is, they make one show. That show's called a pilot. Then they show that show to the people who make shows, and on the strength of that one show they decide if they're going to make more shows. Some pilots get picked and become television programs. Some don't, become nothing. She starred in one of the ones that became nothing.<br><br>

	Now that we know who you are, I know who I am. I'm not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain's going to be? He's the exact opposite of the hero. And most times they're friends, like you and me! I should've known way back when... You know why, David? Because of the kids. They called me Mr Glass.<br><br>

	Now that we know who you are, I know who I am. I'm not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain's going to be? He's the exact opposite of the hero. And most times they're friends, like you and me! I should've known way back when... You know why, David? Because of the kids. They called me Mr Glass.<br><br>

	You think water moves fast? You should see ice. It moves like it has a mind. Like it knows it killed the world once and got a taste for murder. After the avalanche, it took us a week to climb out. Now, I don't know exactly when we turned on each other, but I know that seven of us survived the slide... and only five made it out. Now we took an oath, that I'm breaking now. We said we'd say it was the snow that killed the other two, but it wasn't. Nature is lethal but it doesn't hold a candle to man.<br><br>

	Do you see any Teletubbies in here? Do you see a slender plastic tag clipped to my shirt with my name printed on it? Do you see a little Asian child with a blank expression on his face sitting outside on a mechanical helicopter that shakes when you put quarters in it? No? Well, that's what you see at a toy store. And you must think you're in a toy store, because you're here shopping for an infant named Jeb<br><br>

	Well, the way they make shows is, they make one show. That show's called a pilot. Then they show that show to the people who make shows, and on the strength of that one show they decide if they're going to make more shows. Some pilots get picked and become television programs. Some don't, become nothing. She starred in one of the ones that became nothing.<br><br>

</section>

<section class="live">
		<div>
		<h1>Samuel L. Clippath</h1>
		<small>Click to restart animated clip-path</small>
	</div>
	Well, the way they make shows is, they make one show. That show's called a pilot. Then they show that show to the people who make shows, and on the strength of that one show they decide if they're going to make more shows. Some pilots get picked and become television programs. Some don't, become nothing. She starred in one of the ones that became nothing. <br>
	<img src="https://img.cinemablend.com/filter:scale/quill/8/c/8/c/9/e/8c8c9eb922f1b22165d9a50d231f9db689e4d969.jpg?mw=300" /><br>

	Well, the way they make shows is, they make one show. That show's called a pilot. Then they show that show to the people who make shows, and on the strength of that one show they decide if they're going to make more shows. Some pilots get picked and become television programs. Some don't, become nothing. She starred in one of the ones that became nothing.<br><br>

	Normally, both your asses would be dead as fucking fried chicken, but you happen to pull this shit while I'm in a transitional period so I don't wanna kill you, I wanna help you. But I can't give you this case, it don't belong to me. Besides, I've already been through too much shit this morning over this case to hand it over to your dumb ass.<br><br>

	You think water moves fast? You should see ice. It moves like it has a mind. Like it knows it killed the world once and got a taste for murder. After the avalanche, it took us a week to climb out. Now, I don't know exactly when we turned on each other, but I know that seven of us survived the slide... and only five made it out. Now we took an oath, that I'm breaking now. We said we'd say it was the snow that killed the other two, but it wasn't. Nature is lethal but it doesn't hold a candle to man.<br><br>

	Well, the way they make shows is, they make one show. That show's called a pilot. Then they show that show to the people who make shows, and on the strength of that one show they decide if they're going to make more shows. Some pilots get picked and become television programs. Some don't, become nothing. She starred in one of the ones that became nothing.<br><br>

	Now that we know who you are, I know who I am. I'm not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain's going to be? He's the exact opposite of the hero. And most times they're friends, like you and me! I should've known way back when... You know why, David? Because of the kids. They called me Mr Glass.<br><br>

	Now that we know who you are, I know who I am. I'm not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain's going to be? He's the exact opposite of the hero. And most times they're friends, like you and me! I should've known way back when... You know why, David? Because of the kids. They called me Mr Glass.<br><br>

	You think water moves fast? You should see ice. It moves like it has a mind. Like it knows it killed the world once and got a taste for murder. After the avalanche, it took us a week to climb out. Now, I don't know exactly when we turned on each other, but I know that seven of us survived the slide... and only five made it out. Now we took an oath, that I'm breaking now. We said we'd say it was the snow that killed the other two, but it wasn't. Nature is lethal but it doesn't hold a candle to man.<br><br>

	Do you see any Teletubbies in here? Do you see a slender plastic tag clipped to my shirt with my name printed on it? Do you see a little Asian child with a blank expression on his face sitting outside on a mechanical helicopter that shakes when you put quarters in it? No? Well, that's what you see at a toy store. And you must think you're in a toy store, because you're here shopping for an infant named Jeb<br><br>

	Well, the way they make shows is, they make one show. That show's called a pilot. Then they show that show to the people who make shows, and on the strength of that one show they decide if they're going to make more shows. Some pilots get picked and become television programs. Some don't, become nothing. She starred in one of the ones that became nothing.<br><br>
</section>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css?family=Lato:300,400&display=swap");
html {
	font-family: lato, sans-serif;
	font-size: 16pt;
	font-weight: 300;
	width: 100vw;
	height: 100vh;
	background: hsla(220, 20%, 10%, 0.5);
	color: black;
}
section {
	position: absolute;
	padding: 10px;
	box-sizing: border-box;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
}
img {
	float: right;
	margin: 10px;
	opacity: 0.5;
}
.live {
	clip-path: polygon(
		var(--x0) var(--y0),
		var(--x1) var(--y1),
		var(--x2) var(--y2),
		var(--x3) var(--y3)
	);
	color: yellow;
	z-index: 10;
	transition: all .4s;
}

.live img {
	opacity: 1;
}

.live small {
	color: blue;
	
}

div {
	display: flex;
	justify-content: space-between;
	align-items: center;
}
              
            
!

JS

              
                var coord = [];
const count = 4;

class Coord {
	constructor(id, x, y, dx, dy, speed) {
		this.tick = 0;
		this.x = x;
		this.y = y;
		this.dx = dx || rnd(-5, 5);
		this.dy = dy || rnd(-5, 5);
		this.speed = 8;
		this.id = id;
		this.storeInCssProperty();
	}
	move() {
		this.tick += 1;

		if (this.tick === this.speed) {
			this.x += this.dx;
			if (this.x < 0 || this.x > 100) {
				this.dx = -this.dx;
			}
			this.y += this.dy;
			if (this.y < 0 || this.y > 100) {
				this.dy = -this.dy;
			}
			this.tick = 0;
			this.storeInCssProperty();
		}
	}
	storeInCssProperty() {
		document.documentElement.style.setProperty(`--x${this.id}`, `${this.x}vw`);
		document.documentElement.style.setProperty(`--y${this.id}`, `${this.y}vh`);
	}
}

function rnd(mi, ma) {
	return parseInt(Math.random() * (ma - mi) + mi);
}

function init(evt) {
	const w = 10, h = 10;
	let x = {mi: 30, ma: 80}
	let y = {mi: 0, ma: 70}
	if (evt) {
	const {clientX, clientY} = evt;
		const maxX = clientX/innerWidth,
					maxY = clientY/innerHeight;
		x= {mi: Math.max(maxX-w,0), ma: Math.min(maxX, 100)};
		y= {mi: Math.max(maxY-h,0), ma: Math.min(maxY, 100)}
	}
	
	coord = [];
	for (var i = 0; i < count; i++) {
	coord.push(new Coord(i, rnd(x.mi, x.ma), rnd(y.mi, y.ma)));
}
}

init() 

let running = true;
function step() {
	for (var i = 0; i < count; i++) {
		coord[i].move();
	}
	if (running) {
		window.requestAnimationFrame(step);
	}
}

window.requestAnimationFrame(step);
window.addEventListener('click', init);
window.addEventListener('touchstart', init);
              
            
!
999px

Console