Animations and pseudo-elements
How do I make an animations and pseudo-elements?
This is a tiny demo showing the subtle animation effects you can apply to :after or :before psuedo-elements. With just a little bit of tasteful CSS (and a touch of JavaScript), you can create some really fun interactions while still maintaining clean HTML.. What is a animations and pseudo-elements? How do you make a animations and pseudo-elements? This script and codes were developed by Neil Renicker on 24 November 2022, Thursday.
Animations and pseudo-elements - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Animations and pseudo-elements</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="box"> <p class="box-message" data-dead-message="Oh noes!">Welcome, Earthling.</p>
</div>
<div class="robot"> <img src="https://f.cl.ly/items/2D2M3f0a3W2Z2E0P3G1D/robot.png" alt="Robot" />
</div>
<!-- amazingly cute robot icon courtesy Aha-Soft, via iconfinder.com
https://www.iconfinder.com/icons/131463/ --> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Animations and pseudo-elements - Script Codes CSS Codes
body { background-color: #a2dc75; font-family: Verdana, sans-serif;
}
.box { -moz-transition: all 0.15s ease-in-out; -o-transition: all 0.15s ease-in-out; -webkit-transition: all 0.15s ease-in-out; transition: all 0.15s ease-in-out; background-color: #fff; color: #3a3a3a; font-size: 14px; letter-spacing: 1px; margin: 10em auto 3em; max-width: 15em; padding: 1em; position: relative; cursor: pointer; text-align: center; text-transform: uppercase;
}
.box:after { -moz-transition: all 0.15s ease-in-out; -o-transition: all 0.15s ease-in-out; -webkit-transition: all 0.15s ease-in-out; transition: all 0.15s ease-in-out; content: ""; border: solid transparent; border-top-color: #fff; height: 0; width: 0; left: 50%; position: absolute; pointer-events: none; border-width: 20px; margin-left: -20px; bottom: -2.2em;
}
.box:hover { background-color: #f4fbef; margin: 10.15em auto 2.85em;
}
.box:hover:after { bottom: -2.65em; border-top-color: #f4fbef;
}
.robot { -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%; position: relative; height: 5.8em; width: 9.2em; overflow: hidden; margin: 0 auto;
}
.robot:after { -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%; -moz-transition: all 0.1s ease-in-out; -o-transition: all 0.1s ease-in-out; -webkit-transition: all 0.1s ease-in-out; transition: all 0.1s ease-in-out; display: block; content: ""; width: 4.5em; height: 1.5em; position: absolute; background-color: #79cd38; left: 50%; margin-left: -2.25em; top: 4em; z-index: -1;
}
.robot img { -moz-transition: all 0.3s ease-in-out; -o-transition: all 0.3s ease-in-out; -webkit-transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out; display: block; margin: 0 auto; max-width: 5em; position: relative; z-index: 1;
}
.robot_is-dead img { margin-top: 6em;
}
.robot_is-dead:after { background-color: #000; width: 6em; height: 1.75em; margin-left: -3em;
}
Animations and pseudo-elements - Script Codes JS Codes
(function() { var $boxTrigger, $message, $robot, aliveMessage, deadMessage; $boxTrigger = $(".box"); $robot = $(".robot"); $message = $(".box-message"); aliveMessage = $message.text(); deadMessage = $message.data("dead-message"); $boxTrigger.click(function() { $robot.toggleClass("robot_is-dead"); if ($robot.hasClass("robot_is-dead")) { return $message.text(deadMessage); } else { return $message.text(aliveMessage); } });
}).call(this);
Developer | Neil Renicker |
Username | tinystride |
Uploaded | November 24, 2022 |
Rating | 3.5 |
Size | 3,637 Kb |
Views | 14,168 |
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 |
Pure CSS Loading Block | 2,236 Kb |
React Lifecycle Demo | 3,363 Kb |
Max-width on header elements | 2,041 Kb |
World Map with Pulsing Dots | 69,659 Kb |
A Pen by Neil Renicker | 1,689 Kb |
Vmin Intrinsic Ratio | 1,723 Kb |
Webgl | 2,503 Kb |
Magical inner shadows on a vertically scrolling element | 3,557 Kb |
Chicago Flag in CSS | 2,513 Kb |
A Gallery of Hearting Animations | 5,560 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 |
Pure CSS Tooltip | APinix | 2,815 Kb |
Progressively reveal dots on a Bezier curve | GreenSock | 2,489 Kb |
Slider | Mohammed-fawzy | 2,634 Kb |
Menu | Vivi_Lai | 1,210 Kb |
Image Stack Test SCSS | CalvinMorett | 2,799 Kb |
Angular-HAML | Cwacht | 2,022 Kb |
Hexagons | Ashmind | 4,360 Kb |
A Pen by aleen42 | Aleen42 | 11,473 Kb |
Mega Menu by Joni | Asakasinsky | 3,171 Kb |
Simple yet functional | Matheusxaviersi | 2,025 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!