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.
<header>
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/128542/avatar.jpg" alt="Profile photo of Darin Senneff" />
<h1>Home</h1>
<div id="hamburger"><div></div></div>
</header>
<main>
<section id="refresh-container">
<div class="refresh-content">
<p class="refresh-status">Pull to Re-Flesh!</p>
<p class="refresh-refreshing">Re-fleshing</p>
<div id="svg-wrapper">
<div>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 130 274.5">
<defs>
<linearGradient id="gradient-1" x1="54.8345" x2="74.8345" y1="92.9124" y2="92.9124" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="#e6e6e6"/>
<stop offset="1" stop-color="#fff"/>
</linearGradient>
<linearGradient id="gradient-2" x1="77.6923" x2="105.9766" y1="58.8579" y2="87.1421" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="#e6e6e6"/>
<stop offset="1" stop-color="#fff"/>
</linearGradient>
<linearGradient id="gradient-3" x1="25.6923" x2="53.9766" y1="58.8579" y2="87.1421" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="#e6e6e6"/>
<stop offset="1" stop-color="#fff"/>
</linearGradient>
<clipPath id="mouth-clip-path">
<path d="M72.8 147.1h-16c-11 0-20-9-20-20v-12h56v12c0 11.1-8.9 20-20 20z"/>
</clipPath>
<clipPath id="mouth-clip-path-2">
<path fill="none" d="M64.88 121.71c-9.15 0-18.49-3-27.79-9.12A12 12 0 0 1 50.23 92.5c10.38 6.79 18.63 6.9 27.6.35A12 12 0 1 1 92 112.24c-8.67 6.31-17.79 9.47-27.12 9.47z"/>
</clipPath>
</defs>
<g class="guides" style="visibility: hidden;">
<path class="guide-arm-R" fill="#222" stroke="none" stroke-width="2" d="M125 196.7c2.8 0 5-2.2 5-5s-2.2-5-5-5v-30.3c0-2.8-2.2-5-5-5s-5 2.2-5 5v30.3c-2.8 0-5 2.2-5 5s2.2 5 5 5V223c-2.2 1.5-3.7 4.1-3.7 7v5.7c0 4.7 3.8 8.5 8.5 8.4 4.7 0 8.5-3.8 8.4-8.5v-5.7c0-2.7-1.3-5.1-3.3-6.7v-26.5z"/>
<path class="guide-leg-R" fill="#222" stroke="none" stroke-width="2" d="M104.8 259.5h-8v-20.8h.2c2.8 0 5-2.2 5-5s-2.2-5-5-5h-.2v-26c0-2.8-2.2-5-5-5s-5 2.2-5 5v26c-2.7.1-4.8 2.3-4.8 5s2.2 4.9 4.8 5v30.7c0 2.8 2.2 5 5 5 .2 0 .4 0 .7-.1.6.1 1.2.2 1.8.2h19.5c1.7 0 3-1.3 3-3 0-6.6-5.3-12-12-12z"/>
<path class="guide-leg-L" fill="#222" stroke="none" stroke-width="2" d="M43 228.7h-.2v-26c0-2.8-2.2-5-5-5s-5 2.2-5 5v26c-2.7.1-4.8 2.3-4.8 5s2.2 4.9 4.8 5v20.8h-8c-6.6 0-12 5.4-12 12 0 1.7 1.3 3 3 3h19.5c.6 0 1.2-.1 1.8-.2.2 0 .4.1.7.1 2.8 0 5-2.2 5-5v-30.7h.2c2.8 0 5-2.2 5-5s-2.2-5-5-5z"/>
<path class="guide-arm-L" fill="#222" stroke="none" stroke-width="2" d="M15 196.7c2.8 0 5-2.2 5-5s-2.2-5-5-5v-30.3c0-2.8-2.2-5-5-5s-5 2.2-5 5v30.3c-2.8 0-5 2.2-5 5s2.2 5 5 5V223c-2.2 1.5-3.7 4.1-3.7 7v5.7c0 4.7 3.8 8.5 8.5 8.4 4.7 0 8.5-3.8 8.4-8.5v-5.7c0-2.7-1.3-5.1-3.3-6.7v-26.5z"/>
</g>
<g class="spine-pelvis">
<path fill="none" stroke="#FFF" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="10" d="M64.8 114.7v89.6"/>
<path fill="none" stroke="#FFF" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="10" d="M99.8 184.8s-35.5-4.1-28.6 22.1"/>
<path fill="none" stroke="#FFF" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="10" d="M29.8 184.8s35.5-4.1 28.6 22.1"/>
</g>
<g class="ribs">
<path fill="none" stroke="#6f6a72" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="14" d="M48.1 178.4c-14.3 0-25.8-4.4-25.8-9.7"/>
<path fill="none" stroke="#6f6a72" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="14" d="M48.1 165.5c-14.3 0-25.8-4.4-25.8-9.7"/>
<path fill="none" stroke="#6f6a72" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="14" d="M48.1 152.6c-14.3 0-25.8-4.4-25.8-9.7"/>
<path fill="none" stroke="#6f6a72" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="14" d="M80.5 178.4c14.3 0 25.8-4.4 25.8-9.7"/>
<path fill="none" stroke="#6f6a72" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="14" d="M80.5 165.5c14.3 0 25.8-4.4 25.8-9.7"/>
<path fill="none" stroke="#6f6a72" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="14" d="M80.5 152.6c14.3 0 25.8-4.4 25.8-9.7"/>
<path fill="none" stroke="#FFF" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="8" d="M48.1 178.4c-14.3 0-25.8-4.4-25.8-9.7"/>
<path fill="none" stroke="#FFF" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="8" d="M48.1 165.5c-14.3 0-25.8-4.4-25.8-9.7"/>
<path fill="none" stroke="#FFF" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="8" d="M48.1 152.6c-14.3 0-25.8-4.4-25.8-9.7"/>
<path fill="none" stroke="#FFF" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="8" d="M80.5 178.4c14.3 0 25.8-4.4 25.8-9.7"/>
<path fill="none" stroke="#FFF" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="8" d="M80.5 165.5c14.3 0 25.8-4.4 25.8-9.7"/>
<path fill="none" stroke="#FFF" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="8" d="M80.5 152.6c14.3 0 25.8-4.4 25.8-9.7"/>
</g>
<path class="shoulder" fill="none" stroke="#FFF" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="10" d="M119.8 143.3S96.7 123 64.8 123s-55 20.3-55 20.3"/>
<g class="arm-R">
<path fill="#FFF" d="M120 228c-2.8 0-5-2.2-5-5v-66.7c0-2.8 2.2-5 5-5s5 2.2 5 5V223c0 2.8-2.2 5-5 5z"/>
<path fill="#FFF" d="M125 196.7h-10c-2.8 0-5-2.2-5-5s2.2-5 5-5h10c2.8 0 5 2.2 5 5s-2.2 5-5 5z"/>
<path fill="#FFF" d="M119.8 221.5c4.7 0 8.5 3.8 8.5 8.4v5.7c0 4.7-3.8 8.5-8.4 8.5-4.7 0-8.5-3.8-8.5-8.4V230c-.1-4.7 3.7-8.5 8.4-8.5z"/>
</g>
<g class="arm-L">
<path fill="#FFF" d="M10 228c-2.8 0-5-2.2-5-5v-66.7c0-2.8 2.2-5 5-5s5 2.2 5 5V223c0 2.8-2.2 5-5 5z"/>
<path fill="#FFF" d="M15 196.7H5c-2.8 0-5-2.2-5-5s2.2-5 5-5h10c2.8 0 5 2.2 5 5s-2.2 5-5 5z"/>
<path fill="#FFF" d="M9.8 221.5c4.7 0 8.5 3.8 8.5 8.4v5.7c0 4.7-3.8 8.5-8.4 8.5-4.7 0-8.5-3.8-8.5-8.4V230c-.1-4.7 3.7-8.5 8.4-8.5z"/>
</g>
<g class="leg-R">
<path fill="#FFF" d="M91.8 274.3c-2.8 0-5-2.2-5-5v-66.7c0-2.8 2.2-5 5-5s5 2.2 5 5v66.7c0 2.8-2.2 5-5 5z"/>
<path fill="#FFF" d="M97 238.7H87c-2.8 0-5-2.2-5-5s2.2-5 5-5h10c2.8 0 5 2.2 5 5s-2.2 5-5 5z"/>
<path class="foot" fill="#FFF" d="M113.8 274.5H94.3c-4.1 0-7.5-3.4-7.5-7.5s3.4-7.5 7.5-7.5h10.5c6.6 0 12 5.4 12 12 0 1.7-1.3 3-3 3z"/>
</g>
<g class="leg-L">
<path fill="#FFF" d="M37.8 274.3c-2.8 0-5-2.2-5-5v-66.7c0-2.8 2.2-5 5-5s5 2.2 5 5v66.7c0 2.8-2.2 5-5 5z"/>
<path fill="#FFF" d="M43 238.7H33c-2.8 0-5-2.2-5-5s2.2-5 5-5h10c2.8 0 5 2.2 5 5s-2.2 5-5 5z"/>
<path class="foot" fill="#FFF" d="M15.8 274.5h19.5c4.1 0 7.5-3.4 7.5-7.5s-3.4-7.5-7.5-7.5H24.8c-6.6 0-12 5.4-12 12 0 1.7 1.4 3 3 3z"/>
</g>
<g class="head">
<path class="teeth-top-bg" fill="#6f6a72" d="M87,136.5H43c-4.4,0-8-3.6-8-8v-16h60v16C95,132.9,91.4,136.5,87,136.5z"/>
<path class="jaw" fill="none" stroke="#FFF" stroke-miterlimit="10" stroke-width="6" d="M72.8 147.1h-16c-11 0-20-9-20-20v-12h56v12c0 11.1-8.9 20-20 20z"/>
<path class="skull" fill="#FFF" stroke="#6f6a72" stroke-width="0" d="M110.6 120.5H19.1c-7.9 0-14.2-6.4-14.2-14.2V60.5c0-33.1 26.9-60 60-60s60 26.9 60 60v45.8c-.1 7.8-6.4 14.2-14.3 14.2z"/>
<path fill="none" stroke="#E6E6E6" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="7.2" d="M15.6 49c5.1-19.2 14.4-31.4 36-38.4"/>
<path fill="none" stroke="#E6E6E6" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4.8" d="M119.7 97.7c0 9.4-7.7 17.1-17.1 17.1"/>
<g class="mouth">
<g class="teeth-bottom" clip-path="url(#mouth-clip-path)">
<path class="tooth-bottom" fill="#FFF" d="M46.3 139h-2c-2.2 0-4 1.8-4 4v4h10v-4c0-2.2-1.8-4-4-4z"/>
<path class="tooth-bottom" fill="#FFF" d="M59.3 139h-2c-2.2 0-4 1.8-4 4v4h10v-4c0-2.2-1.8-4-4-4z"/>
<path class="tooth-bottom" fill="#FFF" d="M72.3 139h-2c-2.2 0-4 1.8-4 4v4h10v-4c0-2.2-1.8-4-4-4z"/>
<path class="tooth-bottom" fill="#FFF" d="M85.3 139h-2c-2.2 0-4 1.8-4 4v4h10v-4c0-2.2-1.8-4-4-4z"/>
</g>
<path class="tooth-top tooth-top-1" fill="#FFF" d="M46.3 125.5h-2c-2.2 0-4-1.8-4-4v-14h10v14c0 2.2-1.8 4-4 4z" clip-path="url(#e)"/>
<path class="tooth-top tooth-top-2" fill="#FFF" d="M59.3 130.5h-2c-2.2 0-4-1.8-4-4v-14h10v14c0 2.2-1.8 4-4 4z" clip-path="url(#e)"/>
<path class="tooth-top tooth-top-3" fill="#FFF" d="M72.3 130.5h-2c-2.2 0-4-1.8-4-4v-14h10v14c0 2.2-1.8 4-4 4z" clip-path="url(#e)"/>
<path class="tooth-top tooth-top-4" fill="#FFF" d="M85.3 125.5h-2c-2.2 0-4-1.8-4-4v-14h10v14c0 2.2-1.8 4-4 4z" clip-path="url(#e)"/>
</g>
<path class="nose" fill="#6f6a72" stroke="url(#gradient-1)" stroke-miterlimit="10" stroke-width="2" d="M56.5 94.2l4.8-7.2c1.7-2.5 5.3-2.5 6.9 0l4.8 7.2c1.8 2.8-.1 6.5-3.5 6.5H60c-3.3 0-5.3-3.7-3.5-6.5z"/>
<circle class="eye-R" cx="91.8" cy="73" r="18" fill="#6f6a72" stroke="url(#gradient-2)" stroke-miterlimit="10" stroke-width="4"/>
<circle class="eye-L" cx="39.8" cy="73" r="18" fill="#6f6a72" stroke="url(#gradient-3)" stroke-miterlimit="10" stroke-width="4"/>
</g>
<g class="flesh-hair-back">
<path class="flesh-hair flesh-hair-2" fill="#631809" d="M-9.68 8.93c7.7-16.8 38.55-39.4 77.21-39.4 24 0 49.56 9.81 66.65 32 34 44.19 16.64 157.92 16.64 157.92l-168.75 1.65C-20 129.24-33.77 61.43-9.68 8.93z"/>
<path class="flesh-hair flesh-hair-3" fill="#eae54e" d="M120.26 155.69l24.13-6C143.1 104.84 114.61 69.55 89.2 39L77.5 61.48c23.5 17.45 39.5 57.06 42.76 94.21z"/>
</g>
<path class="flesh-neck flesh-stroke" fill="none" stroke="#CF9E76" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="30" d="M65 168.7v-55.2"/>
<g class="flesh-head">
<path style="visibility: hidden;" class="flesh-ear flesh-ear-L flesh-secondary" fill="#ba8e6a" d="M1 78.93a14 14 0 0 1-14-14V58.8a6.87 6.87 0 0 1 6.87-6.87H1v27z"/>
<path style="visibility: hidden;" class="flesh-ear flesh-ear-R flesh-secondary" fill="#ba8e6a" d="M129 51.93h7.13A6.87 6.87 0 0 1 143 58.8v6.13a14 14 0 0 1-14 14v-27z"/>
<g style="visibility: hidden;" class="flesh-face">
<path class="flesh-fill" fill="#cf9e76" d="M65-28a65 65 0 0 1 65 65v40a50 50 0 0 1-50 50H50A50 50 0 0 1 0 77V37a65 65 0 0 1 65-65z"/>
<g class="flesh-hair-front">
<g class="flesh-hair flesh-hair-1">
<path fill="#42210b" d="M137 29.73c-4.22-33.55-34.27-58.62-64.75-58.62-18.94 0-21.15 8.45-33 21.44C112.5-9.66 95.06 45.33 137 29.73z"/>
<path fill="#42210b" d="M-15.72 32.61A82 82 0 0 1 64-30.16c24 0 47.16 10 60.32 30.62C98.28 64.22 24.13 46.71-15.72 32.61z"/>
<path fill="#42210b" d="M121 19h9v45h-9z"/>
<path fill="#42210b" d="M0 19h9v45H0z"/>
</g>
<path class="flesh-hair flesh-hair-2" fill="#631809" d="M137.57 29.43C134 1 111.81-21.4 86.55-27.52a82.13 82.13 0 0 0-22-2.95 82 82 0 0 0-79.7 62.78C-10.36 34-5.07 35.75.57 37.39V63.7h5V38.8c33.1 9 76.22 13.36 103.15-13.66 4.53 4.45 9.44 7.4 16.85 7V63.7h5V31.51a51.68 51.68 0 0 0 7-2.08z"/>
<path class="flesh-hair flesh-hair-3" fill="#eae54e" d="M130.15 30.3a33.26 33.26 0 0 0 7 1.13c-3.58-28.47-25.76-50.82-51-56.94-.59-.17-1.18-.32-1.77-.47a19.66 19.66 0 0 0 .54-4.5 19.75 19.75 0 0 0-19.77-19.75A19.75 19.75 0 0 0 45.4-30.48a20.17 20.17 0 0 0 .39 3.91C16.53-20.28-4 1.43-4 34.22H.15V65.7L6.48 34C71 31.57 73.1 6.41 88.61-1.41 105.05 6.3 111 19.83 122.39 26.9l7.76 38.8z"/>
<path class="flesh-hair flesh-hair-4" d="M129.22 26.74c0-.24-.07-.48-.11-.72q-.17-1-.36-1.95c-.06-.3-.11-.6-.18-.9-.17-.79-.35-1.57-.54-2.35-.11-.45-.24-.88-.36-1.32l-.21-.8A65 65 0 0 0 65-28.3a65 65 0 0 0-62.45 47l-.21.8c-.12.44-.25.87-.36 1.32-.19.78-.37 1.56-.54 2.35-.07.3-.12.6-.18.9Q1.06 25 .89 26c0 .24-.07.48-.11.72A64.05 64.05 0 0 0 0 36.7v23h6V25c40.67-30.86 80-29.89 118-.13V59.7h6v-23a64.05 64.05 0 0 0-.78-9.96z"/>
</g>
</g>
<path style="visibility: hidden;" class="flesh-nose" fill="none" stroke="#ba8e6a" stroke-linecap="round" stroke-linejoin="round" stroke-width="15" d="M64.78 67.34v6.58"/>
<circle style="visibility: hidden;" class="flesh-eye" cx="39.78" cy="50.93" r="5"/>
<circle style="visibility: hidden;" class="flesh-eye" cx="91.78" cy="50.93" r="5"/>
<g style="visibility: hidden;" class="flesh-mouth">
<path fill="none" stroke="#231f20" stroke-linecap="round" stroke-linejoin="round" stroke-width="24" d="M43.66 102.55c14.11 9.23 27.88 9.75 41.24 0"/>
<g clip-path="url(#mouth-clip-path-2)">
<path fill="#fff" d="M122.43 71.61S106.17 101.74 65 101.74 7.57 71.61 7.57 71.61v-4.93h114.86z"/>
<ellipse cx="64.54" cy="132.52" fill="#9e005d" rx="27.58" ry="18.98"/>
</g>
</g>
</g>
<g class="flesh-arm-L">
<path class="hand flesh-fill" fill="#CF9E76" d="M18.6,243.5L18.6,243.5c-10.1-0.1-18.4,8.1-18.5,18.2L0,274.2c-0.1,10.1,8.1,18.4,18.2,18.5h0 c10.1,0.1,18.4-8.1,18.5-18.2l0.1-12.4C36.9,251.9,28.7,243.6,18.6,243.5z"/>
<line class="arm flesh-stroke" fill="none" stroke="#CF9E76" stroke-width="30" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="18.6" y1="162" x2="18.4" y2="258.7"/>
</g>
<g class="flesh-arm-R">
<path class="hand flesh-fill" fill="#CF9E76" d="M111.8,243.5L111.8,243.5c-10.1-0.1-18.4,8.1-18.5,18.2l-0.1,12.4c-0.1,10.1,8.1,18.4,18.2,18.5h0 c10.1,0.1,18.4-8.1,18.5-18.2L130,262C130.1,251.9,121.9,243.6,111.8,243.5z"/>
<line class="arm flesh-stroke" fill="none" stroke="#CF9E76" stroke-width="30" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="111.8" y1="162" x2="111.6" y2="258.7"/>
</g>
<g class="flesh-leg-L">
<line class="leg flesh-stroke" fill="none" stroke="#CF9E76" stroke-width="30" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="38.3" y1="192.5" x2="38.5" y2="259.2"/>
<path class="foot flesh-fill" fill="#CF9E76" d="M3.8,274.5l40.7-0.1c5,0,9-4.1,9-9l0-8.7c0-5-4.1-9-9-9l-21.5,0.1C10.2,247.7,0,258,0,270.7l0,0 C0,272.8,1.7,274.5,3.8,274.5z"/>
</g>
<g class="flesh-leg-R">
<line class="leg flesh-stroke" fill="none" stroke="#CF9E76" stroke-width="30" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="91.7" y1="192.5" x2="91.5" y2="259.2"/>
<path class="foot flesh-fill" fill="#CF9E76" d="M126.2,274.5l-40.7-0.1c-5,0-9-4.1-9-9l0-8.7c0-5,4.1-9,9-9l21.5,0.1c12.7,0,22.9,10.3,22.9,23v0 C130,272.8,128.3,274.5,126.2,274.5z"/>
</g>
<g class="flesh-body">
<path class="flesh-fill" fill="#CF9E76" d="M122.5,201.6V137c0-5.5-4.5-10-10-10H17.5c-5.5,0-10,4.5-10,10v64.6"/>
<path fill="#FFF" d="M7.5 199.2v11.6c0 6.3 6.4 11.4 14.3 11.4h86.4c7.9 0 14.3-5.1 14.3-11.4v-11.6H7.5z"/>
<path fill="#9E005D" d="M42.7 209.3c-.2-4.2-6.6-5.1-7.6-.8-.8 3.5 1.4 7.2 5.2 11.5 5.3-2.3 8.8-4.7 9.6-8.2.9-4.2-5.3-6.2-7.2-2.5zM77.4 205.3c1.3-4-4.3-7.1-6.7-3.5-2 2.9-1.4 7.2.5 12.6 5.7-.1 9.9-1.1 11.9-4 2.5-3.7-2.5-7.9-5.7-5.1zM91.5 219.5c-1.5-3.9-7.9-2.7-7.4 1.6 0 .4.1.7.2 1h14.6c.2-.8.3-1.7.2-2.5-.4-4.3-6.9-4.2-7.6-.1zM59.8 199.2h-3.2c.5.4 1.1.8 1.7 1.2l1.5-1.2zM107.1 199.5c-.2-.1-.3-.2-.5-.2h-2.8c-2.2.9-3.6 3.9-1.6 6.1 2.4 2.6 6.7 2.9 12.4 2.2.6-3.2.9-6 .5-8.3H107c.1 0 .1.1.1.2zM27.4 199.2H12.9c-.4.8-.4 1.7 0 2.7 1.3 3.3 5.2 5.2 10.7 6.7 2.2-3.5 3.7-6.7 3.8-9.4z"/>
<g class="flesh-bra" style="visibility: visible;">
<path fill="#FFF" d="M122.5 164h-5c-.5-6.2-5.7-11-11.9-11h-2.3v-26h-5v26h-4.7c-6.3 0-11.4 4.8-11.9 11H48.4c-.5-6.2-5.7-11-11.9-11h-2.7v-26h-5v26h-4.3c-6.3 0-11.4 4.8-11.9 11H7.5v5h5.2c1 5.7 5.9 10 11.8 10h12c5.9 0 10.9-4.3 11.8-10h33.4c1 5.7 5.9 10 11.8 10h12c5.9 0 10.9-4.3 11.8-10h5.1v-5z"/>
<path fill="#9E005D" d="M104.1 177c-2.2-1.3-4.7 0-5.6 2h7c2.5 0 4.7-.7 6.6-2-.2-1.8-.8-3.3-1.9-4.5-2.9-3.2-8.1.8-6.1 4.5zM87.1 168.7c-.6-4.3-7.1-4-7.6.2-1.4-3.2-6-2.7-7.1.1h9.3c.4 2.5 1.6 4.7 3.3 6.4 1.6-2.3 2.4-4.5 2.1-6.7zM45.8 167.4c-3.7-2.3-7.7 2.8-4.8 5.9-3.4-1-6.1 3-4.5 5.6 5.6 0 10.3-3.8 11.6-9-.6-1-1.4-1.9-2.3-2.5zM21.8 165.7c-.9-4.1-7.3-4-7.6.4-.2 3.5 2.5 6.9 6.9 10.5 4.8-3.1 8-6 8.2-9.6.3-4.3-6.1-5.3-7.5-1.3zM102.7 161.6c4.3-1.1 3.2-7.5-1-7.5.8-.5 1.3-1.2 1.6-1.9v-2.7c-.6-1.7-2.2-3-4.4-2.5-.2.1-.4.1-.6.2v5.8h-5.5c-.6 1.1-1.2 2.4-1.7 3.8 4.4 3.7 8.2 5.7 11.6 4.8zM32.1 147c-.7 3.5 1.6 7.1 5.5 11.3 2.2-1 4.1-2.1 5.6-3.2-1.9-1.3-4.2-2.1-6.8-2.1h-2.7v-8.4c-.7.4-1.3 1.2-1.6 2.4z"/>
</g>
</g>
</svg>
</div>
</div>
</div>
</section>
<section id="content">
<div>
<h2>fdsfdsfsdfsdfdfsdf</h2>
<p>jfksdjfkljdslfsjjfksdjflksjfksdfkfsdlfjsdlffksdlfddsjdlffjfwefwefwefwesdlfsdjfdslfsdfsdfsdfsdfdsfsdfdsfsdfsdjfksdjfkljdslfsjjfksdjflksjfksdfkfsdlfjsdlffksdlfdd</p>
</div>
<div>
<h2>fdsfdsfsdfsdfdfsdf</h2>
<p>jfksdjfkljdslfsjjfksdjflksjfksdfkfsdlfjsdlffksdlfddsjdlffjfwefwefwefwesdlfsdjfdslfsdfsdfsdfsdfdsfsdfdsfsdfsdjfksdjfkljdslfsjjfksdjflksjfksdfkfsdlfjsdlffksdlfdd</p>
</div>
<div>
<h2>fdsfdsfsdfsdfdfsdf</h2>
<p>jfksdjfkljdslfsjjfksdjflksjfksdfkfsdlfjsdlffksdlfddsjdlffjfwefwefwefwesdlfsdjfdslfsdfsdfsdfsdfdsfsdfdsfsdfsdjfksdjfkljdslfsjjfksdjflksjfksdfkfsdlfjsdlffksdlfdd</p>
</div>
</section>
</main>
@import url('https://rsms.me/inter/inter-ui.css');
@font-face {
font-family: 'BLOKKRegular';
src: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/128542/BLOKKRegular.woff2') format('woff2'),
url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/128542/BLOKKRegular.woff') format('woff');
}
$interUI: 'Inter UI', sans-serif;
$blokk: 'BLOKKRegular';
html {margin: 0; padding: 0;}
body {
padding: 0; margin: 0;
width: 100%; height: auto; box-sizing: border-box;
font-family: $interUI; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
background-color: #FFF;
}
header {
padding: 1rem 2rem;
width: 100%; height: 5rem; box-sizing: border-box;
background-color: #281930;
position: relative; position: fixed; top: 0; left: 0; z-index: 2;
/*flex: 0 0 auto;*/
display: flex; flex-flow: row nowrap; justify-content: space-between; align-items: center;
img {
width: 3rem; height: 3rem;
display: block; box-sizing: border-box;
border-radius: 50%; border: solid 1px #FFF;
}
h1 {
font-size: 1.5rem; font-weight: 900; line-height: 100%;
color: #FFF;
}
#hamburger {
width: 3rem; height: 3rem;
box-sizing: border-box;
position: relative;
display: flex; flex-flow: column wrap; justify-content: center; align-items: center;
div {
margin: 0 auto;
width: 2rem; height: .25rem;
box-sizing: border-box;
position: relative;
background-color: #FFF;
&:before, &:after {
content: "";
background-color: inherit;
width: inherit; height: inherit;
position: absolute; left: 0; top: -.75rem;
}
&:after {top: auto; bottom: -.75rem;}
}
}
}
main {
padding: 0; box-sizing: border-box;
width: 100%; height: calc(100vh - 5rem);
position: fixed; top: 5rem; left: 0;
overflow: auto; -webkit-overflow-scrolling: touch;
#content {
padding: 4rem 2rem; box-sizing: border-box;
background-color: #FFF; border-top: solid 1px #281930; border: none;
position: relative; top: 0; left: 0; z-index: 1;
div {
margin: 0 0 4rem; padding: 4rem 2rem 2rem; box-sizing: border-box;
width: auto;
background-color: #EEE; border-radius: .5rem;
position: relative;
overflow-wrap: break-word;
&:before {
content: "";
position: absolute; left: 50%; top: 0; transform: translate(-50%,-25%);
width: 4rem; height: 4rem;
background-color: #DEDEDE; border-radius: 50%;
}
&:last-of-type {
margin-bottom: 0;
}
h2 {
margin: 0 0 1rem;
font-family: $blokk; font-size: 2rem; color: #CDCDCD;
}
p {
margin: 0 0 1rem;
font-family: $blokk; font-size: 1rem; color: #DEDEDE;
&:last-of-type {margin-bottom: 0;}
}
}
}
#refresh-container {
position: relative; top: 0; left: 0;
width: 100%; height: auto; max-height: 0px; box-sizing: border-box;
color: #FFF;
transition: height .35s ease-out, max-height .35s ease-out;
.refresh-content {
padding: 1.25rem 4rem 8.5rem; box-sizing: border-box;
background-color: #6f6a72;
position: relative;
height: 500px;
.refresh-status, .refresh-refreshing {
font-size: .65rem; font-weight: 600;
text-align: center;
display: inline-block;
text-shadow: 0px 1px 0px rgba(0,0,0,0.35);
position: absolute; top: 15px; left: 50%; transform: translateX(-50%);
}
.refresh-refreshing {
text-align: left;
visibility: hidden;
left: 0; transform: none;
}
#svg-wrapper {
margin: 0 auto;
width: 40px;
position: absolute; left: 50%; top: 38px; transform: translateX(-50%);
/*position: relative; left: auto; top: auto; transform: none;*/
div {
padding: 0 0 211.15%;
width: 100%; height: 0;
position: relative;
svg {
width: 100%; height: 100%;
position: absolute; top: 0; left: 0; overflow: visible;
}
}
}
}
}
}
var
content = document.getElementById('content'),
refreshContainer = document.getElementById('refresh-container'),
dragY, dragD, dragDeltaY, dragDir, dragTargetD = 100, dragMaxD = 300, dragThreshold = 10, dragResistance = 0.6, ptrStatus = false,
touchActive = false,
skeletonTL, fleshTL, readyTL, timer,
refreshStatusText = document.querySelector('.refresh-status'),
refreshRefreshingText = document.querySelector('.refresh-refreshing'),
refreshMessage1 = "Pull to Re-flesh!",
refreshMessage2 = "Release to Re-flesh!",
refreshMessage3 = "Re-fleshing",
refreshTextTL,
shoulderPath2 = "M119.8,123c0,0-23.1,0-55,0s-55,0-55,0",
shoulder = document.querySelector('.shoulder'),
head = document.querySelector('.head'),
jaw = document.querySelector('.jaw'),
teethBottom = document.querySelectorAll('.tooth-bottom'),
toothTop1 = document.querySelector('.tooth-top-1'), toothTop2 = document.querySelector('.tooth-top-2'), toothTop3 = document.querySelector('.tooth-top-3'), toothTop4 = document.querySelector('.tooth-top-4'), teethTopBG = document.querySelector('teeth-top-bg'),
eyeL = document.querySelector('.eye-L'), eyeR = document.querySelector('.eye-R'), nose = document.querySelector('.nose'),
footL = document.querySelector('.leg-L .foot'), footR = document.querySelector('.leg-R .foot'),
ribs = document.querySelector('.ribs'),
armL = document.querySelector('.arm-L'), armR = document.querySelector('.arm-R'),
legL = document.querySelector('.leg-L'), legR = document.querySelector('.leg-R'),
fleshArmL = document.querySelector('.flesh-arm-L'), fleshArmR = document.querySelector('.flesh-arm-R'),
fleshLegL = document.querySelector('.flesh-leg-L'), fleshLegR = document.querySelector('.flesh-leg-R'),
fleshBody = document.querySelector('.flesh-body'), fleshHead = document.querySelector('.flesh-head'),
fleshColors = {
primary: ['#CF9E76', '#F0D0B4', '#8E572A', '#4A3222'],
secondary: ['#BA8E6A', '#ECC19C', '#7D4921', '#38251A'],
hair: ['#42210B', '#EAE54E', '#631809', '#000000']
},
hairElements = ['.flesh-hair-1', '.flesh-hair-2', '.flesh-hair-3', '.flesh-hair-4']
;
$(document).ready(function() {
TweenLite.defaultEase = Linear.easeNone;
TweenMax.set(head, {y: 0});
TweenMax.set(teethBottom, {y: 10});
TweenMax.set([jaw, '#mouth-clip-path'], {y: -27});
TweenMax.set([toothTop1, toothTop4], {y: 5});
TweenMax.set([eyeL, eyeR, nose], {y: 20, scaleY: .6, transformOrigin: "center center"});
TweenMax.set(footL, {rotation: -40, transformOrigin: "right center"});
TweenMax.set(footR, {rotation: 40, transformOrigin: "left center"});
TweenMax.set([armR,armL], {transformOrigin: "10px 5px"});
TweenMax.set(legL, {transformOrigin: "25px 5px"});
TweenMax.set(legR, {transformOrigin: "10.1px 5px"});
TweenMax.set('.guide-arm-L', {rotation: 115, x: -17, y: -35, opacity: .15, transformOrigin: "10px 5px"});
TweenMax.set('.guide-arm-R', {rotation: -115, x: 17, y: -35, opacity: .15, transformOrigin: "10px 5px"});
TweenMax.set('.guide-leg-L', {rotation: 45, opacity: .15, transformOrigin: "25px 5px"});
TweenMax.set('.guide-leg-R', {rotation: -45, opacity: .15, transformOrigin: "10.1px 5px"});
TweenMax.set('.guides', {visibility: "visible"});
TweenMax.set(fleshArmL, {rotation: 115, x: -7, y: -45, visibility: "hidden", transformOrigin: "18.6px 15px"});
TweenMax.set(fleshArmR, {rotation: -115, x: 7, y: -45, visibility: "hidden", transformOrigin: "18.6px 15px"});
TweenMax.set(['.flesh-arm-L .hand', '.flesh-arm-R .hand'], {transformOrigin: "center center", scaleX: 0, scaleY: 0});
TweenMax.set(['.flesh-arm-L .arm', '.flesh-arm-R .arm'], {drawSVG: "0 0"});
TweenMax.set(fleshLegL, {rotation: 45, x: -7, y: 0, visibility: "hidden", transformOrigin: "38.3px 15px"});
TweenMax.set(fleshLegR, {rotation: -45, x: 7, y: 0, visibility: "hidden", transformOrigin: "15.18px 15px"});
TweenMax.set(['.flesh-leg-L .foot', '.flesh-leg-R .foot'], {scaleX: 0, scaleY: 0, transformOrigin: "center center"});
TweenMax.set(['.flesh-leg-L .leg', '.flesh-leg-R .leg'], {drawSVG: "0 0"});
TweenMax.set(fleshBody, {y: -10, scaleX: 0, scaleY: 0, visibility: "hidden", transformOrigin: "center center"});
TweenMax.set('.flesh-neck', {drawSVG: "0 0"});
TweenMax.set(fleshHead, {y: -15});
TweenMax.set('.flesh-ear-L', {x: 18});
TweenMax.set('.flesh-ear-R', {x: -18});
//TweenMax.set('.flesh-hair', {y: 30});
TweenMax.set('.flesh-mouth', {scaleX: 0, scaleY: 0, transformOrigin: "center center"});
TweenMax.set('.flesh-face', {scaleX: 0, scaleY: 0, transformOrigin: "center center"});
TweenMax.set('.flesh-nose', {scaleX: 0, scaleY: 0, transformOrigin: "center center"});
TweenMax.set('.flesh-eye', {scaleX: 0, scaleY: 0, transformOrigin: "center center"})
TweenMax.set(refreshRefreshingText, {x: (content.getBoundingClientRect().width - refreshRefreshingText.getBoundingClientRect().width)/2, y: -7});
var skeletonTimeStart = 2;
skeletonTL = new TimelineMax({paused: true});
skeletonTL
.addCallback(function() {}, "0")
.to(shoulder, 1, {morphSVG: shoulderPath2}, skeletonTimeStart)
.to(head, 1, {y: -40}, skeletonTimeStart)
.to([jaw, '#mouth-clip-path'], 1, {y: 0}, skeletonTimeStart)
.to(teethBottom, 1, {y: 0}, skeletonTimeStart)
.to([toothTop1, toothTop4], 1, {y: 0}, skeletonTimeStart)
.to([eyeL, eyeR, nose], 1, {y: 0, scaleY: 1}, skeletonTimeStart)
.to(ribs, 1, {y: -10}, skeletonTimeStart)
.to(armL, 1, {rotation: 115, x: -17, y: -35}, skeletonTimeStart)
.to(armR, 1, {rotation: -115, x: 17, y: -35}, skeletonTimeStart)
.to(legL, 1, {rotation: 45, x: 0, y: 0}, skeletonTimeStart)
.to(legR, 1, {rotation: -45, x: 0, y: 0}, skeletonTimeStart)
.to([footL, footR], 1, {rotation: 0}, skeletonTimeStart)
.to(refreshStatusText, 1, {x: "-50%", y: -7}, skeletonTimeStart)
;
var fleshTimeStart = 0;
fleshTL = new TimelineMax({paused: true});
fleshTL
//.to(refreshStatusText, .5, {opacity: 0}, fleshTimeStart)
//.to('#svg-wrapper div svg', .5, {y: 0, ease: Quad.easeOut}, fleshTimeStart)
.set([fleshArmL, fleshArmR, fleshLegL, fleshLegR], {autoAlpha: 1}, fleshTimeStart)
.to('.flesh-arm-L .arm', .25, {drawSVG: "0 100%", ease: Quad.easeOut}, fleshTimeStart + .1)
.to('.flesh-arm-L .hand', .3, {scaleX: 1, scaleY: 1, ease: Back.easeOut.config(4)}, fleshTimeStart + .45)
.to('.flesh-arm-R .arm', .25, {drawSVG: "0 100%", ease: Quad.easeOut}, fleshTimeStart + .2)
.to('.flesh-arm-R .hand', .3, {scaleX: 1, scaleY: 1, ease: Back.easeOut.config(4)}, fleshTimeStart + .55)
.to('.flesh-leg-R .leg', .25, {drawSVG: "0 100%", ease: Quad.easeOut}, fleshTimeStart + .3)
.to('.flesh-leg-R .foot', .3, {scaleX: 1, scaleY: 1, ease: Back.easeOut.config(4)}, fleshTimeStart + .65)
.to('.flesh-leg-L .leg', .25, {drawSVG: "0 100%", ease: Quad.easeOut}, fleshTimeStart + .4)
.to('.flesh-leg-L .foot', .3, {scaleX: 1, scaleY: 1, ease: Back.easeOut.config(4)}, fleshTimeStart + .75)
.to('.flesh-neck', .3, {drawSVG: "0 100%", ease: Quad.easeOut}, fleshTimeStart + .5)
.to(fleshBody, .4, {autoAlpha: 1, scaleX: 1, scaleY: 1, ease: Back.easeOut.config(4)}, fleshTimeStart)
.set([legL, legR, armL, armR], {visibility: "hidden"}, fleshTimeStart + 1)
.to('.flesh-face', .4, {autoAlpha: 1, scaleX: 1, scaleY: 1, ease: Back.easeOut.config(3)}, fleshTimeStart + .25)
.to(['.flesh-ear-L', '.flesh-ear-R'], .25, {autoAlpha: 1, x: 0, ease: Quad.easeOut}, fleshTimeStart + .5)
.to('.flesh-hair', .4, {y: 0, ease: Quad.easeOut, opacity: 1}, fleshTimeStart + .6)
.to('.flesh-eye', .25, {scaleX: 1, scaleY: 1, ease: Back.easeOut, autoAlpha: 1}, fleshTimeStart + .6)
.to('.flesh-nose', .25, {scaleX: 1, scaleY: 1, ease: Back.easeOut, autoAlpha: 1}, fleshTimeStart + .6)
.to('.flesh-mouth', .4, {scaleX: 1, scaleY: 1, ease: Back.easeOut, autoAlpha: 1}, fleshTimeStart + .6)
;
readyTL = new TimelineMax({paused: true, repeat: 0, yoyo: false});
readyTL
.to([armL, '.flesh-arm-L'], .1, {rotation: 125}, "0")
.to([armL, '.flesh-arm-L'], .2, {rotation: 105, repeat: -1, yoyo: true}, ".1")
.to([armR, '.flesh-arm-R'], .1, {rotation: -125}, "0")
.to([armR, '.flesh-arm-R'], .2, {rotation: -105, repeat: -1, yoyo: true}, ".1")
.to([legL, '.flesh-leg-L'], .1, {rotation: 55}, "0")
.to([legL, '.flesh-leg-L'], .2, {rotation: 35, repeat: -1, yoyo: true}, ".1")
.to([legR, '.flesh-leg-R'], .1, {rotation: -55}, "0")
.to([legR, '.flesh-leg-R'], .2, {rotation: -35, repeat: -1, yoyo: true}, ".1")
;
readyTL.timeScale(1.5);
var svgBounds = document.querySelector('#svg-wrapper').getBoundingClientRect();
dragTargetD = svgBounds.height + 45;
dragMaxD = dragTargetD + 70;
refreshStatusText.textContent = refreshMessage1;
changeFleshColor();
$(document).on('mousedown touchstart', content, function(e) {
var startY = e.pageY || e.originalEvent.touches[0].pageY;
dragDeltaY = 0;
if($('main').scrollTop() == 0) {
$(document).on('mousemove touchmove', _.throttle(function(e) {
e.preventDefault();
var y = e.pageY || e.originalEvent.touches[0].pageY;
dragDeltaY = (y - startY);
if (dragDeltaY < 0) dragDeltaY = 0;
if (dragDeltaY > dragTargetD) {
refreshStatusText.textContent = refreshMessage2;
ptrStatus = true;
readyTL.play();
} else {
refreshStatusText.textContent = refreshMessage1;
ptrStatus = false;
readyTL.pause();
readyTL.seek(0);
}
if(dragDeltaY >= dragMaxD) {
dragDeltaY = dragMaxD;
console.log("reached max drag, trigger ptr automatically");
refreshContainer.style.maxHeight = dragMaxD + 'px';
if(e.type == 'touchmove') {
$(this).trigger('touchend');
} else if(e.type == 'mousemove') {
$(this).trigger('mouseup');
}
return;
}
var p = dragDeltaY / dragTargetD;
p < 0 ? 0 : p;
TweenMax.killTweensOf(skeletonTL);
TweenMax.to(skeletonTL, .25, {progress: p, ease: Power2.easeOut});
refreshContainer.style.maxHeight = dragDeltaY + 'px';
}, 100, {trailing: false}));
$(document).on('mouseup touchend', function() {
$(document).off('mousemove touchmove mouseup touchend');
if (!dragDeltaY) return;
if (dragDeltaY >= dragTargetD) {
console.log("pull to refresh has happened");
refreshContainer.style.maxHeight = dragTargetD + 'px';
refreshTextTL = new TimelineMax({paused: true, repeat: -1, repeatDelay: .5});
refreshTextTL
.set(refreshStatusText, {autoAlpha: 0}, "0")
.set(refreshRefreshingText, {autoAlpha: 1}, "0")
.set(refreshRefreshingText, {text: refreshMessage3 + "."}, "0")
.set(refreshRefreshingText, {text: refreshMessage3 + ".."}, ".5")
.set(refreshRefreshingText, {text: refreshMessage3 + "..."}, "1")
;
refreshTextTL.play();
TweenMax.killTweensOf(skeletonTL);
TweenMax.to(skeletonTL, .1, {progress: 1, ease: Power2.easeOut});
fleshTL.play();
timer = setTimeout(resetPTR, (fleshTL.duration() * 1000) + parseInt(getRandomInRange(250, 1500, 0)));
} else {
console.log("no pull to refresh");
refreshContainer.style.maxHeight = '0px';
TweenMax.killTweensOf(skeletonTL);
TweenMax.to(skeletonTL, 1.25, {progress: 0, ease: Power2.easeOut});
}
});
}
});
});
function resetPTR() {
console.log("resetPTR");
clearInterval(timer);
refreshContainer.style.maxHeight = 0 + "px";
timer = setTimeout(function() {
refreshTextTL.pause();
TweenMax.killTweensOf(refreshTextTL);
refreshTextTL = null;
TweenMax.set(refreshStatusText, {autoAlpha: 1});
TweenMax.set(refreshRefreshingText, {autoAlpha: 0});
fleshTL.paused(true);
fleshTL.seek(0);
skeletonTL.paused(true);
skeletonTL.seek(0);
changeFleshColor();
//content.addEventListener('mousedown', onPress);
//content.addEventListener('mouseup', onRelease);
}, 500);
}
function changeFleshColor() {
var num1 = getRandomInRange(0, 3, 0);
var num2 = getRandomInRange(0, 3, 0);
var num3 = getRandomInRange(0, 3, 0);
TweenMax.set('.flesh-fill', {fill: fleshColors.primary[num1]});
TweenMax.set('.flesh-stroke', {stroke: fleshColors.primary[num1]});
TweenMax.set('.flesh-ear', {fill: fleshColors.secondary[num1]});
TweenMax.set('.flesh-nose', {stroke: fleshColors.secondary[num1]});
TweenMax.set('.flesh-hair path', {fill: fleshColors.hair[num2]});
TweenMax.set('.flesh-hair', {visibility: 'hidden', opacity: 0});
TweenMax.set(hairElements[num3], {visibility: 'visible'})
TweenMax.set('.flesh-bra', {autoAlpha: getRandomInRange(0,1,0)})
}
console.clear();
/* ========= UTILITIES =========== */
function getRandomInRange(min, max, precision) {
min = min === undefined ? 0 : min;
max = max === undefined ? 9007199254740992 : max;
precision = precision === undefined ? 0 : precision;
var random = Math.random() * (max - min) + min;
return random.toFixed(precision);
}
Also see: Tab Triggers