Simple animated infographic
How do I make an simple animated infographic?
What is a simple animated infographic? How do you make a simple animated infographic? This script and codes were developed by Andy Hullinger on 15 September 2022, Thursday.
Simple animated infographic - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>simple animated infographic</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <figure> <ol> <li><p>72M</p></li> <li><p>70M</p></li> <li><p>68M</p></li> <li><p>66M</p></li> <li><p>64M</p></li> <li><p>62M</p></li> <li><p>60M</p></li> <li><p>58M</p></li> <li><p>56M</p></li> <li><p>54M</p></li> <li><p>55M</p></li> </ol> <div class="democrat"></div> <div class="republican"></div> <nav> <button id="08btn">2008</button> <button id="12btn">2012</button> <button id="16btn">2016</button> </nav> <h1><span>Voting Demographics?</span>It’s not who votes, but how many of us do.</h1>
</figure> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/gsap/1.19.0/TweenMax.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Simple animated infographic - Script Codes CSS Codes
/* ALWAYS USE A RESET */
* { margin: 0; padding: 0; box-sizing: border-box;
}
figure { font-family: Arial; width: 600px; height: 360px;
}
li { border-bottom: 1px solid silver;
}
/* FIRST! create a parent/child positioning context */
figure { position: relative;
}
ol,
div,
nav,
h1 { position: absolute;
}
/* Then, layout the child elements inside the parent container*/
ol { width: 100%; height: 100%; top: 0; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between;
}
h1 { width: 100%; text-align: center; font-size: 48px; line-height: 1; padding: 60px; top: 50px;
}
div { width: 25%; height: 100%; top: 0; -webkit-transform: scaleY(.9); transform: scaleY(.9); -webkit-transform-origin: bottom center; transform-origin: bottom center;
}
div:nth-of-type(1) { left: 20%;
}
div:nth-of-type(2) { left: 60%;
}
nav { width: 80%; left: 80px; top: 15px; display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-pack: distribute; justify-content: space-around;
}
/* Add any art direction and design details */
h1 span { font-weight: bold; text-transform: uppercase;
}
ol { padding: 20px 40px 0 80px; color: silver;
}
p { position: relative; font-size: 12px; left: -30px; top: 6px;
}
.democrat { background-color: rgba(0, 0, 255, .3);
}
.republican { background-color: rgba(255, 0, 0, .3);
}
button { padding: 10px 30px; font-size: 18px;
}
.hilite { background-color: black; color: white;
}
/* codepen prettifying */
body { height: 100vh; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -webkit-box-align: center; -ms-flex-align: center; align-items: center;
}
Simple animated infographic - Script Codes JS Codes
// 2008 d=.78 r=.36
// 2012 d=.63 r=.4
// 2016 d=.33 r=.31
TweenMax.from('h1', 1, {delay:.5, opacity:0, y:'+=30'});
TweenMax.from('.democrat, .republican', 1, {delay:2, scaleY:0, ease:Power2.easeOut});
TweenMax.to('h1', .5, {delay:5, opacity:0});
function show2008data(){ //2008 results TweenMax.to('.democrat', 2, {scaleY:.78}); TweenMax.to('.republican', 2, {scaleY:.36});
}
function show2012data(){ //2012 results TweenMax.to('.democrat', 2, {scaleY:.63}); TweenMax.to('.republican', 2, {scaleY:.4});
}
function show2016data(){ //2012 results TweenMax.to('.democrat', 2, {scaleY:.33}); TweenMax.to('.republican', 2, {scaleY:.31});
}
//$(elem).hover(func,func);
$('#08btn').click(show2008data);
$('#12btn').click(show2012data);
$('#16btn').click(show2016data);
Developer | Andy Hullinger |
Username | andyhullinger |
Uploaded | September 15, 2022 |
Rating | 3 |
Size | 2,803 Kb |
Views | 36,432 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Presentation Template with Animation | 4,597 Kb |
Mageractive Class 1 | 2,505 Kb |
Solved By Flexbox - an excerpt | 6,971 Kb |
A Pen by Andy Hullinger | 2,227 Kb |
Simple Parallax ala Nike Better World | 4,177 Kb |
Banner Example | 3,025 Kb |
Simple example infographic pen | 2,618 Kb |
Example Infographic | 3,882 Kb |
Simple photo captions | 2,030 Kb |
MFA iteration example | 7,065 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Two column of responsive height | Fixie | 2,908 Kb |
Flying Bee | Pwsm50 | 3,711 Kb |
Use the Twitchtv JSON API | Roksanaop | 3,561 Kb |
Expert Help | SinceSidSlid | 4,064 Kb |
Cut and Paste Roll Link | BottomlineInteractive | 2,546 Kb |
A Pen by Patrick Cox | Pcridesagain | 2,899 Kb |
CSS Letter animations | Sladix | 2,116 Kb |
Drawing a Terminal with CSS | Lachlanjc | 3,185 Kb |
Bootstrap 3 Price Table | Honglio | 2,655 Kb |
SCSS Unit Conversion | Jakob-e | 8,210 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!