JSFiddle - React, Tailwind, and code Playground
by von
HTML
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
.gallery {
display: flex;
}
figure {
width: 100px;
height: 100px;
margin: 10px;
cursor: pointer;
position: relative;
}
.image {
position: relative;
width: 100%;
height: 100%;
object-fit: cover;
}
figure::after {
content: '';
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
background-image: url("mag-icon.png");
background-position: 100% 100%;
background-repeat: no-repeat;
background-size: 70%;
pointer-events: none;
}
figcaption {
font-weight: 800;
}
*, *::after, *::before {
margin: 0;
padding: 0;
box-sizing: border-box;
}
p {
padding: 1rem;
}
html {
scroll-behavior: smooth;
}
body {
font-family: Arial, Helvetica, sans-serif;
margin: 0;
position: relative;
}
button {
padding: 5px;
}
#scroll {
position: absolute;
top: 50%
}
.modal {
display: none;
position: absolute;
top: 0px;
border: 0px;
background: black;
left: 0px;
right: 0px;
height: 100%;
background-color: rgb(0, 0, 0); /* Fallback color */
background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */
}
/* Modal Content */
.modal-content {
position: relative;
margin: auto;
width: 80%;
height: 80vh;
display: flex;
justify-content: center;
align-items: center;
background-image: url(https://totojikim.com/_images/loading.gif);
background-position: center;
background-repeat: no-repeat;
}
.modal-content img {
max-width: 100%;
max-height: 100%;
...