a mouse-left-click Effect written in JS
Click the left mouse button will appear Hearts "❤" or character expression "(๑ ́₃ ̀๑)" ... Common emoji
Can be replaced, if you want to copy, please move from the bottom link to GitHub
Code
onload = function () {var click_cnt = 0;
var $html = document.getelementsbytagname ("html") [0];
var $body = document.getElementsByTagName ("body") [0];
$html. onclick = function (e) {var $elem = document.createelement ("B");
$elem. Style.color = "#E94F06";
$elem. Style.zindex = 9999;
$elem. style.position = "absolute";
$elem. Style.select = "None";
var x = E.pagex;
var y = e.pagey;
$elem. Style.left = (x-10) + "px";
$elem. Style.top = (y-20) + "px";
Clearinterval (ANIM);
Switch (++click_cnt) {case: $elem. innertext = "Oωo";
Break
Case: $elem. innertext = "(๑ ́∀ ̀๑)";
Break
Case: $elem. innertext = "(๑ ́₃ ̀๑)";
Break
Case: $elem. innertext = "(๑ ̀_ ́๑)";
Break Case: $elem.innertext = "( ̄へ ̄)";
Break
Case: $elem. innertext = "(╯° °) ╯ (┴-┴);
Break
Case: $elem. innertext = "૮ (ᵒ̌ dish ᵒ̌) ა";
Break Case: $elem. innertext = "。 > Mouth <。
) ╭ ";
Break
Case: $elem. innertext = "(งᵒ̌ dish ᵒ̌) ง⁼³₌₃";
Break
Case 100:case 101:case 102:case 103:case 104:case 105:
$elem. innertext = "(ꐦ°᷄д°᷅)";
Break
Default: $elem. innertext = "❤";
Break
$elem. Style.fontsize = Math.random () + 8 + "px";
var increase = 0;
var Anim;
settimeout (function () {anim = SetInterval (function () {if (++increase = = 150) {
Clearinterval (ANIM); $body. RemoveChild ($elem);
$elem. style.top = y-20-increase + "px";
$elem. style.opacity = (150-increase)/120;
}, 8);
}, 70);
$body. appendchild ($elem);
};
};
Preview
GitHub Address:
Https://github.com/djzhao627/JSClickBubble