Skip to content

Instantly share code, notes, and snippets.

@CalvT
Created February 18, 2019 14:59
Show Gist options
  • Save CalvT/8130001975046307ae08be4060f37c3b to your computer and use it in GitHub Desktop.
Save CalvT/8130001975046307ae08be4060f37c3b to your computer and use it in GitHub Desktop.
// ==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