]> jfr.im git - irc/unrealircd/unrealircd-webpanel-plugins.git/blob - emoji_trail/emoji_trail.php
Update README.md
[irc/unrealircd/unrealircd-webpanel-plugins.git] / emoji_trail / emoji_trail.php
1 <?php
2 /**
3 @title Emoji Trail
4 @author Valware
5 @description This plugin makes an emoji trail from your mouse cursor.
6 @contact valerie@valware.co.uk
7 @version 1.1
8 @tested 0.9
9 @minver 0.9
10 @maxver *
11 @license GPLv3
12 @screenshot https://github.com/unrealircd/unrealircd-webpanel-plugins/blob/main/emoji_trail/screenshots/emoji-trail.png?raw=true
13 @icon https://i.guim.co.uk/img/media/a1b7129c950433c9919f5670c92ef83aa1c682d9/55_344_1971_1183/master/1971.jpg?width=1200&height=900&quality=85&auto=format&fit=crop&s=88ba2531f114b9b58b9cb2d8e723abe1
14 */
15
16 class emoji_trail
17 {
18 /* You must specify these here for internal use
19 * All of these are mandatory or your plugin will not work.
20 */
21 public $name = "emoji_trail"; // Name of your plugin
22 public $author = "Valware"; // Name or handle of your lovely self
23 public $version = "1.1"; // Version of this plugin
24 public $description = "Adds emoji_trail stuff"; // Description of your beautiful plugin
25 public $email = "v.a.pond@outlook.com"; // An email people can contact you with in case of problems
26
27 /** This is run on plugin load. You can add hooks and initialize whatever databases
28 * that you think you might need.
29 */
30 function __construct()
31 {
32
33 Hook::func(HOOKTYPE_HEADER, 'emoji_trail::do_emoji_trail_shit');
34 }
35
36 public static function do_emoji_trail_shit(&$pages)
37 {
38 ?>
39 <style>
40 .emoji {
41 position:absolute;
42 pointer-events: none;
43 animation: animate 1s linear infinite;
44 }
45 @keyframes animate {
46 0%
47 {
48 translate: 0 0;
49 opacity: 0;
50 }
51 10%
52 {
53 opacity: 1;
54 }
55 30%
56 {
57 translate: 0 100px;
58 opacity: 1;
59 }
60 90%
61 {
62 opacity: 1;
63 }
64 100%
65 {
66 translate: 0 80px;
67 opacity: 0;
68 }
69 }
70 </style>
71 <script>
72
73 let images = ["๐Ÿ˜€", "๐Ÿ˜ƒ", "๐Ÿ˜„", "๐Ÿ˜", "๐Ÿ˜†", "๐Ÿ˜…", "๐Ÿ˜‚", "๐Ÿคฃ", "๐Ÿฅฒ", "๐Ÿ˜Š", "๐Ÿ˜‡", "๐Ÿ™‚", "๐Ÿ™ƒ", "๐Ÿ˜‰", "๐Ÿ˜Œ", "๐Ÿ˜", "๐Ÿฅฐ", "๐Ÿ˜˜", "๐Ÿ˜—", "๐Ÿ˜™", "๐Ÿ˜š", "๐Ÿ˜‹", "๐Ÿ˜›", "๐Ÿ˜", "๐Ÿ˜œ", "๐Ÿคช", "๐Ÿคจ", "๐Ÿง", "๐Ÿค“", "๐Ÿ˜Ž", "๐Ÿฅธ", "๐Ÿคฉ", "๐Ÿฅณ", "๐Ÿ˜", "๐Ÿ˜’", "๐Ÿ˜ž", "๐Ÿ˜”", "๐Ÿ˜Ÿ", "๐Ÿ˜•", "๐Ÿ™"];
74
75 document.addEventListener('mousemove', function(e) {
76 let body = document.querySelector("body");
77 let emoji = document.createElement("span");
78 emoji.classList.add("emoji");
79
80 let x = e.offsetX;
81 let y = e.offsetY;
82
83 emoji.style.left = x + "px";
84 emoji.style.top = y + "px";
85
86 let icon = images[Math.floor(Math.random() * images.length)];
87 emoji.innerText = icon;
88
89 let size = Math.random() * 50;
90 emoji.style.fontSize = 5 + size + "px";
91
92 let max = 0;
93 let min = 200;
94 let randomValue = Math.floor((Math.random() * ((max + 1) - min)) + min);
95
96 emoji.style.transform = 'translateX(' + randomValue + 'px)';
97
98 body.appendChild(emoji);
99
100 setTimeout(function(){
101 emoji.remove();
102 }, 1000);
103 });
104
105 </script>
106 <?php
107 }
108 }
109