HeartIt

Developer
Size
2,039 Kb
Views
24,288

How do I make an heartit?

What is a heartit? How do you make a heartit? This script and codes were developed by Rahul Kumar on 14 October 2022, Friday.

HeartIt Previews

HeartIt - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>HeartIt</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <script src="js/index.js"></script>
</body>
</html>

HeartIt - Script Codes CSS Codes

body { margin: 0; background: #352F59; overflow: hidden;
}
.TwitterHeart { float: left; width: 100px; height: 100px; background-image: url(https://abs.twimg.com/a/1446686284/img/t1/web_heart_animation.png); background-position: 0 0;
}
.TwitterHeart:hover { background-position: -2800px 0;
}

HeartIt - Script Codes JS Codes

for (i = 0; i < 800; i++) document.body.innerHTML += '<div id="' + i + '" class="TwitterHeart"></div>';
//------------------------------------------------------------
window.addEventListener("mouseover", HeartAnimation);
//------------------------------------------------------------
function HeartAnimation(event) { if (event.target.tagName != 'HTML') { var targetHeart = document.getElementById(event.target.id); var heartStateCounter = 1; var timer = setInterval(function() { if (heartStateCounter != 29) targetHeart.style.backgroundPosition = -100 * heartStateCounter++ + 'px 0'; else { clearInterval(timer); } }, 100); }
}
//----------------Both directions: it bugs ---------------------
/*function HeartAnimation(event) { if (event.target.tagName != 'HTML') { var targetHeart = document.getElementById(event.target.id); var heartStateCounter = targetHeart.classList.contains('back') ? 28 : 1; var timer = setInterval(function() { if (heartStateCounter != 29 & heartStateCounter != 0) targetHeart.style.backgroundPosition = targetHeart.classList.contains('back') ? 100 : -100 * heartStateCounter++ + 'px 0'; else { clearInterval(timer); targetHeart.classList.toggle('back'); } }, 30); }
}*/
HeartIt - Script Codes
HeartIt - Script Codes
Home Page Home
Developer Rahul Kumar
Username rk007
Uploaded October 14, 2022
Rating 3
Size 2,039 Kb
Views 24,288
Do you need developer help for HeartIt?

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!

Rahul Kumar (rk007) Script Codes
Name
For you
A Pen by Rahul Kumar
Bitch Roxana
Smile
Hey
Shake it
Hmmm...
Chat
By Rahul
-
Create amazing blog posts with AI!

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!