Tears Of Happiness
How do I make an tears of happiness?
A CSS3 animation events with dynamic element creation experiment. The speed sets the density, and CSS filters support the depth.. What is a tears of happiness? How do you make a tears of happiness? This script and codes were developed by Yogev Ahuvia on 11 September 2022, Sunday.
Tears Of Happiness - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Tears Of Happiness</title> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ .stream { width: 100%; margin: 0 auto; position: relative;
}
.tear { position: absolute; top: -50px; width: 20px; height: 20px; border-radius: 50%; animation: pour 5s ease-in; -webkit-filter: blur(0px); filter: blur(0px);
}
.far { width: 17px; height: 17px; animation-duration: 5s; -webkit-filter: blur(1px);
}
.furthest { width: 14px; height: 14px; animation-duration: 7s; -webkit-filter: blur(2px);
}
label { font-family: sans-serif; font-size: 12px;
}
input[type='range'] { border-radius: 5px; background: #ccc; height: 8px; -moz-appearance: none; -webkit-appearance: none;
}
input[type='range']::-webkit-slider-thumb { cursor: pointer; border-radius: 100%; background: #eee; height: 15px; width: 15px; -moz-appearance: none; -webkit-appearance: none; -moz-box-shadow: 0px 0px 1px 1px #999, inset 0px 1px 1px 1px white; -webkit-box-shadow: 0px 0px 1px 1px #999, inset 0px 1px 1px 1px white; box-shadow: 0px 0px 1px 1px #999, inset 0px 1px 1px 1px white;
}
@keyframes pour { from { -moz-transform: translateY(0px); -ms-transform: translateY(0px); -webkit-transform: translateY(0px); transform: translateY(0px); } to { -moz-transform: translateY(1080px); -ms-transform: translateY(1080px); -webkit-transform: translateY(1080px); transform: translateY(1080px); }
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="controls"> <label for="density">less</label> <input type="range" id="density" min="1" max="1001" step="10" value="901"> <label for="density">more</label>
</div>
<div class="stream"></div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Tears Of Happiness - Script Codes CSS Codes
.stream { width: 100%; margin: 0 auto; position: relative;
}
.tear { position: absolute; top: -50px; width: 20px; height: 20px; border-radius: 50%; animation: pour 5s ease-in; -webkit-filter: blur(0px); filter: blur(0px);
}
.far { width: 17px; height: 17px; animation-duration: 5s; -webkit-filter: blur(1px);
}
.furthest { width: 14px; height: 14px; animation-duration: 7s; -webkit-filter: blur(2px);
}
label { font-family: sans-serif; font-size: 12px;
}
input[type='range'] { border-radius: 5px; background: #ccc; height: 8px; -moz-appearance: none; -webkit-appearance: none;
}
input[type='range']::-webkit-slider-thumb { cursor: pointer; border-radius: 100%; background: #eee; height: 15px; width: 15px; -moz-appearance: none; -webkit-appearance: none; -moz-box-shadow: 0px 0px 1px 1px #999, inset 0px 1px 1px 1px white; -webkit-box-shadow: 0px 0px 1px 1px #999, inset 0px 1px 1px 1px white; box-shadow: 0px 0px 1px 1px #999, inset 0px 1px 1px 1px white;
}
@keyframes pour { from { -moz-transform: translateY(0px); -ms-transform: translateY(0px); -webkit-transform: translateY(0px); transform: translateY(0px); } to { -moz-transform: translateY(1080px); -ms-transform: translateY(1080px); -webkit-transform: translateY(1080px); transform: translateY(1080px); }
}
Tears Of Happiness - Script Codes JS Codes
var density; updateDensity();
$('#density').on('change', updateDensity);
setTimeout(pour, density);
function pour() { var speed = randomSpeed(); var color = randomColor(); var offset = randomOffset(); var tear = $('<div class="tear '+speed+'" style="background: '+color+'; left: '+offset+'px;"></div>'); $('.stream').append(tear); $(tear).on('webkitAnimationEnd oanimationend msAnimationEnd animationend', function(e) { $(this).remove(); }); setTimeout(pour, density);
}
function updateDensity() { density = $('#density').attr('max') - $('#density').val();
}
function randomSpeed() { var choice = Math.round(Math.random() * 3); return (choice == 0 ? "" : (choice == 1 ? "far" : "furthest"));
}
function randomColor() { // http://stackoverflow.com/a/1484514 var letters = '0123456789ABCDEF'.split(''); var color = '#'; for (var i = 0; i < 6; i++ ) { color += letters[Math.round(Math.random() * 15)]; } return color;
}
function randomOffset() { return Math.round(Math.random() * $('.stream').width());
}
Developer | Yogev Ahuvia |
Username | kindofone |
Uploaded | September 11, 2022 |
Rating | 3 |
Size | 3,667 Kb |
Views | 20,240 |
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 |
Spinning Top | 6,037 Kb |
CSS Only In-Place Translation | 3,336 Kb |
3D Cube of 3D Balls | 4,507 Kb |
A Pen by Yogev Ahuvia | 1,941 Kb |
Natural Language Accordion Form | 8,426 Kb |
Humble Progress | 2,766 Kb |
Real-Time Love Meter | 5,493 Kb |
The CodePen Logo | 4,259 Kb |
Reactive CSS Transitions | 4,405 Kb |
CSS-Only Countdown Clock | 5,974 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 |
STAR WARS LIGHTSABER | Francoiscoron | 4,420 Kb |
Kudos Please | TimPietrusky | 6,624 Kb |
700 Synapses Per Second | Silentkrange | 2,138 Kb |
Apex Calculator | Michaelwnelson | 2,370 Kb |
A Pen by Final Boss tommyb9 | FBtommyb9 | 55,354 Kb |
Pomodoro Timer | Sdas13 | 2,900 Kb |
HTML5 Video Autoplay | Zivcos | 1,352 Kb |
A Pen by tugce | Ecgutcnkr | 4,197 Kb |
Animated Donut Chart | Jplhomer | 3,808 Kb |
Responsive Minimal Blog Layout | Hackthevoid | 5,261 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!