MediaWiki:Gadget-AbsyFancyBoxy.css: различия между версиями
Перейти к навигации
Перейти к поиску
Ланселот (обсуждение | вклад) Нет описания правки |
Ланселот (обсуждение | вклад) Нет описания правки |
||
| (не показано 7 промежуточных версий этого же участника) | |||
| Строка 1: | Строка 1: | ||
/** | /** | ||
* AbsyFancyBoxy — локальный лайтбокс | * AbsyFancyBoxy — локальный лайтбокс | ||
* Версия 1.0: | |||
• Идеальный минимум для работы всех фичей: Safari (iOS/macOS) 15.4+ (март 2022); Chrome 108+ (конец 2022); Firefox 101+ (май 2022). | |||
• Реальный минимум (работает, но с упрощениями): Safari (iOS) 10+ (2016); Chrome 49+ (2016); Firefox: 49+ (2016) | |||
* Идёт в связке с [[MediaWiki:Gadget-AbsyFancyBoxy.js]] | * Идёт в связке с [[MediaWiki:Gadget-AbsyFancyBoxy.js]] | ||
* Лицензия: | * Лицензия: MIT (opensource.org/license/mit) ==> 2026, absurdopedia.wiki | ||
*/ | */ | ||
| Строка 15: | Строка 18: | ||
justify-content: center; | justify-content: center; | ||
flex-direction: column; | flex-direction: column; | ||
opacity: 0.99; /* хак бага iOS 26.0, есть у 1% айфонщиков на 2026 год */ | |||
} | } | ||
| Строка 33: | Строка 37: | ||
flex-direction: column; | flex-direction: column; | ||
align-items: center; | align-items: center; | ||
justify-content: | justify-content: flex-start; | ||
max-width: 90vw; | max-width: 90vw; | ||
max-height: 90vh; | max-height: 90vh; | ||
max-height: 90dvh; /* dvh поддерживают современные браузеры с 2022 года */ | |||
z-index: 1; | z-index: 1; | ||
overflow: hidden; | overflow: hidden; | ||
box-sizing: border-box; | box-sizing: border-box; | ||
} | } | ||
| Строка 47: | Строка 52: | ||
max-width: 90vw; | max-width: 90vw; | ||
max-height: 80vh; | max-height: 80vh; | ||
flex-shrink: 0; | max-height: 80dvh; | ||
min-height: 0; | flex-shrink: 0; | ||
min-height: 0; | |||
} | } | ||
| Строка 55: | Строка 61: | ||
max-width: 90vw; | max-width: 90vw; | ||
max-height: 80vh; | max-height: 80vh; | ||
max-height: 80dvh; | |||
object-fit: contain; | object-fit: contain; | ||
box-shadow: 0 0 20px rgba(0, 0, 0, 0.6); | box-shadow: 0 0 20px rgba(0, 0, 0, 0.6); | ||
| Строка 71: | Строка 78: | ||
text-shadow: 1px 1px 3px #000; | text-shadow: 1px 1px 3px #000; | ||
max-width: 90vw; | max-width: 90vw; | ||
flex: 1 1 auto; | flex: 1 1 auto; | ||
min-height: | min-height: 0; | ||
max-height: 30vh; | |||
max-height: 30dvh; | |||
overflow-y: auto; | overflow-y: auto; | ||
overflow-x: hidden; | overflow-x: hidden; | ||
-webkit-overflow-scrolling: touch; | -webkit-overflow-scrolling: touch; | ||
overscroll-behavior: contain; | overscroll-behavior: contain; | ||
scrollbar-width: thin; | scrollbar-width: thin; | ||
scrollbar-color: rgba(255,255,255,0.4) transparent; | scrollbar-color: rgba(255,255,255,0.4) transparent; | ||
pointer-events: auto; | pointer-events: auto; | ||
line-height: 1.4; | line-height: 1.4; | ||
| Строка 86: | Строка 93: | ||
word-break: break-word; | word-break: break-word; | ||
white-space: normal; | white-space: normal; | ||
padding: 0 4px; | padding: 0 4px; | ||
box-sizing: border-box; | box-sizing: border-box; | ||
} | } | ||
#absyfancyboxy-caption::-webkit-scrollbar { | #absyfancyboxy-caption::-webkit-scrollbar { | ||
width: 6px; | width: 6px; | ||
| Строка 107: | Строка 113: | ||
#absyfancyboxy-filelink { | #absyfancyboxy-filelink { | ||
align-self: center; | align-self: center; | ||
margin-top: | margin-top: 8px; | ||
margin-bottom: 8px; | margin-bottom: 8px; | ||
color: #8ecbff; | color: #8ecbff; | ||
font-size: 12px; | font-size: 12px; | ||
| Строка 120: | Строка 126: | ||
transition: opacity 0.15s, background 0.15s, color 0.15s, border-color 0.15s; | transition: opacity 0.15s, background 0.15s, color 0.15s, border-color 0.15s; | ||
outline: none; | outline: none; | ||
flex-shrink: 0; | flex-shrink: 0; | ||
} | } | ||
| Строка 140: | Строка 146: | ||
#absyfancyboxy-counter { | #absyfancyboxy-counter { | ||
position: absolute; | position: absolute; | ||
color: #fff; | color: #fff; | ||
font-size: 13px; | font-size: 13px; | ||
| Строка 149: | Строка 152: | ||
font-family: sans-serif; | font-family: sans-serif; | ||
white-space: nowrap; | white-space: nowrap; | ||
pointer-events: none; | pointer-events: none; | ||
z-index: 5; | |||
transform: translateX(-50%); | |||
} | } | ||
#absyfancyboxy-close { | #absyfancyboxy-close { | ||
position: absolute; | position: absolute; | ||
width: 18px; | |||
height: 18px; | |||
width: | |||
height: | |||
display: flex; | display: flex; | ||
align-items: center; | align-items: center; | ||
| Строка 222: | Строка 225: | ||
outline-offset: 2px; | outline-offset: 2px; | ||
border-radius: 4px; | border-radius: 4px; | ||
} | |||
/* ===== Только альбомная ориентация: уменьшаем картинку до 70vh ===== */ | |||
@media (orientation: landscape) { | |||
.absyfancyboxy-imagewrap, | |||
#absyfancyboxy-image { | |||
max-height: 70vh; /* в альбоме 80vh не влезает — уменьшаем */ | |||
max-height: 70dvh; | |||
} | |||
#absyfancyboxy-caption { | |||
max-height: 15vh; /* и подпись уменьшаем, чтобы кнопка не уезжала */ | |||
max-height: 15dvh; | |||
} | |||
} | |||
/* На низких альбомных экранах (телефон) скрываем «ФАЙЛ» и счётчик */ | |||
@media (orientation: landscape) and (max-height: 500px) { | |||
#absyfancyboxy-filelink, | |||
#absyfancyboxy-counter { | |||
display: none !important; | |||
} | |||
} | } | ||
Текущая версия от 20:26, 15 ноября 2026
/**
* AbsyFancyBoxy — локальный лайтбокс
* Версия 1.0:
• Идеальный минимум для работы всех фичей: Safari (iOS/macOS) 15.4+ (март 2022); Chrome 108+ (конец 2022); Firefox 101+ (май 2022).
• Реальный минимум (работает, но с упрощениями): Safari (iOS) 10+ (2016); Chrome 49+ (2016); Firefox: 49+ (2016)
* Идёт в связке с [[MediaWiki:Gadget-AbsyFancyBoxy.js]]
* Лицензия: MIT (opensource.org/license/mit) ==> 2026, absurdopedia.wiki
*/
#absyfancyboxy-overlay {
display: none;
position: fixed;
top: 0; left: 0;
width: 100%; height: 100%;
background: rgba(0, 0, 0, 0.9);
z-index: 10000;
align-items: center;
justify-content: center;
flex-direction: column;
opacity: 0.99; /* хак бага iOS 26.0, есть у 1% айфонщиков на 2026 год */
}
#absyfancyboxy-overlay.is-open {
display: flex;
}
.absyfancyboxy-backdrop {
position: absolute;
top: 0; left: 0;
width: 100%; height: 100%;
cursor: zoom-out;
}
.absyfancyboxy-stage {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
max-width: 90vw;
max-height: 90vh;
max-height: 90dvh; /* dvh поддерживают современные браузеры с 2022 года */
z-index: 1;
overflow: hidden;
box-sizing: border-box;
}
.absyfancyboxy-imagewrap {
position: relative;
display: inline-block;
line-height: 0;
max-width: 90vw;
max-height: 80vh;
max-height: 80dvh;
flex-shrink: 0;
min-height: 0;
}
#absyfancyboxy-image {
display: block;
max-width: 90vw;
max-height: 80vh;
max-height: 80dvh;
object-fit: contain;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
user-select: none;
-webkit-user-drag: none;
background-color: #e8e8e8;
padding: 4px;
box-sizing: border-box;
}
#absyfancyboxy-caption {
margin-top: 10px;
color: #fff;
font-size: 18px;
text-align: center;
text-shadow: 1px 1px 3px #000;
max-width: 90vw;
flex: 1 1 auto;
min-height: 0;
max-height: 30vh;
max-height: 30dvh;
overflow-y: auto;
overflow-x: hidden;
-webkit-overflow-scrolling: touch;
overscroll-behavior: contain;
scrollbar-width: thin;
scrollbar-color: rgba(255,255,255,0.4) transparent;
pointer-events: auto;
line-height: 1.4;
overflow-wrap: anywhere;
word-break: break-word;
white-space: normal;
padding: 0 4px;
box-sizing: border-box;
}
#absyfancyboxy-caption::-webkit-scrollbar {
width: 6px;
}
#absyfancyboxy-caption::-webkit-scrollbar-track {
background: transparent;
}
#absyfancyboxy-caption::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.3);
border-radius: 3px;
}
#absyfancyboxy-caption::-webkit-scrollbar-thumb:hover {
background: rgba(255, 255, 255, 0.5);
}
#absyfancyboxy-filelink {
align-self: center;
margin-top: 8px;
margin-bottom: 8px;
color: #8ecbff;
font-size: 12px;
font-family: sans-serif;
text-decoration: none;
opacity: 0.8;
text-shadow: 1px 1px 3px #000;
border: 1px solid #8ecbff;
border-radius: 4px;
padding: 3px 10px;
transition: opacity 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
outline: none;
flex-shrink: 0;
}
#absyfancyboxy-filelink:hover,
#absyfancyboxy-filelink:focus {
opacity: 1;
text-decoration: none;
color: #b8dcff;
border-color: #b8dcff;
background: rgba(142, 203, 255, 0.12);
}
#absyfancyboxy-filelink:focus-visible {
outline: 2px solid #8ecbff;
outline-offset: 2px;
border-radius: 4px;
}
#absyfancyboxy-counter {
position: absolute;
color: #fff;
font-size: 13px;
opacity: 0.8;
text-shadow: 1px 1px 3px #000;
font-family: sans-serif;
white-space: nowrap;
pointer-events: none;
z-index: 5;
transform: translateX(-50%);
}
#absyfancyboxy-close {
position: absolute;
width: 18px;
height: 18px;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
font-size: 14px;
line-height: 1;
cursor: pointer;
opacity: 0.9;
font-family: sans-serif;
z-index: 10;
outline: none;
background: rgba(0, 0, 0, 0.55);
border: 2px solid #fff;
border-radius: 50%;
box-sizing: border-box;
transition: opacity 0.15s, background 0.15s;
text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
}
#absyfancyboxy-close:hover,
#absyfancyboxy-close:focus {
opacity: 1;
background: rgba(0, 0, 0, 0.85);
}
#absyfancyboxy-close:focus-visible {
outline: 2px solid #fff;
outline-offset: 2px;
border-radius: 50%;
}
.absyfancyboxy-arrow {
position: absolute;
top: 50%;
transform: translateY(-50%);
color: #fff;
font-size: 48px;
line-height: 1;
cursor: pointer;
opacity: 0.85;
user-select: none;
font-family: sans-serif;
padding: 6px 10px;
background: transparent;
border-radius: 0;
z-index: 10;
transition: opacity 0.15s, transform 0.15s;
outline: none;
text-shadow: 0 0 8px rgba(0, 0, 0, 0.9), 0 0 2px rgba(0, 0, 0, 0.9);
}
.absyfancyboxy-arrow[data-dir="prev"] { left: 12px; }
.absyfancyboxy-arrow[data-dir="next"] { right: 12px; }
.absyfancyboxy-arrow:hover,
.absyfancyboxy-arrow:focus {
opacity: 1;
transform: translateY(-50%) scale(1.15);
}
.absyfancyboxy-arrow:focus-visible {
outline: 2px solid #fff;
outline-offset: 2px;
border-radius: 4px;
}
/* ===== Только альбомная ориентация: уменьшаем картинку до 70vh ===== */
@media (orientation: landscape) {
.absyfancyboxy-imagewrap,
#absyfancyboxy-image {
max-height: 70vh; /* в альбоме 80vh не влезает — уменьшаем */
max-height: 70dvh;
}
#absyfancyboxy-caption {
max-height: 15vh; /* и подпись уменьшаем, чтобы кнопка не уезжала */
max-height: 15dvh;
}
}
/* На низких альбомных экранах (телефон) скрываем «ФАЙЛ» и счётчик */
@media (orientation: landscape) and (max-height: 500px) {
#absyfancyboxy-filelink,
#absyfancyboxy-counter {
display: none !important;
}
}