photoswipe.css 7.4 KB

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