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 id="btn-download">
<svg width="22px" height="16px" viewBox="0 0 22 16">
<path d="M2,10 L6,13 L12.8760559,4.5959317 C14.1180021,3.0779974 16.2457925,2.62289624 18,3.5 L18,3.5 C19.8385982,4.4192991 21,6.29848669 21,8.35410197 L21,10 C21,12.7614237 18.7614237,15 16,15 L1,15" id="check"></path>
<polyline points="4.5 8.5 8 11 11.5 8.5" class="svg-out"></polyline>
<path d="M8,1 L8,11" class="svg-out"></path>
</svg>
</div>
<!-- dribbble -->
<a class="credit" href="https://dribbble.com/shots/4570587-Download-micro-interaction" target="_blank"><img src="https://cdn.dribbble.com/assets/logo-footer-hd-a05db77841b4b27c0bf23ec1378e97c988190dfe7d26e32e1faea7269f9e001b.png" alt=""></a>
#btn-download
cursor: pointer
display: block
width: 48px
height: 48px
border-radius: 50%
-webkit-tap-highlight-color: transparent
//transform: scale(2)
//centering
position: absolute
top: calc(50% - 24px)
left: calc(50% - 24px)
&:hover
background: rgba(#223254,.03)
svg
margin: 16px 0 0 16px
fill: none
transform: translate3d(0,0,0)
polyline,
path
stroke: #0077FF
stroke-width: 2
stroke-linecap: round
stroke-linejoin: round
transition: all .3s ease
transition-delay: .3s
path#check
stroke-dasharray: 38
stroke-dashoffset: 114
transition: all .4s ease
&.downloaded
svg
.svg-out
opacity: 0
animation: drop .3s linear
transition-delay: .4s
path#check
stroke: #20CCA5
stroke-dashoffset: 174
transition-delay: .4s
@keyframes drop
20%
transform: (translate(0, -3px))
80%
transform: (translate(0, 2px))
95%
transform: (translate(0, 0))
//dribbble
.credit
position: fixed
right: 20px
bottom: 20px
transition: all .2s ease
-webkit-user-select: none
user-select: none
opacity: .6
img
width: 72px
&:hover
transform: scale(.95)
$("#btn-download").click(function() {
$(this).toggleClass("downloaded");
});
Also see: Tab Triggers