Skip to content

Commit

Permalink
Added a image grid animation (#2750)
Browse files Browse the repository at this point in the history
* Added a image grid animation

* Removed the images
  • Loading branch information
KC1064 authored Oct 15, 2024
1 parent 91b6d3d commit 1dbc222
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Art/KC1064-Grid-Animation/index.html
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>
4 changes: 4 additions & 0 deletions Art/KC1064-Grid-Animation/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"githubHandle": "KC1064",
"artName": "Image Grid Animation"
}
58 changes: 58 additions & 0 deletions Art/KC1064-Grid-Animation/styles.css
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;
}

0 comments on commit 1dbc222

Please sign in to comment.