Skip to content

Commit 368b61a

Browse files
authored
Add files via upload
1 parent c078413 commit 368b61a

7 files changed

Lines changed: 305 additions & 0 deletions

File tree

adidas.png

618 KB
Loading

app.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
const container = document.querySelector('.container');
2+
const card = document.querySelector('.card');
3+
//Items
4+
const title = document.querySelector("h1");
5+
const sneaker = document.querySelector(".shoe img");
6+
const description = document.querySelector(".card p");
7+
// const sizes = document.querySelector("button");
8+
9+
//const container = document.querySelector('.container');
10+
container.addEventListener("mousemove", (e) => {
11+
let xAxis = (window.innerWidth / 2 - e.pageX) / 25;
12+
let yAxis = (window.innerHeight / 2 - e.pageY) / 25;
13+
card.style.transform = `rotateY(${xAxis}deg) rotateX(${yAxis}deg)`;
14+
});
15+
//Animation starts
16+
container.addEventListener("mouseenter", (e) => {
17+
card.style.transition = "none";
18+
//zoom
19+
title.style.transform = "translateZ(150px)";
20+
sneaker.style.transform = "translateZ(200px) rotateZ(-45deg) scale(1.4)";
21+
description.style.transform = "translateZ(125px)";
22+
sizes.style.transform = "translateZ(100px)";
23+
});
24+
// Animation ends
25+
container.addEventListener("mouseleave", (e) => {
26+
card.style.transition = "all 0.5s ease";
27+
card.style.transform = `rotateY(0deg) rotateX(0deg)`;
28+
//Popback
29+
title.style.transform = "translateZ(0px)";
30+
sneaker.style.transform = "translateZ(0px) rotateZ(0deg)";
31+
description.style.transform = "translateZ(0px)";
32+
sizes.style.transform = "translateZ(0px)";
33+
purchase.style.transform = "translateZ(0px)";
34+
})

apps.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//Movement Animation to happen
2+
const container = document.querySelector(".container");
3+
const card = document.querySelector(".card");
4+
5+
//Items
6+
const title = document.querySelector(".title");
7+
const sneaker = document.querySelector(".sneaker img");
8+
const purchase = document.querySelector(".purchase");
9+
const description = document.querySelector(".info h3");
10+
const sizes = document.querySelector(".sizes");
11+
12+
//Moving Animation Event
13+
container.addEventListener("mousemove", (e) => {
14+
let xAxis = (window.innerWidth / 2 - e.pageX) / 25;
15+
let yAxis = (window.innerHeight / 2 - e.pageY) / 25;
16+
card.style.transform = `rotateY(${xAxis}deg) rotateX(${yAxis}deg)`;
17+
});
18+
//Animate In
19+
container.addEventListener("mouseenter", (e) => {
20+
card.style.transition = "none";
21+
//Popout
22+
title.style.transform = "translateZ(150px)";
23+
sneaker.style.transform = "translateZ(200px) rotateZ(-45deg)";
24+
description.style.transform = "translateZ(125px)";
25+
sizes.style.transform = "translateZ(100px)";
26+
purchase.style.transform = "translateZ(75px)";
27+
});
28+
//Animate Out
29+
container.addEventListener("mouseleave", (e) => {
30+
card.style.transition = "all 0.5s ease";
31+
card.style.transform = `rotateY(0deg) rotateX(0deg)`;
32+
//Popback
33+
title.style.transform = "translateZ(0px)";
34+
sneaker.style.transform = "translateZ(0px) rotateZ(0deg)";
35+
description.style.transform = "translateZ(0px)";
36+
sizes.style.transform = "translateZ(0px)";
37+
purchase.style.transform = "translateZ(0px)";
38+
});

index.html

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<link rel="stylesheet" href="styles.css">
4+
5+
6+
<head>
7+
<meta charset="UTF-8" http-equiv="X-UA-Compatible" content="IE">
8+
<title>snix</title>
9+
10+
</head>
11+
12+
<body>
13+
14+
<div class="container">
15+
<div class="card">
16+
<div class="shoe">
17+
<img src="./adidas.png" alt="shoe">
18+
19+
</div>
20+
<h1>Adidas Znix</h1>
21+
<p>Future Ready Trainers with wrapped Boost Zoom your WAY</p>
22+
<ul>Sizes
23+
<button>22</button>
24+
<button>28</button>
25+
<button>30</button>
26+
<button>32</button>
27+
</ul>
28+
</div>
29+
</div>
30+
<script src="app.js"></script>
31+
</body>
32+
33+
</html>

styles.css

Lines changed: 106 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

styles.css.map

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

styles.scss

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;800;900&display=swap');
2+
html {
3+
font-size: 16px;
4+
}
5+
6+
* {
7+
margin: 0;
8+
padding: 0;
9+
box-sizing: border-box;
10+
font-family: 'Poppins', sans-serif;
11+
}
12+
13+
body {
14+
display: flex;
15+
justify-content: center;
16+
align-content: center;
17+
height: 100vh;
18+
perspective: 1000px;
19+
}
20+
21+
.container {
22+
margin-top: 5rem;
23+
height: 40rem;
24+
transform-style: preserve-3d;
25+
display: flex;
26+
text-align: center;
27+
justify-content: center;
28+
padding: 3rem;
29+
// width: 20rem;
30+
// background-color: lightcoral;
31+
border-radius: 18px;
32+
box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.2), 0px 0px 50px rgba(0, 0, 0, 0.3);
33+
}
34+
35+
.shoe {
36+
background: linear-gradient(90deg, red, blue);
37+
border-radius: 50%;
38+
width: 10rem;
39+
height: 10rem;
40+
place-self: center;
41+
}
42+
43+
.card {
44+
place-items: center;
45+
display: flex;
46+
transform-style: preserve-3d;
47+
flex-wrap: nowrap;
48+
width: 40rem;
49+
flex-direction: column;
50+
gap: 10px;
51+
}
52+
53+
.card>*,
54+
.shoe img {
55+
transition: .8s;
56+
}
57+
58+
img {
59+
width: 15rem;
60+
z-index: 1;
61+
// position: absolute;
62+
// left: 170px;
63+
}
64+
65+
.shoe {
66+
margin-bottom: 4rem;
67+
}
68+
69+
p {
70+
width: 18rem;
71+
}
72+
73+
button {
74+
font-size: medium;
75+
padding: .4rem;
76+
margin: 1rem;
77+
border: none;
78+
border-radius: 50%;
79+
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
80+
}
81+
82+
button:hover {
83+
color: black;
84+
background: linear-gradient(90deg, rgb(208, 99, 99), rgb(120, 120, 220));
85+
}

0 commit comments

Comments
 (0)