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.
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./style.css">
<link href="https://fonts.googleapis.com/css2?family=Cutive+Mono&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Bungee+Shade&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Bungee+Outline&display=swap" rel="stylesheet">
<title>Avatar Creator</title>
</head>
<body>
<p id="title">Avatar<br/>Creator</p>
<div class="circle" id="circle">
<div class="head" id="head">
<div class="hair-1" id="hair-bald"></div>
<div class="hair-2" id="hair-balding">
<div class="hair-2" id="hair-balding-receed"></div>
</div>
<div class="hair-3" id="hair-short">
<div class="hair-3" id="hair-short-bangs-one"></div>
<div class="hair-3" id="hair-short-bangs-two"></div>
</div>
<div class="hair-4" id="hair-shaggy">
<div class="hair-4" id="hair-shaggy-bangs-one"></div>
<div class="hair-4" id="hair-shaggy-bangs-two"></div>
<div class="hair-4" id="hair-shaggy-bangs-three"></div>
<div class="hair-4" id="hair-shaggy-sideburn-left"></div>
<div class="hair-4" id="hair-shaggy-sideburn-right"></div>
</div>
<div class="hair-5" id="hair-long">
<div class="hair-5" id="hair-long-bangs-one"></div>
<div class="hair-5" id="hair-long-bangs-two"></div>
<div class="hair-5" id="hair-long-bangs-three"></div>
<div class="hair-5" id="hair-long-sideburn-left"></div>
<div class="hair-5" id="hair-long-sideburn-right"></div>
</div>
<div class="hair-6" id="hair-bangs">
<div class="hair-6" id="hair-bangs-bangs"></div>
<div class="hair-6" id="hair-bangs-sideburn-left"></div>
<div class="hair-6" id="hair-bangs-sideburn-right"></div>
</div>
<div class="hair-7" id="hair-bun">
<div class="hair-7" id="hair-bun-bun"></div>
<div class="hair-7" id="hair-bun-bangs-one"></div>
<div class="hair-7" id="hair-bun-bangs-two"></div>
<div class="hair-7" id="hair-bun-sideburn-left"></div>
<div class="hair-7" id="hair-bun-sideburn-right"></div>
</div>
<div class="face-1" id="face-one"></div>
<div class="face-2" id="face-two"></div>
<div class="face-3" id="face-three"></div>
<div class="face-4" id="face-four"></div>
<div class="face-5" id="face-five"></div>
<div class="face-6" id="face-six"></div>
<div class="face-7" id="face-seven"></div>
<div class="face-features" id="face-features">
<div class="glasses-1" id="glasses-square">
<div class="glasses-1" id="glasses-square-left"></div>
<div class="glasses-1" id="glasses-square-right"></div>
<div class="glasses-1 bridge" id="glasses-square-bridge"></div>
</div>
<div class="glasses-2" id="glasses-round">
<div class="glasses-2" id="glasses-round-left"></div>
<div class="glasses-2" id="glasses-round-right"></div>
<div class="glasses-2 bridge" id="glasses-round-bridge"></div>
</div>
<div class="glasses-3" id="glasses-cateye">
<div class="glasses-3" id="glasses-cateye-left"></div>
<div class="glasses-3" id="glasses-cateye-right"></div>
<div class="glasses-3 bridge" id="glasses-cateye-bridge"></div>
</div>
<div class="glasses-4" id="glasses-readers">
<div class="glasses-4" id="glasses-readers-left"></div>
<div class="glasses-4" id="glasses-readers-right"></div>
<div class="glasses-4 bridge" id="glasses-readers-bridge"></div>
</div>
<div class="glasses-5" id="sunglasses-square">
<div class="glasses-5" id="sunglasses-square-left"></div>
<div class="glasses-5" id="sunglasses-square-right"></div>
<div class="glasses-5 bridge" id="sunglasses-square-bridge"></div>
</div>
<div class="glasses-6" id="sunglasses-round">
<div class="glasses-6" id="sunglasses-round-left"></div>
<div class="glasses-6" id="sunglasses-round-right"></div>
<div class="glasses-6 bridge" id="sunglasses-round-bridge"></div>
</div>
<div class="glasses-7" id="no-glasses"></div>
<div class="eyebrows-1" id="eyebrows-one-left"></div>
<div class="eyebrows-1" id="eyebrows-one-right"></div>
<div class="eyebrows-2" id="eyebrows-two-left"></div>
<div class="eyebrows-2" id="eyebrows-two-right"></div>
<div class="eyebrows-3" id="eyebrows-three-left"></div>
<div class="eyebrows-3" id="eyebrows-three-right"></div>
<div class="eyebrows-4" id="eyebrows-four-left"></div>
<div class="eyebrows-4" id="eyebrows-four-right"></div>
<div class="eyebrows-5" id="eyebrows-five-left"></div>
<div class="eyebrows-5" id="eyebrows-five-right"></div>
<div class="eyebrows-6" id="eyebrows-six-left"></div>
<div class="eyebrows-6" id="eyebrows-six-right"></div>
<div class="eyebrows-7" id="eyebrows-seven-left">
<div class="eyebrows-7" id="eyebrows-seven-left-point"></div>
</div>
<div class="eyebrows-7" id="eyebrows-seven-right">
<div class="eyebrows-7" id="eyebrows-seven-right-point"></div>
</div>
<div class="eyes-1" id="eyes-one-left"></div>
<div class="eyes-1" id="eyes-one-right"></div>
<div class="eyes-2 sclera" id="eyes-two-left">
<div class="eyes-2" id="eyes-two-left-pupil"></div>
</div>
<div class="eyes-2 sclera" id="eyes-two-right">
<div class="eyes-2" id="eyes-two-right-pupil"></div>
</div>
<div class="eyes-3" id="eyes-three-left">
<div class="eyes-3" id="eyes-three-left-eyelash"></div>
<div class="eyes" id="eyes-three-left-pupil"></div>
</div>
<div class="eyes-3" id="eyes-three-right">
<div class="eyes-3" id="eyes-three-right-eyelash"></div>
<div class="eyes" id="eyes-three-right-pupil"></div>
</div>
<div class="eyes-4 sclera" id="eyes-four-left">
<div class="eyes-4" id="eyes-four-left-pupil"></div>
</div>
<div class="eyes-4 sclera" id="eyes-four-right">
<div class="eyes-4" id="eyes-four-right-pupil"></div>
</div>
<div class="eyes-5 sclera" id="eyes-five-left">
<div class="eyes-5" id="eyes-five-left-pupil"></div>
</div>
<div class="eyes-5 sclera" id="eyes-five-right">
<div class="eyes-5" id="eyes-five-right-pupil"></div>
</div>
<div class="eyes-6" id="eyes-six-left">
<div class="eyes" id="eyes-six-left-pupil"></div>
</div>
<div class="eyes-6" id="eyes-six-right">
<div class="eyes" id="eyes-six-right-pupil"></div>
</div>
<div class="eyes-7" id="eyes-seven-left">
<div class="eyes-7" id="eyes-seven-left-eyelash-one"></div>
<div class="eyes-7" id="eyes-seven-left-eyelash-two"></div>
<div class="eyes" id="eyes-seven-left-pupil"></div>
</div>
<div class="eyes-7" id="eyes-seven-right">
<div class="eyes-7" id="eyes-seven-right-eyelash-one"></div>
<div class="eyes-7" id="eyes-seven-right-eyelash-two"></div>
<div class="eyes" id="eyes-seven-right-pupil"></div>
</div>
<div class="ears-1 ears" id="ears-one-left"></div>
<div class="ears-1 ears" id="ears-one-right"></div>
<div class="ears-2 ears" id="ears-two-left"></div>
<div class="ears-2 ears" id="ears-two-right"></div>
<div class="ears-3 ears" id="ears-three-left"></div>
<div class="ears-3 ears" id="ears-three-right"></div>
<div class="ears-4 ears" id="ears-four-left"></div>
<div class="ears-4 ears" id="ears-four-right"></div>
<div class="ears-5 ears" id="ears-five-left"></div>
<div class="ears-5 ears" id="ears-five-right"></div>
<div class="ears-6 ears" id="ears-six-left"></div>
<div class="ears-6 ears" id="ears-six-right"></div>
<div class="ears-7 ears" id="ears-seven-left"></div>
<div class="ears-7 ears" id="ears-seven-right"></div>
<div class="earrings-1 earrings" id="earrings-one"></div>
<div class="earrings-2 earrings" id="earrings-two-left"></div>
<div class="earrings-2 earrings" id="earrings-two-right"></div>
<div class="earrings-3 earrings" id="earrings-three-left"></div>
<div class="earrings-3 earrings" id="earrings-three-right"></div>
<div class="earrings-4 earrings" id="earrings-four-left">
<div class="earrings-4 earrings" id="earrings-four-left-pearl-one"></div>
<div class="earrings-4 earrings" id="earrings-four-left-pearl-two"></div>
</div>
<div class="earrings-4 earrings" id="earrings-four-right">
<div class="earrings-4 earrings" id="earrings-four-right-pearl-one"></div>
<div class="earrings-4 earrings" id="earrings-four-right-pearl-two"></div>
</div>
<div class="earrings-5 earrings-gauge" id="earrings-five-left">
<div class="earrings-5 earrings-hoop" id="earrings-five-left-helix"></div>
</div>
<div class="earrings-5 earrings-gauge" id="earrings-five-right">
<div class="earrings-5 earrings-hoop" id="earrings-five-right-helix"></div>
</div>
<div class="earrings-6 earrings" id="earrings-six-left">
<div class="earrings-6 earrings" id="earrings-six-left-diamond"></div>
</div>
<div class="earrings-6 earrings" id="earrings-six-right">
<div class="earrings-6 earrings" id="earrings-six-right-diamond"></div>
</div>
<div class="earrings-7 earrings" id="earrings-seven-left">
<div class="earrings-7 earrings" id="earrings-seven-left-contour"></div>
</div>
<div class="earrings-7 earrings" id="earrings-seven-right">
<div class="earrings-7 earrings" id="earrings-seven-right-contour"></div>
</div>
<div class="nose-1" id="nose-one"></div>
<div class="nose-2" id="nose-two"></div>
<div class="nose-3" id="nose-three"></div>
<div class="nose-4" id="nose-four">
<div class="nose-4" id="nose-four-bulb"></div>
</div>
<div class="nose-5" id="nose-five"></div>
<div class="nose-6" id="nose-six"></div>
<div class="nose-7" id="nose-seven">
<div class="nose-7" id="nose-seven-left-nostril"></div>
<div class="nose-7" id="nose-seven-right-nostril"></div>
</div>
<div class="mouth-1" id="mouth-one"></div>
<div class="mouth-2" id="mouth-two">
<div class="mouth-2 tongue" id="mouth-two-tongue"></div>
</div>
<div class="mouth-3" id="mouth-three">
<div class="mouth-3" id="mouth-three-lip-one"></div>
<div class="mouth-3" id="mouth-three-lip-two"></div>
</div>
<div class="mouth-4" id="mouth-four">
<div class="mouth-4 teeth" id="mouth-four-teeth"></div>
</div>
<div class="mouth-5" id="mouth-five">
<div class="mouth-5 teeth" id="mouth-five-left-tooth"></div>
<div class="mouth-5 teeth" id="mouth-five-right-tooth"></div>
</div>
<div class="mouth-6" id="mouth-six">
<div class="mouth-6 tongue" id="mouth-six-tongue"></div>
<div class="mouth-6 teeth" id="mouth-six-teeth"></div>
</div>
<div class="mouth-7" id="mouth-seven"></div>
<div class="facial-hair-1" id="mustache-left"></div>
<div class="facial-hair-1" id="mustache-right"></div>
<div class="facial-hair-2" id="beard">
<div class="facial-hair-2" id="beard-sideburn-left"></div>
<div class="facial-hair-2" id="beard-sideburn-right"></div>
</div>
<div class="facial-hair-3" id="goatee">
<div class="facial-hair-3" id="goatee-mustache"></div>
<div class="facial-hair-3" id="goatee-left"></div>
<div class="facial-hair-3" id="goatee-right"></div>
</div>
<div class="facial-hair-4" id="van-dyke"></div>
<div class="facial-hair-4" id="van-dyke-left-mustache"></div>
<div class="facial-hair-4" id="van-dyke-right-mustache"></div>
<div class="facial-hair-5" id="lamb-chops-left"></div>
<div class="facial-hair-5" id="lamb-chops-right"></div>
<div class="facial-hair-5" id="lamb-chops-left-mustache"></div>
<div class="facial-hair-5" id="lamb-chops-right-mustache"></div>
<div class="facial-hair-6" id="cowboy-mustache-left">
<div class="facial-hair-6" id="cowboy-mustache-left-handle"></div>
</div>
<div class="facial-hair-6" id="cowboy-mustache-right">
<div class="facial-hair-6" id="cowboy-mustache-right-handle"></div>
</div>
<div class="facial-hair-7" id="no-facial-hair"></div>
<div class="blush-1" id="blush-one-left"></div>
<div class="blush-1" id="blush-one-right"></div>
<div class="blush-2" id="blush-two-left"></div>
<div class="blush-2" id="blush-two-right"></div>
<div class="blush-3" id="blush-three-left"></div>
<div class="blush-3" id="blush-three-right"></div>
<div class="blush-4" id="blush-four-left"></div>
<div class="blush-4" id="blush-four-right"></div>
<div class="blush-5" id="blush-five-left"></div>
<div class="blush-5" id="blush-five-right"></div>
<div class="blush-6" id="blush-six-left"></div>
<div class="blush-6" id="blush-six-right"></div>
<div class="blush-7" id="blush-seven-left"></div>
<div class="blush-7" id="blush-seven-right"></div>
</div>
</div>
<div class="neck" id="neck"></div>
<div class="necklace-1" id="necklace-one"></div>
<div class="necklace-2" id="necklace-two">
<div class="necklace-2 left-necklace" id="necklace-two-left"></div>
<div class="necklace-2 right-necklace" id="necklace-two-right"></div>
</div>
<div class="necklace-3 necklace" id="necklace-three">
<div class="necklace-3 necklace" id="necklace-three-inner"></div>
</div>
<div class="necklace-4 necklace" id="necklace-four">
<div class="necklace-4 necklace-shape" id="necklace-four-rectangle"></div>
<div class="necklace-4 necklace-shape" id="necklace-four-circle"></div>
</div>
<div class="necklace-5" id="necklace-five">
<div class="necklace-5 left-necklace" id="necklace-five-left"></div>
<div class="necklace-5 right-necklace" id="necklace-five-right"></div>
<div class="necklace-5 necklace-shape" id="necklace-five-rectangle"></div>
<div class="necklace-5 necklace-shape" id="necklace-five-diamond"></div>
</div>
<div class="necklace-6" id="necklace-six">
<div class="necklace-6 left-necklace" id="necklace-six-left"></div>
<div class="necklace-6 right-necklace" id="necklace-six-right"></div>
<div class="necklace-6 necklace-shape" id="necklace-six-rectangle"></div>
<div class="necklace-6 necklace-triangle" id="necklace-six-triangle-one"></div>
<div class="necklace-6 necklace-triangle" id="necklace-six-triangle-two"></div>
</div>
<div class="necklace-7" id="necklace-seven">
<div class="necklace-7 left-necklace" id="necklace-seven-left"></div>
<div class="necklace-7 right-necklace" id="necklace-seven-right"></div>
<div class="necklace-7 necklace-shape" id="necklace-seven-rectangle"></div>
<div class="necklace-7 necklace-shape" id="necklace-seven-heart-left"></div>
<div class="necklace-7 necklace-shape" id="necklace-seven-heart-right"></div>
</div>
<div class="body-1" id="solid"></div>
<div class="body-2" id="stripes"></div>
<div class="body-3" id="gradient"></div>
<div class="body-4 jacket" id="jacket-collar"></div>
<div class="body-4" id="jacket">
<div class="body-4 jacket" id="jacket-left"></div>
<div class="body-4 jacket" id="jacket-right"></div>
<div class="body-4 jacket" id="jacket-left-pocket"></div>
<div class="body-4 jacket" id="jacket-right-pocket"></div>
<div class="body-4 jacket" id="jacket-left-shoulder-loop"></div>
<div class="body-4 jacket" id="jacket-right-shoulder-loop"></div>
<div class="body-4 jacket" id="jacket-left-top-lapel"></div>
<div class="body-4 jacket" id="jacket-right-top-lapel"></div>
<div class="body-4 jacket" id="jacket-left-bottom-lapel"></div>
<div class="body-4 jacket" id="jacket-right-bottom-lapel"></div>
</div>
<div class="body-5" id="small-boobs">
<div class="body-5 boobs" id="small-boobs-left"></div>
<div class="body-5 boobs" id="small-boobs-right"></div>
</div>
<div class="body-6" id="big-boobs">
<div class="body-6 boobs" id="big-boobs-left"></div>
<div class="body-6 boobs" id="big-boobs-right"></div>
</div>
<div class="body-7" id="cape">
<div class="body-7 cape" id="cape-left"></div>
<div class="body-7 cape" id="cape-right"></div>
<div class="body-7 cape" id="cape-left-collar"></div>
<div class="body-7 cape" id="cape-right-collar"></div>
<div class="body-7 cape" id="cape-button"></div>
</div>
</div>
<form>
<select name="features" id="features">
<option value="" disabled selected>Select a feature</option>
<option value="hair">Hair</option>
<option value="face">Face</option>
<option value="glasses">Glasses</option>
<option value="eyebrows">Eyebrows</option>
<option value="eyes">Eyes</option>
<option value="ears">Ears</option>
<option value="nose">Nose</option>
<option value="mouth">Mouth</option>
<option value="blush">Blush</option>
<option value="facial-hair">Facial Hair</option>
<option value="earrings">Earrings</option>
<option value="necklace">Necklace</option>
<option value="body">Body</option>
</select>
</form>
<div id="instructions-one">
<div class="arrow" id="up-arrow"><p>↑</p></div>
</div>
<div id="instructions-two">
<div class="arrow" id="left-arrow"><p>←</p></div>
<div class="arrow" id="down-arrow"><p>↓</p></div>
<div class="arrow" id="right-arrow"><p>→</p></div>
</div>
<script src="./code.js"></script>
</body>
</html>
/* Version Two */
* {
margin: 0;
padding: 0;
}
body {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 85vh;
background: #B0BEC5;
font-family: 'Cutive Mono', monospace;
color: #184C51;
padding: 30px;
}
#title {
text-align: center;
font-family: 'Bungee Shade', cursive;
font-size: 3rem;
color: #184C51;
}
@media (max-height: 600px) {
#title {
display: none;
}
}
form {
width: 450px;
display: flex;
justify-content: center;
}
label {
font-size: 1.2rem;
}
select {
width: 220px;
font-family: 'Cutive Mono', monospace;
font-size: 1.1rem;
border-radius: 4px;
margin-bottom: 20px;
padding: 2px 0 2px 3px;
background: none;
border: 2px solid #184C51;
color: #184C51;
outline: none;
}
#instructions-one {
display: flex;
justify-content: center;
}
#instructions-two {
display: flex;
justify-content: center;
}
.arrow {
display: flex;
align-items: center;
justify-content: center;
margin-left: 3px;
margin-top: 3px;
width: 45px;
height: 30px;
color: #184C51;
border: 1px solid #184C51;
border-radius: 5px;
animation-name: appear;
animation-duration: 5s;
}
@keyframes appear{
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
/* BEGIN Styling of the Avatar Features */
.circle,
.head,
.hair-1,
.hair-2,
.hair-3,
.hair-4,
.hair-5,
.hair-6,
.hair-7,
.face-1,
.face-2,
.face-3,
.face-4,
.face-5,
.face-6,
.face-7,
.face-features,
.glasses-1,
.glasses-2,
.glasses-3,
.glasses-4,
.glasses-5,
.glasses-6,
.glasses-7,
.eyebrows-1,
.eyebrows-2,
.eyebrows-3,
.eyebrows-4,
.eyebrows-5,
.eyebrows-6,
.eyebrows-7,
.eyes,
.eyes-1,
.eyes-2,
.eyes-3,
.eyes-4,
.eyes-5,
.eyes-6,
.eyes-7,
.ears-1,
.ears-2,
.ears-3,
.ears-4,
.ears-5,
.ears-6,
.ears-7,
.earrings-1,
.earrings-2,
.earrings-3,
.earrings-4,
.earrings-5,
.earrings-6,
.earrings-7,
.nose-1,
.nose-2,
.nose-3,
.nose-4,
.nose-5,
.nose-6,
.nose-7,
.mouth,
.mouth-1,
.mouth-2,
.mouth-3,
.mouth-4,
.mouth-5,
.mouth-6,
.mouth-7,
.facial-hair-1,
.facial-hair-2,
.facial-hair-3,
.facial-hair-4,
.facial-hair-5,
.facial-hair-6,
.facial-hair-7,
.blush-1,
.blush-2,
.blush-3,
.blush-4,
.blush-5,
.blush-6,
.blush-7,
.neck,
.necklace-1,
.necklace-2,
.necklace-3,
.necklace-4,
.necklace-5,
.necklace-6,
.necklace-7,
.body-1,
.body-2,
.body-3,
.body-4,
.body-5,
.body-6,
.body-7 {
position: absolute;
}
.circle {
position: relative;
margin: 25px;
width: 250px;
height: 250px;
background: none;
border-radius: 50%;
clip-path: circle(125px at center);
}
/* ------------------------- HAIR OPTIONS BEGIN */
.hair-1 {
display: block;
background: #546E7A;
}
.hair-2,
.hair-3,
.hair-4,
.hair-5,
.hair-6,
.hair-7 {
display: none;
background: #546E7A;
}
/* Bald */
#hair-bald {
left: 70px;
top: 55px;
width: 110px;
height: 60px;
border-radius: 50% 50% 0 0;
}
/* Balding Group */
#hair-balding {
left: 70px;
top: 35px;
width: 110px;
height: 120px;
border-radius: 50%;
}
#hair-balding-receed {
z-index: 4;
left: 30px;
top: 2px;
width: 50px;
height: 20px;
border-radius: 50%;
}
/* Short Hair Group */
#hair-short {
left: 70px;
top: 35px;
width: 110px;
height: 120px;
border-radius: 50%;
}
#hair-short-bangs-one {
z-index: 4;
left: 18px;
top: 10px;
width: 50px;
height: 30px;
border-radius: 50%;
transform: rotate(-15deg);
}
#hair-short-bangs-two {
z-index: 4;
left: 45px;
top: 15px;
width: 50px;
height: 30px;
border-radius: 50%;
transform: rotate(-35deg);
}
/* Shaggy Hair Group */
#hair-shaggy {
left: 70px;
top: 35px;
width: 110px;
height: 120px;
border-radius: 50% 50% 5% 5%;
}
#hair-shaggy-bangs-one {
z-index: 4;
left: 5px;
top: 17px;
width: 50px;
height: 30px;
border-radius: 50%;
transform: rotate(-35deg);
}
#hair-shaggy-bangs-two {
z-index: 4;
left: 35px;
top: 15px;
width: 70px;
height: 30px;
border-radius: 50%;
transform: rotate(25deg);
}
#hair-shaggy-bangs-three {
z-index: 4;
left: 35px;
top: 15px;
width: 50px;
height: 30px;
border-radius: 50%;
transform: rotate(-45deg);
}
#hair-shaggy-sideburn-left {
z-index: 4;
top: 60px;
width: 5px;
height: 25px;
border-radius: 0 0 0 90%;
}
#hair-shaggy-sideburn-right {
z-index: 4;
left: 105px;
top: 60px;
width: 5px;
height: 25px;
border-radius: 0 0 90% 0;
}
/* Long Hair Group */
#hair-long {
left: 65px;
top: 35px;
width: 120px;
height: 160px;
border-radius: 50% 50% 0 0;
}
#hair-long-bangs-one {
z-index: 4;
top: 17px;
width: 70px;
height: 35px;
border-radius: 50%;
transform: rotate(-45deg);
}
#hair-long-bangs-two {
z-index: 4;
left: 50px;
top: 17px;
width: 70px;
height: 35px;
border-radius: 50%;
transform: rotate(45deg);
}
#hair-long-sideburn-left {
z-index: 4;
left: 5px;
top: 60px;
width: 5px;
height: 25px;
border-radius: 0 0 0 90%;
}
#hair-long-sideburn-right {
z-index: 4;
left: 110px;
top: 60px;
width: 5px;
height: 25px;
border-radius: 0 0 90% 0;
}
/* Bangs Hair Group */
#hair-bangs {
left: 65px;
top: 35px;
width: 120px;
height: 145px;
border-radius: 50% 50% 0 0;
}
#hair-bangs-bangs {
z-index: 4;
left: 13px;
top: 12px;
width: 94px;
height: 50px;
border-radius: 100px 100px 0 0;
}
#hair-bangs-sideburn-left {
z-index: 4;
left: 5px;
top: 60px;
width: 5px;
height: 25px;
border-radius: 0 0 0 90%;
}
#hair-bangs-sideburn-right {
z-index: 4;
left: 110px;
top: 60px;
width: 5px;
height: 25px;
border-radius: 0 0 90% 0;
}
/* Hair Bun Group */
#hair-bun {
left: 70px;
top: 35px;
width: 110px;
height: 110px;
border-radius: 50% 50% 20% 20%;
}
#hair-bun-bun {
left: 30px;
top: -20px;
width: 50px;
height: 50px;
border-radius: 50%;
}
#hair-bun-bangs-one {
z-index: 4;
top: 15px;
width: 70px;
height: 30px;
border-radius: 50%;
transform: rotate(-40deg);
}
#hair-bun-bangs-two {
z-index: 4;
left: 25px;
top: 15px;
width: 70px;
height: 30px;
border-radius: 50%;
}
#hair-bun-sideburn-left {
z-index: 4;
top: 65px;
width: 5px;
height: 20px;
border-radius: 0 0 90% 0;
}
#hair-bun-sideburn-right {
z-index: 4;
left: 105px;
top: 65px;
width: 5px;
height: 45px;
border-radius: 0 0 0 90%;
}
/* ------------------------- HAIR OPTIONS END */
/* ------------------------- FACE OPTIONS BEGIN */
.face-1,
.face-2,
.face-3,
.face-4,
.face-5,
.face-6,
.face-7,
.face-features {
display: none;
z-index: 3;
}
.face-1 {
display: block;
left: 75px;
top: 50px;
width: 100px;
height: 120px;
background: #FFCCBC;
border-radius: 45%;
}
.face-2 {
left: 75px;
top: 50px;
width: 100px;
height: 120px;
border-radius: 70% 70% 50% 50%;
}
.face-3 {
left: 75px;
top: 50px;
width: 100px;
height: 128px;
border-radius: 50%;
}
.face-4 {
left: 75px;
top: 50px;
width: 100px;
height: 113px;
border-radius: 50%;
}
.face-5 {
left: 75px;
top: 50px;
width: 100px;
height: 115px;
border-radius: 70% 70% 50% 50%;
}
.face-6 {
left: 70px;
top: 54px;
width: 110px;
height: 110px;
border-radius: 80% 15% 55% 50% / 55% 15% 80% 50%;
transform: rotate(135deg);
}
.face-7 {
left: 75px;
top: 50px;
width: 100px;
height: 120px;
border-radius: 50%;
}
.face-features {
display: block;
left: 75px;
top: 50px;
width: 100px;
height: 120px;
}
/* ------------------------- FACE OPTIONS END */
/* ------------------------- GLASSES OPTIONS BEGIN */
.glasses-1,
.glasses-2,
.glasses-3,
.glasses-4,
.glasses-5,
.glasses-6,
.glasses-7 {
display: none;
z-index: 5;
}
/* Square Glasses Group */
#glasses-square-left {
left: 5px;
top: 46px;
width: 28px;
height: 16px;
border: 5px solid #263238;
border-radius: 5px 5px 10px 10px;
background: linear-gradient(
45deg,
rgba(255, 255, 255, 0.9),
rgba(255, 255, 255, 0)
);
}
#glasses-square-right {
left: 59px;
top: 46px;
width: 28px;
height: 16px;
border: 5px solid #263238;
border-radius: 5px 5px 10px 10px;
background: linear-gradient(
45deg,
rgba(255, 255, 255, 0.9),
rgba(255, 255, 255, 0)
);
}
#glasses-square-bridge {
left: 41px;
top: 52px;
width: 20px;
height: 5px;
background: #263238;
border-radius: 50% 50% 0 0;
}
/* Round Glasses Group */
#glasses-round-left {
left: 6px;
top: 44px;
width: 25px;
height: 25px;
border: 5px solid red;
border-radius: 50%;
background: linear-gradient(
45deg,
rgba(255, 255, 255, 0.9),
rgba(255, 255, 255, 0)
);
}
#glasses-round-right {
left: 60px;
top: 44px;
width: 25px;
height: 25px;
border: 5px solid red;
border-radius: 50%;
background: linear-gradient(
45deg,
rgba(255, 255, 255, 0.9),
rgba(255, 255, 255, 0)
);
}
#glasses-round-bridge {
left: 38px;
top: 55px;
width: 25px;
height: 5px;
background: red;
border-radius: 50% 50% 0 0;
}
/* Cateye Glasses Group */
#glasses-cateye-left {
left: 6px;
top: 45px;
width: 25px;
height: 20px;
border: 5px solid blueviolet;
border-radius: 0 70% 50% 70%;
transform: rotate(-10deg);
background: linear-gradient(
45deg,
rgba(255, 255, 255, 0.9),
rgba(255, 255, 255, 0)
);
}
#glasses-cateye-right {
left: 60px;
top: 45px;
width: 25px;
height: 20px;
border: 5px solid blueviolet;
border-radius: 70% 0 70% 50%;
transform: rotate(10deg);
background: linear-gradient(
45deg,
rgba(255, 255, 255, 0.9),
rgba(255, 255, 255, 0)
);
}
#glasses-cateye-bridge {
left: 38px;
top: 55px;
width: 25px;
height: 5px;
background: blueviolet;
border-radius: 50% 50% 0 0;
}
/* Reader Glasses Group */
#glasses-readers-left {
left: 5px;
top: 52px;
width: 28px;
height: 8px;
border: 5px solid #263238;
border-radius: 5px 5px 10px 10px;
background: linear-gradient(
45deg,
rgba(255, 255, 255, 0.9),
rgba(255, 255, 255, 0)
);
}
#glasses-readers-right {
left: 59px;
top: 52px;
width: 28px;
height: 8px;
border: 5px solid #263238;
border-radius: 5px 5px 10px 10px;
background: linear-gradient(
45deg,
rgba(255, 255, 255, 0.9),
rgba(255, 255, 255, 0)
);
}
#glasses-readers-bridge {
left: 41px;
top: 55px;
width: 20px;
height: 5px;
background: #263238;
border-radius: 50% 50% 0 0;
}
/* Square Sunglasses Group */
#sunglasses-square-left {
left: 5px;
top: 46px;
width: 28px;
height: 16px;
border: 5px solid #263238;
border-radius: 5px 5px 10px 10px;
background: linear-gradient(
-25deg,
rgba(0, 0, 0, 1),
rgba(0, 0, 0, 0.5)
);
}
#sunglasses-square-right {
left: 59px;
top: 46px;
width: 28px;
height: 16px;
border: 5px solid #263238;
border-radius: 5px 5px 10px 10px;
background: linear-gradient(
-25deg,
rgba(0, 0, 0, 1),
rgba(0, 0, 0, 0.5)
);
}
#sunglasses-square-bridge {
left: 41px;
top: 52px;
width: 20px;
height: 5px;
background: #263238;
border-radius: 50% 50% 0 0;
}
/* Round Sunglasses Group */
#sunglasses-round-left {
left: 6px;
top: 44px;
width: 25px;
height: 25px;
border: 5px solid red;
border-radius: 50%;
background: linear-gradient(
-25deg,
rgba(0, 0, 0, 1),
rgba(0, 0, 0, 0.5)
);
}
#sunglasses-round-right {
left: 60px;
top: 44px;
width: 25px;
height: 25px;
border: 5px solid red;
border-radius: 50%;
background: linear-gradient(
-25deg,
rgba(0, 0, 0, 1),
rgba(0, 0, 0, 0.5)
);
}
#sunglasses-round-bridge {
left: 38px;
top: 55px;
width: 25px;
height: 5px;
background: red;
border-radius: 50% 50% 0 0;
}
/* Cateye Sunglasses Group */
#sunglasses-cateye-left {
left: 6px;
top: 45px;
width: 25px;
height: 20px;
border: 5px solid blueviolet;
border-radius: 0 70% 50% 70%;
transform: rotate(-10deg);
background: linear-gradient(
-25deg,
rgba(0, 0, 0, 1),
rgba(0, 0, 0, 0.5)
);
}
#sunglasses-cateye-right {
left: 60px;
top: 45px;
width: 25px;
height: 20px;
border: 5px solid blueviolet;
border-radius: 70% 0 70% 50%;
transform: rotate(10deg);
background: linear-gradient(
-25deg,
rgba(0, 0, 0, 1),
rgba(0, 0, 0, 0.5)
);
}
/* Seventh option is no glasses */
/* ------------------------- GLASSES OPTIONS END */
/* ------------------------- EYEBROW OPTIONS BEGIN */
.eyebrows-1,
.eyebrows-2,
.eyebrows-3,
.eyebrows-4,
.eyebrows-5,
.eyebrows-6,
.eyebrows-7 {
display: none;
z-index: 3;
background: #546E7A;
}
/* Eyebrows First Pair */
#eyebrows-one-left {
left: 17px;
top: 43px;
width: 15px;
height: 3px;
border-radius: 50% 0 0 0;
}
#eyebrows-one-right {
left: 68px;
top: 43px;
width: 15px;
height: 3px;
border-radius: 0 50% 0 0;
}
/* Eyebrows Second Pair */
#eyebrows-two-left {
left: 15px;
top: 40px;
width: 19px;
height: 6px;
border-radius: 50% 50% 0 0;
transform: rotate(-6deg);
}
#eyebrows-two-right {
left: 67px;
top: 40px;
width: 19px;
height: 6px;
border-radius: 50% 50% 0 0;
transform: rotate(6deg);
}
/* Eyebrows Third Pair */
#eyebrows-three-left {
display: block;
left: 11px;
top: 40px;
width: 25px;
height: 8px;
border-radius: 50% 0 70% 0;
transform: rotate(-4deg);
}
#eyebrows-three-right {
display: block;
left: 65px;
top: 40px;
width: 25px;
height: 8px;
background: #546E7A;
border-radius: 0 50% 0 70%;
transform: rotate(-4deg);
}
/* Eyebrows Fourth Pair */
#eyebrows-four-left {
left: 10px;
top: 44px;
width: 35px;
height: 5px;
background: #546E7A;
border-radius: 0 0 50% 50%;
}
#eyebrows-four-right {
left: 56px;
top: 44px;
width: 35px;
height: 5px;
background: #546E7A;
border-radius: 0 0 50% 50%;
}
/* Eyebrows Fifth Pair */
#eyebrows-five-left {
left: 17px;
top: 43px;
width: 15px;
height: 5px;
background: #546E7A;
border-radius: 50% 50% 0 0;
transform: rotate(7deg);
}
#eyebrows-five-right {
left: 69px;
top: 40px;
width: 15px;
height: 5px;
background: #546E7A;
border-radius: 50% 50% 0 0;
transform: rotate(-7deg);
}
/* Eyebrows Sixth Pair */
#eyebrows-six-left {
left: 10px;
top: 43px;
width: 30px;
height: 4px;
background: #546E7A;
border-radius: 90% 30% 0 0;
transform: rotate(-4deg);
}
#eyebrows-six-right {
left: 61px;
top: 43px;
width: 30px;
height: 4px;
background: #546E7A;
border-radius: 30% 90% 0 0;
transform: rotate(4deg);
}
/* Eyebrows Seventh Pair */
#eyebrows-seven-left {
left: 10px;
top: 43px;
width: 20px;
height: 4px;
background: #546E7A;
border-radius: 100% 0 0 0;
transform: rotate(-9deg);
}
#eyebrows-seven-left-point {
left: 21px;
top: 0;
width: 10px;
height: 4px;
background: #546E7A;
border-radius: 0 100% 0 0;
}
#eyebrows-seven-right {
left: 72px;
top: 43px;
width: 20px;
height: 4px;
background: #546E7A;
border-radius: 0 100% 0 0;
transform: rotate(9deg);
}
#eyebrows-seven-right-point {
left: -11px;
top: 2px;
width: 10px;
height: 4px;
background: #546E7A;
border-radius: 100% 0 0 0;
transform: rotate(-18deg);
}
/* ------------------------- EYEBROW OPTIONS END */
/* ------------------------- EYES OPTIONS BEGIN */
.eyes {
display: block;
z-index: 3;
border-radius: 50%;
}
.eyes-1,
.eyes-2,
.eyes-3,
.eyes-4,
.eyes-5,
.eyes-6,
.eyes-7 {
display: none;
z-index: 3;
border-radius: 50%;
animation-name: pulse;
animation-duration: 1000ms;
}
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.15); }
100% { transform: scale(1); }
}
/* Eyes First Pair */
#eyes-one-left {
display: block;
left: 20px;
top: 53px;
width: 10px;
height: 10px;
background: #546E7A;
}
#eyes-one-right {
display: block;
left: 70px;
top: 53px;
width: 10px;
height: 10px;
background: #546E7A;
}
/* Eyes Second Pair */
#eyes-two-left {
left: 17px;
top: 50px;
width: 15px;
height: 15px;
background: #FFF;
}
#eyes-two-right {
left: 69px;
top: 50px;
width: 15px;
height: 15px;
background: #FFF;
}
#eyes-two-left-pupil {
left: 3px;
top: 3px;
width: 9px;
height: 9px;
background: #000;
}
#eyes-two-right-pupil {
left: 3px;
top: 3px;
width: 9px;
height: 9px;
background: #000;
}
/* Eyes Third Pair */
#eyes-three-left {
left: 17px;
top: 53px;
width: 13px;
height: 13px;
background: #26C6DA;
}
#eyes-three-left-eyelash {
left: -2px;
top: -0.5px;
width: 10px;
height: 5px;
background: #26C6DA;
border-radius: 0 20% 0 90%;
transform: rotate(5deg);
}
#eyes-three-left-pupil {
left: 4px;
top: 4px;
width: 5px;
height: 5px;
background: #FFF;
}
#eyes-three-right {
left: 71px;
top: 53px;
width: 13px;
height: 13px;
background: #26C6DA;
}
#eyes-three-right-eyelash {
left: 5px;
top: -0.5px;
width: 10px;
height: 5px;
background: #26C6DA;
border-radius: 20% 0 90% 0;
transform: rotate(-5deg);
}
#eyes-three-right-pupil {
left: 4px;
top: 4px;
width: 5px;
height: 5px;
background: #FFF;
}
/* Eyes Fourth Pair */
#eyes-four-left {
left: 17px;
top: 55px;
width: 15px;
height: 7px;
background: #FFF;
border-radius: 0 0 100px 100px;
}
#eyes-four-right {
left: 69px;
top: 55px;
width: 15px;
height: 7px;
background: #FFF;
border-radius: 0 0 100px 100px;
}
#eyes-four-left-pupil {
left: 3px;
width: 9px;
height: 5px;
background: #000;
border-radius: 0 0 100px 100px;
}
#eyes-four-right-pupil {
left: 3px;
width: 9px;
height: 5px;
background: #000;
border-radius: 0 0 100px 100px;
}
/* Eyes Fifth Pair */
#eyes-five-left {
left: 17px;
top: 55px;
width: 15px;
height: 7px;
background: #FFF;
border-radius: 100px 100px 0 0;
}
#eyes-five-right {
left: 69px;
top: 55px;
width: 15px;
height: 7px;
background: #FFF;
border-radius: 100px 100px 0 0;
}
#eyes-five-left-pupil {
left: 3px;
top: 2px;
width: 9px;
height: 5px;
background: #000;
border-radius: 100px 100px 0 0;
}
#eyes-five-right-pupil {
left: 3px;
top: 2px;
width: 9px;
height: 5px;
background: #000;
border-radius: 100px 100px 0 0;
}
/* Eyes Sixth Pair */
#eyes-six-left {
left: 20px;
top: 53px;
width: 10px;
height: 10px;
background: #000;
}
#eyes-six-right {
left: 71px;
top: 53px;
width: 10px;
height: 10px;
background: #000;
}
#eyes-six-left-pupil {
left: 3px;
width: 5px;
height: 5px;
background: #FFF;
}
#eyes-six-right-pupil {
left: 3px;
width: 5px;
height: 5px;
background: #FFF;
}
/* Eyes Seventh Pair */
#eyes-seven-left {
left: 23px;
top: 53px;
width: 8px;
height: 8px;
background: #000;
}
#eyes-seven-right {
left: 70px;
top: 53px;
width: 8px;
height: 8px;
background: #000;
}
#eyes-seven-left-eyelash-one {
left: -7px;
top: 2px;
width: 10px;
height: 2px;
background: #000;
}
#eyes-seven-left-eyelash-two {
left: -5px;
width: 10px;
height: 2px;
background: #000;
transform: rotate(9deg);
}
#eyes-seven-right-eyelash-one {
left: 5px;
top: 2px;
width: 10px;
height: 2px;
background: #000;
}
#eyes-seven-right-eyelash-two {
left: 4px;
width: 10px;
height: 2px;
background: #000;
transform: rotate(-9deg);
}
#eyes-seven-left-pupil{
left: 3px;
top: 2px;
width: 2px;
height: 4px;
background: #FFF;
border-radius: 0;
}
#eyes-seven-right-pupil{
left: 3px;
top: 2px;
width: 2px;
height: 4px;
background: #FFF;
border-radius: 0;
}
/* ------------------------- EYES OPTIONS END */
/* ------------------------- EARS OPTIONS BEGIN */
.ears-1,
.ears-2,
.ears-3,
.ears-4,
.ears-5,
.ears-6,
.ears-7 {
display: none;
}
/* Ears First Pair */
#ears-one-left {
left: -15px;
top: 55px;
width: 20px;
height: 20px;
border-radius: 50% 0 0 50%;
background: #FFCCBC;
}
#ears-one-right {
left: 95px;
top: 55px;
width: 20px;
height: 20px;
border-radius: 0 50% 50% 0;
background: #FFCCBC;
}
/* Ears Second Pair */
#ears-two-left {
left: -13px;
top: 55px;
width: 20px;
height: 35px;
border-radius: 50%;
transform: rotate(-17deg);
background: #FFCCBC;
}
#ears-two-right {
left: 93px;
top: 55px;
width: 20px;
height: 35px;
border-radius: 50%;
transform: rotate(17deg);
background: #FFCCBC;
}
/* Ears Third Pair */
#ears-three-left {
display: block;
left: -20px;
top: 55px;
width: 35px;
height: 25px;
border-radius: 50%;
transform: rotate(18deg);
background: #FFCCBC;
}
#ears-three-right {
display: block;
left: 85px;
top: 55px;
width: 35px;
height: 25px;
border-radius: 50%;
transform: rotate(-18deg);
background: #FFCCBC;
}
/* Ears Fourth Pair */
#ears-four-left {
left: -25px;
top: 55px;
width: 30px;
height: 30px;
border-radius: 10% 0 20% 100%;
transform: rotate(13deg);
background: #FFCCBC;
}
#ears-four-right {
left: 95px;
top: 55px;
width: 30px;
height: 30px;
border-radius: 0 10% 100% 20%;
transform: rotate(-13deg);
background: #FFCCBC;
}
/* Ears Fifth Pair */
#ears-five-left {
left: -18px;
top: 50px;
width: 30px;
height: 35px;
border-radius: 35% 50% 0 65%;
transform: rotate(-10deg);
background: #FFCCBC;
}
#ears-five-right {
left: 88px;
top: 50px;
width: 30px;
height: 35px;
border-radius: 50% 35% 65% 0;
transform: rotate(10deg);
background: #FFCCBC;
}
/* Ears Sixth Pair */
#ears-six-left {
left: -15px;
top: 55px;
width: 25px;
height: 25px;
border-radius: 40% 0 0 80%;
background: #FFCCBC;
}
#ears-six-right {
left: 90px;
top: 55px;
width: 25px;
height: 25px;
border-radius: 0 40% 80% 0;
background: #FFCCBC;
}
/* Ears Seventh Pair */
#ears-seven-left {
left: -14px;
top: 55px;
width: 20px;
height: 30px;
border-radius: 25% 50% 50% 65%;
background: #FFCCBC;
}
#ears-seven-right {
left: 94px;
top: 55px;
width: 20px;
height: 30px;
border-radius: 50% 25% 65% 50%;
background: #FFCCBC;
}
/* ------------------------- EARS OPTIONS END */
/* ------------------------- EARRINGS OPTIONS BEGIN */
.earrings-1,
.earrings-2,
.earrings-3,
.earrings-4,
.earrings-5,
.earrings-6,
.earrings-7 {
display: none;
z-index: 5;
}
/* Earrings First Pair is no earrings */
/* Earrings Second Pair */
#earrings-two-left {
left: -7px;
top: 72px;
width: 5px;
height: 5px;
border-radius: 50%;
background: #000;
}
#earrings-two-right {
left: 102px;
top: 72px;
width: 5px;
height: 5px;
border-radius: 50%;
background: #000;
}
/* Earrings Third Pair */
#earrings-three-left {
left: -7px;
top: 75px;
width: 3px;
height: 10px;
border-radius: 50%;
background: #000;
}
#earrings-three-right {
left: 102px;
top: 75px;
width: 3px;
height: 10px;
border-radius: 50%;
background: #000;
}
#earrings-four-left {
left: -4px;
top: 75px;
width: 2px;
height: 10px;
border-radius: 50% 50% 0 0;
background: #000;
}
#earrings-four-left-pearl-one {
left: -2px;
top: 8px;
width: 6px;
height: 6px;
border-radius: 50%;
background: #000;
}
#earrings-four-left-pearl-two {
left: -1px;
top: 14px;
width: 4px;
height: 4px;
border-radius: 50%;
background: #000;
}
#earrings-four-right {
left: 102px;
top: 75px;
width: 2px;
height: 10px;
border-radius: 50% 50% 0 0;
background: #000;
}
#earrings-four-right-pearl-one {
left: -2px;
top: 8px;
width: 6px;
height: 6px;
border-radius: 50%;
background: #000;
}
#earrings-four-right-pearl-two {
left: -1px;
top: 14px;
width: 4px;
height: 4px;
border-radius: 50%;
background: #000;
}
#earrings-five-left {
left: -7px;
top: 72px;
width: 8px;
height: 8px;
border-radius: 50%;
background: none;
box-shadow: 0 0 0 2px #000 inset;
}
#earrings-five-right {
left: 99px;
top: 72px;
width: 8px;
height: 8px;
border-radius: 50%;
background: none;
box-shadow: 0 0 0 2px #000 inset;
}
#earrings-five-left-helix {
left: -10px;
top: -15px;
width: 5px;
height: 5px;
border-radius: 50%;
background: none;
box-shadow: 0 -2px #000;
}
#earrings-five-right-helix {
left: 13px;
top: -15px;
width: 5px;
height: 5px;
border-radius: 50%;
background: none;
box-shadow: 0 -2px #000;
}
#earrings-six-left {
left: -5px;
top: 75px;
width: 2px;
height: 10px;
background: #000;
border-radius: 50% 50% 0 0;
}
#earrings-six-right {
left: 103px;
top: 75px;
width: 2px;
height: 10px;
background: #000;
border-radius: 50% 50% 0 0;
}
#earrings-six-left-diamond {
left: -2px;
top: 10px;
width: 6px;
height: 6px;
background: #000;
transform: rotate(45deg);
}
#earrings-six-right-diamond {
left: -2px;
top: 10px;
width: 6px;
height: 6px;
background: #000;
transform: rotate(45deg);
}
#earrings-seven-left {
left: -5px;
top: 75px;
width: 3px;
height: 3px;
border-radius: 50%;
background: #000;
}
#earrings-seven-right {
left: 102px;
top: 75px;
width: 3px;
height: 3px;
border-radius: 50%;
background: #000;
}
#earrings-seven-left-contour {
left: -10px;
top: -3px;
width: 8px;
height: 2px;
border-radius: 0 0 50% 50%;
background: #000;
transform: rotate(35deg);
}
#earrings-seven-right-contour {
left: 5px;
top: -3px;
width: 8px;
height: 2px;
border-radius: 0 0 50% 50%;
background: #000;
transform: rotate(-35deg);
}
/* ------------------------- EARRINGS OPTIONS END */
/* ------------------------- NOSE OPTIONS BEGIN */
.nose-1,
.nose-2,
.nose-3,
.nose-4,
.nose-5,
.nose-6,
.nose-7 {
display: none;
z-index: 3;
}
/* Nose First Option */
#nose-one {
display: block;
left: 45px;
top: 60px;
width: 10px;
height: 16px;
background: #EF9A9A;
border-radius: 40%;
}
/* Nose Second Option */
#nose-two {
left: 45px;
top: 63px;
width: 10px;
height: 10px;
background: #EF9A9A;
border-radius: 20% 90% 0 0;
}
/* Nose Third Option */
#nose-three {
left: 40px;
top: 65px;
width: 20px;
height: 10px;
background: #EF9A9A;
border-radius: 100px 100px 0 0;
}
/* Nose Fourth Option */
#nose-four {
left: 44px;
top: 50px;
width: 13px;
height: 25px;
border-radius: 85% 85% 50% 50%;
background: #EF9A9A;
}
#nose-four-bulb {
left: -4px;
top: 17px;
width: 21px;
height: 13px;
border-radius: 50%;
background: #EF9A9A;
}
/* Nose Fifth Option */
#nose-five {
left: 43px;
top: 63px;
width: 15px;
height: 15px;
border-radius: 50% 50% 50% 90%;
transform: rotate(-13deg);
background: #EF9A9A;
}
/* Nose Sixth Option */
#nose-six {
left: 43px;
top: 53px;
width: 15px;
height: 25px;
border-radius: 50% 50% 0 0;
background: #EF9A9A;
}
/* Nose Seventh Option */
#nose-seven {
left: 43px;
top: 62px;
width: 15px;
height: 15px;
border-radius: 50%;
background: #EF9A9A;
}
#nose-seven-left-nostril {
left: -4px;
top: 5px;
width: 8px;
height: 8px;
border-radius: 50%;
background: #EF9A9A;
}
#nose-seven-right-nostril {
left: 11px;
top: 5px;
width: 8px;
height: 8px;
border-radius: 50%;
background: #EF9A9A;
}
/* ------------------------- NOSE OPTIONS END */
/* ------------------------- MOUTH OPTIONS BEGIN */
.mouth,
.mouth-1,
.mouth-2,
.mouth-3,
.mouth-4,
.mouth-5,
.mouth-6,
.mouth-7 {
display: none;
z-index: 5;
}
/* Mouth First Option */
#mouth-one {
display: block;
left: 35px;
top: 95px;
width: 30px;
height: 3px;
background: #EF9A9A;
border-radius: 0 0 50% 50%;
transform: rotate(2deg);
}
/* Mouth Second Option */
#mouth-two {
left: 30px;
top: 92px;
width: 40px;
height: 20px;
background: #263238;
border-radius: 0 0 100px 100px;
overflow: hidden;
}
#mouth-two-tongue {
left: 5px;
top: 5px;
width: 40px;
height: 25px;
background: #F48FB1;
border-radius: 100px 100px 0 0;
}
/* Mouth Third Option */
#mouth-three {
left: 40px;
top: 97px;
width: 20px;
height: 10px;
background: #EF9A9A;
border-radius: 0 0 100px 100px;
}
#mouth-three-lip-one {
left: 0px;
top: -3px;
width: 10px;
height: 6px;
border-radius: 90% 25% 0 0;
transform: rotate(-30deg);
}
#mouth-three-lip-two {
left: 10px;
top: -3px;
width: 10px;
height: 6px;
border-radius: 25% 90% 0 0;
transform: rotate(30deg);
}
/* Mouth Fourth Option */
#mouth-four {
left: 35px;
top: 94px;
width: 30px;
height: 15px;
background: #000;
border-radius: 0 0 100px 100px;
}
#mouth-four-teeth {
left: 2px;
width: 26px;
height: 4px;
border-radius: 0 0 60% 60%;
}
/* Mouth Fifth Option */
#mouth-five {
left: 33px;
top: 94px;
width: 34px;
height: 4px;
border-radius: 0 0 50% 50%;
}
#mouth-five-left-tooth {
left: 3px;
width: 4px;
height: 7px;
border-radius: 0 0 0 100%;
}
#mouth-five-right-tooth {
left: 27px;
width: 4px;
height: 7px;
border-radius: 0 0 100% 0;
}
/* Mouth Sixth Option */
#mouth-six {
left: 33px;
top: 94px;
width: 34px;
height: 10px;
border-radius: 0 0 100px 100px;
}
#mouth-six-tongue {
left: 7px;
width: 20px;
height: 20px;
border-radius: 0 0 50% 50%;
}
#mouth-six-teeth {
width: 34px;
height: 4px;
border-radius: 0 0 50% 50%;
}
/* Mouth Seventh Option */
#mouth-seven {
left: 33px;
top: 94px;
width: 34px;
height: 3px;
border-radius: 50% 50% 0 0;
transform: rotate(-2deg);
}
/* ------------------------- MOUTH OPTIONS END */
/* ------------------------- BLUSH OPTIONS BEGIN */
.blush-1,
.blush-2,
.blush-3,
.blush-4,
.blush-5,
.blush-6,
.blush-7 {
display: none;
z-index: 3;
}
/* Blush First Pair */
#blush-one-left {
display: block;
left: 10px;
top: 70px;
width: 20px;
height: 10px;
background: #F8BBD0;
border-radius: 50%;
opacity: 50%;
}
#blush-one-right {
display: block;
left: 70px;
top: 70px;
width: 20px;
height: 10px;
background: #F8BBD0;
border-radius: 50%;
opacity: 50%;
}
/* Blush Second Pair */
#blush-two-left {
left: 5px;
top: 70px;
width: 30px;
height: 10px;
border-radius: 50%;
opacity: 50%;
}
#blush-two-right {
left: 65px;
top: 70px;
width: 30px;
height: 10px;
border-radius: 50%;
opacity: 50%;
}
/* Blush Third Pair */
#blush-three-left {
left: 10px;
top: 70px;
width: 20px;
height: 20px;
border-radius: 50%;
opacity: 50%;
}
#blush-three-right {
left: 70px;
top: 70px;
width: 20px;
height: 20px;
border-radius: 50%;
opacity: 50%;
}
/* Blush Fourth Pair */
#blush-four-left {
left: 10px;
top: 70px;
width: 20px;
height: 8px;
border-radius: 20%;
opacity: 50%;
transform: rotate(-8deg);
}
#blush-four-right {
left: 70px;
top: 70px;
width: 20px;
height: 8px;
border-radius: 20%;
opacity: 50%;
transform: rotate(8deg);
}
/* Blush Fifth Pair */
#blush-five-left {
left: 10px;
top: 70px;
width: 25px;
height: 10px;
border-radius: 30%;
opacity: 50%;
transform: rotate(-8deg);
}
#blush-five-right {
left: 65px;
top: 70px;
width: 25px;
height: 10px;
border-radius: 30%;
opacity: 50%;
transform: rotate(8deg);
}
/* Blush Sixth Pair */
#blush-six-left {
left: 10px;
top: 70px;
width: 10px;
height: 10px;
border-radius: 20%;
opacity: 50%;
transform: rotate(45deg);
}
#blush-six-right {
left: 80px;
top: 70px;
width: 10px;
height: 10px;
border-radius: 20%;
opacity: 50%;
transform: rotate(45deg);
}
/* Blush Seventh Pair is no blush */
/* ------------------------- BLUSH OPTIONS END */
/* ------------------------- FACIAL HAIR OPTIONS BEGIN */
.facial-hair-1,
.facial-hair-2,
.facial-hair-3,
.facial-hair-4,
.facial-hair-5,
.facial-hair-6,
.facial-hair-7 {
display: none;
z-index: 4;
}
/* Mustache Group */
#mustache-left {
display: block;
left: 20px;
top: 80px;
width: 30px;
height: 10px;
background: #546E7A;
border-radius: 100% 0 0 0;
}
#mustache-right {
display: block;
left: 50px;
top: 80px;
width: 30px;
height: 10px;
background: #546E7A;
border-radius: 0 100% 0 0;
}
/* Beard Group */
#beard {
top: 81px;
width: 100px;
height: 70px;
background: #546E7A;
border-radius: 70% 70% 100px 100px;
}
#beard-sideburn-left {
top: -19px;
width: 10px;
height: 40px;
background: #546E7A;
border-radius: 0 100% 0 0;
}
#beard-sideburn-right {
left: 90px;
top: -19px;
width: 10px;
height: 40px;
background: #546E7A;
border-radius: 100% 0 0 0;
}
/* Goatee Group */
#goatee {
left: 20px;
top: 100px;
width: 60px;
height: 30px;
background: #546E7A;
border-radius: 0 0 100px 100px;
}
#goatee-mustache {
top: -20px;
width: 60px;
height: 10px;
background: #546E7A;
border-radius: 100px 100px 0 0 ;
}
#goatee-left {
top: -12px;
width: 10px;
height: 20px;
background: #546E7A;
border-radius: 0 90% 0 30%;
}
#goatee-right {
left: 50px;
top: -12px;
width: 10px;
height: 20px;
background: #546E7A;
border-radius: 90% 0 30% 0;
}
/* Van Dyke Group */
#van-dyke {
left: 40px;
top: 105px;
width: 20px;
height: 20px;
border-radius: 90% 0 0 0;
transform: rotate(45deg);
}
#van-dyke-left-mustache {
left: 28px;
top: 82px;
width: 20px;
height: 7px;
border-radius: 90% 0 0 0;
}
#van-dyke-right-mustache {
left: 52px;
top: 82px;
width: 20px;
height: 7px;
border-radius: 0 90% 0 0;
}
/* Lamb Chops Group */
#lamb-chops-left {
left: -6px;
top: 56px;
width: 20px;
height: 42px;
border-radius: 0 100% 0 100%;
transform: rotate(12deg);
}
#lamb-chops-right {
left: 86px;
top: 56px;
width: 20px;
height: 42px;
border-radius: 100% 0 100% 0;
transform: rotate(-12deg);
}
#lamb-chops-left-mustache {
left: 8px;
top: 83px;
width: 43px;
height: 13px;
border-radius: 70% 0 100% 0;
transform: rotate(-10deg);
}
#lamb-chops-right-mustache {
left: 50px;
top: 83px;
width: 43px;
height: 13px;
border-radius: 0 70% 0 100%;
transform: rotate(10deg);
}
/* Cowboy Mustache Group */
#cowboy-mustache-left {
left: 20px;
top: 80px;
width: 30px;
height: 10px;
border-radius: 100% 0 0 0;
}
#cowboy-mustache-left-handle {
top: 10px;
width: 10px;
height: 20px;
border-radius: 0 0 80% 0;
}
#cowboy-mustache-right {
left: 50px;
top: 80px;
width: 30px;
height: 10px;
border-radius: 0 100% 0 0;
}
#cowboy-mustache-right-handle {
left: 20px;
top: 10px;
width: 10px;
height: 20px;
border-radius: 0 0 0 80%;
}
/* Seventh option is no facial hair */
/* ------------------------- FACIAL HAIR OPTIONS END */
.neck {
z-index: 2;
left: 110px;
top: 155px;
width: 30px;
height: 30px;
background: #FFCCBC;
border-radius: 0 0 50% 50%;
}
/* ------------------------- NECKLACE OPTIONS START */
.necklace-1,
.necklace-2,
.necklace-3,
.necklace-4,
.necklace-5,
.necklace-6,
.necklace-7 {
display: none;
z-index: 1;
}
/* First option is no necklace */
#necklace-two-left {
left: 105px;
top: 169px;
width: 30px;
height: 55px;
border-radius: 50%;
background: none;
box-shadow: -1px 0px gold;
transform: rotate(-15deg);
}
#necklace-two-right {
left: 114px;
top: 169px;
width: 30px;
height: 55px;
border-radius: 50%;
background: none;
box-shadow: 1px 0px gold;
transform: rotate(15deg);
}
#necklace-three {
left: 100px;
top: 123px;
width: 50px;
height: 100px;
border-radius: 0 0 50% 50%;
background: none;
box-shadow: 0 1px gold;
}
#necklace-three-inner {
left: 0px;
top: 12px;
width: 50px;
height: 80px;
border-radius: 0 0 50% 50%;
background: none;
box-shadow: 0 1px gold;
}
#necklace-four {
left: 96px;
top: 175px;
width: 58px;
height: 29px;
border-radius: 0 0 100px 100px;
background: none;
box-shadow: 0 1px gold;
}
#necklace-four-rectangle {
left: 28.5px;
top: 30px;
width: 1px;
height: 8px;
background: gold;
}
#necklace-four-circle {
left: 24px;
top: 35px;
width: 10px;
height: 10px;
border-radius: 50%;
background: gold;
}
#necklace-five-left {
left: 105px;
top: 169px;
width: 30px;
height: 55px;
border-radius: 50%;
background: none;
box-shadow: -1px 0px gold;
transform: rotate(-15deg);
}
#necklace-five-right {
left: 114px;
top: 169px;
width: 30px;
height: 55px;
border-radius: 50%;
background: none;
box-shadow: 1px 0px gold;
transform: rotate(15deg);
}
#necklace-five-rectangle {
left: 124px;
top: 223.5px;
width: 1px;
height: 5px;
background: gold;
}
#necklace-five-diamond {
left: 120.5px;
top: 229px;
width: 8px;
height: 8px;
background: gold;
transform: rotate(45deg);
}
#necklace-six-left {
left: 105px;
top: 169px;
width: 30px;
height: 45px;
border-radius: 50%;
background: none;
box-shadow: -1px 0px gold;
transform: rotate(-15deg);
}
#necklace-six-right {
left: 114px;
top: 169px;
width: 30px;
height: 45px;
border-radius: 50%;
background: none;
box-shadow: 1px 0px gold;
transform: rotate(15deg);
}
#necklace-six-rectangle {
left: 124px;
top: 214px;
width: 1px;
height: 5px;
background: gold;
}
#necklace-six-triangle-one {
left: 117.5px;
top: 217px;
width: 0;
height: 0;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-top: 7px solid gold;
}
#necklace-six-triangle-two {
left: 117.5px;
top: 224px;
width: 0;
height: 0;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-top: 7px solid gold;
}
#necklace-seven-left {
left: 105px;
top: 169px;
width: 30px;
height: 55px;
border-radius: 50%;
background: none;
box-shadow: -1px 0px gold;
transform: rotate(-15deg);
}
#necklace-seven-right {
left: 114px;
top: 169px;
width: 30px;
height: 55px;
border-radius: 50%;
background: none;
box-shadow: 1px 0px gold;
transform: rotate(15deg);
}
#necklace-seven-rectangle {
left: 124px;
top: 223.5px;
width: 1px;
height: 5px;
background: gold;
}
#necklace-seven-heart-left {
left: 120.75px;
top: 225px;
width: 5px;
height: 8px;
border-radius: 50% 50% 0 0;
background: gold;
transform: rotate(-45deg);
}
#necklace-seven-heart-right {
left: 123.25px;
top: 225px;
width: 5px;
height: 8px;
border-radius: 50% 50% 0 0;
background: gold;
transform: rotate(45deg);
}
/* ------------------------- NECKLACE OPTIONS END */
/* ------------------------- CLOTHING OPTIONS START */
.body-1,
.body-2,
.body-3,
.body-4,
.body-5,
.body-6,
.body-7 {
display: none;
}
/* Solid Shirt */
#solid {
left: 54px;
top: 170px;
width: 140px;
height: 140px;
background: #1976D2;
border-radius: 50%;
}
/* Striped Shirt */
#stripes {
left: 54px;
top: 170px;
width: 140px;
height: 140px;
border-radius: 50%;
background: repeating-linear-gradient(
90deg,
#000,
#000 10px,
#FFF 10px,
#FFF 20px
);
}
/* Gradient Shirt */
#gradient {
display: block;
left: 54px;
top: 170px;
width: 140px;
height: 140px;
background: linear-gradient(65deg, #8C366C, #6E64E7);
border-radius: 50%;
}
/* Jacket */
#jacket-collar {
left: 108px;
top: 165px;
width: 34px;
height: 30px;
}
#jacket {
left: 54px;
top: 170px;
width: 140px;
height: 140px;
border-radius: 50%;
}
#jacket-left {
left: 1px;
top: -1px;
width: 53px;
height: 140px;
border-radius: 100px 0 0 100px;
}
#jacket-right {
left: 88px;
top: -1px;
width: 53px;
height: 140px;
border-radius: 0 100px 100px 0;
}
#jacket-left-pocket {
left: 24px;
top: 40px;
width: 20px;
height: 3px;
box-shadow: 0 0 0 1px #666 inset;
}
#jacket-right-pocket {
left: 98px;
top: 40px;
width: 20px;
height: 3px;
box-shadow: 0 0 0 1px #666 inset;
}
#jacket-left-top-lapel {
left: 35px;
top: -8px;
width: 20px;
height: 25px;
border-radius: 100% 0 0 0;
box-shadow: 0 0 0 1px #666 inset;
transform: rotate(5deg);
}
#jacket-right-top-lapel {
left: 87px;
top: -8px;
width: 20px;
height: 25px;
border-radius: 0 100% 0 0;
box-shadow: 0 0 0 1px #666 inset;
transform: rotate(-5deg);
}
#jacket-left-bottom-lapel {
left: 40px;
top: 18px;
width: 20px;
height: 75px;
border-radius: 0 0 0 100%;
box-shadow: 0 0 0 1px #666 inset;
transform: rotate(-9deg);
}
#jacket-right-bottom-lapel {
left: 82px;
top: 18px;
width: 20px;
height: 75px;
border-radius: 0 0 100% 0;
box-shadow: 0 0 0 1px #666 inset;
transform: rotate(9deg);
}
#jacket-left-shoulder-loop {
left: 12px;
top: 5px;
width: 30px;
height: 8px;
border-radius: 50% 50% 30% 30%;
box-shadow: 0 0 0 1px #666 inset;
transform: rotate(-30deg);
}
#jacket-right-shoulder-loop {
left: 100px;
top: 5px;
width: 30px;
height: 8px;
border-radius: 50% 50% 30% 30%;
box-shadow: 0 0 0 1px #666 inset;
transform: rotate(30deg);
}
#small-boobs {
left: 54px;
top: 170px;
width: 140px;
height: 140px;
border-radius: 50%;
}
#small-boobs-left {
left: 27px;
top: 43px;
width: 30px;
height: 30px;
border-radius: 50%;
opacity: 25%;
box-shadow: -2px 3px #000000;
animation-name: pulse; /* keyframe defined under eyes */
animation-duration: 1000ms;
}
#small-boobs-right {
left: 84px;
top: 43px;
width: 30px;
height: 30px;
border-radius: 50%;
opacity: 25%;
box-shadow: 2px 3px #000000;
animation-name: pulse; /* keyframe defined under eyes */
animation-duration: 1000ms;
}
#big-boobs {
left: 54px;
top: 170px;
width: 140px;
height: 140px;
border-radius: 50%;
}
#big-boobs-left {
left: 25px;
top: 30px;
width: 45px;
height: 45px;
border-radius: 50%;
opacity: 25%;
box-shadow: -2px 3px #000000;
animation-name: pulse; /* keyframe defined under eyes */
animation-duration: 1000ms;
}
#big-boobs-right {
left: 71px;
top: 30px;
width: 45px;
height: 45px;
border-radius: 50%;
opacity: 25%;
box-shadow: 2px 3px #000000;
animation-name: pulse; /* keyframe defined under eyes */
animation-duration: 1000ms;
}
#cape {
left: 54px;
top: 170px;
width: 140px;
height: 140px;
border-radius: 50%;
}
#cape-left {
left: -8px;
top: -5px;
width: 70px;
height: 140px;
border-radius: 100px 0 0 100px;
transform: rotate(10deg);
}
#cape-right {
left: 80px;
top: -5px;
width: 70px;
height: 140px;
border-radius: 0 100px 100px 0;
transform: rotate(-10deg);
}
#cape-left-collar {
z-index: 2;
left: 39px;
top: -7px;
width: 30px;
height: 30px;
border-radius: 0 100% 0 0;
transform: rotate(-10deg);
}
#cape-right-collar {
z-index: 2;
left: 73px;
top: -7px;
width: 30px;
height: 30px;
border-radius: 100% 0 0 0;
transform: rotate(10deg);
}
#cape-button {
z-index: 2;
left: 67px;
top: 13px;
width: 8px;
height: 8px;
border-radius: 50%;
box-shadow: 0px 0px 0px 2px #FFFFFF inset;
}
/* ------------------------- CLOTHING OPTIONS END */
// Version Two
document.addEventListener('DOMContentLoaded', () => {
document.getElementById('features').addEventListener('change', getOption);
let features, featuresOption, optionNumber, elements;
// Grabs feature to be customized
function getOption() {
features = document.getElementById('features');
featuresOption = features.options[features.selectedIndex].value;
optionNumber = 1;
elements = document.querySelectorAll(`.${featuresOption}-${optionNumber}`);
}
// Setting up so user can click arrows
const upArrow = document.getElementById('up-arrow');
const downArrow = document.getElementById('down-arrow');
const leftArrow = document.getElementById('left-arrow');
const rightArrow = document.getElementById('right-arrow');
upArrow.addEventListener('mouseenter', () => {
upArrow.style.background = '#184C51';
upArrow.style.color = '#FFF';
});
upArrow.addEventListener('mouseleave', () => {
upArrow.style.background = 'none';
upArrow.style.color = '#184C51';
});
upArrow.addEventListener('click', () => {
if (colorsIndex < 12) { // colorIndex is defined under the colors object
colorsIndex++;
} else if (colorsIndex === 12) {
colorsIndex = 0;
}
changeColor();
});
downArrow.addEventListener('mouseenter', () => {
downArrow.style.background = '#184C51';
downArrow.style.color = '#FFF';
});
downArrow.addEventListener('mouseleave', () => {
downArrow.style.background = 'none';
downArrow.style.color = '#184C51';
});
downArrow.addEventListener('click', () => {
if (colorsIndex > 0) {
colorsIndex--;
} else if (colorsIndex === 0) {
colorsIndex = 12;
}
changeColor();
});
rightArrow.addEventListener('mouseenter', () => {
rightArrow.style.background = '#184C51';
rightArrow.style.color = '#FFF';
});
rightArrow.addEventListener('mouseleave', () => {
rightArrow.style.background = 'none';
rightArrow.style.color = '#184C51';
});
rightArrow.addEventListener('click', () => {
elements.forEach(div => div.style.display = 'none');
if (optionNumber < 7) {
optionNumber++;
} else if (optionNumber === 7) {
optionNumber = 1;
}
elements = document.querySelectorAll(`.${featuresOption}-${optionNumber}`);
elements.forEach(div => div.style.display = 'block');
changeColor();
});
leftArrow.addEventListener('mouseenter', () => {
leftArrow.style.background = '#184C51';
leftArrow.style.color = '#FFF';
});
leftArrow.addEventListener('mouseleave', () => {
leftArrow.style.background = 'none';
leftArrow.style.color = '#184C51';
});
leftArrow.addEventListener('click', () => {
elements.forEach(div => div.style.display = 'none');
if (optionNumber > 1) {
optionNumber--;
} else if (optionNumber === 1) {
optionNumber = 7;
}
elements = document.querySelectorAll(`.${featuresOption}-${optionNumber}`);
elements.forEach(div => div.style.display = 'block');
changeColor();
});
// Highlights arrow btns on screen when using arrow keys
function highlight(obj){
obj.style.background = '#184C51';
obj.style.color = '#FFF';
setTimeout(function(){
obj.style.background = 'none';
obj.style.color = '#184C51';
}, 150);
}
// Setting up so user can use keyboard
document.addEventListener('keydown', keyChanges);
// This controls looping through options
function keyChanges(e) {
switch(e.keyCode) {
// First 2 - up and down - change colors
case 38:
e.preventDefault();
highlight(upArrow);
if (colorsIndex < 12) { // colorIndex is defined under the colors object
colorsIndex++;
} else if (colorsIndex === 12) {
colorsIndex = 0;
}
changeColor();
break;
case 40:
e.preventDefault();
highlight(downArrow);
if (colorsIndex > 0) {
colorsIndex--;
} else if (colorsIndex === 0) {
colorsIndex = 12;
}
changeColor();
break;
// Second 2 - left and right - change styles
case 39:
e.preventDefault();
highlight(rightArrow);
elements.forEach(div => div.style.display = 'none');
if (optionNumber < 7) {
optionNumber++;
} else if (optionNumber === 7) {
optionNumber = 1;
}
elements = document.querySelectorAll(`.${featuresOption}-${optionNumber}`);
elements.forEach(div => div.style.display = 'block');
changeColor();
break;
case 37:
e.preventDefault();
highlight(leftArrow);
elements.forEach(div => div.style.display = 'none');
if (optionNumber > 1) {
optionNumber--;
} else if (optionNumber === 1) {
optionNumber = 7;
}
elements = document.querySelectorAll(`.${featuresOption}-${optionNumber}`);
elements.forEach(div => div.style.display = 'block');
changeColor();
break;
}
}
// Color object containing hex color options for different features
const colors = {
hair: [
'#263238', '#546E7A', '#4E342E', '#BF360C', '#E65100',
'#FDD835', '#FFEE58', '#E0E0E0', '#FAFAFA', '#FF4081',
'#00B0FF', '#00C853', '#D500F9'
],
face: [
'#FDEFE5', '#FDE7DD', '#FBDDCF', '#FBD4C5', '#FDC5B1',
'#F1DCB7', '#ECCEA2', '#ECBE83', '#D19556', '#925743',
'#7F4B3C', '#6B3F34', '#523530',
],
glasses: [
'#212121', '#4E342E', '#FF5722', '#FFA726', '#FFEB3B',
'#4CAF50', '#00B0FF', '#304FFE', '#651FFF', '#D500F9',
'#E91E63', '#D50000', '#795548'
],
eyes: [
'#263228', '#546E7A', '#4E342E', '#33691E', '#006064',
'#0D47A1', '#2196F3', '#D500F9', '#F50057', '#D50000',
'#FFC107', '#00E676', '#CFD8DC'
],
nose: [
'#F1AF99', '#F2C1AD', '#FCE1D5', '#F6D1BE', '#F1B3A4',
'#F19D9A', '#A8896D', '#9A7863', '#8C6B57', '#7D5D4B',
'#6B4F42', '#5E453C', '#AA6666'
],
mouth: [
'#AA6666', '#995566', '#804040', ' #50161A', '#2C0000',
'#880E4F', '#311B92', '#0D47A1', '#B71C1C', '#004D40',
'#33691E', '#4A148C', '#212121'
],
jewelry: [
'#A67D01', '#CFAB38', '#F8F0C9', '#F6F9FC', '#C8CACA',
'#A9AAAE', '#CD8E97', '#E3AEB1', '#B76B79', '#A85D6E',
'#033F63', '#028090', '#02C39A'
],
body: [
'#D50000', '#C51162', '#AA00FF', '#6200EA', '#304FFE',
'#2962FF', '#00B8D4', '#00BFA5', '#64DD17', '#FFD600',
'#FF6D00', '#212121', '#607D8B'
]
};
// Set color index at the beginning - used in changeColor()
let colorsIndex = 0;
// Specific features that need to be altered differently from elements variable current value
const face = document.getElementById('face-one');
const ears = document.querySelectorAll('.ears');
const neck = document.getElementById('neck');
const glassesBridge = document.querySelectorAll('.bridge');
const tongue = document.querySelectorAll('.tongue');
const teeth = document.querySelectorAll('.teeth');
const sclera = document.querySelectorAll('.sclera');
const earrings = document.querySelectorAll('.earrings');
const earringHoops = document.querySelectorAll('.earrings-hoop');
const earringGauges = document.querySelectorAll('.earrings-gauge');
const necklace = document.querySelectorAll('.necklace');
const necklaceLeft = document.querySelectorAll('.left-necklace');
const necklaceRight = document.querySelectorAll('.right-necklace');
const necklaceShapes = document.querySelectorAll('.necklace-shape');
const necklaceTriangles = document.querySelectorAll('.necklace-triangle');
const clothingStripes = document.getElementById('stripes');
const clothingGradient = document.getElementById('gradient');
const businessJacket = document.querySelectorAll('.jacket');
const cape = document.querySelectorAll('.cape');
// Called in keyChanges()
function changeColor() {
switch(featuresOption) {
case 'hair':
elements.forEach(div => div.style.backgroundColor = colors.hair[colorsIndex]);
break;
case 'face':
elements.forEach(div => div.style.backgroundColor = colors.face[colorsIndex]);
ears.forEach(div => div.style.backgroundColor = colors.face[colorsIndex]);
neck.style.backgroundColor = colors.face[colorsIndex];
break;
case 'glasses':
elements.forEach(div => div.style.borderColor = colors.glasses[colorsIndex]);
glassesBridge.forEach(div => div.style.backgroundColor = colors.glasses[colorsIndex]);
break;
case 'eyebrows':
elements.forEach(div => div.style.backgroundColor = colors.hair[colorsIndex]);
break;
case 'eyes':
elements.forEach(div => div.style.backgroundColor = colors.eyes[colorsIndex]);
sclera.forEach(div => div.style.backgroundColor = '#FFFFFF');
break;
case 'ears':
elements.forEach(div => div.style.backgroundColor = colors.face[colorsIndex]);
face.style.backgroundColor = colors.face[colorsIndex];
neck.style.backgroundColor = colors.face[colorsIndex];
break;
case 'nose':
elements.forEach(div => div.style.backgroundColor = colors.nose[colorsIndex]);
break;
case 'mouth':
elements.forEach(div => div.style.backgroundColor = colors.mouth[colorsIndex]);
tongue.forEach(div => div.style.backgroundColor = '#F48FB1');
teeth.forEach(div => div.style.backgroundColor = '#FFFFFF');
break;
case 'blush':
elements.forEach(div => div.style.backgroundColor = colors.nose[colorsIndex]);
break;
case 'facial-hair':
elements.forEach(div => div.style.backgroundColor = colors.hair[colorsIndex]);
break;
case 'earrings':
earrings.forEach(div => div.style.backgroundColor = colors.jewelry[colorsIndex]);
earringHoops.forEach(div => div.style.boxShadow = '0px -2px' +
colors.jewelry[colorsIndex]);
earringGauges.forEach(div => div.style.boxShadow = '0px 0px 0px 2px inset' +
colors.jewelry[colorsIndex]);
break;
case 'necklace':
necklace.forEach(div => div.style.boxShadow = '0px 1px' +
colors.jewelry[colorsIndex]);
necklaceLeft.forEach(div => div.style.boxShadow = '-1px 0px' +
colors.jewelry[colorsIndex]);
necklaceRight.forEach(div => div.style.boxShadow = '1px 0px' +
colors.jewelry[colorsIndex]);
necklaceShapes.forEach(div => div.style.backgroundColor = colors.jewelry[colorsIndex]);
necklaceTriangles.forEach(div => div.style.borderTop = '7px solid' +
colors.jewelry[colorsIndex]);
break;
case 'body':
elements.forEach(div => div.style.backgroundColor = colors.body[colorsIndex]);
businessJacket.forEach(div => div.style.backgroundColor = '#000000');
cape.forEach(div => div.style.backgroundColor = '#000000');
clothingGradient.style.background = 'linear-gradient(65deg,' +
colors.body[colorsIndex] + ',' +
colors.body[colorsIndex + 1] + ')';
break;
}
}
});
Also see: Tab Triggers