HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URL's 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 it's URL and the proper URL extention.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
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.
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.
Using packages here is powered by Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<!doctype html>
<html lang="en">
<head>
</head>
<body>
<div class="tester">
<div class="img">
<svg id="tibby" class="morph-canvas hidden scroll-block show" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 171.6 115.9" preserveAspectRatio="xMidYMid slice" data-width="171.6" data-height="115.9" data-id="id-9" data-wait-scroll="true" data-scroll-mod="true">
<g class="canvas-svg" data-name="triple-5" data-svg-origin="-0.3338432312011719 -2.2095394134521484" transform="matrix(1,0,0,1,0,0)" style="opacity: 1;">
<g class="morph" data-name="triple-5-el-1-anim">
<path class="scroll-morph-start morph-shape-start" data-morph="morph-43" data-delay="0.3" fill="#3043CA" d="M66.02899999999994,51.495 C61.12509999999994,45.595 54.10399999999998,47.20100000000002 51.49809999999999,47.92500000000001 34.59610000000006,52.655099999999955 35.1249999999999,58.68210000000002 24.864099999999993,75.403 16.490000000000048,91.56800000000005 37.74499999999997,103.17199999999997 38.43889999999997,103.57199999999997 54.02799999999997,113.29399999999997 57.64499999999997,110.24500000000002 72.72189999999998,104.48400000000002 74.02189999999997,103.98400000000002 81.76189999999994,96.29499999999999 81.06189999999994,87.095 80.56189999999994,81.19109999999999 75.76189999999994,80.69109999999999 71.66189999999995,71.2911 67.36799999999994,61.495 70.36799999999994,56.795 66.02899999999994,51.495 z" data-original="M41.8,19.8c-4.9-6-7.5,8.8-9.4,8.9C20.1,29.3-1.3,61.2-0.3,78.2c1,16.9,13.7,42.4,44.7,41.2c18-0.2,37.5-2,45.1-6.3c1.2-0.7,43.4-24.1,42.7-33.3c-0.5-5.9-18-50.4-22.1-59.8C105.9,10.3,46.2,25,41.8,19.8z" style="fill: rgb(48, 67, 202); opacity: 1;"></path>
<path class="scroll-morph-end" data-morph="morph-43" fill="#3043CA" d="M66,54.3c-4.9-5.9-13.5-5.5-15.4-5.4c-12.3,0.6-26.4,12.4-25.4,29.4
c1,16.9,16.2,26.4,16.9,26.8c9.3,5.5,19.8,5.3,27.4,1c1.2-0.7,12.2-7.1,11.5-16.3c-0.5-5.9-5.3-6.4-9.4-15.8
C67.3,64.3,70.3,59.6,66,54.3z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" data-timing="0.7" fill="#3043CA" d="M66,54.3c-4.9-5.9-13.5-5.5-15.4-5.4c-12.3,0.6-26.4,12.4-25.4,29.4
c1,16.9,16.2,26.4,16.9,26.8c9.3,5.5,19.8,5.3,27.4,1c1.2-0.7,12.2-7.1,11.5-16.3c-0.5-5.9-5.3-6.4-9.4-15.8
C67.3,64.3,70.3,59.6,66,54.3z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" data-timing="0.7" fill="#3043CA" d="M61.7,51.3c-4.9-5.9-9-2.5-10.9-2.4c-12.3,0.6-22.5,10.8-26.4,27.4
C20,95,35.6,101.3,36.3,101.7c15.7,9.8,19.2,10.3,34.4,4.5c1.3-0.5,6.7-10.1,6-19.3c-0.5-5.9-5.3-6.4-9.4-15.8
C63,61.3,66,56.6,61.7,51.3z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" data-timing="0.7" fill="#3043CA" d="M72.8,51.8c-4.9-5.9-16.5-7.1-20.2-5.4c-24.1,11.2-6.8,10.7-27,27.6
C11,86.2,41.1,106.1,41.8,106.5c15.4,9.6,19.2,1,34.1-4.7c1.3-0.5,12.7-5.2,12-14.4c-0.5-5.9-5.3-6.4-9.4-15.8
C74.2,61.8,77.2,57.1,72.8,51.8z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" data-timing="0.7" fill="#3043CA" d="M66,54.3c-4.9-5.9-13.5-5.5-15.4-5.4c-12.3,0.6-26.4,12.4-25.4,29.4
c1,16.9,16.2,26.4,16.9,26.8c9.3,5.5,19.8,5.3,27.4,1c1.2-0.7,12.2-7.1,11.5-16.3c-0.5-5.9-5.3-6.4-9.4-15.8
C67.3,64.3,70.3,59.6,66,54.3z" style="fill: rgb(48, 67, 202);"></path>
</g>
<g class="morph" data-name="triple-5-el-2-anim">
<path class="scroll-morph-start morph-shape-start" data-morph="morph-44" data-delay="0.3" fill="#3043CA" d="M124.16799999999999,29.386999999999983 C122.26799999999999,30.183099999999982 115.173,36.75809999999997 112.37299999999999,44.261999999999965 108.973,53.16199999999997 116.793,64.30199999999999 124.19300000000001,69.4981 133.293,75.9981 151.09300000000002,73.79199999999999 158.9891,65.9981 159.793,65.20199999999998 169.343,61.8351 167.493,54.70199999999999 164.46910000000005,43.92599999999998 161.26109999999997,42.58500000000004 146.98799999999994,29.63200000000001 137.88299999999995,21.511999999999997 125.729,28.72599999999998 124.16799999999999,29.386999999999983 z" data-original="M128.4,28.5c-1.9,0.8-9.8,3.9-12.6,11.4c-3.4,8.9,2.2,19.6,9.6,24.8c9.1,6.5,22.9,6.3,30.8-1.5c0.8-0.8,5.9-6,6-13.8c0.1-11.4-10.5-20.6-20.6-22.4C135.1,25.9,129.9,27.9,128.4,28.5z" style="fill: rgb(48, 67, 202); opacity: 1;"></path>
<path class="scroll-morph-end" data-morph="morph-44" fill="#3043CA" d="M129.9,29.4c-1.9,0.8-9.8,3.9-12.6,11.4c-3.4,8.9,2.2,19.6,9.6,24.8
c9.1,6.5,22.9,6.3,30.8-1.5c0.8-0.8,5.9-6,6-13.8c0.1-11.4-10.5-20.6-20.6-22.4C136.6,26.8,131.4,28.8,129.9,29.4z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" data-timing="0.7" fill="#3043CA" d="M129.9,29.4c-1.9,0.8-9.8,3.9-12.6,11.4c-3.4,8.9,2.2,19.6,9.6,24.8
c9.1,6.5,22.9,6.3,30.8-1.5c0.8-0.8,5.9-6,6-13.8c0.1-11.4-10.5-20.6-20.6-22.4C136.6,26.8,131.4,28.8,129.9,29.4z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" data-timing="0.7" fill="#3043CA" d="M123.7,28.1c-1.9,0.8-8.8,6.4-11.6,13.9c-3.4,8.9,5.2,21.6,12.6,26.8
c9.1,6.5,26.9,4.3,34.8-3.5c0.8-0.8,8.4-3.5,8.5-11.3c0.1-11.4-8.1-8.1-24.6-23.9C134.1,21.2,125.3,27.4,123.7,28.1z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" data-timing="0.7" fill="#3043CA" d="M124.9,31.4c-1.9,0.8-9.3,8.9-12.1,16.4c-3.4,8.9,3.2,17.6,10.6,22.8
c9.1,6.5,26.9,4.3,34.8-3.5c0.8-0.8,13.4-5.2,8.5-11.3c-7.9-9.8-3.3-18.4-14.1-26.9C143.8,22,126.4,30.8,124.9,31.4z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" data-timing="0.7" fill="#3043CA" d="M129.9,29.4c-1.9,0.8-9.8,3.9-12.6,11.4c-3.4,8.9,2.2,19.6,9.6,24.8
c9.1,6.5,22.9,6.3,30.8-1.5c0.8-0.8,5.9-6,6-13.8c0.1-11.4-10.5-20.6-20.6-22.4C136.6,26.8,131.4,28.8,129.9,29.4z" style="fill: rgb(48, 67, 202);"></path>
</g>
<g class="morph" data-name="triple-5-el-3-anim">
<path class="scroll-morph-start morph-shape-start" data-morph="morph-45" data-delay="0.3" fill="#3043CA" d="M7.476000000000009,8.9 C5.73700000000001,10 0.2300000000000164,15.867999999999995 0.3169999999999984,22.289999999999992 0.41599999999997594,30.011999999999997 7.138999999999999,33.732000000000006 15.205899999999996,32.06999999999998 32.102,28.279999999999937 37.602,33.995 43.812,26.005000000000003 44.35099999999999,25.144000000000002 49.790099999999974,19.547999999999984 50.35099999999999,13.608999999999984 52.10200000000005,-0.8550000000000302 38.559900000000006,0.5150000000000083 28.327000000000005,0.9150000000000083 18.027000000000005,1.4150000000000083 8.837000000000009,8.1 7.476000000000009,8.9 z" data-original="M10.1,4.5c-1.7,1.1-8.6,5.5-9.9,12c-1.5,7.8,0.4,48,8.6,50.3c10.1,2.8,161.3-4.5,147.2-54.7C143.3-12.8,105.5,2,94.2,3.7C92-5.2,32.8-0.9,22.6,0.2C16.1,0.8,11.5,3.7,10.1,4.5z" style="fill: rgb(48, 67, 202); opacity: 1;"></path>
<path class="scroll-morph-end" data-morph="morph-45" fill="#3043CA" d="M11.6,5.4c-1.7,1.1-8.7,5.5-9.9,11.9c-1.5,7.8,6,14.7,14.2,17c10.1,2.8,23.4-0.7,29.6-8.7
c0.6-0.8,4.5-6.1,3.1-12.2C46.4,4.6,34.3,0,24.1,1C17.6,1.7,13,4.6,11.6,5.4z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" data-timing="0.7" fill="#3043CA" d="M11.6,5.4c-1.7,1.1-8.7,5.5-9.9,11.9c-1.5,7.8,6,14.7,14.2,17c10.1,2.8,23.4-0.7,29.6-8.7
c0.6-0.8,4.5-6.1,3.1-12.2C46.4,4.6,34.3,0,24.1,1C17.6,1.7,13,4.6,11.6,5.4z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" data-timing="0.7" fill="#3043CA" d="M8.1,8.9C6.4,10,1.4,15.4,0.2,21.9c-1.5,7.8,6.9,12.3,14.7,9c16.9-7.3,22.4,3.3,28.6-4.7
C44,25.3,48,18.3,50,12.4C55.3-3,38.8,1.1,28.6,1.5C18.3,2,9.5,8.1,8.1,8.9z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" data-timing="0.7" fill="#3043CA" d="M6.5,8.9C4.7,10-1.6,16.6,0.5,22.9c2.6,7.6,6.7,10.1,15.2,11c16.9,1.7,22.4-0.2,28.6-8.2
c0.6-0.8,8.3-4.2,6.6-10.2C47.1,2.5,38.2-0.4,27.9,0C17.6,0.5,7.8,8.1,6.5,8.9z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" data-timing="0.7" fill="#3043CA" d="M11.6,5.4c-1.7,1.1-8.7,5.5-9.9,11.9c-1.5,7.8,6,14.7,14.2,17c10.1,2.8,23.4-0.7,29.6-8.7
c0.6-0.8,4.5-6.1,3.1-12.2C46.4,4.6,34.3,0,24.1,1C17.6,1.7,13,4.6,11.6,5.4z" style="fill: rgb(48, 67, 202);"></path>
</g>
<g data-scroll-mod="true">
<path class="scroll-morph-start" data-morph="morph-46" data-delay="0.3" fill="#FA4E40" d="M145,114.4c-5.7-1.8-95.2-29.3-95.2-29.3c-2.1-0.6-2.6-3.3-2.7-5.1c-0.2-1.8,14.9-50.2,14.9-50.2c0.6-2.1,2.9-3.4,5.1-2.7c0,0,95.8,27.4,98,28c3.2,0.8,5.9,4.5,5,7.2c-0.9,2.7-16.7,49.2-16.7,49.2C152.6,113.6,150.7,116.2,145,114.4z" data-original="M145,114.4c-5.7-1.8-113.3-2.9-113.3-2.9C18.5,109,20.5,58.2,20.4,56.4c-6.5-28.1,34.9-39.7,34.9-39.7C55.9,14.5,74.5,1.3,76.7,2c0,0,88-4.2,88,14.6c3.2,0.8,6.3,43,5.4,45.7s-4.4,49.6-4.4,49.6C164.9,114,150.7,116.2,145,114.4z" style="fill: rgb(250, 78, 64); opacity: 1;"></path>
<path class="scroll-morph-end" data-morph="morph-46" fill="#FA4E40" d="M145,114.4c-5.7-1.8-95.2-29.3-95.2-29.3c-2.1-0.6-2.6-3.3-2.7-5.1c-0.2-1.8,14.9-50.2,14.9-50.2c0.6-2.1,2.9-3.4,5.1-2.7c0,0,95.8,27.4,98,28c3.2,0.8,5.9,4.5,5,7.2c-0.9,2.7-16.7,49.2-16.7,49.2C152.6,113.6,150.7,116.2,145,114.4z" style="fill: rgb(250, 78, 64);"></path>
</g>
<g data-scroll-mod="true">
<path class="scroll-morph-start" data-morph="morph-48" data-delay="0.3" fill="#F82412" d="M142.9,49.3l-37.1-10.6c-11.1,3.3-21,11.8-24.4,24.6c-3.6,13.4-2.3,24.6,4.4,33.4l41.4,12.8c3.8-1.3,5.8-2.8,6-3.5c0.2-1.2-5.7-15.2-7-15.4c-1.3-0.1-9.2,5.1-17.2,2.6c-7.9-2.4-17.1-13.9-11.9-26.9c5.2-13,19.4-13,23.8-11.3c4.5,1.7,11.6,12,12.6,12.2c1,0.1,14.5-6.5,15-7.5C148.8,59,147.3,54.3,142.9,49.3z" data-original="M148.4,87.7c11.4,0,17.3-22.8,17.8-23.8c0.5-1,10.7-53.4-6.3-59.2
S55.3,16.6,49.7,37.4C45.6,52.7,78.2,90,87.4,99.2c7.3,7.4,21.3,16.2,31.6,15.8c10.7-0.4,12.5-8.9,12.8-10
c0.2-1.2-5.7-15.2-7-15.4s0.3-23.2-7.7-25.7c-8-2.5-26.6,14.4-21.4,1.5s19.4-13,23.8-11.3S130.3,87.7,148.4,87.7z" style="fill: rgb(248, 36, 18); opacity: 1;"></path>
<path class="scroll-morph-end" data-morph="morph-48" fill="#F82412" d="M142.9,49.3l-37.1-10.6c-11.1,3.3-21,11.8-24.4,24.6c-3.6,13.4-2.3,24.6,4.4,33.4l41.4,12.8c3.8-1.3,5.8-2.8,6-3.5c0.2-1.2-5.7-15.2-7-15.4c-1.3-0.1-9.2,5.1-17.2,2.6c-7.9-2.4-17.1-13.9-11.9-26.9c5.2-13,19.4-13,23.8-11.3c4.5,1.7,11.6,12,12.6,12.2c1,0.1,14.5-6.5,15-7.5C148.8,59,147.3,54.3,142.9,49.3z" style="fill: rgb(248, 36, 18);"></path>
</g>
<g data-scroll-mod="true">
<path class="scroll-morph-start" data-morph="morph-49" data-delay="0.3" fill="#FFFFFF" d="M74.5,71.8c0,4.4-4.1,8-8.5,8c-4.4,0-7.5-2.9-7.5-7.3c0-4.4,2.9-8.5,7.9-8.6C71.1,63.7,74.5,67.4,74.5,71.8z" data-original="M74.5,71.8c-3,3.2-4.1,8-8.5,8S-0.3,88.6,5,47C9,15.4,71.2-5.7,85.1,6.8C107.6,24.5,98.8,46,74.5,71.8z" style="fill: rgb(255, 255, 255); opacity: 1;"></path>
<path class="scroll-morph-end" data-morph="morph-49" fill="#FFFFFF" d="M74.5,71.8c0,4.4-4.1,8-8.5,8c-4.4,0-7.5-2.9-7.5-7.3c0-4.4,2.9-8.5,7.9-8.6C71.1,63.7,74.5,67.4,74.5,71.8z" style="fill: rgb(255, 255, 255);"></path>
</g>
<g data-scroll-mod="true">
<path class="scroll-morph-start" data-morph="morph-50" data-delay="0.3" fill="#3043CA" d="M83.3,74.8c0,4.4-2.4,8-8,8c-4.4,0-8.4-4.5-8-8c0.5-4.4,3.6-8,8-8C79.8,66.8,83.3,70.4,83.3,74.8z" data-original="M105.8,93.7c0,4.4-46.4,6.4-51.2,3.6C27.9,82.1,43.3,77.2,43.7,73.7c0.5-4.4,13.2,0.6,31.6-6.9C96.1,58.3,105.8,89.3,105.8,93.7z" style="fill: rgb(48, 67, 202); opacity: 1;"></path>
<path class="scroll-morph-end" data-morph="morph-50" fill="#3043CA" d="M83.3,74.8c0,4.4-2.4,8-8,8c-4.4,0-8.4-4.5-8-8c0.5-4.4,3.6-8,8-8C79.8,66.8,83.3,70.4,83.3,74.8z" style="fill: rgb(48, 67, 202);"></path>
</g>
<g class="morph" data-name="triple-5-el-4-anim">
<path class="scroll-morph-start morph-shape-start" data-morph="morph-51" data-delay="0.3" fill="#3043CA" d="M92.9509,84.93293333333334 C108.53413333333334,89.57006666666666 119.87311,93.38263333333333 134.7982,96.94742333333333 138.61084333333332,97.81676666666667 139.53353333333334,92.67191 135.31016666666667,91.93113333333334 121.02573333333333,88.6018 107.65866666666666,83.68323333333333 94.18383333333333,80.16646666666666 91.36886666666666,79.37485000000001 90.11749,83.44107 92.65413,84.3964 92.61053666666666,84.60095333333334 92.69101666666667,84.85748333333333 92.9509,84.93293333333334 z" data-original="M91.3,84.1c-10.6,7.9,33.3,26.7,48.2,30.3c15.3-8.1,5.3-72.2,17.5-61.6c-14.1-4-57.2-46.9-67.5-21.2C86.4,30.8,88.2,83.2,91.3,84.1L91.3,84.1z" style="fill: rgb(48, 67, 202); opacity: 1;"></path>
<path class="scroll-morph-end" data-morph="morph-51" fill="#3043CA" d="M92.8,85c15.6,4,27.4,8.5,42.3,12.1c3.1,0.7,4.4-3.9,1.3-4.8c-14.1-4-27.4-8.6-42.3-12.1
C91,79.4,89.7,84.1,92.8,85L92.8,85z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" fill="#3043CA" d="M92.8,85c15.6,4,27.4,8.5,42.3,12.1c3.1,0.7,4.4-3.9,1.3-4.8c-14.1-4-27.4-8.6-42.3-12.1
C91,79.4,89.7,84.1,92.8,85L92.8,85z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" fill="#3043CA" d="M93.6,84.4c15.5,7.8,26.6,9.8,41.6,13.4c3.1,0.7,4.8-6.4,1.6-6.3c-15.2,0.3-27.7-7.1-42.6-10.6
C91,80.1,90.5,83.5,93.6,84.4z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" fill="#3043CA" d="M93.7,84.6c15.5,7.8,24.6,8.2,39.6,11.6c7.4,1.7,6.4-6.1-3.4-6.1c-15.2,0-28.9-6.5-35.3-10.1
C91.8,78.5,90.6,83.7,93.7,84.6z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" fill="#3043CA" d="M92.8,85c15.6,4,27.4,8.5,42.3,12.1c3.1,0.7,4.4-3.9,1.3-4.8c-14.1-4-27.4-8.6-42.3-12.1
C91,79.4,89.7,84.1,92.8,85L92.8,85z" style="fill: rgb(48, 67, 202);"></path>
</g>
</g>
</svg>
<canvas class="scroll-block show" width="212" height="143" style="width: 212px; height: 143px;"></canvas>
</div>
<div class="img">
<svg class="morph-canvas hidden scroll-block show" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 171.6 115.9" preserveAspectRatio="xMidYMid slice" data-width="171.6" data-height="115.9" data-id="id-9" data-wait-scroll="true" data-scroll-mod="true">
<g class="canvas-svg" data-name="triple-5" data-svg-origin="-0.3338432312011719 -2.2095394134521484" transform="matrix(1,0,0,1,0,0)" style="opacity: 1;">
<g class="morph" data-name="triple-5-el-1-anim">
<path class="scroll-morph-start morph-shape-start" data-morph="morph-43" data-delay="0.3" fill="#3043CA" d="M66.02899999999994,51.495 C61.12509999999994,45.595 54.10399999999998,47.20100000000002 51.49809999999999,47.92500000000001 34.59610000000006,52.655099999999955 35.1249999999999,58.68210000000002 24.864099999999993,75.403 16.490000000000048,91.56800000000005 37.74499999999997,103.17199999999997 38.43889999999997,103.57199999999997 54.02799999999997,113.29399999999997 57.64499999999997,110.24500000000002 72.72189999999998,104.48400000000002 74.02189999999997,103.98400000000002 81.76189999999994,96.29499999999999 81.06189999999994,87.095 80.56189999999994,81.19109999999999 75.76189999999994,80.69109999999999 71.66189999999995,71.2911 67.36799999999994,61.495 70.36799999999994,56.795 66.02899999999994,51.495 z" data-original="M41.8,19.8c-4.9-6-7.5,8.8-9.4,8.9C20.1,29.3-1.3,61.2-0.3,78.2c1,16.9,13.7,42.4,44.7,41.2c18-0.2,37.5-2,45.1-6.3c1.2-0.7,43.4-24.1,42.7-33.3c-0.5-5.9-18-50.4-22.1-59.8C105.9,10.3,46.2,25,41.8,19.8z" style="fill: rgb(48, 67, 202); opacity: 1;"></path>
<path class="scroll-morph-end" data-morph="morph-43" fill="#3043CA" d="M66,54.3c-4.9-5.9-13.5-5.5-15.4-5.4c-12.3,0.6-26.4,12.4-25.4,29.4
c1,16.9,16.2,26.4,16.9,26.8c9.3,5.5,19.8,5.3,27.4,1c1.2-0.7,12.2-7.1,11.5-16.3c-0.5-5.9-5.3-6.4-9.4-15.8
C67.3,64.3,70.3,59.6,66,54.3z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" data-timing="0.7" fill="#3043CA" d="M66,54.3c-4.9-5.9-13.5-5.5-15.4-5.4c-12.3,0.6-26.4,12.4-25.4,29.4
c1,16.9,16.2,26.4,16.9,26.8c9.3,5.5,19.8,5.3,27.4,1c1.2-0.7,12.2-7.1,11.5-16.3c-0.5-5.9-5.3-6.4-9.4-15.8
C67.3,64.3,70.3,59.6,66,54.3z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" data-timing="0.7" fill="#3043CA" d="M61.7,51.3c-4.9-5.9-9-2.5-10.9-2.4c-12.3,0.6-22.5,10.8-26.4,27.4
C20,95,35.6,101.3,36.3,101.7c15.7,9.8,19.2,10.3,34.4,4.5c1.3-0.5,6.7-10.1,6-19.3c-0.5-5.9-5.3-6.4-9.4-15.8
C63,61.3,66,56.6,61.7,51.3z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" data-timing="0.7" fill="#3043CA" d="M72.8,51.8c-4.9-5.9-16.5-7.1-20.2-5.4c-24.1,11.2-6.8,10.7-27,27.6
C11,86.2,41.1,106.1,41.8,106.5c15.4,9.6,19.2,1,34.1-4.7c1.3-0.5,12.7-5.2,12-14.4c-0.5-5.9-5.3-6.4-9.4-15.8
C74.2,61.8,77.2,57.1,72.8,51.8z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" data-timing="0.7" fill="#3043CA" d="M66,54.3c-4.9-5.9-13.5-5.5-15.4-5.4c-12.3,0.6-26.4,12.4-25.4,29.4
c1,16.9,16.2,26.4,16.9,26.8c9.3,5.5,19.8,5.3,27.4,1c1.2-0.7,12.2-7.1,11.5-16.3c-0.5-5.9-5.3-6.4-9.4-15.8
C67.3,64.3,70.3,59.6,66,54.3z" style="fill: rgb(48, 67, 202);"></path>
</g>
<g class="morph" data-name="triple-5-el-2-anim">
<path class="scroll-morph-start morph-shape-start" data-morph="morph-44" data-delay="0.3" fill="#3043CA" d="M124.16799999999999,29.386999999999983 C122.26799999999999,30.183099999999982 115.173,36.75809999999997 112.37299999999999,44.261999999999965 108.973,53.16199999999997 116.793,64.30199999999999 124.19300000000001,69.4981 133.293,75.9981 151.09300000000002,73.79199999999999 158.9891,65.9981 159.793,65.20199999999998 169.343,61.8351 167.493,54.70199999999999 164.46910000000005,43.92599999999998 161.26109999999997,42.58500000000004 146.98799999999994,29.63200000000001 137.88299999999995,21.511999999999997 125.729,28.72599999999998 124.16799999999999,29.386999999999983 z" data-original="M128.4,28.5c-1.9,0.8-9.8,3.9-12.6,11.4c-3.4,8.9,2.2,19.6,9.6,24.8c9.1,6.5,22.9,6.3,30.8-1.5c0.8-0.8,5.9-6,6-13.8c0.1-11.4-10.5-20.6-20.6-22.4C135.1,25.9,129.9,27.9,128.4,28.5z" style="fill: rgb(48, 67, 202); opacity: 1;"></path>
<path class="scroll-morph-end" data-morph="morph-44" fill="#3043CA" d="M129.9,29.4c-1.9,0.8-9.8,3.9-12.6,11.4c-3.4,8.9,2.2,19.6,9.6,24.8
c9.1,6.5,22.9,6.3,30.8-1.5c0.8-0.8,5.9-6,6-13.8c0.1-11.4-10.5-20.6-20.6-22.4C136.6,26.8,131.4,28.8,129.9,29.4z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" data-timing="0.7" fill="#3043CA" d="M129.9,29.4c-1.9,0.8-9.8,3.9-12.6,11.4c-3.4,8.9,2.2,19.6,9.6,24.8
c9.1,6.5,22.9,6.3,30.8-1.5c0.8-0.8,5.9-6,6-13.8c0.1-11.4-10.5-20.6-20.6-22.4C136.6,26.8,131.4,28.8,129.9,29.4z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" data-timing="0.7" fill="#3043CA" d="M123.7,28.1c-1.9,0.8-8.8,6.4-11.6,13.9c-3.4,8.9,5.2,21.6,12.6,26.8
c9.1,6.5,26.9,4.3,34.8-3.5c0.8-0.8,8.4-3.5,8.5-11.3c0.1-11.4-8.1-8.1-24.6-23.9C134.1,21.2,125.3,27.4,123.7,28.1z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" data-timing="0.7" fill="#3043CA" d="M124.9,31.4c-1.9,0.8-9.3,8.9-12.1,16.4c-3.4,8.9,3.2,17.6,10.6,22.8
c9.1,6.5,26.9,4.3,34.8-3.5c0.8-0.8,13.4-5.2,8.5-11.3c-7.9-9.8-3.3-18.4-14.1-26.9C143.8,22,126.4,30.8,124.9,31.4z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" data-timing="0.7" fill="#3043CA" d="M129.9,29.4c-1.9,0.8-9.8,3.9-12.6,11.4c-3.4,8.9,2.2,19.6,9.6,24.8
c9.1,6.5,22.9,6.3,30.8-1.5c0.8-0.8,5.9-6,6-13.8c0.1-11.4-10.5-20.6-20.6-22.4C136.6,26.8,131.4,28.8,129.9,29.4z" style="fill: rgb(48, 67, 202);"></path>
</g>
<g data-scroll-mod="true">
<path class="scroll-morph-start" data-morph="morph-46" data-delay="0.3" fill="#FA4E40" d="M145,114.4c-5.7-1.8-95.2-29.3-95.2-29.3c-2.1-0.6-2.6-3.3-2.7-5.1c-0.2-1.8,14.9-50.2,14.9-50.2c0.6-2.1,2.9-3.4,5.1-2.7c0,0,95.8,27.4,98,28c3.2,0.8,5.9,4.5,5,7.2c-0.9,2.7-16.7,49.2-16.7,49.2C152.6,113.6,150.7,116.2,145,114.4z" data-original="M145,114.4c-5.7-1.8-113.3-2.9-113.3-2.9C18.5,109,20.5,58.2,20.4,56.4c-6.5-28.1,34.9-39.7,34.9-39.7C55.9,14.5,74.5,1.3,76.7,2c0,0,88-4.2,88,14.6c3.2,0.8,6.3,43,5.4,45.7s-4.4,49.6-4.4,49.6C164.9,114,150.7,116.2,145,114.4z" style="fill: rgb(250, 78, 64); opacity: 1;"></path>
<path class="scroll-morph-end" data-morph="morph-46" fill="#FA4E40" d="M145,114.4c-5.7-1.8-95.2-29.3-95.2-29.3c-2.1-0.6-2.6-3.3-2.7-5.1c-0.2-1.8,14.9-50.2,14.9-50.2c0.6-2.1,2.9-3.4,5.1-2.7c0,0,95.8,27.4,98,28c3.2,0.8,5.9,4.5,5,7.2c-0.9,2.7-16.7,49.2-16.7,49.2C152.6,113.6,150.7,116.2,145,114.4z" style="fill: rgb(250, 78, 64);"></path>
</g>
<g data-scroll-mod="true">
<path class="scroll-morph-start" data-morph="morph-48" data-delay="0.3" fill="#F82412" d="M142.9,49.3l-37.1-10.6c-11.1,3.3-21,11.8-24.4,24.6c-3.6,13.4-2.3,24.6,4.4,33.4l41.4,12.8c3.8-1.3,5.8-2.8,6-3.5c0.2-1.2-5.7-15.2-7-15.4c-1.3-0.1-9.2,5.1-17.2,2.6c-7.9-2.4-17.1-13.9-11.9-26.9c5.2-13,19.4-13,23.8-11.3c4.5,1.7,11.6,12,12.6,12.2c1,0.1,14.5-6.5,15-7.5C148.8,59,147.3,54.3,142.9,49.3z" data-original="M148.4,87.7c11.4,0,17.3-22.8,17.8-23.8c0.5-1,10.7-53.4-6.3-59.2
S55.3,16.6,49.7,37.4C45.6,52.7,78.2,90,87.4,99.2c7.3,7.4,21.3,16.2,31.6,15.8c10.7-0.4,12.5-8.9,12.8-10
c0.2-1.2-5.7-15.2-7-15.4s0.3-23.2-7.7-25.7c-8-2.5-26.6,14.4-21.4,1.5s19.4-13,23.8-11.3S130.3,87.7,148.4,87.7z" style="fill: rgb(248, 36, 18); opacity: 1;"></path>
<path class="scroll-morph-end" data-morph="morph-48" fill="#F82412" d="M142.9,49.3l-37.1-10.6c-11.1,3.3-21,11.8-24.4,24.6c-3.6,13.4-2.3,24.6,4.4,33.4l41.4,12.8c3.8-1.3,5.8-2.8,6-3.5c0.2-1.2-5.7-15.2-7-15.4c-1.3-0.1-9.2,5.1-17.2,2.6c-7.9-2.4-17.1-13.9-11.9-26.9c5.2-13,19.4-13,23.8-11.3c4.5,1.7,11.6,12,12.6,12.2c1,0.1,14.5-6.5,15-7.5C148.8,59,147.3,54.3,142.9,49.3z" style="fill: rgb(248, 36, 18);"></path>
</g>
<g data-scroll-mod="true">
<path class="scroll-morph-start" data-morph="morph-49" data-delay="0.3" fill="#FFFFFF" d="M74.5,71.8c0,4.4-4.1,8-8.5,8c-4.4,0-7.5-2.9-7.5-7.3c0-4.4,2.9-8.5,7.9-8.6C71.1,63.7,74.5,67.4,74.5,71.8z" data-original="M74.5,71.8c-3,3.2-4.1,8-8.5,8S-0.3,88.6,5,47C9,15.4,71.2-5.7,85.1,6.8C107.6,24.5,98.8,46,74.5,71.8z" style="fill: rgb(255, 255, 255); opacity: 1;"></path>
<path class="scroll-morph-end" data-morph="morph-49" fill="#FFFFFF" d="M74.5,71.8c0,4.4-4.1,8-8.5,8c-4.4,0-7.5-2.9-7.5-7.3c0-4.4,2.9-8.5,7.9-8.6C71.1,63.7,74.5,67.4,74.5,71.8z" style="fill: rgb(255, 255, 255);"></path>
</g>
<g data-scroll-mod="true">
<path class="scroll-morph-start" data-morph="morph-50" data-delay="0.3" fill="#3043CA" d="M83.3,74.8c0,4.4-2.4,8-8,8c-4.4,0-8.4-4.5-8-8c0.5-4.4,3.6-8,8-8C79.8,66.8,83.3,70.4,83.3,74.8z" data-original="M105.8,93.7c0,4.4-46.4,6.4-51.2,3.6C27.9,82.1,43.3,77.2,43.7,73.7c0.5-4.4,13.2,0.6,31.6-6.9C96.1,58.3,105.8,89.3,105.8,93.7z" style="fill: rgb(48, 67, 202); opacity: 1;"></path>
<path class="scroll-morph-end" data-morph="morph-50" fill="#3043CA" d="M83.3,74.8c0,4.4-2.4,8-8,8c-4.4,0-8.4-4.5-8-8c0.5-4.4,3.6-8,8-8C79.8,66.8,83.3,70.4,83.3,74.8z" style="fill: rgb(48, 67, 202);"></path>
</g>
<g class="morph" data-name="triple-5-el-4-anim">
<path class="scroll-morph-start morph-shape-start" data-morph="morph-51" data-delay="0.3" fill="#3043CA" d="M92.9509,84.93293333333334 C108.53413333333334,89.57006666666666 119.87311,93.38263333333333 134.7982,96.94742333333333 138.61084333333332,97.81676666666667 139.53353333333334,92.67191 135.31016666666667,91.93113333333334 121.02573333333333,88.6018 107.65866666666666,83.68323333333333 94.18383333333333,80.16646666666666 91.36886666666666,79.37485000000001 90.11749,83.44107 92.65413,84.3964 92.61053666666666,84.60095333333334 92.69101666666667,84.85748333333333 92.9509,84.93293333333334 z" data-original="M91.3,84.1c-10.6,7.9,33.3,26.7,48.2,30.3c15.3-8.1,5.3-72.2,17.5-61.6c-14.1-4-57.2-46.9-67.5-21.2C86.4,30.8,88.2,83.2,91.3,84.1L91.3,84.1z" style="fill: rgb(48, 67, 202); opacity: 1;"></path>
<path class="scroll-morph-end" data-morph="morph-51" fill="#3043CA" d="M92.8,85c15.6,4,27.4,8.5,42.3,12.1c3.1,0.7,4.4-3.9,1.3-4.8c-14.1-4-27.4-8.6-42.3-12.1
C91,79.4,89.7,84.1,92.8,85L92.8,85z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" fill="#3043CA" d="M92.8,85c15.6,4,27.4,8.5,42.3,12.1c3.1,0.7,4.4-3.9,1.3-4.8c-14.1-4-27.4-8.6-42.3-12.1
C91,79.4,89.7,84.1,92.8,85L92.8,85z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" fill="#3043CA" d="M93.6,84.4c15.5,7.8,26.6,9.8,41.6,13.4c3.1,0.7,4.8-6.4,1.6-6.3c-15.2,0.3-27.7-7.1-42.6-10.6
C91,80.1,90.5,83.5,93.6,84.4z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" fill="#3043CA" d="M93.7,84.6c15.5,7.8,24.6,8.2,39.6,11.6c7.4,1.7,6.4-6.1-3.4-6.1c-15.2,0-28.9-6.5-35.3-10.1
C91.8,78.5,90.6,83.7,93.7,84.6z" style="fill: rgb(48, 67, 202);"></path>
<path class="morph-shape-step" fill="#3043CA" d="M92.8,85c15.6,4,27.4,8.5,42.3,12.1c3.1,0.7,4.4-3.9,1.3-4.8c-14.1-4-27.4-8.6-42.3-12.1
C91,79.4,89.7,84.1,92.8,85L92.8,85z" style="fill: rgb(48, 67, 202);"></path>
</g>
</g>
</svg>
<canvas class="scroll-block show" width="212" height="143" style="width: 212px; height: 143px;"></canvas>
</div>
</div>
</body>
</html>
// bower:scss
// endbower
.browserupgrade {
margin: 0.2em 0;
background: #0b1d24;
color: #000;
padding: 0.2em 0;
}
html{
font-size: 62.5%;
}
body {
background: #0b1d24;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
color: #333;
padding:0px;
margin: 0px;
}
.tester{
width:30%;
}
.hidden{
visibility: hidden;
}
//SVG ANIMATION
var svgParent = document.querySelectorAll('.img'); //get all '.img' on page
for(var i = 0; i < svgParent.length; i++) // loop thourgh the '.img' divs
{
var svgElm = svgParent[i].querySelectorAll('svg')[0]; //main svg to render to canvas but maybe not
var wrap = document.createElement('div'); //wrapper for dom context
var svg = svgElm; // the svg to render
var image = new Image(); //img wrapper for svg
var data; // var for svg data
wrap.appendChild(svg.cloneNode(true));
data = 'data:image/svg+xml;base64,' + window.btoa(wrap.innerHTML);
image.src = data; //created img src to use to render to canvas
var svgCanvas = svgParent[i].querySelectorAll('canvas')[0]; //canvas in img tag that will have the context of the svg
var svgMorph= [].slice.call(svgElm.querySelectorAll('.morph')); // all of the child paths that I wish to animate on svg
var svgPath = []; // container for tween path strings
for (var j=0; j < svgMorph.length; j++){ // loop though paths in .morph conatiner
var svgMorphPath = svgMorph[j].children;
for(var k=0; k < svgMorphPath.length; k++){
svgPath.push(svgMorphPath[k].getAttribute('d'));
}
}
runTweenSVG(svgCanvas, image, svgPath); //once I have my svg, canvas to render the svg on, and the paths to animate I should be good?
}
function runTweenSVG(svgCanvas, image, svgPath){
var canvas = svgCanvas;
var context = canvas.getContext('2d');
context.drawImage(image, 0, 0);
var path = {
d: svgPath
};
// all the vars are in but animating them has proven difficult
TweenLite.defaultEase = Power1.easeInOut;
var tl = new TimelineMax({delay:0.5, repeat:-1, yoyo:true, onUpdate:render});
tl.to(path, 2, {d: svgPath[1], stringFilter:MorphSVGPlugin.pathFilter}) // should be in a loop but was just tring to get things to work
.to(path, 2, {d: svgPath[2], stringFilter:MorphSVGPlugin.pathFilter})
.to(path, 2, {d: svgPath[3], stringFilter:MorphSVGPlugin.pathFilter});
function render() { // not sure if I should be doing it like this
context.clearRect(0, 0, 0, 0);
context.fill(new Path2D(path.d));
}
}
Also see: Tab Triggers