JSFiddle - React, Tailwind, and code Playground
HTML
<div class="postit-surround">
<a href="#">
<div class="postit">
<div class="pin">
<img src="<?php echo get_template_directory_uri(); ?>/assets/drawing-pin.png">
</div>
<div class="postit-title">
<h1 class="nav-title-text">Products</h1>
</div>
<div class="corner-peel">
<img src="<?php echo get_template_directory_uri(); ?>/assets/corner-flick-cyan.png">
</div>
</div>
</a>
<div class="navigation-dropdown">
<ul>
<li>
<h2 class="dropdown-text">Products 1</h2>
</li>
<li>
<h2 class="dropdown-text">Products 2</h2>
</li>
<li>
<h2 class="dropdown-text">Products 3</h2>
</li>
<li>
<h2 class="dropdown-text">Products 4</h2>
</li>
<li>
<h2 class="dropdown-text">Products 5</h2>
</li>
</ul>
</div>
</div>
CSS
.postit-surround {
width: 120px;
height: 110px;
position: relative;
display: inline-block;
margin: 0px 5px;
}
.postit {
width: 120px;
height: 110px;
background-color: #888888;
position: relative;
margin: 20px auto;
display: inline-block;
margin: 20px 5px;
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
-webkit-box-shadow: -3px -3px 5px 0px rgba(90, 90, 90, 0.6);
-moz-box-shadow: -3px -3px 5px 0px rgba(90, 90, 90, 0.6);
box-shadow: -3px -3px 5px 0px rgba(90, 90, 90, 0.6);
}
.pin {
position: absolute;
width: 20px;
height: auto;
top: 3px;
left: 3px;
}
.pin > img {
width: 15px;
height: 15px;
}
.corner-peel {
width: 120px;
height: 110px;
position: absolute;
bottom: -1px;
right: -1px;
}
.corner-peel > img {
width: 30px;
height: 30px;
position: absolute;
bottom: 0;
right: 0;
}
.postit:hover {
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
}
.postit-title {
text-align: center;
font-family: Arial, Helvetica, sans-serif;
padding-top: 30px;
font-size: 20px;
vertical-align: middle;
color: #ffffff;
}
.nav-title-text {
font-size: 20px;
vertical-align: middle;
color: #ffffff;
text-align: center;
font-family: Arial, Helvetica, sans-serif;
font-weight: normal;
}
.dropdown-text {
color: #ffffff;
font-family: arial, helvetica, sans-serif;
font-size: 14px;
line-height: 16px;
text-align: left;
margin: 0px;
font-weight: normal;
}
div.navigation-dropdown {
position: absolute;
top: 80px;
left: -5px;
}
div.navigation-dropdown > ul {
padding: 0px;
margin: 0px;
position: absolute;
top: 20px;
width: 120px;
left: 15px;
z-index: 80;
}
div.navigation-dropdown > ul > li {
padding: 10px 10px 20px 10px;
list-style-type: none;
background-color: #fbe73d;
margin-top: -15px;
margin-bottom:...
JavaScript
//START OF MAIN NAVIATION SCRIPT
$("div.corner-peel").click(function(){
$(this).find("img").stop();
$(this).find("img").animate({
height: "160px",
width: "160px"
}, 1000);
});
$("div.corner-peel").hover(function(){
$(this).find("img").animate({
height: "60px",
width: "60px"
}, 500);
}, function() {
$(this).find("img").animate({
height: "30px",
width: "30px"
}, 500);
});
// END OF MAIN NAVIGATION SCRIPT
// START OF NAVIGATION DROPDOWN SCRIPT
$("div.navigation-dropdown").children().children().hide();
$("div.postit-surround").hover(function(){
if(!$(this).find("div.navigation-dropdown > ul > li").is(":visible")) {
var offset = 50;
function dropdown(x){
setTimeout(function() {
$(x).fadeIn(200);
$(x).addClass("dropdown-anim");
},$(x).index() * offset)
};
$(this).find("div.navigation-dropdown > ul > li").each(function(){
dropdown(this);
});
} else {
stop();
};
}, function returning(){
if($(this).find("div.navigation-dropdown > ul > li").is(":visible")) {
var offset = 50;
var totalLi = $("div.navigation-dropdown > ul > li").length;
function dropup(y){
setTimeout(function() {
$(y).fadeOut(200);
$(y).removeClass("dropdown-anim");
},(totalLi-$(y).index()) * offset);
};
$($(this).find("div.navigation-dropdown > ul > li").get().reverse()).each(function() {
dropup(this);
});
} else {
stop();
};
});
// END OF NAVIGATION DROPDOWN SCRIPT