Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save raphaelfruneaux/810b7e77c43cb83ee7fbb33886c1124d to your computer and use it in GitHub Desktop.
Save raphaelfruneaux/810b7e77c43cb83ee7fbb33886c1124d to your computer and use it in GitHub Desktop.
// 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;}");
@charleslcsantos
Copy link

Awesome!! I will update the source code.

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