Perspective Grid w/Animation // CSS Grid
How do I make an perspective grid w/animation // css grid?
I often see this type of skewed image design for apps and websites, as well as graphic design portfolios. What if we animated that into an image gallery? This gallery utilizes CSS Grid Layout and CSS3 perspective to create something a little unique.. What is a perspective grid w/animation // css grid? How do you make a perspective grid w/animation // css grid? This script and codes were developed by Brian Haferkamp on 27 January 2023, Friday.
Perspective Grid w/Animation // CSS Grid - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Perspective Grid w/Animation // CSS Grid</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="view-gallery"> <button>View Gallery</button>
</div>
<ul> <li class="box box-1"></li> <li class="box box-2"></li> <li class="box box-3"></li> <li class="box box-4"></li> <li class="box box-5"></li> <li class="box box-6"></li>
</ul> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Perspective Grid w/Animation // CSS Grid - Script Codes CSS Codes
* { box-sizing: border-box;
}
ul { list-style: none; padding: 0; -webkit-perspective: 3000px; perspective: 3000px; max-width: 768px; margin: auto; padding: 2rem;
}
@media (min-width: 768px) { ul { display: -ms-grid; display: grid; -ms-grid-columns: (1fr)[2]; grid-template-columns: repeat(2, 1fr); -ms-grid-rows: (1fr)[2]; grid-template-rows: repeat(2, 1fr); grid-gap: 1rem; }
}
.box { width: 100%; height: 200px; margin: -3rem 0 0; -webkit-transform: translateY(10vh) skew(60deg, -15deg) rotateX(40deg); transform: translateY(10vh) skew(60deg, -15deg) rotateX(40deg); box-shadow: -5px 5px 30px 1px rgba(0, 0, 0, 0.3); -webkit-transition: all 300ms ease; transition: all 300ms ease;
}
.box-1 { background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/495197/01ZeHnK3F_4_2000px.jpg); background-position: center; background-size: cover; background-repeat: no-repeat;
}
.box-2 { background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/495197/0st9yhngses-benjamin-child.jpg); background-position: center; background-size: cover; background-repeat: no-repeat;
}
.box-3 { background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/495197/Great_Wave_off_Kanagawa2_cr.jpg); background-position: center; background-size: cover; background-repeat: no-repeat;
}
.box-4 { background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/495197/bfezchfpm2i-igor-ovsyannykov.jpg); background-position: center; background-size: cover; background-repeat: no-repeat;
}
.box-5 { background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/495197/esawhr5fhn8-oskar-krawczyk.jpg); background-position: center; background-size: cover; background-repeat: no-repeat;
}
.box-6 { background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/495197/joshua-sortino-5581_cr.jpg); background-position: center; background-size: cover; background-repeat: no-repeat;
}
.view-gallery { text-align: center; margin: 5vh 0;
}
.view-gallery button { background: red; color: white; padding: 1rem 2rem; border: 0; -webkit-transition: background 200ms ease; transition: background 200ms ease;
}
.view-gallery button:hover { cursor: pointer; background: rgba(255, 0, 0, 0.8);
}
.animated { -webkit-transform: translateY(0) skew(0, 0) rotateX(0deg); transform: translateY(0) skew(0, 0) rotateX(0deg); margin: 0 0 1rem;
}
@media (min-width: 768px) { .animated { margin: 0; }
}
Perspective Grid w/Animation // CSS Grid - Script Codes JS Codes
$('.view-gallery button').on('click', function() { $('.box').toggleClass('animated'); // $('ul').css({ // 'max-width' : '100%' // });
});
Developer | Brian Haferkamp |
Username | brianhaferkamp |
Uploaded | January 27, 2023 |
Rating | 4 |
Size | 3,531 Kb |
Views | 2,024 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Gradient Transitions Between Sections | 3,329 Kb |
Follow Your Heart | 4,964 Kb |
Full-Width Hero with Image Using Flexbox | 2,459 Kb |
RADIOLOGY | 2,751 Kb |
Emoji-Driven Survey | 5,710 Kb |
Brutal, Bro | 6,575 Kb |
Creating a CSS Flexbox Grid | 2,022 Kb |
2-Up Magazine Layout | 8,250 Kb |
Brutalism Web Design School | 7,231 Kb |
Travel Blog Design with Sticky Nav and Sidebar | 8,383 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
SCSS Social Icons Flat | Mattsince87 | 3,482 Kb |
A Pen by Anoop | Anoopjohn | 330,760 Kb |
Slick Slider | Wearebold | 5,913 Kb |
Three js | Paulq | 2,353 Kb |
Adding and Removing Element | Accimeesterlin | 2,119 Kb |
A Pen by Oliver Schafeld | Schafeld | 1,720 Kb |
CSS-Flexbox-Demo | Sstiglets | 1,709 Kb |
JQuery AJAX reddit Exercise | Btholt | 1,777 Kb |
A cube | KyleDavidE | 18,627 Kb |
Revolving Text Landing Page Trial | TimRuby | 2,976 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!