-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
175 lines (159 loc) · 13.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Emojify</title>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-ZPBTX9ZCSE"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-ZPBTX9ZCSE');
</script>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-T36LRLG6');</script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&display=swap" rel="stylesheet">
<meta name="description" content="Emojify is a customizable emoji trail javascript library that follows your mouse cursor, embedding playfulness and personality into any webpage.">
<meta name="keywords" content="Emojify, Emojify JS, Open Source, Github, library, web development, user interface, customizable, design, JS Library, css, js, html, CDN, Web, accessible, modern, Emoji, mouse, cursor, trail, Emojis, javascript">
<meta name="robots" content="index, follow">
<link rel="icon" href="https://raw.githubusercontent.com/open-emojify/emojify/main/logo/logo.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="https://raw.githubusercontent.com/open-emojify/emojify/main/logo/logo.png">
<link rel="canonical" href="https://open-emojify.github.io/emojify/">
<meta property="og:title" content="Emojify">
<meta property="og:site_name" content="Emojify">
<meta property="og:type" content="website">
<meta property="og:description" content="Emojify is a customizable emoji trail javascript library that follows your mouse cursor, embedding playfulness and personality into any webpage.">
<meta property="og:url" content="https://open-emojify.github.io/emojify/">
<meta property="og:image" content="https://raw.githubusercontent.com/open-emojify/emojify/main/banner/banner.png">
<meta property="og:image:alt" content="https://raw.githubusercontent.com/open-emojify/emojify/main/banner/banner.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Emojify">
<meta name="twitter:description" content="Emojify is a customizable emoji trail javascript library that follows your mouse cursor, embedding playfulness and personality into any webpage.">
<meta name="twitter:image" content="https://raw.githubusercontent.com/open-emojify/emojify/main/banner/banner.png">
<link rel="stylesheet" href="css/style.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/emojify.min.js"></script>
</head>
<body>
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-T36LRLG6"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<h1 id="emojify" aria-label="mojify is a customizable emoji trail javascript library that follows your mouse cursor.">Emojify.</h1>
<a id="github" aria-label="GitHub repository for Emojify" href="https://github.com/open-emojify/emojify" target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 32 32">
<path fill="#000000" fill-rule="evenodd" d="M 16 4 C 9.371094 4 4 9.371094 4 16 C 4 21.300781 7.4375 25.800781 12.207031 27.386719 C 12.808594 27.496094 13.027344 27.128906 13.027344 26.808594 C 13.027344 26.523438 13.015625 25.769531 13.011719 24.769531 C 9.671875 25.492188 8.96875 23.160156 8.96875 23.160156 C 8.421875 21.773438 7.636719 21.402344 7.636719 21.402344 C 6.546875 20.660156 7.71875 20.675781 7.71875 20.675781 C 8.921875 20.761719 9.554688 21.910156 9.554688 21.910156 C 10.625 23.746094 12.363281 23.214844 13.046875 22.910156 C 13.15625 22.132813 13.46875 21.605469 13.808594 21.304688 C 11.144531 21.003906 8.34375 19.972656 8.34375 15.375 C 8.34375 14.0625 8.8125 12.992188 9.578125 12.152344 C 9.457031 11.851563 9.042969 10.628906 9.695313 8.976563 C 9.695313 8.976563 10.703125 8.65625 12.996094 10.207031 C 13.953125 9.941406 14.980469 9.808594 16 9.804688 C 17.019531 9.808594 18.046875 9.941406 19.003906 10.207031 C 21.296875 8.65625 22.300781 8.976563 22.300781 8.976563 C 22.957031 10.628906 22.546875 11.851563 22.421875 12.152344 C 23.191406 12.992188 23.652344 14.0625 23.652344 15.375 C 23.652344 19.984375 20.847656 20.996094 18.175781 21.296875 C 18.605469 21.664063 18.988281 22.398438 18.988281 23.515625 C 18.988281 25.121094 18.976563 26.414063 18.976563 26.808594 C 18.976563 27.128906 19.191406 27.503906 19.800781 27.386719 C 24.566406 25.796875 28 21.300781 28 16 C 28 9.371094 22.628906 4 16 4 Z"></path>
</svg>
</a>
<a id="codepen" aria-label="Codepen demo for Emojify" href="https://codepen.io/GreenestGoat/pen/gONGbBo" target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="100" height="100" viewBox="0,0,256,256">
<g fill="#000000" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><g transform="scale(5.33333,5.33333)"><path d="M24,43.4l-19,-12.3v-14.2l19,-12.3l19,12.3v14.2zM9,28.9l15,9.7l15,-9.7v-9.8l-15,-9.7l-15,9.7z"></path><path d="M24,32.4l-18.2,-12.8l2.4,-3.2l15.8,11.2l15.8,-11.2l2.4,3.2z"></path><path d="M39.9,31.6l-15.9,-11l-15.9,11l-2.2,-3.2l18.1,-12.6l18.1,12.6z"></path><path d="M22,8h4v10.1h-4zM22,29.9h4v10.1h-4z"></path></g></g>
</svg>
</a>
<!--<button id="config-btn" tabindex="0" aria-label="Config button for Emojify options">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000000" stroke-width="2" color="#000000" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/></svg>
</button>-->
<div id="code-block">
<button title="Copy code to clipboard" aria-label="Code Copy Button" tabindex="0" id="code-copy-button"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg></button>
<button title="Reset code to default values" aria-label="Code Rest Button" tabindex="0" id="code-reset-button"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-ccw"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/></svg></button>
<!--<span class="code-yellow code-line">import <span class="code-blue">Emojify </span><span class="code-yellow">from </span><span class="code-green">'https://cdn.jsdelivr.net/npm/open-emojify/emojify.min.js'</span><span class="code-white">;</span></span>-->
<span class="code-brown code-line"><script<span class="code-yellow"> src</span><span class="code-white">=</span><span class="code-green">"https://cdn.jsdelivr.net/npm/[email protected]/emojify.min.js"</span><span class="code-brown">></script></span></span>
<span class="code-line"> </span>
<span class="code-brown code-line"><script></span>
<span class="code-yellow code-line"> window<span class="code-white">.</span><span class="code-purple">emojify</span><span class="code-white"> = </span><span class="code-yellow">new </span><span class="code-yellow">Emojify</span><span class="code-white">({</span></span>
<!-- <span class="code-purple code-line code-start"> random<span class="code-white">: </span><span id="emojify-random" class="code-yellow" onkeypress="return isLetter(event)">true</span><span class="code-white">,</span></span> -->
<span class="code-purple code-line code-start"> duration<span class="code-white">: </span><span id="emojify-duration" contenteditable="true" class="code-orange" onkeypress="return isNumber(event)">500</span><span class="code-white">,</span></span>
<span class="code-purple code-line code-start"> delay<span class="code-white">: </span><span id="emojify-delay" contenteditable="true" class="code-orange" onkeypress="return isNumber(event)">15</span><span class="code-white">,</span></span>
<!-- <span class="code-purple code-line code-start"> size<span class="code-white">: </span><span id="emojify-size" contenteditable="false" class="code-green">'48px'</span><span class="code-white">,</span></span> -->
<span class="code-purple code-line code-start"> zIndex<span class="code-white">: </span><span id="emojify-z-index" contenteditable="true" class="code-orange" onkeypress="return isNumber(event)">9999</span><span class="code-white">,</span></span>
<span class="code-white code-line"> });</span>
<span class="code-brown code-line"></script></span>
</div>
</body>
<script type="module">
window.emojify = new Emojify({});
// const emojifyRandom = document.getElementById('emojify-random');
const emojifyDuration = document.getElementById('emojify-duration');
const emojifyDelay = document.getElementById('emojify-delay');
// const emojifySize = document.getElementById('emojify-size');
const emojifyzIndex = document.getElementById('emojify-z-index');
function updateEmojify() {
window.emojify.options['duration'] = parseInt(emojifyDuration.textContent);
window.emojify.options['delay'] = parseInt(emojifyDelay.textContent);
// window.emojify.options['size'] = emojifySize.textContent;
window.emojify.options['zIndex'] = parseInt(emojifyzIndex.textContent);
};
// emojifyRandom.addEventListener('input', updateEmojify);
emojifyDuration.addEventListener('input', updateEmojify);
emojifyDelay.addEventListener('input', updateEmojify);
// emojifySize.addEventListener('input', updateEmojify);
emojifyzIndex.addEventListener('input', updateEmojify);
const resetButton = document.getElementById('code-reset-button')
resetButton.addEventListener('click', () => {
emojifyDuration.textContent = '500';
emojifyDelay.textContent = '15';
emojifyzIndex.textContent = '9999';
window.emojify.options['duration'] = 500;
window.emojify.options['delay'] = 15;
window.emojify.options['zIndex'] = 9999;
});
</script>
<script>
function isNumber(evt) {
evt = evt ? evt : window.event;
var charCode = evt.which ? evt.which : evt.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
return false;
}
return true;
}
function validateNumber(element) {
var value = parseInt(element.textContent);
if (value < 1) {
element.textContent = "1";
}
}
function isLetter(evt) {
evt = evt ? evt : window.event;
var charCode = evt.which ? evt.which : evt.keyCode;
if ((charCode > 64 && charCode < 91) || (charCode > 96 && charCode < 123)) {
return true;
}
return false;
}
/* const configBtn = document.getElementById('config-btn');*/
const codeBlock = document.getElementById('code-block');
/*configBtn.addEventListener('click', () => {
if (codeBlock.style.display === 'none') {
codeBlock.style.display = 'flex';
} else {
codeBlock.style.display = 'none';
}
});*/
const copyButton = document.getElementById('code-copy-button');
let timeoutId;
copyButton.addEventListener('click', () => {
const codeText = Array.from(codeBlock.querySelectorAll('.code-line'))
.map(span => span.textContent.replace(/ /g, ''))
.join('\n');
navigator.clipboard.writeText(codeText)
.then(() => {
console.log('Code copied to clipboard!');
copyButton.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check"><path d="M20 6 9 17l-5-5"/></svg>';
// Clear any existing timeout
clearTimeout(timeoutId);
// Set a new timeout to revert the icon
timeoutId = setTimeout(() => {
copyButton.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>';
}, 1250);
})
.catch(err => {
console.error('Failed to copy code to clipboard:', err);
});
});
</script>
</html>