Forked from charleslcsantos/opacidade imagem whatsapp web
Last active
February 2, 2018 13:12
-
-
Save raphaelfruneaux/810b7e77c43cb83ee7fbb33886c1124d to your computer and use it in GitHub Desktop.
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
// Código em parceria com @jroqueweb | |
function cssEngine(rule) { | |
var css = document.createElement('style'); // Creates <style></style> | |
css.type = 'text/css'; // Specifies the type | |
if (css.styleSheet) css.styleSheet.cssText = rule; // Support for IE | |
else css.appendChild(document.createTextNode(rule)); // Support for the rest | |
document.getElementsByTagName("head")[0].appendChild(css); // Specifies where to place the css | |
} | |
cssEngine(".message.message-image img, .message.message-gif > div > div > div:nth-child(2), .message.message-video .video-thumb {opacity: .2; filter: blur(5px); transition: all ease .2s;}"); | |
cssEngine(".message.message-image:hover img, .message.message-gif:hover > div > div > div:nth-child(2), .message.message-video:hover .video-thumb {opacity: 1; filter: blur(0); transition: all ease .1s;}"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome!! I will update the source code.