Spaces:
Running on Zero
Running on Zero
File size: 1,322 Bytes
619344d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | /* ---------- layout / thumbnails ---------- */
body{
margin:0;
font-family:Arial,Helvetica,sans-serif;
padding:1rem;
}
/* will be “auto-fill” by default or 2-col when forced */
.grid{
display:grid;
grid-template-columns:repeat(auto-fill,minmax(320px,1fr));
gap:1rem;
}
.item img,
.item video{
width:100%;
height:auto;
border:1px solid #ccc;
box-sizing:border-box;
cursor:pointer;
}
.prompt{
width:100%;
height:120px;
margin-top:6px;
overflow:auto;
resize:vertical;
box-sizing:border-box;
}
/* ---------- light-box ---------- */
#overlay{
display:none;
position:fixed;
inset:0;
background:rgba(0,0,0,.9);
z-index:9999;
flex-direction:column;
align-items:center;
justify-content:center;
overflow:auto;
overscroll-behavior:contain; /* stop background scrolling */
}
#overlay.scrollY{ /* vertical overflow when zoomed */
justify-content:flex-start;
}
#overlay img{
max-width:90vw;
max-height:90vh;
cursor:zoom-in;
}
#overlay img.zoomed{
max-width:none;
max-height:none;
cursor:zoom-out;
}
#overlay video{
max-width:90vw;
max-height:90vh;
cursor:default; /* videos don’t zoom */
}
#caption{
color:#fff;
margin:1rem auto 0 auto;
text-align:center;
font-size:1rem;
padding:0 1rem;
max-width:90vw;
}
|