-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a image grid animation (#2750)
* Added a image grid animation * Removed the images
- Loading branch information
Showing
3 changed files
with
78 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,16 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Grid Animation</title> | ||
</head> | ||
<link rel="stylesheet" href="styles.css"> | ||
<body> | ||
<div id="grid"> | ||
<div class="col left">Silde 1</div> | ||
<div class="col center">Slide 2</div> | ||
<div class="col right">Slide 3</div> | ||
</div> | ||
</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,4 @@ | ||
{ | ||
"githubHandle": "KC1064", | ||
"artName": "Image Grid Animation" | ||
} |
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,58 @@ | ||
*, | ||
*::before, | ||
*::after { | ||
margin: 0; | ||
padding: 0; | ||
box-sizing: border-box; | ||
} | ||
|
||
body { | ||
height: 100vh; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
background-color: #222; | ||
} | ||
|
||
#grid { | ||
width: 90%; | ||
height: 100%; | ||
display: grid; | ||
grid-template-columns: 1fr 1fr 1fr; | ||
gap: 8px; | ||
transition: grid-template-columns 0.5s ease-in-out; | ||
} | ||
|
||
#grid:has(.left:hover) { | ||
grid-template-columns: 2fr 0.5fr 0.5fr; | ||
} | ||
#grid:has(.center:hover) { | ||
grid-template-columns: 0.5fr 2fr 0.5fr; | ||
} | ||
#grid:has(.right:hover) { | ||
grid-template-columns: 0.5fr 0.5fr 2fr; | ||
} | ||
|
||
|
||
.left { | ||
background-color: pink; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
font-size: 2rem; | ||
} | ||
.center { | ||
background-color: aqua; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
font-size: 2rem; | ||
|
||
} | ||
.right { | ||
background-color: greenyellow; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
font-size: 2rem; | ||
} |