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 URLs 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 its URL and the proper URL extension.
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 esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM 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.
<svg id="svg" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="600px" height="600px" viewBox="0 0 600 600" enable-background="new 0 0 600 600" xml:space="preserve">
<g id="scene_1">
<g id="clock">
<path id="face" d="M300,597.249C136.451,597.249,2.751,463.547,2.751,300C2.751,136.451,136.451,2.751,300,2.751
C463.55,2.751,597.249,135.83,597.249,300C597.249,463.547,463.55,597.249,300,597.249z" />
<g id="dots">
<g id="bigdots">
<circle id="dot_11_" fill="#FFFFFF" cx="300" cy="46.281" r="11.194" />
<circle id="dot_10_" fill="#FFFFFF" cx="300" cy="549.987" r="11.194" />
<circle id="dot_9_" fill="#FFFFFF" cx="551.854" cy="298.756" r="11.193" />
<circle id="dot" fill="#FFFFFF" cx="48.146" cy="298.756" r="11.193" />
</g>
<circle id="dot_8_" fill="#FFFFFF" cx="169.41" cy="83.594" r="6.219" />
<circle id="dot_7_" fill="#FFFFFF" cx="430.591" cy="83.594" r="6.219" />
<circle id="dot_6_" fill="#FFFFFF" cx="517.65" cy="170.653" r="6.219" />
<circle id="dot_5_" fill="#FFFFFF" cx="82.35" cy="170.653" r="6.219" />
<circle id="dot_4_" fill="#FFFFFF" cx="169.41" cy="512.676" r="6.218" />
<circle id="dot_3_" fill="#FFFFFF" cx="430.591" cy="512.676" r="6.218" />
<circle id="dot_2_" fill="#FFFFFF" cx="517.65" cy="425.614" r="6.218" />
<circle id="dot_1_" fill="#FFFFFF" cx="82.35" cy="425.614" r="6.218" />
<path id="center" fill="#FFFFFF" d="M300,315.546L300,315.546c-8.706,0-15.546-6.84-15.546-15.546l0,0
c0-8.706,6.84-15.547,15.546-15.547l0,0c8.707,0,15.546,6.841,15.546,15.547l0,0C315.546,308.706,308.707,315.546,300,315.546z" />
</g>
<path id="minhand" fill="#FFFFFF" d="M300,299.262L300,299.262c-1.864,0-3.109-1.244-3.109-3.11V84.721
c0-1.865,1.245-3.11,3.109-3.11l0,0c1.865,0,3.11,1.245,3.11,3.11v211.431C303.11,298.018,301.865,299.262,300,299.262z" />
<path id="hourhand" fill="#FFFFFF" d="M300,299.262L300,299.262c-1.866,0-3.109-1.244-3.109-3.11V153.124
c0-1.863,1.243-3.107,3.109-3.107l0,0c1.867,0,3.11,1.244,3.11,3.107v143.028C303.11,298.018,301.867,299.262,300,299.262z" />
</g>
</g>
<g id="scene_2">
<g id="clipGroup">
<defs>
<path id="face_1_" d="M300,597.249C136.451,597.249,2.751,463.547,2.751,300C2.751,136.451,136.451,2.751,300,2.751
C463.55,2.751,597.249,135.83,597.249,300C597.249,463.547,463.55,597.249,300,597.249z" />
</defs>
<clipPath id="face_3_">
<use xlink:href="#face_1_" overflow="visible" />
</clipPath>
<g id="glasses" clip-path="url(#face_3_)">
<path id="glassR" fill="#FFFFFF" d="M669.056,369H641v-41.542c20-1.752,34.743-18.058,34.724-38.196l-6.797-62.169
c-0.193-1.754-1.563-3.093-3.324-3.093h-55.244c-1.754,0-3.231,1.338-3.433,3.093l-6.689,62.539
c0,19.779,14.764,36.075,34.764,37.826V369h-24.642c-1.905,0-3.452,1.594-3.452,3.5s1.547,3.5,3.452,3.5h58.697
c1.913,0,3.452-1.594,3.452-3.5S670.961,369,669.056,369z M613.452,231h49.063l4.616,41h-58.28L613.452,231z" />
<path id="glassL" fill="#FFFFFF" d="M-6.885,369H-35v-41.542c20-1.752,34.773-18.058,34.753-38.196l-6.782-62.169
c-0.193-1.754-1.549-3.093-3.31-3.093h-55.244c-1.754,0-3.231,1.338-3.433,3.093l-6.719,62.539
c0,19.779,14.734,36.075,34.734,37.826V369h-24.582c-1.905,0-3.452,1.594-3.452,3.5s1.547,3.5,3.452,3.5h58.697
c1.913,0,3.452-1.594,3.452-3.5S-4.979,369-6.885,369z M-62.488,231h49.063l4.617,41h-58.281L-62.488,231z" />
</g>
</g>
</g>
<g id="scene_3">
<g id="letters">
<g>
<defs>
<path id="SVGID_1_" d="M61.232,296.037h15.994v-14.505h5.596v37.08h-5.596v-17.314H61.232v17.314h-5.596v-37.08h5.596V296.037z"
/>
</defs>
<clipPath id="SVGID_2_">
<use xlink:href="#SVGID_1_" overflow="visible"/>
</clipPath>
<polyline clip-path="url(#SVGID_2_)" fill="none" stroke="#000000" stroke-width="11" stroke-miterlimit="10" points="57.5,320
57.5,277.146 58.72,299.021 79.393,298.896 79.917,277.396 79.208,322.573 "/>
</g>
<g>
<defs>
<path id="SVGID_3_" d="M118.409,309.605h-15.875l-4.13,9.006h-6.028l18.348-39.409l17.7,39.409H122.3L118.409,309.605z
M116.127,304.347l-5.499-12.608l-5.764,12.608H116.127z"/>
</defs>
<clipPath id="SVGID_4_">
<use xlink:href="#SVGID_3_" overflow="visible"/>
</clipPath>
<polyline clip-path="url(#SVGID_4_)" fill="none" stroke="#000000" stroke-width="7" stroke-miterlimit="10" points="
93.595,323.323 110.33,286.672 125.885,321.472 95.163,323.174 102.315,306.5 120,306.5 "/>
</g>
<g>
<defs>
<path id="SVGID_5_" d="M143.572,303.555v15.057h-5.596v-37.08h6.341c3.105,0,5.451,0.216,7.036,0.648
c1.601,0.432,3.01,1.249,4.227,2.45c2.129,2.082,3.194,4.707,3.194,7.877c0,3.395-1.137,6.084-3.41,8.069
c-2.273,1.985-5.34,2.979-9.198,2.979H143.572z M143.572,298.367h2.09c5.139,0,7.709-1.977,7.709-5.932
c0-3.827-2.65-5.74-7.949-5.74h-1.85V298.367z"/>
</defs>
<clipPath id="SVGID_6_">
<use xlink:href="#SVGID_5_" overflow="visible"/>
</clipPath>
<polyline clip-path="url(#SVGID_6_)" fill="none" stroke="#000000" stroke-width="10" stroke-miterlimit="10" points="
140.19,321.396 140.69,283.521 152.19,285.396 155.315,292.646 154.44,297.896 148.565,300.771 134.94,300.521 "/>
</g>
<g>
<defs>
<path id="SVGID_7_" d="M174.802,304.305v15.057h-5.596v-37.08h6.341c3.105,0,5.451,0.216,7.036,0.648
c1.601,0.432,3.01,1.249,4.227,2.45c2.129,2.082,3.194,4.707,3.194,7.877c0,3.395-1.137,6.084-3.41,8.069
c-2.273,1.985-5.34,2.979-9.198,2.979H174.802z M174.802,299.117h2.09c5.139,0,7.709-1.977,7.709-5.932
c0-3.827-2.65-5.74-7.949-5.74h-1.85V299.117z"/>
</defs>
<clipPath id="SVGID_8_">
<use xlink:href="#SVGID_7_" overflow="visible"/>
</clipPath>
<polyline clip-path="url(#SVGID_8_)" fill="none" stroke="#000000" stroke-width="10" stroke-miterlimit="10" points="
172.19,320.396 172.69,282.521 184.19,284.396 187.315,291.646 186.44,296.896 180.565,299.771 166.94,299.521 "/>
</g>
<g>
<defs>
<path id="SVGID_9_" d="M208.429,302.594l-12.104-21.062h6.436l8.478,14.818l8.502-14.818h6.436l-12.151,21.062v16.018h-5.596
V302.594z"/>
</defs>
<clipPath id="SVGID_10_">
<use xlink:href="#SVGID_9_" overflow="visible"/>
</clipPath>
<polyline clip-path="url(#SVGID_10_)" fill="none" stroke="#000000" stroke-width="10" stroke-miterlimit="10" points="
210.69,321.771 210.44,301.021 196.94,278.271 211.315,300.271 224.94,277.646 "/>
</g>
<g>
<defs>
<path id="SVGID_11_" d="M255.466,318.611V279.01l27.041,28.291v-25.769h5.596v39.337l-27.041-28.218v25.96H255.466z"/>
</defs>
<clipPath id="SVGID_12_">
<use xlink:href="#SVGID_11_" overflow="visible"/>
</clipPath>
<polyline clip-path="url(#SVGID_12_)" fill="none" stroke="#000000" stroke-width="10" stroke-miterlimit="10" points="
257.606,321.896 257.523,284.563 285.44,317.062 285.523,280.146 "/>
</g>
<g>
<defs>
<path id="SVGID_13_" d="M322.368,286.791h-14.865v8.91h14.434v5.259h-14.434v12.391h14.865v5.26h-20.461v-37.08h20.461V286.791z
"/>
</defs>
<clipPath id="SVGID_14_">
<use xlink:href="#SVGID_13_" overflow="visible"/>
</clipPath>
<polyline clip-path="url(#SVGID_14_)" fill="none" stroke="#000000" stroke-width="10" stroke-miterlimit="10" points="
304.971,283.958 305,321.896 305,283.146 322.846,283.771 298.268,281.646 298.792,298.271 323.429,298.396 297.185,299.146
297.812,316.771 324.517,316.521 "/>
</g>
<g>
<defs>
<path id="SVGID_15_" d="M336.46,281.532l9.654,24.785l10.087-26.586l9.654,26.586l10.255-24.785h6.076l-16.571,39.433
l-9.534-26.272l-9.942,26.298l-15.754-39.458H336.46z"/>
</defs>
<clipPath id="SVGID_16_">
<use xlink:href="#SVGID_15_" overflow="visible"/>
</clipPath>
<polyline clip-path="url(#SVGID_16_)" fill="none" stroke="#000000" stroke-width="10" stroke-miterlimit="10" points="
331.69,278.271 345.315,314.146 355.94,285.146 365.69,315.396 380.565,278.896 "/>
</g>
<g>
<defs>
<path id="SVGID_17_" d="M419.305,302.594l-12.104-21.062h6.436l8.478,14.818l8.502-14.818h6.437L424.9,302.594v16.018h-5.596
V302.594z"/>
</defs>
<clipPath id="SVGID_18_">
<use xlink:href="#SVGID_17_" overflow="visible"/>
</clipPath>
<polyline clip-path="url(#SVGID_18_)" fill="none" stroke="#000000" stroke-width="10" stroke-miterlimit="10" points="
421.69,321.771 421.44,301.021 407.94,278.271 422.315,300.271 435.94,277.646 "/>
</g>
<g>
<defs>
<path id="SVGID_19_" d="M466.707,286.791h-14.866v8.91h14.434v5.259h-14.434v12.391h14.866v5.26h-20.461v-37.08h20.461V286.791z
"/>
</defs>
<clipPath id="SVGID_20_">
<use xlink:href="#SVGID_19_" overflow="visible"/>
</clipPath>
<polyline clip-path="url(#SVGID_20_)" fill="none" stroke="#000000" stroke-width="10" stroke-miterlimit="10" points="
451.971,283.958 452,321.896 452,283.146 469.846,283.771 445.268,281.646 445.792,298.271 470.429,298.396 444.185,299.146
444.812,316.771 471.517,316.521 "/>
</g>
<g>
<defs>
<path id="SVGID_21_" d="M500.756,309.605h-15.874l-4.131,9.006h-6.027l18.348-39.409l17.699,39.409h-6.124L500.756,309.605z
M498.475,304.347l-5.499-12.608l-5.764,12.608H498.475z"/>
</defs>
<clipPath id="SVGID_22_">
<use xlink:href="#SVGID_21_" overflow="visible"/>
</clipPath>
<polyline clip-path="url(#SVGID_22_)" fill="none" stroke="#000000" stroke-width="7" stroke-miterlimit="10" points="
475.596,323.323 492.33,286.672 507.886,321.472 477.163,323.174 484.315,306.5 502,306.5 "/>
</g>
<g>
<defs>
<path id="SVGID_23_" d="M532.884,302.81l11.479,15.802h-6.845l-10.591-15.178h-1.009v15.178h-5.595v-37.08h6.556
c4.899,0,8.438,0.921,10.615,2.762c2.401,2.05,3.603,4.755,3.603,8.117c0,2.626-0.753,4.884-2.258,6.772
C537.335,301.072,535.35,302.281,532.884,302.81z M525.919,298.559h1.777c5.3,0,7.949-2.025,7.949-6.076
c0-3.794-2.578-5.692-7.732-5.692h-1.994V298.559z"/>
</defs>
<clipPath id="SVGID_24_">
<use xlink:href="#SVGID_23_" overflow="visible"/>
</clipPath>
<polyline clip-path="url(#SVGID_24_)" fill="none" stroke="#000000" stroke-width="10" stroke-miterlimit="10" points="
523.19,322.396 523.69,284.521 535.19,286.396 538.315,293.646 537.44,298.896 531.565,301.771 517.94,301.521 531.148,303.271
541.357,320.312 "/>
</g>
</g>
<g id="lines">
<line fill="#FFFFFF" stroke="#000000" stroke-width="3" stroke-miterlimit="10" x1="14" y1="260.5" x2="587" y2="260.5"/>
<line fill="#FFFFFF" stroke="#000000" stroke-width="3" stroke-miterlimit="10" x1="14" y1="340.5" x2="587" y2="340.5"/>
</g>
<g id="yearclip">
<defs>
<path id="SVGID_25_" d="M301,127C138.628,127,7,206.693,7,305s131.628,178,294,178c162.372,0,294-79.693,294-178
S463.372,127,301,127z M587,342H14v-82h573V342z"/>
</defs>
<clipPath id="SVGID_26_">
<use xlink:href="#SVGID_25_" overflow="visible"/>
</clipPath>
<g id="year" clip-path="url(#SVGID_26_)">
<g id="twenty">
<path d="M250.117,247.542h34.334v13.077h-61.92l32.005-38.752c3.145-3.861,5.781-7.205,7.911-10.032
c2.13-2.826,3.752-5.195,4.867-7.105c2.269-3.741,3.403-7.105,3.403-10.091c0-4.299-1.514-7.901-4.538-10.808
c-3.025-2.905-6.768-4.359-11.226-4.359c-9.315,0-14.649,5.514-16.003,16.54h-13.853c2.229-19.426,12.041-29.139,29.438-29.139
c8.398,0,15.444,2.667,21.138,8.001c5.732,5.335,8.599,11.942,8.599,19.824c0,5.016-1.335,9.933-4.001,14.749
c-1.354,2.508-3.334,5.484-5.941,8.927c-2.607,3.444-5.902,7.514-9.882,12.211L250.117,247.542z"/>
<path d="M312.384,213.924c0-14.688,3.424-26.412,10.271-35.169c6.13-7.921,13.555-11.883,22.272-11.883
s16.142,3.961,22.272,11.883c6.846,8.758,10.27,20.68,10.27,35.767c0,15.047-3.424,26.95-10.27,35.708
c-6.131,7.922-13.535,11.882-22.213,11.882c-8.679,0-16.122-3.96-22.332-11.882C315.808,241.471,312.384,229.37,312.384,213.924
z M326.117,213.984c0,10.231,1.769,18.729,5.307,25.497c3.537,6.648,8.048,9.972,13.532,9.972c5.445,0,9.956-3.323,13.533-9.972
c3.577-6.607,5.366-14.947,5.366-25.019c0-10.071-1.789-18.43-5.366-25.079c-3.577-6.607-8.088-9.912-13.533-9.912
c-5.405,0-9.896,3.305-13.473,9.912C327.906,195.951,326.117,204.152,326.117,213.984z"/>
</g>
<g id="sixteen">
<path d="M250.466,349.967h-15.942l7.643-13.076h22.213v92.193h-13.913V349.967z"/>
<path d="M342.29,333.666l10.211,7.643l-22.034,29.975c1.194-0.158,2.21-0.277,3.046-0.357s1.492-0.119,1.97-0.119
c7.484,0,13.952,2.865,19.406,8.598c5.413,5.654,8.121,12.461,8.121,20.422c0,8.439-3.025,15.684-9.076,21.734
c-6.011,6.012-13.236,9.018-21.675,9.018c-8.359,0-15.685-2.967-21.974-8.898c-6.171-5.93-9.256-12.957-9.256-21.078
c0-7.283,3.006-15.006,9.017-23.168L342.29,333.666z M349.455,400.723c0-4.896-1.692-9.037-5.075-12.42
c-3.424-3.424-7.544-5.137-12.36-5.137c-4.857,0-8.978,1.693-12.36,5.076c-3.384,3.385-5.075,7.484-5.075,12.301
s1.691,8.918,5.075,12.301c3.383,3.383,7.523,5.074,12.42,5.074c4.777,0,8.857-1.691,12.241-5.074
C347.743,409.42,349.455,405.379,349.455,400.723z"/>
</g>
</g>
</g>
</g>
</svg>
<div id="slider"></div>
<button class="play button">Replay?</button>
body {
margin:0;
background: #ffa266;
}
svg {
display: block;
margin: auto;
width:80vw;
transform: translate(-50%, -50%);
position: absolute;
top: 50%;
left: 50%;
}
#slider {
width:420px;
margin:20px auto;
}
#slider {
display: none;
}
/* Custom */
#face, #dots circle, #clock {
transform-origin: 0%;
}
#minhand, #hourhand {
transform-origin: 100%;
}
.play {
padding: 1.25rem 2rem;
text-transform: uppercase;
background: white;
box-shadow: none;
border: none;
font-family: 'futura', sans-serif;
letter-spacing: 0.2rem;
left: 50%;
bottom: 50px;
position: absolute;
transform: translateX(-50%);
opacity: 0;
outline: none;
&:hover, &:focus {
background: black;
color: white;
}
}
var primColor = '#fff',
secColor = '#000'
var bgColor = $('body').css('background');
var scene1 = [
$dots = $('#dots circle'),
$center = $('#center'),
$bigdots = $('#bigdots circle'),
$minhand = $('#minhand'),
$hourhand = $('#hourhand'),
$face = $('#face')
],
$scene2 = $('#scene_2'),
scene2 = [
$clipGroup = $('#clipGroup'),
$glassR = $('#glassR'),
$glassL = $('#glassL')
],
$scene3 = $('#scene_3'),
scene3 = [
$letters = $('#letters g > polyline, #letters g > path'),
$twenty = $('#twenty'),
$sixteen = $('#sixteen'),
$lines = $('#lines line')
];
var tl = new TimelineMax({
// repeat: -1,
onUpdate: updateSlider
});
tl
// Scene 1
// setup
.set([$dots, $face, $center, $glassL, $glassR], {
transformOrigin: '50% 50%'
})
.set([$minhand, $hourhand, $twenty], {
transformOrigin: '50% 100%'
})
.set([$sixteen], {
transformOrigin: '50% 0%'
})
.set([$face], {
scale: 0
})
.set([$dots, $minhand, $hourhand], {
scaleX: 0,
display: 'block'
})
.set([$scene2, $scene3], {
display: 'block',
opacity: 0
})
// Begin
.add('start')
.from('#svg', 0.5, { y: 200, opacity: 0 }, 'start')
.to($face, 0.3, {
scale: 1
}, 'start')
.staggerTo($dots, 0.1, {
scale: 1
}, 0.05, 'start+=0.2')
.add('minhandIn', 'start')
.to([$minhand], 0.8, {
scaleX: 1,
rotation: 702
}, 'minhandIn')
.to($minhand, 0.5, {
rotation: '+=6',
ease: Elastic.easeOut.config(0.5, 0.2)
}, '+=0')
.to($minhand, 0.5, {
rotation: '+=6',
ease: Elastic.easeOut.config(0.5, 0.2)
}, '+=0.5')
.to($minhand, 0.5, {
rotation: '+=6',
ease: Elastic.easeOut.config(0.5, 0.2)
}, '+=0.5')
.add('hourhandIn', 'minhandIn-=1')
.to([$hourhand], 0.2, {
scaleX: 1
}, 'hourhandIn')
.to([$hourhand], 0.8, {
rotation: 715
}, 'hourhandIn')
.to([$hourhand], 3.5, {
scaleX: 1,
rotation: '+=5'
}, 'hourhandIn+=1')
// Start Champaign Scene
.add('scene2-start', '-=0.6')
.set([$minhand, $hourhand], {
display:'none'
})
.set($scene2, {
opacity: 1
})
.to($dots, 0.02, {
strokeWidth: '10px',
fill: 'transparent',
stroke: primColor
}, 'scene2-start')
.staggerTo($dots, 0.1, {
strokeWidth: '0px'
}, 0.05, 'scene2-start+=0.1')
.to($center, 0.1, { scale: 0 })
.set($center, { y: -50, fill: bgColor, zIndex: 99999 })
.add('glassesIn')
.to($glassL, 0.3, { x: '250', ease: Power4.easeOut }, 'glassesIn')
.to($glassR, 0.3, { x: '-250', ease: Power4.easeOut }, 'glassesIn')
.to($glassL, 0.5, { x: '-=50', rotation: 25, ease: Power4.easeInOut }, 'glassesIn+=0.38')
.to($glassR, 0.5, { x: '+=50', rotation: -25, ease: Power4.easeInOut }, 'glassesIn+=0.38')
.add('glassesCollide')
.to($glassL, 0.5, { x: '+=80', ease: Power4.easeIn }, 'glassesCollide')
.to($glassR, 0.5, { x: '-=80', ease: Power4.easeIn }, 'glassesCollide')
.to($center, 0.2, { scale: 20, y: 0 })
.set($glassL, { display: 'none', x: 0, y: 0 }, '-=0.2')
.set($glassR, { display: 'none', x: 0, y: 0 }, '-=0.2')
// Happy New Year Message
.add('lines')
.set($scene3, { opacity: 1 }, 'lines')
.set([$twenty, $sixteen], { scale: 0.7 }, 'lines')
.add('message')
.staggerFrom($letters, 1, { drawSVG: '0%' }, 0.05, 'message')
.from([$lines], 0.3, {
drawSVG: '0% 0%'
}, 'message')
.fromTo($twenty, 0.5, { y: '60%', x: '60%'}, { y: '0%', x: '-50%' },'message+=0.2')
.fromTo($sixteen, 0.5, { y: '-60%', x: '-60%'}, { y: '0%', x: '50%' },'message+=0.2')
.to('.play', 0.2, { y: -20, opacity: 1});
/* controls */
$("#slider").slider({
range: false,
min: 0,
max: 1,
step: .001,
slide: function(event, ui) {
tl.progress(ui.value).pause();
},
stop: function() {
tl.play();
}
});
function updateSlider() {
$("#slider").slider("value", tl.progress());
}
$('.play').click(function() {
tl.progress(0).play();
});
Also see: Tab Triggers