Pure CSS Gallery
How do I make an pure css gallery?
Responsive gallery with pop-up lightboxes. Everything in pure CSS!. What is a pure css gallery? How do you make a pure css gallery? This script and codes were developed by Miro Karilahti on 07 July 2022, Thursday.
Pure CSS Gallery - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Pure CSS Gallery</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body>
// The numbers are Unsplash It picture IDs
- var pics = [
- 1, 20, 635, 42,
- 180, 625, 201, 7,
- 48, 180, 534, 24
- ]
// Loop all pictures and print checkboxes and lightboxes for them
- var pic_id = 0
- each pic in pics - pic_id++ input(type="checkbox", id="pic-#{pic_id}") label.lightbox(for="pic-#{pic_id}") img(src="//unsplash.it/800/600?image=#{pic}")
.grid // Loop all pictures and print the actual images - var pic_id = 0 - each pic in pics - pic_id++ label.grid-item(for="pic-#{pic_id}") img(src="//unsplash.it/400/300?image=#{pic}") <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
</body>
</html>
Pure CSS Gallery - Script Codes CSS Codes
*,
*:before,
*:after { box-sizing: border-box;
}
label[for] { cursor: pointer;
}
input[type="checkbox"] { display: none;
}
body { background-color: #000;
}
.lightbox, .grid { width: 100%; position: fixed; top: 0; left: 0;
}
.lightbox { z-index: 1; min-height: 100%; overflow: auto; transform: scale(0); transition: transform .5s ease-out;
}
.lightbox img { position: fixed; top: 50%; left: 50%; max-width: 96%; max-height: 96%; transform: translate(-50%, -50%); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
input[type="checkbox"]:checked + .lightbox { transform: scale(1);
}
input[type="checkbox"]:checked ~ .grid { opacity: .125;
}
.grid { display: flex; flex-wrap: wrap; align-items: flex-start; align-content: flex-start; height: 100%; padding: 16px; overflow: auto; z-index: 0; background-color: #222; text-align: center; transition: opacity .75s;
}
.grid .grid-item { display: block; width: 25%; padding: 16px; opacity: .75; transition: opacity .5s;
}
.grid .grid-item:hover { opacity: 1;
}
@media screen and (max-width: 1280px) { .grid .grid-item { width: 33.3333%; }
}
@media screen and (max-width: 960px) { .grid .grid-item { width: 50%; }
}
@media screen and (max-width: 480px) { .grid .grid-item { width: 100%; }
}
.grid img { max-width: 100%; max-height: 100%; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
Developer | Miro Karilahti |
Username | miroot |
Uploaded | July 07, 2022 |
Rating | 4.5 |
Size | 3,817 Kb |
Views | 42,504 |
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 |
Single element Nexus 5 | 2,159 Kb |
Calendar | 2,033 Kb |
Social Icons | 2,941 Kb |
Flat sidebar | 2,664 Kb |
Long Shadow Calendar Icon | 1,856 Kb |
Color changing text | 2,068 Kb |
Flat Text Editor | 2,468 Kb |
Simple personal profile | 2,856 Kb |
Long Shadow Camera Icon | 1,825 Kb |
Corner Ribbons | 1,911 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 |
NgEasyModal | Lorenzodianni | 4,159 Kb |
Scoreboard.js basic usage | Tbleckert | 1,733 Kb |
Spilled Paint | Darrylhuffman | 3,894 Kb |
Animated css matrix type | NielsOeltjen | 3,484 Kb |
Use the Twitchtv JSON API | Roksanaop | 3,561 Kb |
AOR site logo | Thatbram | 2,527 Kb |
SVG Animation | Pollardld | 3,133 Kb |
A Pen by James Podles | Jpod | 2,656 Kb |
DIV wormhole | Heydon | 1,932 Kb |
Countdown Timer | Massiebn | 3,001 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!