summaryrefslogtreecommitdiff
path: root/gallery/pswp/default-skin/default-skin.css
blob: f99db1be6253b09123fb784b3cca938715d9d15e (plain)
  1. /*! PhotoSwipe Default UI CSS by Dmitry Semenov | photoswipe.com | MIT license */
  2. /*
  3. Contents:
  4. 1. Buttons
  5. 2. Share modal and links
  6. 3. Index indicator ("1 of X" counter)
  7. 4. Caption
  8. 5. Loading indicator
  9. 6. Additional styles (root element, top bar, idle state, hidden state, etc.)
  10. */
  11. /*
  12. 1. Buttons
  13. */
  14. /* <button> css reset */
  15. .pswp__button {
  16. width: 44px;
  17. height: 44px;
  18. position: relative;
  19. background: none;
  20. cursor: pointer;
  21. overflow: visible;
  22. -webkit-appearance: none;
  23. display: block;
  24. border: 0;
  25. padding: 0;
  26. margin: 0;
  27. float: right;
  28. opacity: 0.75;
  29. -webkit-transition: opacity 0.2s;
  30. transition: opacity 0.2s;
  31. -webkit-box-shadow: none;
  32. box-shadow: none; }
  33. .pswp__button:focus,
  34. .pswp__button:hover {
  35. opacity: 1; }
  36. .pswp__button:active {
  37. outline: none;
  38. opacity: 0.9; }
  39. .pswp__button::-moz-focus-inner {
  40. padding: 0;
  41. border: 0; }
  42. /* pswp__ui--over-close class it added when mouse is over element that should close gallery */
  43. .pswp__ui--over-close .pswp__button--close {
  44. opacity: 1; }
  45. .pswp__button,
  46. .pswp__button--arrow--left:before,
  47. .pswp__button--arrow--right:before {
  48. background: url(default-skin.png) 0 0 no-repeat;
  49. background-size: 264px 88px;
  50. width: 44px;
  51. height: 44px; }
  52. @media (-webkit-min-device-pixel-ratio: 1.1), (-webkit-min-device-pixel-ratio: 1.09375), (min-resolution: 105dpi), (min-resolution: 1.1dppx) {
  53. /* Serve SVG sprite if browser supports SVG and resolution is more than 105dpi */
  54. .pswp--svg .pswp__button,
  55. .pswp--svg .pswp__button--arrow--left:before,
  56. .pswp--svg .pswp__button--arrow--right:before {
  57. background-image: url(default-skin.svg); }
  58. .pswp--svg .pswp__button--arrow--left,
  59. .pswp--svg .pswp__button--arrow--right {
  60. background: none; } }
  61. .pswp__button--close {
  62. background-position: 0 -44px; }
  63. .pswp__button--share {
  64. background-position: -44px -44px; }
  65. .pswp__button--fs {
  66. display: none; }
  67. .pswp--supports-fs .pswp__button--fs {
  68. display: block; }
  69. .pswp--fs .pswp__button--fs {
  70. background-position: -44px 0; }
  71. .pswp__button--zoom {
  72. display: none;
  73. background-position: -88px 0; }
  74. .pswp--zoom-allowed .pswp__button--zoom {
  75. display: block; }
  76. .pswp--zoomed-in .pswp__button--zoom {
  77. background-position: -132px 0; }
  78. /* no arrows on touch screens */
  79. .pswp--touch .pswp__button--arrow--left,
  80. .pswp--touch .pswp__button--arrow--right {
  81. visibility: hidden; }
  82. /*
  83. Arrow buttons hit area
  84. (icon is added to :before pseudo-element)
  85. */
  86. .pswp__button--arrow--left,
  87. .pswp__button--arrow--right {
  88. background: none;
  89. top: 50%;
  90. margin-top: -50px;
  91. width: 70px;
  92. height: 100px;
  93. position: absolute; }
  94. .pswp__button--arrow--left {
  95. left: 0; }
  96. .pswp__button--arrow--right {
  97. right: 0; }
  98. .pswp__button--arrow--left:before,
  99. .pswp__button--arrow--right:before {
  100. content: '';
  101. top: 35px;
  102. background-color: rgba(0, 0, 0, 0.3);
  103. height: 30px;
  104. width: 32px;
  105. position: absolute; }
  106. .pswp__button--arrow--left:before {
  107. left: 6px;
  108. background-position: -138px -44px; }
  109. .pswp__button--arrow--right:before {
  110. right: 6px;
  111. background-position: -94px -44px; }
  112. /*
  113. 2. Share modal/popup and links
  114. */
  115. .pswp__counter,
  116. .pswp__share-modal {
  117. -webkit-user-select: none;
  118. -moz-user-select: none;
  119. -ms-user-select: none;
  120. user-select: none; }
  121. .pswp__share-modal {
  122. display: block;
  123. background: rgba(0, 0, 0, 0.5);
  124. width: 100%;
  125. height: 100%;
  126. top: 0;
  127. left: 0;
  128. padding: 10px;
  129. position: absolute;
  130. z-index: 1600;
  131. opacity: 0;
  132. -webkit-transition: opacity 0.25s ease-out;
  133. transition: opacity 0.25s ease-out;
  134. -webkit-backface-visibility: hidden;
  135. will-change: opacity; }
  136. .pswp__share-modal--hidden {
  137. display: none; }
  138. .pswp__share-tooltip {
  139. z-index: 1620;
  140. position: absolute;
  141. background: #FFF;
  142. top: 56px;
  143. border-radius: 2px;
  144. display: block;
  145. width: auto;
  146. right: 44px;
  147. -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  148. box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  149. -webkit-transform: translateY(6px);
  150. -ms-transform: translateY(6px);
  151. transform: translateY(6px);
  152. -webkit-transition: -webkit-transform 0.25s;
  153. transition: transform 0.25s;
  154. -webkit-backface-visibility: hidden;
  155. will-change: transform; }
  156. .pswp__share-tooltip a {
  157. display: block;
  158. padding: 8px 12px;
  159. color: #000;
  160. text-decoration: none;
  161. font-size: 14px;
  162. line-height: 18px; }
  163. .pswp__share-tooltip a:hover {
  164. text-decoration: none;
  165. color: #000; }
  166. .pswp__share-tooltip a:first-child {
  167. /* round corners on the first/last list item */
  168. border-radius: 2px 2px 0 0; }
  169. .pswp__share-tooltip a:last-child {
  170. border-radius: 0 0 2px 2px; }
  171. .pswp__share-modal--fade-in {
  172. opacity: 1; }
  173. .pswp__share-modal--fade-in .pswp__share-tooltip {
  174. -webkit-transform: translateY(0);
  175. -ms-transform: translateY(0);
  176. transform: translateY(0); }
  177. /* increase size of share links on touch devices */
  178. .pswp--touch .pswp__share-tooltip a {
  179. padding: 16px 12px; }
  180. a.pswp__share--facebook:before {
  181. content: '';
  182. display: block;
  183. width: 0;
  184. height: 0;
  185. position: absolute;
  186. top: -12px;
  187. right: 15px;
  188. border: 6px solid transparent;
  189. border-bottom-color: #FFF;
  190. -webkit-pointer-events: none;
  191. -moz-pointer-events: none;
  192. pointer-events: none; }
  193. a.pswp__share--facebook:hover {
  194. background: #3E5C9A;
  195. color: #FFF; }
  196. a.pswp__share--facebook:hover:before {
  197. border-bottom-color: #3E5C9A; }
  198. a.pswp__share--twitter:hover {
  199. background: #55ACEE;
  200. color: #FFF; }
  201. a.pswp__share--pinterest:hover {
  202. background: #CCC;
  203. color: #CE272D; }
  204. a.pswp__share--download:hover {
  205. background: #DDD; }
  206. /*
  207. 3. Index indicator ("1 of X" counter)
  208. */
  209. .pswp__counter {
  210. position: absolute;
  211. left: 0;
  212. top: 0;
  213. height: 44px;
  214. font-size: 13px;
  215. line-height: 44px;
  216. color: #FFF;
  217. opacity: 0.75;
  218. padding: 0 10px; }
  219. /*
  220. 4. Caption
  221. */
  222. .pswp__caption {
  223. position: absolute;
  224. left: 0;
  225. bottom: 0;
  226. width: 100%;
  227. min-height: 44px; }
  228. .pswp__caption small {
  229. font-size: 11px;
  230. color: #BBB; }
  231. .pswp__caption__center {
  232. text-align: left;
  233. max-width: 420px;
  234. margin: 0 auto;
  235. font-size: 13px;
  236. padding: 10px;
  237. line-height: 20px;
  238. color: #CCC; }
  239. .pswp__caption--empty {
  240. display: none; }
  241. /* Fake caption element, used to calculate height of next/prev image */
  242. .pswp__caption--fake {
  243. visibility: hidden; }
  244. /*
  245. 5. Loading indicator (preloader)
  246. You can play with it here - http://codepen.io/dimsemenov/pen/yyBWoR
  247. */
  248. .pswp__preloader {
  249. width: 44px;
  250. height: 44px;
  251. position: absolute;
  252. top: 0;
  253. left: 50%;
  254. margin-left: -22px;
  255. opacity: 0;
  256. -webkit-transition: opacity 0.25s ease-out;
  257. transition: opacity 0.25s ease-out;
  258. will-change: opacity;
  259. direction: ltr; }
  260. .pswp__preloader__icn {
  261. width: 20px;
  262. height: 20px;
  263. margin: 12px; }
  264. .pswp__preloader--active {
  265. opacity: 1; }
  266. .pswp__preloader--active .pswp__preloader__icn {
  267. /* We use .gif in browsers that don't support CSS animation */
  268. background: url(preloader.gif) 0 0 no-repeat; }
  269. .pswp--css_animation .pswp__preloader--active {
  270. opacity: 1; }
  271. .pswp--css_animation .pswp__preloader--active .pswp__preloader__icn {
  272. -webkit-animation: clockwise 500ms linear infinite;
  273. animation: clockwise 500ms linear infinite; }
  274. .pswp--css_animation .pswp__preloader--active .pswp__preloader__donut {
  275. -webkit-animation: donut-rotate 1000ms cubic-bezier(0.4, 0, 0.22, 1) infinite;
  276. animation: donut-rotate 1000ms cubic-bezier(0.4, 0, 0.22, 1) infinite; }
  277. .pswp--css_animation .pswp__preloader__icn {
  278. background: none;
  279. opacity: 0.75;
  280. width: 14px;
  281. height: 14px;
  282. position: absolute;
  283. left: 15px;
  284. top: 15px;
  285. margin: 0; }
  286. .pswp--css_animation .pswp__preloader__cut {
  287. /*
  288. The idea of animating inner circle is based on Polymer ("material") loading indicator
  289. by Keanu Lee https://blog.keanulee.com/2014/10/20/the-tale-of-three-spinners.html
  290. */
  291. position: relative;
  292. width: 7px;
  293. height: 14px;
  294. overflow: hidden; }
  295. .pswp--css_animation .pswp__preloader__donut {
  296. -webkit-box-sizing: border-box;
  297. box-sizing: border-box;
  298. width: 14px;
  299. height: 14px;
  300. border: 2px solid #FFF;
  301. border-radius: 50%;
  302. border-left-color: transparent;
  303. border-bottom-color: transparent;
  304. position: absolute;
  305. top: 0;
  306. left: 0;
  307. background: none;
  308. margin: 0; }
  309. @media screen and (max-width: 1024px) {
  310. .pswp__preloader {
  311. position: relative;
  312. left: auto;
  313. top: auto;
  314. margin: 0;
  315. float: right; } }
  316. @-webkit-keyframes clockwise {
  317. 0% {
  318. -webkit-transform: rotate(0deg);
  319. transform: rotate(0deg); }
  320. 100% {
  321. -webkit-transform: rotate(360deg);
  322. transform: rotate(360deg); } }
  323. @keyframes clockwise {
  324. 0% {
  325. -webkit-transform: rotate(0deg);
  326. transform: rotate(0deg); }
  327. 100% {
  328. -webkit-transform: rotate(360deg);
  329. transform: rotate(360deg); } }
  330. @-webkit-keyframes donut-rotate {
  331. 0% {
  332. -webkit-transform: rotate(0);
  333. transform: rotate(0); }
  334. 50% {
  335. -webkit-transform: rotate(-140deg);
  336. transform: rotate(-140deg); }
  337. 100% {
  338. -webkit-transform: rotate(0);
  339. transform: rotate(0); } }
  340. @keyframes donut-rotate {
  341. 0% {
  342. -webkit-transform: rotate(0);
  343. transform: rotate(0); }
  344. 50% {
  345. -webkit-transform: rotate(-140deg);
  346. transform: rotate(-140deg); }
  347. 100% {
  348. -webkit-transform: rotate(0);
  349. transform: rotate(0); } }
  350. /*
  351. 6. Additional styles
  352. */
  353. /* root element of UI */
  354. .pswp__ui {
  355. -webkit-font-smoothing: auto;
  356. visibility: visible;
  357. opacity: 1;
  358. z-index: 1550; }
  359. /* top black bar with buttons and "1 of X" indicator */
  360. .pswp__top-bar {
  361. position: absolute;
  362. left: 0;
  363. top: 0;
  364. height: 44px;
  365. width: 100%; }
  366. .pswp__caption,
  367. .pswp__top-bar,
  368. .pswp--has_mouse .pswp__button--arrow--left,
  369. .pswp--has_mouse .pswp__button--arrow--right {
  370. -webkit-backface-visibility: hidden;
  371. will-change: opacity;
  372. -webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1);
  373. transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
  374. /* pswp--has_mouse class is added only when two subsequent mousemove events occur */
  375. .pswp--has_mouse .pswp__button--arrow--left,
  376. .pswp--has_mouse .pswp__button--arrow--right {
  377. visibility: visible; }
  378. .pswp__top-bar,
  379. .pswp__caption {
  380. background-color: rgba(0, 0, 0, 0.5); }
  381. /* pswp__ui--fit class is added when main image "fits" between top bar and bottom bar (caption) */
  382. .pswp__ui--fit .pswp__top-bar,
  383. .pswp__ui--fit .pswp__caption {
  384. background-color: rgba(0, 0, 0, 0.3); }
  385. /* pswp__ui--idle class is added when mouse isn't moving for several seconds (JS option timeToIdle) */
  386. .pswp__ui--idle .pswp__top-bar {
  387. opacity: 0; }
  388. .pswp__ui--idle .pswp__button--arrow--left,
  389. .pswp__ui--idle .pswp__button--arrow--right {
  390. opacity: 0; }
  391. /*
  392. pswp__ui--hidden class is added when controls are hidden
  393. e.g. when user taps to toggle visibility of controls
  394. */
  395. .pswp__ui--hidden .pswp__top-bar,
  396. .pswp__ui--hidden .pswp__caption,
  397. .pswp__ui--hidden .pswp__button--arrow--left,
  398. .pswp__ui--hidden .pswp__button--arrow--right {
  399. /* Force paint & create composition layer for controls. */
  400. opacity: 0.001; }
  401. /* pswp__ui--one-slide class is added when there is just one item in gallery */
  402. .pswp__ui--one-slide .pswp__button--arrow--left,
  403. .pswp__ui--one-slide .pswp__button--arrow--right,
  404. .pswp__ui--one-slide .pswp__counter {
  405. display: none; }
  406. .pswp__element--disabled {
  407. display: none !important; }
  408. .pswp--minimal--dark .pswp__top-bar {
  409. background: none; }