Skip to content

Instantly share code, notes, and snippets.

@charleslcsantos
Last active March 12, 2018 13:17
Show Gist options
  • Save charleslcsantos/b0811c63a2b8560537bdfaf1c9bf2477 to your computer and use it in GitHub Desktop.
Save charleslcsantos/b0811c63a2b8560537bdfaf1c9bf2477 to your computer and use it in GitHub Desktop.
// Código em parceria com @jroqueweb @raphaelfruneaux
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-gif > div > div > div:nth-child(2), .message.message-video .video-thumb, .message-in img:not(.selectable-text), .message-in .video-thumb, .message-out img:not(.selectable-text), .message-out .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-gif:hover > div > div > div:nth-child(2), .message.message-video:hover .video-thumb, .message-in:hover img:not(.selectable-text), .message-in .video-thumb:hover, .message-out:hover img:not(.selectable-text), .message-out .video-thumb:hover {opacity: 1; filter: blur(0); transition: all ease .1s;}");
@raphaelfruneaux
Copy link

@charleslcsantos I forked your gist and updated it. Now it hides video thumbs. You can see these changes here.

@charleslcsantos
Copy link
Author

Thanks @raphaelfruneaux. Was it updated! 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment