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="container">
<h1> <span>border-gradient</span> demo</h1>
<div class="circles">
<div class="circle"></div>
<div class="circle"></div>
<div class="circle-multiple">
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
</div>
</div>
<a class="btn" href="https://twitter.com/exah" target="_blank">
Follow @exah on Twitter
</a>
</div>
@import "bourbon";
/// border-gradient mixin: ///
@mixin border-gradient($from, $to, $weight: 0) {
$mix-main: mix($from, $to);
$mix-sub-from: mix($mix-main, $from);
$mix-sub-to: mix($mix-main, $to);
box-shadow: 0 1px 0 $weight rgba($mix-sub-to, .25),
0 -1px 0 $weight rgba($mix-sub-from, .25),
1px 0 0 $weight rgba($mix-sub-to, .25),
-1px 0 0 $weight rgba($mix-sub-from, .25),
1px -1px 0 $weight rgba($mix-main, .5),
-1px 1px 0 $weight rgba($mix-main, .5),
1px 1px 0 $weight rgba($to, .75),
-1px -1px 0 $weight rgba($from, .75);
}
/// BASIC EXAMPLE ///
.circle {
@include size(100px 100px);
border-radius: 100%;
@include border-gradient(red, yellow);
}
////////////// OTHER EXAMPLES ////////////////
.circle {
&:nth-of-type(2) {
@include border-gradient(skyblue, hotpink);
animation: rotateThis 1s linear infinite;
}
&:nth-of-type(3) {
@include border-gradient(#E14847, #B53BB4);
}
&-multiple { @include size(100px 100px); }
&-multiple & {
@include position(absolute, 0px 0px 0px 0px);
margin: auto;
&:nth-of-type(1) { animation: psycho 2s linear infinite; }
&:nth-of-type(2) { animation: psycho 2s linear .1s infinite; }
&:nth-of-type(3) { animation: psycho 2s linear .25s infinite; }
}
}
@keyframes rotateThis {
from {
transform: rotate(0deg) scale(1);
}
to {
transform: rotate(360deg) scale(1);
}
}
@keyframes psycho {
0% {
transform: rotate(0deg) scale(1) translate(0, 0);
}
33% {
transform: rotate(360deg) scale(1) translate(5px, 5px);
}
66% {
transform: rotate(720deg) scale(1) translate(-5px, -5px);
}
100% {
transform: rotate(1080deg) scale(1) translate(0, 0);
}
}
.btn {
border: none;
display: inline-block;
background: transparent;
color: rgba(white, .7);
background: rgba(white, .05);
text-decoration: none;
padding: 15px 20px;
border-radius: 10px;
transition: all .2s;
@include border-gradient(gray, darkgray);
&:hover {
@include border-gradient(hotpink, skyblue);
color: white;
background: rgba(skyblue, .05);
}
}
///// OTHER /////
.circles > * {
display: inline-block; vertical-align: top;
position: relative;
margin: 0 2%;
}
.circles {
transform: translateZ(0);
margin-bottom: 100px;
}
body {
background-color: #222; color: #fff;
text-align: center;
}
.container {
overflow: hidden;
padding-bottom: 150px;
}
h1 {
font: 100 50px/1.25em "Helvetica Neue", Helvetica, Arial, sans-serif;
margin-bottom: 50px;
span {
font-weight: 300;
}
}
Also see: Tab Triggers