<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Grid Gallery</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1 class="heading">Grid<br>Gallery</h1>
<div class="container">
<div class="child-container">
<img src="https://picsum.photos/100" alt="pic 1">
</div>
<div class="child-container">
<img src="https://picsum.photos/200" alt="pic 2">
</div>
<div class="child-container">
<img src="https://picsum.photos/300" alt="pic 3">
</div>
<div class="child-container">
<img src="https://picsum.photos/400" alt="pic 4">
</div>
<div class="child-container">
<img src="https://picsum.photos/500" alt="pic 5">
</div>
<div class="child-container">
<img src="https://picsum.photos/600" alt="pic 6">
</div>
<div class="child-container">
<img src="https://picsum.photos/150" alt="pic 7">
</div>
<div class="child-container">
<img src="https://picsum.photos/250" alt="pic 8">
</div>
<div class="child-container">
<img src="https://picsum.photos/350" alt="pic 9">
</div>
<div class="child-container">
<img src="https://picsum.photos/450" alt="pic 10">
</div>
<div class="child-container">
<img src="https://picsum.photos/550" alt="pic 11">
</div>
<div class="child-container">
<img src="https://picsum.photos/650" alt="pic 12">
</div>
<div class="child-container">
<img src="https://picsum.photos/110" alt="pic 13">
</div>
<div class="child-container">
<img src="https://picsum.photos/210" alt="pic 14">
</div>
<div class="child-container">
<img src="https://picsum.photos/310" alt="pic 15">
</div>
<div class="child-container">
<img src="https://picsum.photos/410" alt="pic 16">
</div>
<div class="child-container">
<img src="https://picsum.photos/510" alt="pic 17">
</div>
<div class="child-container">
<img src="https://picsum.photos/610" alt="pic 18">
</div>
<div class="child-container">
<img src="https://picsum.photos/125" alt="pic 19">
</div>
<div class="child-container">
<img src="https://picsum.photos/225" alt="pic 20">
</div>
<div class="child-container">
<img src="https://picsum.photos/325" alt="pic 21">
</div>
<div class="child-container">
<img src="https://picsum.photos/425" alt="pic 22">
</div>
<div class="child-container">
<img src="https://picsum.photos/525" alt="pic 23">
</div>
<div class="child-container">
<img src="https://picsum.photos/625" alt="pic 24">
</div>
</div>
</body>
</html>
* {
box-sizing: border-box;
transition: all 0.2s;
}
body {
margin: 0px;
overflow: hidden;
}
body .heading {
font-size: 8rem;
margin: 7rem 3rem;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
font-weight: 300;
color: #cb904d;
display: inline-block;
position: relative;
z-index: 3;
}
body .heading::after {
content: "";
width: 80%;
height: 80%;
position: absolute;
top: 22%;
left: 12%;
border: 1px solid #cb904d31;
z-index: -20;
}
@keyframes move {
from {
transform: rotate(45deg) translate(-120px, 60px);
}
to {
transform: rotate(45deg) translate(-120px, -290px);
}
}
body .container {
margin: 0px;
position: fixed;
right: 0px;
top: 0px;
display: grid;
grid-template-columns: auto auto auto;
gap: 1rem;
animation: move 4.5s linear infinite alternate;
}
.container .child-container {
width: 150px;
height: 150px;
border-radius: 5px;
background-color: #b9b9b9;
text-align: center;
overflow: hidden;
}
.child-container img {
width: 100%;
height: 100%;
border-radius: inherit;
}
@media screen and (max-width: 1000px) {
body .heading {
margin: 9rem 3rem;
font-size: 6rem;
}
}
@media screen and (max-width: 780px) {
body .heading {
font-size: 4rem;
margin: 12rem 2rem;
}
@keyframes move {
from {
transform: rotate(45deg) translate(20px, 80px);
}
to {
transform: rotate(45deg) translate(20px, 20px);
}
}
body .container {
gap: 0.5rem;
}
.container .child-container {
width: 100px;
height: 100px;
border-radius: 4px;
}
}
@media screen and (max-width: 500px) {
body .heading {
margin: 8rem 2rem;
}
@keyframes move {
from {
transform: rotate(45deg) translate(150px, 80px);
}
to {
transform: rotate(45deg) translate(150px, 20px);
}
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.