SOURCE CODE
HTML SOURCE_CODE:-
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>Page Title</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<link rel='stylesheet' type='text/css' media='screen' href='style.css'>
</head>
<body>
<div class="container">
<div class="card" >
<div class="imgBx sh1">
<img src="img/kisspng-nike-free-sneakers-air-force-nike-air-max-shoe-5b01c152eba9e8.9763145815268416829653.png" alt="">
</div>
<div class="imgBx sh2">
<img src="img/kisspng-nike-free-sneakers-nike-air-max-nike-flywire-nike-women-5b629d03577a04.6930883815331893793583.png" alt="">
</div>
<div class="imgBx sh3">
<img src="img/kisspng-sneakers-air-force-nike-air-max-nike-free-nike-air-force-5b1771bdbbc553.0731025715282631017691.png" alt="">
</div>
<div class="imgBx sh4">
<img src="img/kisspng-nike-free-nike-air-max-shoe-sneakers-men-shoes-5abc7cf3ebfd90.5501549415223021959666.png" alt="">
</div>
<div class="contentBx co-text1">
<h2>Nike Air Max Impact<br>
Flyknit 3</h2>
<div class="size">
<h3>Size:</h3>
<span>5</span>
<span>5.5</span>
<span>6</span>
<span>6.5</span>
</div>
<div class="color">
<h3>Color:</h3>
<span class="butt" id="c1"></span>
<span class="butt" id="c2"></span>
<span class="butt" id="c3"></span>
<span class="butt" id="c4"></span>
</div>
<a href="#">Buy Now</a>
</div>
<div class="contentBx co-text2">
<h2>Nike Air Max 95 <br>
Flyknit 1</h2>
<div class="size">
<h3>Size:</h3>
<span>5</span>
<span>5.5</span>
<span>6</span>
<span>6.5</span>
</div>
<div class="color">
<h3>Color:</h3>
<span class="butt" id="c1"></span>
<span class="butt" id="c2"></span>
<span class="butt" id="c3"></span>
<span class="butt" id="c4"></span>
</div>
<a href="#">Buy Now</a>
</div>
<div class="contentBx co-text3">
<h2>Nike Air Force 1 '07 <br>
Flyknit 3</h2>
<div class="size">
<h3>Size:</h3>
<span>5</span>
<span>5.5</span>
<span>6</span>
<span>6.5</span>
</div>
<div class="color">
<h3>Color:</h3>
<span class="butt" id="c1"></span>
<span class="butt" id="c2"></span>
<span class="butt" id="c3"></span>
<span class="butt" id="c4"></span>
</div>
<a href="#">Buy Now</a>
</div>
<div class="contentBx co-text4">
<h2>Nike Air VaporMax <br>
Flyknit 3</h2>
<div class="size">
<h3>Size:</h3>
<span>5</span>
<span>5.5</span>
<span>6</span>
<span>6.5</span>
</div>
<div class="color">
<h3>Color:</h3>
<span class="butt" id="c1"></span>
<span class="butt" id="c2"></span>
<span class="butt" id="c3"></span>
<span class="butt" id="c4"></span>
</div>
<a href="#">Buy Now</a>
</div>
<div class="co"></div>
</div>
</div>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.0/gsap.min.js" integrity="sha512-JO6JyFPJupQKZf7icgZkHwuq/rAQxH7COqvEd4WdK52AtHPedwHog05T69pIelI69jVN/zZbW6TuHfH2mS8j/Q==" crossorigin="anonymous"></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.0/CSSRulePlugin.min.js'></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.0/EaselPlugin.min.js"></script>
<script src='main.js'></script>
</html>
CSS SOURCE_CODE:-
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #070114;
color: white;
font-family: "poppins", sans-serif;
}
.container {
position: relative;
}
.container .card {
position: relative;
width: 320px;
height: 550px;
background:rgb(59, 59, 59);
border-radius: 20px;
overflow: hidden;
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
}
.co{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #f63f08;
clip-path: circle(150px at 80% 20%);
}
.container .card:after {
content: "Nike";
position: absolute;
top: 30%;
left: -20%;
font-size: 12em;
font-weight: 800;
font-style: italic;
color: rgba(255, 255, 255, 0.1);
}
.container .card .imgBx {
position: absolute;
top: 50%;
transform: translateY(-50%);
z-index: 1000;
width: 100%;
height: 200px;
transition: 0.5s;
}
.container .card:hover .imgBx {
top: 30%;
transform: translateY(0%);
}
.container .card .imgBx img {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-55%, -60%) rotate(-20deg);
width: cover;
height: 300px;
}
.container .card .contentBx {
position: absolute;
bottom: 0;
width: 100%;
height: 100px;
text-align: center;
transition: 1s;
z-index: 10;
}
.container .card:hover .contentBx {
height: 210px;
}
.container .card .contentBx h2 {
position: relative;
font-weight: 600;
letter-spacing: 1;
}
.container .card .contentBx .size,
.container .card .contentBx .color {
display: flex;
justify-content: center;
align-items: center;
padding: 8px 20px;
transition: 0.5s;
opacity: 0;
visibility: hidden;
}
.container .card:hover .contentBx .size {
opacity: 1;
visibility: visible;
transition-delay: 0.5s;
}
.container .card:hover .contentBx .color {
opacity: 1;
visibility: visible;
transition-delay: 0.5s;
}
.container .card .contentBx .size h3,
.container .card .contentBx .color h3 {
font-weight: 300;
font-size: 14px;
text-transform: uppercase;
letter-spacing: 2px;
margin-right: 10px;
}
.container .card .contentBx .size span {
width: 26px;
height: 26px;
text-align: center;
line-height: 26px;
font-size: 14px;
display: inline-block;
color: #fff;
background: #5f5d52;
margin: 0 5px;
transition: 0.5s;
color: #fff;
}
.container .card .contentBx .size span:hover {
background: #807775;
}
.container .card .contentBx .color span {
width: 20px;
height: 20px;
background: rgb(10, 10, 10);
border-radius: 50%;
margin: 0 5px;
cursor: pointer;
}
.container .card .contentBx .color span:nth-child(2) {
background: #ff5100;
}
.container .card .contentBx .color span:nth-child(3) {
background: #ffffff;
}
.container .card .contentBx .color span:nth-child(4) {
background: #f6b855;
}
.container .card .contentBx a {
display: inline-block;
padding: 10px 20px;
background: #575652;
border-radius: 24px;
margin-top: 5px;
text-decoration: none;
font-weight: 600;
opacity: 0;
color: #fff;
transform: translateY(50px);
transition: 0.5s;
}
.container .card:hover .contentBx a {
opacity: 1;
transform: translateY(0px);
transition-delay: 0.75s;
}
img {
height: 320px;
}
Javascript (.js file) SOURCE_CODE:-
$(".butt").click(function() {
$('.container').attr("color-center", this.id);
if (this.id == "c1") shoes1();
if (this.id == "c2") shoes2();
if (this.id == "c3") shoes3();
if (this.id == "c4") shoes4();
});
function shoes1() {
var tl = new TimelineMax()
.to(".sh2",0.1,{xPercent:100,},0)
.to(".sh3",0.1,{xPercent:100},0)
.to(".sh4",0.1,{xPercent:100},0)
.to(".sh1",0.1,{xPercent:0,},0)
.to(".co",0.1,{backgroundColor:"#f76b2a"})
.to("body",0.1,{backgroundColor:"#f76b2a"},0)
.from(".co",1,{xPercent:100,yPercent:-100})
.to(".co-text1",0.1,{yPercent:-3},0)
.to(".co-text2",0.1,{yPercent:900},0)
.to(".co-text3",0.1,{yPercent:950},0)
.to(".co-text4",0.1,{yPercent:950},0)
;
}
function shoes2() {
var tl = new TimelineMax()
.to(".sh1",0.1,{xPercent:100},0)
.to(".sh3",0.1,{xPercent:100},0)
.to(".sh4",0.1,{xPercent:100},0)
.to(".sh2",0.1,{xPercent:0,yPercent:-60},0)
.to(".co",0.1,{backgroundColor:"#eeeeee"})
.to("body",0.1,{backgroundColor:"#eeeeee"},0)
.from(".co",1,{xPercent:100,yPercent:-100})
.to(".co-text2",0.1,{yPercent:-3},0)
.to(".co-text1",0.1,{yPercent:900},0)
.to(".co-text3",0.1,{yPercent:950},0)
.to(".co-text4",0.1,{yPercent:950},0);
}
function shoes3() {
var tl = new TimelineMax()
.to(".sh2",0.1,{xPercent:100},0)
.to(".sh1",0.1,{xPercent:100},0)
.to(".sh4",0.1,{xPercent:100},0)
.to(".sh3",0.1,{xPercent:0},0)
.to(".co",0.1,{backgroundColor:"#f6b855"})
.to("body",0.1,{backgroundColor:"#f6b855"},0)
.from(".co",1,{xPercent:100,yPercent:-100})
.to(".co-text3",0.1,{yPercent:-3},0)
.to(".co-text1",0.1,{yPercent:900},0)
.to(".co-text2",0.1,{yPercent:950},0)
.to(".co-text4",0.1,{yPercent:950},0);
}
function shoes4() {
var tl = new TimelineMax()
.to(".sh2",0.1,{xPercent:100},0)
.to(".sh3",0.1,{xPercent:100},0)
.to(".sh1",0.1,{xPercent:100},0)
.to(".sh4",0.1,{xPercent:0},0)
.to(".co",0.1,{backgroundColor:"#999999"})
.to("body",0.1,{backgroundColor:"#999999"},0)
.from(".co",1,{xPercent:100,yPercent:-100})
.to(".co-text4",0.1,{yPercent:-3},0)
.to(".co-text1",0.1,{yPercent:900},0)
.to(".co-text3",0.1,{yPercent:950},0)
.to(".co-text2",0.1,{yPercent:950},0);
}
$(function() {
shoes1();
})
Comments
Post a Comment