Created
February 18, 2019 14:59
-
-
Save CalvT/8130001975046307ae08be4060f37c3b to your computer and use it in GitHub Desktop.
This file contains 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 bakerite.co.uk mods | |
// @match https://bakerite.co.uk/* | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
jQuery( document ).ready(function() { | |
jQuery( "li.product img" ).wrap( "<div class='product-container'></div>" ); | |
jQuery( ".product-container").append( "<div class='product-hover'></div>" ); | |
jQuery('head').append( `<style> | |
.product-container { | |
position: relative; | |
} | |
.product-hover { | |
display: grid; | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
background: rgba(255, 255, 255, 0.5); | |
opacity: 0; | |
transition: all .3s ease-out; | |
} | |
li.product:hover .product-hover { | |
opacity: 1; | |
} | |
.product-hover:after { | |
content: 'View Product'; | |
display: inline-block; | |
margin: auto; | |
background-color: #d23b2e; | |
color: #ffffff; | |
font-weight: 500; | |
text-transform: uppercase; | |
font-size: .9rem; | |
padding: 15px 40px; | |
} | |
li.product .button { | |
display: none; | |
} | |
li.product { | |
margin-bottom: 0!important; | |
} | |
</style>`); | |
}) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment