Created
April 10, 2023 04:15
-
-
Save rynomad/d2aba71abea8cd469f8a476ed001bcfc to your computer and use it in GitHub Desktop.
Adds a big smiley face to the upper right corner of every page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Big Smileys Everywhere | |
// @description Adds a big smiley face to the upper right corner of every page | |
// @version 1 | |
// @match *://*/* | |
// @grant GM_addStyle | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const smileyImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAeElEQVRoQ+2XsQmAMBCEWQ/U8QvDQikfUCZwEhYf+B8sxvAghPYX3dKBL0GQc0Zbknv1vvJtFn/xEoYRnRHm7xkAAAAASUVORK5CYII="; | |
const smileyDiv = document.createElement('div'); | |
smileyDiv.style.position = 'fixed'; | |
smileyDiv.style.top = '20px'; | |
smileyDiv.style.right = '20px'; | |
smileyDiv.style.zIndex = '9999'; | |
smileyDiv.innerHTML = `<img src="${smileyImg}" alt="Big smiley">`; | |
document.body.appendChild(smileyDiv); | |
GM_addStyle(` | |
#big-smiley:hover { | |
transform: scale(1.2); | |
transition: transform 0.2s ease-in-out; | |
cursor: pointer; | |
} | |
`); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment