photoswipe.css 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. /*! PhotoSwipe main CSS by Dmytro Semenov | photoswipe.com */
  2. .pswp {
  3. --pswp-bg: #000;
  4. --pswp-placeholder-bg: #222;
  5. --pswp-root-z-index: 100000;
  6. --pswp-preloader-color: rgba(79, 79, 79, 0.4);
  7. --pswp-preloader-color-secondary: rgba(255, 255, 255, 0.9);
  8. /* defined via js:
  9. --pswp-transition-duration: 333ms; */
  10. --pswp-icon-color: #fff;
  11. --pswp-icon-color-secondary: #4f4f4f;
  12. --pswp-icon-stroke-color: #4f4f4f;
  13. --pswp-icon-stroke-width: 2px;
  14. --pswp-error-text-color: var(--pswp-icon-color);
  15. }
  16. /*
  17. Styles for basic PhotoSwipe (pswp) functionality (sliding area, open/close transitions)
  18. */
  19. .pswp {
  20. position: fixed;
  21. top: 0;
  22. left: 0;
  23. width: 100%;
  24. height: 100%;
  25. z-index: var(--pswp-root-z-index);
  26. display: none;
  27. touch-action: none;
  28. outline: 0;
  29. opacity: 0.003;
  30. contain: layout style size;
  31. -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  32. }
  33. /* Prevents focus outline on the root element,
  34. (it may be focused initially) */
  35. .pswp:focus {
  36. outline: 0;
  37. }
  38. .pswp * {
  39. box-sizing: border-box;
  40. }
  41. .pswp img {
  42. max-width: none;
  43. }
  44. .pswp--open {
  45. display: block;
  46. }
  47. .pswp,
  48. .pswp__bg {
  49. transform: translateZ(0);
  50. will-change: opacity;
  51. }
  52. .pswp__bg {
  53. opacity: 0.005;
  54. background: var(--pswp-bg);
  55. }
  56. .pswp,
  57. .pswp__scroll-wrap {
  58. overflow: hidden;
  59. }
  60. .pswp__scroll-wrap,
  61. .pswp__bg,
  62. .pswp__container,
  63. .pswp__item,
  64. .pswp__content,
  65. .pswp__img,
  66. .pswp__zoom-wrap {
  67. position: absolute;
  68. top: 0;
  69. left: 0;
  70. width: 100%;
  71. height: 100%;
  72. }
  73. .pswp__img,
  74. .pswp__zoom-wrap {
  75. width: auto;
  76. height: auto;
  77. }
  78. .pswp--click-to-zoom.pswp--zoom-allowed .pswp__img {
  79. cursor: -webkit-zoom-in;
  80. cursor: -moz-zoom-in;
  81. cursor: zoom-in;
  82. }
  83. .pswp--click-to-zoom.pswp--zoomed-in .pswp__img {
  84. cursor: move;
  85. cursor: -webkit-grab;
  86. cursor: -moz-grab;
  87. cursor: grab;
  88. }
  89. .pswp--click-to-zoom.pswp--zoomed-in .pswp__img:active {
  90. cursor: -webkit-grabbing;
  91. cursor: -moz-grabbing;
  92. cursor: grabbing;
  93. }
  94. /* :active to override grabbing cursor */
  95. .pswp--no-mouse-drag.pswp--zoomed-in .pswp__img,
  96. .pswp--no-mouse-drag.pswp--zoomed-in .pswp__img:active,
  97. .pswp__img {
  98. cursor: -webkit-zoom-out;
  99. cursor: -moz-zoom-out;
  100. cursor: zoom-out;
  101. }
  102. /* Prevent selection and tap highlights */
  103. .pswp__container,
  104. .pswp__img,
  105. .pswp__button,
  106. .pswp__counter {
  107. -webkit-user-select: none;
  108. -moz-user-select: none;
  109. -ms-user-select: none;
  110. user-select: none;
  111. }
  112. .pswp__item {
  113. /* z-index for fade transition */
  114. z-index: 1;
  115. overflow: hidden;
  116. }
  117. .pswp__hidden {
  118. display: none !important;
  119. }
  120. /* Allow to click through pswp__content element, but not its children */
  121. .pswp__content {
  122. pointer-events: none;
  123. }
  124. .pswp__content > * {
  125. pointer-events: auto;
  126. }
  127. /*
  128. PhotoSwipe UI
  129. */
  130. /*
  131. Error message appears when image is not loaded
  132. (JS option errorMsg controls markup)
  133. */
  134. .pswp__error-msg-container {
  135. display: grid;
  136. }
  137. .pswp__error-msg {
  138. margin: auto;
  139. font-size: 1em;
  140. line-height: 1;
  141. color: var(--pswp-error-text-color);
  142. }
  143. /*
  144. class pswp__hide-on-close is applied to elements that
  145. should hide (for example fade out) when PhotoSwipe is closed
  146. and show (for example fade in) when PhotoSwipe is opened
  147. */
  148. .pswp .pswp__hide-on-close {
  149. opacity: 0.005;
  150. will-change: opacity;
  151. transition: opacity var(--pswp-transition-duration) cubic-bezier(0.4, 0, 0.22, 1);
  152. z-index: 10; /* always overlap slide content */
  153. pointer-events: none; /* hidden elements should not be clickable */
  154. }
  155. /* class pswp--ui-visible is added when opening or closing transition starts */
  156. .pswp--ui-visible .pswp__hide-on-close {
  157. opacity: 1;
  158. pointer-events: auto;
  159. }
  160. /* <button> styles, including css reset */
  161. .pswp__button {
  162. position: relative;
  163. display: block;
  164. width: 50px;
  165. height: 60px;
  166. padding: 0;
  167. margin: 0;
  168. overflow: hidden;
  169. cursor: pointer;
  170. background: none;
  171. border: 0;
  172. box-shadow: none;
  173. opacity: 0.85;
  174. -webkit-appearance: none;
  175. -webkit-touch-callout: none;
  176. }
  177. .pswp__button:hover,
  178. .pswp__button:active,
  179. .pswp__button:focus {
  180. transition: none;
  181. padding: 0;
  182. background: none;
  183. border: 0;
  184. box-shadow: none;
  185. opacity: 1;
  186. }
  187. .pswp__button:disabled {
  188. opacity: 0.3;
  189. cursor: auto;
  190. }
  191. .pswp__icn {
  192. fill: var(--pswp-icon-color);
  193. color: var(--pswp-icon-color-secondary);
  194. }
  195. .pswp__icn {
  196. position: absolute;
  197. top: 14px;
  198. left: 9px;
  199. width: 32px;
  200. height: 32px;
  201. overflow: hidden;
  202. pointer-events: none;
  203. }
  204. .pswp__icn-shadow {
  205. stroke: var(--pswp-icon-stroke-color);
  206. stroke-width: var(--pswp-icon-stroke-width);
  207. fill: none;
  208. }
  209. .pswp__icn:focus {
  210. outline: 0;
  211. }
  212. /*
  213. div element that matches size of large image,
  214. large image loads on top of it,
  215. used when msrc is not provided
  216. */
  217. div.pswp__img--placeholder,
  218. .pswp__img--with-bg {
  219. background: var(--pswp-placeholder-bg);
  220. }
  221. .pswp__top-bar {
  222. position: absolute;
  223. left: 0;
  224. top: 0;
  225. width: 100%;
  226. height: 60px;
  227. display: flex;
  228. flex-direction: row;
  229. justify-content: flex-end;
  230. z-index: 10;
  231. /* allow events to pass through top bar itself */
  232. pointer-events: none !important;
  233. }
  234. .pswp__top-bar > * {
  235. pointer-events: auto;
  236. /* this makes transition significantly more smooth,
  237. even though inner elements are not animated */
  238. will-change: opacity;
  239. }
  240. /*
  241. Close button
  242. */
  243. .pswp__button--close {
  244. margin-right: 6px;
  245. }
  246. /*
  247. Arrow buttons
  248. */
  249. .pswp__button--arrow {
  250. position: absolute;
  251. top: 0;
  252. width: 75px;
  253. height: 100px;
  254. top: 50%;
  255. margin-top: -50px;
  256. }
  257. .pswp__button--arrow:disabled {
  258. display: none;
  259. cursor: default;
  260. }
  261. .pswp__button--arrow .pswp__icn {
  262. top: 50%;
  263. margin-top: -30px;
  264. width: 60px;
  265. height: 60px;
  266. background: none;
  267. border-radius: 0;
  268. }
  269. .pswp--one-slide .pswp__button--arrow {
  270. display: none;
  271. }
  272. /* hide arrows on touch screens */
  273. .pswp--touch .pswp__button--arrow {
  274. visibility: hidden;
  275. }
  276. /* show arrows only after mouse was used */
  277. .pswp--has_mouse .pswp__button--arrow {
  278. visibility: visible;
  279. }
  280. .pswp__button--arrow--prev {
  281. right: auto;
  282. left: 0px;
  283. }
  284. .pswp__button--arrow--next {
  285. right: 0px;
  286. }
  287. .pswp__button--arrow--next .pswp__icn {
  288. left: auto;
  289. right: 14px;
  290. /* flip horizontally */
  291. transform: scale(-1, 1);
  292. }
  293. /*
  294. Zoom button
  295. */
  296. .pswp__button--zoom {
  297. display: none;
  298. }
  299. .pswp--zoom-allowed .pswp__button--zoom {
  300. display: block;
  301. }
  302. /* "+" => "-" */
  303. .pswp--zoomed-in .pswp__zoom-icn-bar-v {
  304. display: none;
  305. }
  306. /*
  307. Loading indicator
  308. */
  309. .pswp__preloader {
  310. position: relative;
  311. overflow: hidden;
  312. width: 50px;
  313. height: 60px;
  314. margin-right: auto;
  315. }
  316. .pswp__preloader .pswp__icn {
  317. opacity: 0;
  318. transition: opacity 0.2s linear;
  319. animation: pswp-clockwise 600ms linear infinite;
  320. }
  321. .pswp__preloader--active .pswp__icn {
  322. opacity: 0.85;
  323. }
  324. @keyframes pswp-clockwise {
  325. 0% { transform: rotate(0deg); }
  326. 100% { transform: rotate(360deg); }
  327. }
  328. /*
  329. "1 of 10" counter
  330. */
  331. .pswp__counter {
  332. height: 30px;
  333. margin-top: 15px;
  334. margin-inline-start: 20px;
  335. font-size: 14px;
  336. line-height: 30px;
  337. color: var(--pswp-icon-color);
  338. text-shadow: 1px 1px 3px var(--pswp-icon-color-secondary);
  339. opacity: 0.85;
  340. }
  341. .pswp--one-slide .pswp__counter {
  342. display: none;
  343. }