-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0488527
commit ee8d744
Showing
38 changed files
with
3,273 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<!-- <link | ||
rel="stylesheet" | ||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css" | ||
integrity="sha512-+4zCK9k+qNFUR5X+cKL9EIR+ZOhtIloNl9GIKS57V1MyNsYpYcUrUeQc9vNfzsWfV28IaLL3i96P9sdNyeRssA==" | ||
crossorigin="anonymous" | ||
/> --> | ||
<link rel="stylesheet" href="style.css" /> | ||
<title>Talha - Expanding cards</title> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div | ||
class="panel active" | ||
style=" | ||
background-image: url('https://images.unsplash.com/photo-1610212570473-6015f631ae96?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80'); | ||
" | ||
> | ||
<h3>Explore the world</h3> | ||
</div> | ||
<div | ||
class="panel" | ||
style=" | ||
background-image: url('https://images.unsplash.com/photo-1606838830438-5f380a664a4e?ixlib=rb-1.2.1&ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&auto=format&fit=crop&w=1350&q=80'); | ||
" | ||
> | ||
<h3>Explore the world</h3> | ||
</div> | ||
<div | ||
class="panel" | ||
style=" | ||
background-image: url('https://images.unsplash.com/photo-1606059100151-b09b22709477?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1778&q=80'); | ||
" | ||
> | ||
<h3>Explore the world</h3> | ||
</div> | ||
<div | ||
class="panel" | ||
style=" | ||
background-image: url('https://images.unsplash.com/photo-1603048675767-6e79ff5b8fc1?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80'); | ||
" | ||
> | ||
<h3>Explore the world</h3> | ||
</div> | ||
<div | ||
class="panel" | ||
style=" | ||
background-image: url('https://images.unsplash.com/photo-1595433502559-d8f05e6a1041?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80'); | ||
" | ||
> | ||
<h3>Explore the world</h3> | ||
</div> | ||
</div> | ||
<script src="script.js"></script> | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const panels = document.querySelectorAll(".panel"); | ||
|
||
panels.forEach((panel) => { | ||
panel.addEventListener("click", () => { | ||
removeActiveClasses(); | ||
panel.classList.add("active"); | ||
}); | ||
}); | ||
|
||
const removeActiveClasses = () => { | ||
panels.forEach((panel) => { | ||
panel.classList.remove("active"); | ||
}); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
@import url("https://fonts.googleapis.com/css2?family=Muli&display=swap"); | ||
|
||
* { | ||
box-sizing: border-box; /* to avoid width problems if padding */ | ||
} | ||
|
||
body { | ||
font-family: "Muli", sans-serif; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
height: 100vh; | ||
overflow: hidden; /* to hide scrollbars */ | ||
margin: 0; | ||
} | ||
|
||
.container { | ||
display: flex; | ||
width: 90vw; | ||
} | ||
|
||
.panel { | ||
background-size: auto 100%; | ||
background-position: center; | ||
background-repeat: no-repeat; | ||
height: 80vh; | ||
border-radius: 50px; | ||
color: #fff; | ||
cursor: pointer; | ||
flex: 0.5; | ||
margin: 10px; | ||
position: relative; | ||
transition: flex 0.7s ease-in; | ||
-webkit-transition: all 700ms ease-in; | ||
} | ||
|
||
.panel h3 { | ||
font-size: 24px; | ||
position: absolute; | ||
bottom: 20px; | ||
left: 20px; | ||
margin: 0; | ||
opacity: 0; | ||
} | ||
|
||
.panel.active { | ||
flex: 5; | ||
} | ||
|
||
.panel.active h3 { | ||
opacity: 1; | ||
transition: opacity 0.3s ease-in 0.4s; | ||
} | ||
|
||
@media (max-width: 480px) { | ||
.container { | ||
width: 100vw; | ||
} | ||
|
||
.panel:nth-of-type(4), | ||
.panel:nth-of-type(5) { | ||
display: none; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Talha - 3D Card Hover Effect</title> | ||
<link rel="stylesheet" href="./style.css" /> | ||
</head> | ||
<body> | ||
<!-- partial:index.partial.html --> | ||
<div class="card"> | ||
<div class="wrapper"> | ||
<img | ||
src="https://ggayane.github.io/css-experiments/cards/dark_rider-cover.jpg" | ||
class="cover-image" | ||
/> | ||
</div> | ||
<img | ||
src="https://ggayane.github.io/css-experiments/cards/dark_rider-title.png" | ||
class="title" | ||
/> | ||
<img | ||
src="https://ggayane.github.io/css-experiments/cards/dark_rider-character.webp" | ||
class="character" | ||
/> | ||
</div> | ||
|
||
<div class="card"> | ||
<div class="wrapper"> | ||
<img | ||
src="https://ggayane.github.io/css-experiments/cards/force_mage-cover.jpg" | ||
class="cover-image" | ||
/> | ||
</div> | ||
<img | ||
src="https://ggayane.github.io/css-experiments/cards/force_mage-title.png" | ||
class="title" | ||
/> | ||
<img | ||
src="https://ggayane.github.io/css-experiments/cards/force_mage-character.webp" | ||
class="character" | ||
/> | ||
</div> | ||
<!-- partial --> | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
:root { | ||
--card-height: 300px; | ||
--card-width: calc(var(--card-height) / 1.5); | ||
} | ||
* { | ||
box-sizing: border-box; | ||
} | ||
body { | ||
width: 100vw; | ||
height: 100vh; | ||
margin: 0; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
background: #191c29; | ||
} | ||
.card { | ||
width: var(--card-width); | ||
height: var(--card-height); | ||
position: relative; | ||
display: flex; | ||
justify-content: center; | ||
align-items: flex-end; | ||
padding: 0 36px; | ||
perspective: 2500px; | ||
margin: 0 50px; | ||
} | ||
|
||
.cover-image { | ||
width: 100%; | ||
height: 100%; | ||
object-fit: cover; | ||
} | ||
|
||
.wrapper { | ||
transition: all 0.5s; | ||
position: absolute; | ||
width: 100%; | ||
z-index: -1; | ||
} | ||
|
||
.card:hover .wrapper { | ||
transform: perspective(900px) translateY(-5%) rotateX(25deg) translateZ(0); | ||
box-shadow: 2px 35px 32px -8px rgba(0, 0, 0, 0.75); | ||
-webkit-box-shadow: 2px 35px 32px -8px rgba(0, 0, 0, 0.75); | ||
-moz-box-shadow: 2px 35px 32px -8px rgba(0, 0, 0, 0.75); | ||
} | ||
|
||
.wrapper::before, | ||
.wrapper::after { | ||
content: ""; | ||
opacity: 0; | ||
width: 100%; | ||
height: 80px; | ||
transition: all 0.5s; | ||
position: absolute; | ||
left: 0; | ||
} | ||
.wrapper::before { | ||
top: 0; | ||
height: 100%; | ||
background-image: linear-gradient( | ||
to top, | ||
transparent 46%, | ||
rgba(12, 13, 19, 0.5) 68%, | ||
rgba(12, 13, 19) 97% | ||
); | ||
} | ||
.wrapper::after { | ||
bottom: 0; | ||
opacity: 1; | ||
background-image: linear-gradient( | ||
to bottom, | ||
transparent 46%, | ||
rgba(12, 13, 19, 0.5) 68%, | ||
rgba(12, 13, 19) 97% | ||
); | ||
} | ||
|
||
.card:hover .wrapper::before, | ||
.wrapper::after { | ||
opacity: 1; | ||
} | ||
|
||
.card:hover .wrapper::after { | ||
height: 120px; | ||
} | ||
.title { | ||
width: 100%; | ||
transition: transform 0.5s; | ||
} | ||
.card:hover .title { | ||
transform: translate3d(0%, -50px, 100px); | ||
} | ||
|
||
.character { | ||
width: 100%; | ||
opacity: 0; | ||
transition: all 0.5s; | ||
position: absolute; | ||
z-index: -1; | ||
} | ||
|
||
.card:hover .character { | ||
opacity: 1; | ||
transform: translate3d(0%, -30%, 100px); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Talha - Creative Card</title> | ||
<link rel="stylesheet" href="style.css" /> | ||
</head> | ||
<body> | ||
<section class="card"> | ||
<section class="imgBox"> | ||
<img src="marian-oleksyn-Edv_EEWiB3E-unsplash.jpg" /> | ||
</section> | ||
<article class="details"> | ||
<h2>Olivia</h2> | ||
</article> | ||
</section> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
body { | ||
margin: 0; | ||
height: 100vh; | ||
background: linear-gradient(#0093e9, #80d0c7); | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
font-family: sans-serif; | ||
} | ||
|
||
.card { | ||
position: relative; | ||
width: 30rem; | ||
height: 30rem; | ||
background: white; | ||
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5); | ||
} | ||
|
||
.card:before, | ||
.card:after { | ||
content: ""; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background: white; | ||
transition: 1s; | ||
z-index: -1; | ||
} | ||
|
||
.card:hover:before { | ||
transform: rotate(20deg); | ||
box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2); | ||
} | ||
|
||
.card:hover:after { | ||
transform: rotate(10deg); | ||
box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2); | ||
} | ||
|
||
.imgBox { | ||
position: absolute; | ||
top: 10px; | ||
left: 10px; | ||
bottom: 10px; | ||
right: 10px; | ||
background: #222; | ||
transition: 1s; | ||
z-index: 2; | ||
} | ||
|
||
img { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
object-fit: cover; | ||
} | ||
|
||
.card:hover .imgBox { | ||
bottom: 80px; | ||
} | ||
|
||
.details { | ||
position: absolute; | ||
left: 10px; | ||
right: 10px; | ||
bottom: 10px; | ||
height: 60px; | ||
text-align: center; | ||
} |
Oops, something went wrong.