Skip to content

Commit d6823f7

Browse files
committed
PhotoSwipeSupport
1 parent 23a445c commit d6823f7

File tree

2 files changed

+250
-304
lines changed

2 files changed

+250
-304
lines changed

assets/css/main.css

Lines changed: 12 additions & 170 deletions
Original file line numberDiff line numberDiff line change
@@ -2272,176 +2272,18 @@ button,
22722272
margin-top: 0;
22732273
padding-top: 0; }
22742274

2275-
/* Image Modal */
2276-
.modal {
2277-
display: none;
2278-
position: fixed;
2279-
z-index: 10001;
2280-
padding-top: 50px;
2281-
left: 0;
2282-
top: 0;
2283-
width: 100%;
2284-
height: 100%;
2285-
overflow: auto;
2286-
background-color: rgba(0, 0, 0, 0.9);
2287-
backdrop-filter: blur(5px);
2288-
}
2289-
2290-
.modal-content {
2291-
margin: auto;
2292-
display: block;
2293-
width: 90%;
2294-
max-width: 1200px;
2295-
max-height: 85vh;
2296-
object-fit: contain;
2297-
border-radius: 0.375em;
2298-
animation: zoom 0.3s ease;
2299-
}
2300-
2301-
@keyframes zoom {
2302-
from {
2303-
transform: scale(0.1);
2304-
opacity: 0;
2305-
}
2306-
to {
2307-
transform: scale(1);
2308-
opacity: 1;
2309-
}
2310-
}
2311-
2312-
.close {
2275+
.pswp__custom-caption {
2276+
background: rgba(0, 0, 0, 0.75);
2277+
font-size: 16px;
2278+
color: #fff;
2279+
width: calc(100% - 32px);
2280+
max-width: 600px;
2281+
padding: 8px 16px;
2282+
border-radius: 4px;
23132283
position: absolute;
2314-
top: 15px;
2315-
right: 35px;
2316-
color: #f1f1f1;
2317-
font-size: 40px;
2318-
font-weight: bold;
2319-
transition: 0.3s;
2320-
cursor: pointer;
2321-
z-index: 10002;
2322-
}
2323-
2324-
.close:hover,
2325-
.close:focus {
2326-
color: #f56a6a;
2327-
text-decoration: none;
2328-
}
2329-
2330-
#caption {
2331-
margin: auto;
2332-
display: block;
2333-
width: 80%;
2334-
max-width: 700px;
2335-
text-align: center;
2336-
color: #ccc;
2337-
padding: 10px 0;
2284+
left: 50%;
2285+
bottom: 16px;
2286+
transform: translateX(-50%);
23382287
font-family: "Roboto Slab", serif;
2339-
font-size: 1.1em;
2340-
}
2341-
2342-
/* Clickable images cursor */
2343-
.image.fit img,
2344-
.image.main img {
2345-
cursor: pointer;
2346-
transition: transform 0.2s ease, opacity 0.2s ease;
2347-
}
2348-
2349-
.image.fit img:hover,
2350-
.image.main img:hover {
2351-
transform: scale(1.02);
2352-
opacity: 0.9;
2353-
}
2354-
2355-
.image.fit img,
2356-
.image.main img {
2357-
max-width: 400px;
2358-
height: auto;
2359-
object-fit: cover;
2360-
2361-
/* Prevent body scroll when modal is open */
2362-
body.modal-open {
2363-
overflow: hidden;
2364-
}
2365-
2366-
/* Mobile responsive */
2367-
@media screen and (max-width: 736px) {
2368-
.modal {
2369-
padding-top: 20px;
2370-
}
2371-
2372-
.modal-content {
2373-
width: 95%;
2374-
max-height: 80vh;
2375-
}
2376-
2377-
.close {
2378-
top: 10px;
2379-
right: 20px;
2380-
font-size: 30px;
2381-
}
2382-
2383-
#caption {
2384-
width: 90%;
2385-
font-size: 1em;
2386-
}
2387-
}
2388-
2389-
/* Navigation arrows */
2390-
.modal-nav {
2391-
cursor: pointer;
2392-
position: absolute;
2393-
top: 50%;
2394-
width: auto;
2395-
margin-top: -22px;
2396-
padding: 16px;
2397-
color: white;
2398-
font-weight: bold;
2399-
font-size: 24px;
2400-
transition: 0.3s ease;
2401-
border-radius: 0 3px 3px 0;
2402-
user-select: none;
2403-
background-color: rgba(0, 0, 0, 0.5);
2404-
z-index: 10003;
2405-
}
2406-
2407-
.modal-prev {
2408-
left: 20px;
2409-
border-radius: 3px 0 0 3px;
2410-
}
2411-
2412-
.modal-next {
2413-
right: 20px;
2414-
border-radius: 0 3px 3px 0;
2415-
}
2416-
2417-
.modal-nav:hover {
2418-
background-color: rgba(0, 0, 0, 0.8);
2419-
color: #f56a6a;
2420-
}
2421-
2422-
.modal-nav.disabled {
2423-
color: #666;
2424-
cursor: not-allowed;
2425-
background-color: rgba(0, 0, 0, 0.2);
2426-
}
2427-
2428-
.modal-nav.disabled:hover {
2429-
background-color: rgba(0, 0, 0, 0.2);
2430-
color: #666;
2431-
}
2432-
2433-
@media screen and (max-width: 736px) {
2434-
.modal-nav {
2435-
font-size: 18px;
2436-
padding: 12px;
2437-
margin-top: -18px;
2438-
}
2439-
2440-
.modal-prev {
2441-
left: 10px;
2442-
}
2443-
2444-
.modal-next {
2445-
right: 10px;
2446-
}
2288+
text-align: center;
24472289
}

0 commit comments

Comments
 (0)