<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>TikTok spinner</title>
<style>
:root {
--base: 4px;
--scale: 10;
--length: 1.4s;
--max-zoom: 1.2;
--min-zoom: 0.6;
--bg-color: black;
--green: rgb(145, 244, 239);
--red: rgb(219, 45, 82);
--radius: calc(var(--base) * var(--scale));
--margin: var(--base);
--iradius: calc(var(--radius) - var(--margin));
/* --ease: cubic-bezier(.05, 0, 1, 1); */
--ease: linear;
}
body {
padding: 0px;
margin: 0px;
background: var(--bg-color);
height: 100vh;
width: 100vw;
/* center */
display: flex;
justify-content: center;
align-items: center;
}
.loading-container {
display: block;
width: 200px;
height: 100px;
}
.green {
fill: var(--green);
stroke-width: 0;
r: var(--iradius);
cx: calc(var(--radius));
cy: calc(var(--radius) + var(--margin));
animation: green var(--length) var(--ease) infinite;
}
.red {
fill: var(--red);
stroke-width: 0;
r: var(--iradius);
cx: calc(var(--radius) * 3);
cy: calc(var(--radius) + var(--margin));
animation: red var(--length) var(--ease) infinite;
}
.black {
fill: black;
}
@keyframes green {
25% {
cx: calc(var(--radius) * 2);
r: calc(var(--iradius) * var(--max-zoom));
}
50% {
cx: calc(var(--radius) * 3);
r: var(--iradius);
}
75% {
cx: calc(var(--radius) * 2);
r: calc(var(--iradius) * var(--min-zoom));
}
100% {
cx: var(--radius);
r: var(--iradius);
}
}
@keyframes red {
25% {
cx: calc(var(--radius) * 2);
r: calc(var(--radius) * var(--min-zoom));
}
50% {
cx: calc(var(--radius) * 1);
r: var(--iradius);
}
75% {
cx: calc(var(--radius) * 2);
r: calc(var(--iradius) * var(--max-zoom));
}
100% {
cx: calc(var(--radius) * 3);
r: var(--iradius);
}
}
</style>
</head>
<body>
<svg class="loading-container"
preserveAspectRatio="none"
viewBox="0 0 200 100"
width="200" height="100">
<defs>
<mask id="redhole">
<rect width="100%" height="100%" fill="white"/>
<circle fill="black" class="red black"></circle>
</mask>
<mask id="greenhole">
<rect width="100%" height="100%" fill="white"/>
<circle fill="black" class="green black"></circle>
</mask>
</defs>
<circle id="green" class="green" mask="url(#redhole)" ></circle>
<circle id="red" class="red" mask="url(#greenhole)" ></circle>
</svg>
</body>
</html>
Output
You can jump to the latest bin by adding /latest
to your URL
Keyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |