JavaScript preprocessors can help make authoring JavaScript easier and more convenient. For instance, CoffeeScript can help prevent easy-to-make mistakes and offer a cleaner syntax and Babel can bring ECMAScript 6 features to browsers that only support ECMAScript 5.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
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.
<div class="ufo">
<div class="monster" style="color: #7cb342">
<div class="body">
<div class="ear"></div>
<div class="ear"></div>
<div class="vampi-mouth">
<div class="vampi-tooth"></div>
</div>
</div>
<div class="eyes">
<div class="eye">
<div class="pupil"></div>
</div>
</div>
</div>
<div class="ship">
<div class="glass"></div>
<div class="base">
<span></span>
<span></span>
<span></span>
<span></span>
</div>
</div>
</div>
.ufo {
font-size: 25vmin;
position:relative;
}
.ship {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.glass {
width: 2.65em;
height: 1.5em;
opacity:0.9;
margin:auto;
border-top-left-radius: 4em;
border-top-right-radius: 4em;
box-shadow:inset 0px 20px 65px -10px rgba(255, 255, 255, 0.79);
}
.base {
width:3.25em;
height:0.3em;
border-radius:200px;
margin:auto;
background:#2196f3;
padding-left: 20px;
padding-right: 20px;
border-top:3px solid rgba(255, 255, 255, 0.17);
border-bottom:10px solid rgba(0, 0, 0, 0.09);
display: flex;
justify-content: space-between;
align-items: center;
}
.base span {
width:14px;
height:14px;
border-radius:50%;
border:2px solid #555;
background:#eadc8a;
margin-top:7px;
}
.monster {
font-size: 0.7em;
margin: 0 auto;
width: 1em;
height: 1.3em;
border-radius: 0.5em 0.5em 0em 0em / 0.6em 0.6em 0em 0em;
box-sizing: content-box;
border: 0.07em solid transparent;
position: relative;
user-select: none;
cursor: move;
cursor: -moz-grab;
cursor: -webkit-grab;
cursor: grab;
}
.monster.small {
font-size: 4rem;
}
.body {
width: 100%;
height: 100%;
background-color: currentColor;
border-radius: inherit;
position: relative;
transform-origin: bottom center;
animation: bouncebody alternate infinite 400ms 40ms ease-in-out;
}
.eyes {
text-align: center;
display: flex;
font-size: 0.65em;
width: 1em;
height: 1em;
position: absolute;
left: 0.25em;
top: 0.3em;
animation: bounce alternate infinite 400ms ease-in-out;
}
.eye {
display: inline-block;
overflow: hidden;
position: relative;
width: 100%;
height: 100%;
background-color: white;
border-radius: 0.5em 0.5em 0.5em 0.5em / 0.6em 0.6em 0.4em 0.4em;
box-shadow: 0.03em 0.14em rgba(0,0,0,0.1);
animation: blink forwards infinite 10s ease-in-out;
}
.eye:nth-last-child(n+2),
.eye:nth-last-child(n+2) ~ .eye {
width: 1em;
height: 1em;
font-size: 0.5em;
}
.pupil {
--pupil-size: 0.6em;
position: absolute;
content: ' ';
width: var(--pupil-size);
height: var(--pupil-size);
border-radius: 50%;
background-color: black;
box-sizing: border-box;
transform: translateX(calc(0.5 * 0.3em + 0.05em)) translateY(calc(0.5 * 0.3em + 0.05em));
}
.pupil::before {
content: ' ';
width: 0.25em;
height: 0.25em;
transform: translateX(-0.05em);
background-color: white;
display: block;
border-radius: 50%;
}
.mouth {
font-size: 0.2em;
width: 1em;
height: 0.3em;
background: black;
border-radius: 1.5em 1.5em 0.5em 0.5em;
position: absolute;
bottom: 0.8em;
left: 50%;
transform: translateX(-50%);
}
.mouth::before {
width: 50%;
height: 30%;
display: block;
content: ' ';
background-color: #ff8800;
border-radius: 50% / 100% 100% 50% 50%;
position:absolute;
top: 50%;
left: 50%;
transform: translateY(-10%) translateX(-50%);
}
.vampi-mouth {
position: absolute;
background: black;
overflow: hidden;
font-size: 0.3em;
width: 1em;
height: 0.7em;
left: 50%;
bottom: 0.3em;
transform: translateX(-50%);
border-radius: 0.7em 0.7em 1.2em 1.2em;
}
.vampi-mouth::before {
content: '';
display: block;
background: #ff8800;
width: 100%;
height: 0.2em;
position: absolute;
bottom: 0;
border-radius: 50% 50% 0 0;
}
.vampi-tooth::before,
.vampi-tooth::after,
.vampi-tooth {
--teeth-size: 0.25em;
display: block;
width: 0;
height: 0;
font-size: inherit;
border-left: calc(var(--teeth-size) / 2) solid transparent;
border-right: calc(var(--teeth-size) / 2) solid transparent;
border-top: var(--teeth-size) solid #fff;
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
}
.vampi-tooth:before {
content: '';
transform: translateX(-150%) translateY(-100%);
}
.vampi-tooth:after {
content: '';
transform: translateX(50%) translateY(-100%);
}
.ear {
position: absolute;
top: -1.2em;
transform-origin: bottom center;
font-size: 0.3em;
width: .8em;
height: 1.5em;
left: 18%;
transform: rotate(-10deg);
animation: antena_e 5s infinite;
}
.ear + .ear {
left: auto;
right: 18%;
transform: rotate(10deg);
animation: antena_d 5s infinite;
}
.ear:before {
content: '';
display: block;
width: .8em;
height: .8em;
position: absolute;
z-index: 2;
left: 0;
border-radius: 50%;
background: currentColor;
box-shadow: inset -.1em -.08em rgba(0,0,0,.1);
}
.ear:after {
content: '';
display: block;
width: 0.3em;
height: 100%;
position: absolute;
top: .2em;
left: .3em;
background: currentColor;
}
@keyframes blink {
0%, 2%, 60%, 62%, 100% { transform: scaleX(1) scaleY(1); }
1%, 61% { transform: scaleX(1.3) scaleY(0.1); }
}
@keyframes bounce {
to { transform: translateY(4%); }
}
@keyframes bouncebody {
to { transform: scaleX(1.03) scaleY(0.97); }
}
@keyframes antena_d { 50% {transform: rotate(20deg);} }
@keyframes antena_e { 50% {transform: rotate(-20deg);} }
Also see: Tab Triggers