intranet-pictures 0.0.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/intranet/pictures/json_db_provider.rb +196 -0
- data/lib/intranet/pictures/responder.rb +247 -0
- data/lib/intranet/pictures/version.rb +1 -1
- data/lib/intranet/resources/haml/pictures_browse.haml +14 -0
- data/lib/intranet/resources/haml/pictures_home.haml +36 -0
- data/lib/intranet/resources/haml/pictures_photoswipe.haml +23 -0
- data/lib/intranet/resources/locales/en.yml +28 -0
- data/lib/intranet/resources/locales/fr.yml +28 -0
- data/lib/intranet/resources/www/group_thumbnail.jpg +0 -0
- data/lib/intranet/resources/www/jpictures.js +42 -0
- data/lib/intranet/resources/www/photoswipe/LICENSE +21 -0
- data/lib/intranet/resources/www/photoswipe/default-skin/default-skin.css +484 -0
- data/lib/intranet/resources/www/photoswipe/default-skin/default-skin.png +0 -0
- data/lib/intranet/resources/www/photoswipe/default-skin/default-skin.svg +1 -0
- data/lib/intranet/resources/www/photoswipe/default-skin/preloader.gif +0 -0
- data/lib/intranet/resources/www/photoswipe/photoswipe-ui-default.js +861 -0
- data/lib/intranet/resources/www/photoswipe/photoswipe-ui-default.min.js +4 -0
- data/lib/intranet/resources/www/photoswipe/photoswipe.css +179 -0
- data/lib/intranet/resources/www/photoswipe/photoswipe.js +3734 -0
- data/lib/intranet/resources/www/photoswipe/photoswipe.min.js +4 -0
- data/lib/intranet/resources/www/style.css +81 -0
- data/spec/intranet/pictures/alpha.png +0 -0
- data/spec/intranet/pictures/json_db_provider_spec.rb +273 -0
- data/spec/intranet/pictures/responder_spec.rb +499 -0
- data/spec/intranet/pictures/sample-db.json +71 -0
- data/spec/intranet/pictures/white.jpg +0 -0
- data/spec/spec_helper.rb +6 -2
- metadata +52 -13
@@ -0,0 +1,14 @@
|
|
1
|
+
%section
|
2
|
+
= to_markup 'title_and_breadcrumb', {title: title, nav: nav}
|
3
|
+
%ul.groups
|
4
|
+
- groups.each do |group|
|
5
|
+
%li{ title: group['title'] }
|
6
|
+
%a{ onclick: 'openImagesGallery("' + gallery_url(group_type, group['id'], filters) + '");' }
|
7
|
+
%figure
|
8
|
+
%div{ style: 'background-image: url("api/group/' + group_type + '?' + group_type + '=' + group['id'] + '")' }
|
9
|
+
%figcaption
|
10
|
+
= group['title']
|
11
|
+
- if group['brief']
|
12
|
+
%br
|
13
|
+
%em= group['brief']
|
14
|
+
= to_markup 'pictures_photoswipe'
|
@@ -0,0 +1,36 @@
|
|
1
|
+
%section
|
2
|
+
= to_markup 'title_and_breadcrumb', {title: title, nav: nav}
|
3
|
+
|
4
|
+
- recent_groups.each do |recent|
|
5
|
+
%h3= I18n.t('pictures.recents.' + recent[:group_type])
|
6
|
+
%ul.groups
|
7
|
+
- recent[:groups].each do |group|
|
8
|
+
%li{ title: group['title'] }
|
9
|
+
%a{ onclick: 'openImagesGallery("' + gallery_url(recent[:group_type], group['id']) + '");' }
|
10
|
+
%figure
|
11
|
+
%div{ style: 'background-image: url("api/group/' + recent[:group_type] + '?' + recent[:group_type] + '=' + group['id'] + '")' }
|
12
|
+
%figcaption
|
13
|
+
= group['title']
|
14
|
+
- if group['brief']
|
15
|
+
%br
|
16
|
+
%em= group['brief']
|
17
|
+
- unless recent[:see_more_url].empty?
|
18
|
+
%p.see_more
|
19
|
+
%a{ href: recent[:see_more_url] }= I18n.t('pictures.see_more')
|
20
|
+
|
21
|
+
- all_groups.each do |section|
|
22
|
+
%h3= I18n.t('pictures.browse_by.' + section[:group_type])
|
23
|
+
%ul.groups.wide
|
24
|
+
- section[:groups].each do |group|
|
25
|
+
%li{ title: group['title'] }
|
26
|
+
%a{ href: section[:url_prefix] + '&' + section[:group_type] + '=' + group['id'] }
|
27
|
+
%figure
|
28
|
+
%div{ style: 'background-image: url("api/group/' + section[:group_type] + '?' + section[:group_type] + '=' + group['id'] + '")' }
|
29
|
+
%figcaption
|
30
|
+
= group['title']
|
31
|
+
- if group['brief']
|
32
|
+
%br
|
33
|
+
%em= group['brief']
|
34
|
+
|
35
|
+
- unless recent_groups.empty?
|
36
|
+
= to_markup 'pictures_photoswipe'
|
@@ -0,0 +1,23 @@
|
|
1
|
+
%div.pswp{tabindex: -1, role: 'dialog', 'aria-hidden' => true}
|
2
|
+
%div.pswp__bg
|
3
|
+
%div.pswp__scroll-wrap
|
4
|
+
%div.pswp__container
|
5
|
+
%div.pswp__item
|
6
|
+
%div.pswp__item
|
7
|
+
%div.pswp__item
|
8
|
+
%div.pswp__ui.pswp__ui--hidden
|
9
|
+
%div.pswp__top-bar
|
10
|
+
%div.pswp__counter
|
11
|
+
%button.pswp__button.pswp__button--close{title: I18n.t('pictures.viewer.close') + ' (Esc)'}
|
12
|
+
%button.pswp__button.pswp__button--fs{title: I18n.t('pictures.viewer.fullscreen')}
|
13
|
+
%button.pswp__button.pswp__button--zoom{title: I18n.t('pictures.viewer.zoom')}
|
14
|
+
%div.pswp__preloader
|
15
|
+
%div.pswp__preloader__icn
|
16
|
+
%div.pswp__preloader__cut
|
17
|
+
%div.pswp__preloader__donut
|
18
|
+
%div.pswp__share-modal.pswp__share-modal--hidden.pswp__single-tap
|
19
|
+
%div.pswp__share-tooltip
|
20
|
+
%button.pswp__button.pswp__button--arrow--left{title: I18n.t('pictures.viewer.previous')}
|
21
|
+
%button.pswp__button.pswp__button--arrow--right{title: I18n.t('pictures.viewer.next')}
|
22
|
+
%div.pswp__caption
|
23
|
+
%div.pswp__caption__center
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# system/locales/en.yml - Translation file for the System module in en-GB/en-US
|
2
|
+
---
|
3
|
+
|
4
|
+
en:
|
5
|
+
pictures:
|
6
|
+
menu: 'Pictures'
|
7
|
+
see_more: 'See more results'
|
8
|
+
viewer:
|
9
|
+
close: 'Close'
|
10
|
+
fullscreen: 'Fullscreen'
|
11
|
+
zoom: 'Zoom'
|
12
|
+
previous: 'Previous image'
|
13
|
+
next: 'Next image'
|
14
|
+
nav:
|
15
|
+
event: 'Events'
|
16
|
+
city: 'Cities'
|
17
|
+
region: 'Regions'
|
18
|
+
country: 'Countries'
|
19
|
+
recents:
|
20
|
+
event: 'Latest events'
|
21
|
+
city: 'Cities visited recently'
|
22
|
+
region: 'Regions visited recently'
|
23
|
+
country: 'Countries visited recently'
|
24
|
+
browse_by:
|
25
|
+
event: 'Browse pictures by event'
|
26
|
+
city: 'Browse pictures by city'
|
27
|
+
region: 'Browse pictures by region'
|
28
|
+
country: 'Browse pictures by country'
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# pictures/locales/fr.yml - Translation file for the Pictures module in fr-FR
|
2
|
+
---
|
3
|
+
|
4
|
+
fr:
|
5
|
+
pictures:
|
6
|
+
menu: 'Photos'
|
7
|
+
see_more: 'Afficher plus de résultats'
|
8
|
+
viewer:
|
9
|
+
close: 'Fermer'
|
10
|
+
fullscreen: 'Plein écran'
|
11
|
+
zoom: 'Agrandir'
|
12
|
+
previous: 'Image précédente'
|
13
|
+
next: 'Image suivante'
|
14
|
+
nav:
|
15
|
+
event: 'Événements'
|
16
|
+
city: 'Villes'
|
17
|
+
region: 'Régions'
|
18
|
+
country: 'Pays'
|
19
|
+
recents:
|
20
|
+
event: 'Événements récents'
|
21
|
+
city: 'Dernières villes visitées'
|
22
|
+
region: 'Dernières régions visitées'
|
23
|
+
country: 'Derniers pays visités'
|
24
|
+
browse_by:
|
25
|
+
event: 'Parcourir les images par événement'
|
26
|
+
city: 'Parcourir les images par ville'
|
27
|
+
region: 'Parcourir les images par région'
|
28
|
+
country: 'Parcourir les images par pays'
|
Binary file
|
@@ -0,0 +1,42 @@
|
|
1
|
+
/**
|
2
|
+
* jpictures.js
|
3
|
+
* JavaScript functions for the pictures galleries.
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
function convertDate(iso8601_date) {
|
8
|
+
const d = new Date(iso8601_date);
|
9
|
+
const str = d.toLocaleDateString() + ' ' + d.toLocaleTimeString().replace(/(\d{2}):(\d{2}):(\d{2})/, '$1h$2');
|
10
|
+
return str;
|
11
|
+
}
|
12
|
+
|
13
|
+
function createImageGallery(json) {
|
14
|
+
var items = [];
|
15
|
+
for (let i = 0; i < json.length; i++) {
|
16
|
+
const imageUrl = 'api/picture?id=' + json[i].id;
|
17
|
+
const imageTitle = convertDate(json[i].datetime, true) + '<br />' + json[i].title;
|
18
|
+
items.push({ src: imageUrl, msrc: imageUrl, w: json[i].width, h: json[i].height, title: imageTitle});
|
19
|
+
}
|
20
|
+
|
21
|
+
// Get the PhotoSwipe container
|
22
|
+
const pswpElement = document.querySelectorAll('.pswp')[0];
|
23
|
+
|
24
|
+
// Define options
|
25
|
+
const options = {
|
26
|
+
// core options
|
27
|
+
index: 0, // start at first slide
|
28
|
+
history: false,
|
29
|
+
closeOnScroll: false,
|
30
|
+
closeOnVerticalDrag: false
|
31
|
+
};
|
32
|
+
|
33
|
+
// Initialize and open PhotoSwipe
|
34
|
+
let gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options);
|
35
|
+
gallery.init();
|
36
|
+
}
|
37
|
+
|
38
|
+
function openImagesGallery(selectors) {
|
39
|
+
fetch('api/pictures?' + selectors) // selectors is not empty
|
40
|
+
.then(response => response.json())
|
41
|
+
.then(data => createImageGallery(data));
|
42
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2014-2019 Dmitry Semenov, http://dimsemenov.com
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
@@ -0,0 +1,484 @@
|
|
1
|
+
/*! PhotoSwipe Default UI CSS by Dmitry Semenov | photoswipe.com | MIT license */
|
2
|
+
/*
|
3
|
+
|
4
|
+
Contents:
|
5
|
+
|
6
|
+
1. Buttons
|
7
|
+
2. Share modal and links
|
8
|
+
3. Index indicator ("1 of X" counter)
|
9
|
+
4. Caption
|
10
|
+
5. Loading indicator
|
11
|
+
6. Additional styles (root element, top bar, idle state, hidden state, etc.)
|
12
|
+
|
13
|
+
*/
|
14
|
+
/*
|
15
|
+
|
16
|
+
1. Buttons
|
17
|
+
|
18
|
+
*/
|
19
|
+
/* <button> css reset */
|
20
|
+
.pswp__button {
|
21
|
+
width: 44px;
|
22
|
+
height: 44px;
|
23
|
+
position: relative;
|
24
|
+
background: none;
|
25
|
+
cursor: pointer;
|
26
|
+
overflow: visible;
|
27
|
+
-webkit-appearance: none;
|
28
|
+
display: block;
|
29
|
+
border: 0;
|
30
|
+
padding: 0;
|
31
|
+
margin: 0;
|
32
|
+
float: right;
|
33
|
+
opacity: 0.75;
|
34
|
+
-webkit-transition: opacity 0.2s;
|
35
|
+
transition: opacity 0.2s;
|
36
|
+
-webkit-box-shadow: none;
|
37
|
+
box-shadow: none; }
|
38
|
+
.pswp__button:focus, .pswp__button:hover {
|
39
|
+
opacity: 1; }
|
40
|
+
.pswp__button:active {
|
41
|
+
outline: none;
|
42
|
+
opacity: 0.9; }
|
43
|
+
.pswp__button::-moz-focus-inner {
|
44
|
+
padding: 0;
|
45
|
+
border: 0; }
|
46
|
+
|
47
|
+
/* pswp__ui--over-close class it added when mouse is over element that should close gallery */
|
48
|
+
.pswp__ui--over-close .pswp__button--close {
|
49
|
+
opacity: 1; }
|
50
|
+
|
51
|
+
.pswp__button,
|
52
|
+
.pswp__button--arrow--left:before,
|
53
|
+
.pswp__button--arrow--right:before {
|
54
|
+
background: url(default-skin.png) 0 0 no-repeat;
|
55
|
+
background-size: 264px 88px;
|
56
|
+
width: 44px;
|
57
|
+
height: 44px; }
|
58
|
+
|
59
|
+
@media (-webkit-min-device-pixel-ratio: 1.1), (-webkit-min-device-pixel-ratio: 1.09375), (min-resolution: 105dpi), (min-resolution: 1.1dppx) {
|
60
|
+
/* Serve SVG sprite if browser supports SVG and resolution is more than 105dpi */
|
61
|
+
.pswp--svg .pswp__button,
|
62
|
+
.pswp--svg .pswp__button--arrow--left:before,
|
63
|
+
.pswp--svg .pswp__button--arrow--right:before {
|
64
|
+
background-image: url(default-skin.svg); }
|
65
|
+
.pswp--svg .pswp__button--arrow--left,
|
66
|
+
.pswp--svg .pswp__button--arrow--right {
|
67
|
+
background: none; } }
|
68
|
+
|
69
|
+
.pswp__button--close {
|
70
|
+
background-position: 0 -44px; }
|
71
|
+
|
72
|
+
.pswp__button--share {
|
73
|
+
background-position: -44px -44px; }
|
74
|
+
|
75
|
+
.pswp__button--fs {
|
76
|
+
display: none; }
|
77
|
+
|
78
|
+
.pswp--supports-fs .pswp__button--fs {
|
79
|
+
display: block; }
|
80
|
+
|
81
|
+
.pswp--fs .pswp__button--fs {
|
82
|
+
background-position: -44px 0; }
|
83
|
+
|
84
|
+
.pswp__button--zoom {
|
85
|
+
display: none;
|
86
|
+
background-position: -88px 0; }
|
87
|
+
|
88
|
+
.pswp--zoom-allowed .pswp__button--zoom {
|
89
|
+
display: block; }
|
90
|
+
|
91
|
+
.pswp--zoomed-in .pswp__button--zoom {
|
92
|
+
background-position: -132px 0; }
|
93
|
+
|
94
|
+
/* no arrows on touch screens */
|
95
|
+
.pswp--touch .pswp__button--arrow--left,
|
96
|
+
.pswp--touch .pswp__button--arrow--right {
|
97
|
+
visibility: hidden; }
|
98
|
+
|
99
|
+
/*
|
100
|
+
Arrow buttons hit area
|
101
|
+
(icon is added to :before pseudo-element)
|
102
|
+
*/
|
103
|
+
.pswp__button--arrow--left,
|
104
|
+
.pswp__button--arrow--right {
|
105
|
+
background: none;
|
106
|
+
top: 50%;
|
107
|
+
margin-top: -50px;
|
108
|
+
width: 70px;
|
109
|
+
height: 100px;
|
110
|
+
position: absolute; }
|
111
|
+
|
112
|
+
.pswp__button--arrow--left {
|
113
|
+
left: 0; }
|
114
|
+
|
115
|
+
.pswp__button--arrow--right {
|
116
|
+
right: 0; }
|
117
|
+
|
118
|
+
.pswp__button--arrow--left:before,
|
119
|
+
.pswp__button--arrow--right:before {
|
120
|
+
content: '';
|
121
|
+
top: 35px;
|
122
|
+
background-color: rgba(0, 0, 0, 0.3);
|
123
|
+
height: 30px;
|
124
|
+
width: 32px;
|
125
|
+
position: absolute; }
|
126
|
+
|
127
|
+
.pswp__button--arrow--left:before {
|
128
|
+
left: 6px;
|
129
|
+
background-position: -138px -44px; }
|
130
|
+
|
131
|
+
.pswp__button--arrow--right:before {
|
132
|
+
right: 6px;
|
133
|
+
background-position: -94px -44px; }
|
134
|
+
|
135
|
+
/*
|
136
|
+
|
137
|
+
2. Share modal/popup and links
|
138
|
+
|
139
|
+
*/
|
140
|
+
.pswp__counter,
|
141
|
+
.pswp__share-modal {
|
142
|
+
-webkit-user-select: none;
|
143
|
+
-moz-user-select: none;
|
144
|
+
-ms-user-select: none;
|
145
|
+
user-select: none; }
|
146
|
+
|
147
|
+
.pswp__share-modal {
|
148
|
+
display: block;
|
149
|
+
background: rgba(0, 0, 0, 0.5);
|
150
|
+
width: 100%;
|
151
|
+
height: 100%;
|
152
|
+
top: 0;
|
153
|
+
left: 0;
|
154
|
+
padding: 10px;
|
155
|
+
position: absolute;
|
156
|
+
z-index: 1600;
|
157
|
+
opacity: 0;
|
158
|
+
-webkit-transition: opacity 0.25s ease-out;
|
159
|
+
transition: opacity 0.25s ease-out;
|
160
|
+
-webkit-backface-visibility: hidden;
|
161
|
+
will-change: opacity; }
|
162
|
+
|
163
|
+
.pswp__share-modal--hidden {
|
164
|
+
display: none; }
|
165
|
+
|
166
|
+
.pswp__share-tooltip {
|
167
|
+
z-index: 1620;
|
168
|
+
position: absolute;
|
169
|
+
background: #FFF;
|
170
|
+
top: 56px;
|
171
|
+
border-radius: 2px;
|
172
|
+
display: block;
|
173
|
+
width: auto;
|
174
|
+
right: 44px;
|
175
|
+
-webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
|
176
|
+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
|
177
|
+
-webkit-transform: translateY(6px);
|
178
|
+
-ms-transform: translateY(6px);
|
179
|
+
transform: translateY(6px);
|
180
|
+
-webkit-transition: -webkit-transform 0.25s;
|
181
|
+
transition: transform 0.25s;
|
182
|
+
-webkit-backface-visibility: hidden;
|
183
|
+
will-change: transform; }
|
184
|
+
.pswp__share-tooltip a {
|
185
|
+
display: block;
|
186
|
+
padding: 8px 12px;
|
187
|
+
color: #000;
|
188
|
+
text-decoration: none;
|
189
|
+
font-size: 14px;
|
190
|
+
line-height: 18px; }
|
191
|
+
.pswp__share-tooltip a:hover {
|
192
|
+
text-decoration: none;
|
193
|
+
color: #000; }
|
194
|
+
.pswp__share-tooltip a:first-child {
|
195
|
+
/* round corners on the first/last list item */
|
196
|
+
border-radius: 2px 2px 0 0; }
|
197
|
+
.pswp__share-tooltip a:last-child {
|
198
|
+
border-radius: 0 0 2px 2px; }
|
199
|
+
|
200
|
+
.pswp__share-modal--fade-in {
|
201
|
+
opacity: 1; }
|
202
|
+
.pswp__share-modal--fade-in .pswp__share-tooltip {
|
203
|
+
-webkit-transform: translateY(0);
|
204
|
+
-ms-transform: translateY(0);
|
205
|
+
transform: translateY(0); }
|
206
|
+
|
207
|
+
/* increase size of share links on touch devices */
|
208
|
+
.pswp--touch .pswp__share-tooltip a {
|
209
|
+
padding: 16px 12px; }
|
210
|
+
|
211
|
+
a.pswp__share--facebook:before {
|
212
|
+
content: '';
|
213
|
+
display: block;
|
214
|
+
width: 0;
|
215
|
+
height: 0;
|
216
|
+
position: absolute;
|
217
|
+
top: -12px;
|
218
|
+
right: 15px;
|
219
|
+
border: 6px solid transparent;
|
220
|
+
border-bottom-color: #FFF;
|
221
|
+
-webkit-pointer-events: none;
|
222
|
+
-moz-pointer-events: none;
|
223
|
+
pointer-events: none; }
|
224
|
+
|
225
|
+
a.pswp__share--facebook:hover {
|
226
|
+
background: #3E5C9A;
|
227
|
+
color: #FFF; }
|
228
|
+
a.pswp__share--facebook:hover:before {
|
229
|
+
border-bottom-color: #3E5C9A; }
|
230
|
+
|
231
|
+
a.pswp__share--twitter:hover {
|
232
|
+
background: #55ACEE;
|
233
|
+
color: #FFF; }
|
234
|
+
|
235
|
+
a.pswp__share--pinterest:hover {
|
236
|
+
background: #CCC;
|
237
|
+
color: #CE272D; }
|
238
|
+
|
239
|
+
a.pswp__share--download:hover {
|
240
|
+
background: #DDD; }
|
241
|
+
|
242
|
+
/*
|
243
|
+
|
244
|
+
3. Index indicator ("1 of X" counter)
|
245
|
+
|
246
|
+
*/
|
247
|
+
.pswp__counter {
|
248
|
+
position: absolute;
|
249
|
+
left: 0;
|
250
|
+
top: 0;
|
251
|
+
height: 44px;
|
252
|
+
font-size: 100%; /* patch intranet */
|
253
|
+
font-weight: bold; /* patch intranet */
|
254
|
+
line-height: 44px;
|
255
|
+
color: #FFF;
|
256
|
+
opacity: 0.75;
|
257
|
+
padding: 0 10px; }
|
258
|
+
|
259
|
+
/*
|
260
|
+
|
261
|
+
4. Caption
|
262
|
+
|
263
|
+
*/
|
264
|
+
.pswp__caption {
|
265
|
+
position: absolute;
|
266
|
+
left: 0;
|
267
|
+
bottom: 0;
|
268
|
+
width: 100%;
|
269
|
+
min-height: 44px; }
|
270
|
+
.pswp__caption small {
|
271
|
+
font-size: 11px;
|
272
|
+
color: #BBB; }
|
273
|
+
|
274
|
+
.pswp__caption__center {
|
275
|
+
text-align: center; /* patch intranet */
|
276
|
+
max-width: 600px; /* patch intranet */
|
277
|
+
margin: 0 auto;
|
278
|
+
font-size: 100%; /* patch intranet */
|
279
|
+
padding: 10px;
|
280
|
+
line-height: 20px;
|
281
|
+
font-weight: bold; /* patch intranet */
|
282
|
+
color: #CCC; }
|
283
|
+
|
284
|
+
.pswp__caption--empty {
|
285
|
+
display: none; }
|
286
|
+
|
287
|
+
/* Fake caption element, used to calculate height of next/prev image */
|
288
|
+
.pswp__caption--fake {
|
289
|
+
visibility: hidden; }
|
290
|
+
|
291
|
+
/*
|
292
|
+
|
293
|
+
5. Loading indicator (preloader)
|
294
|
+
|
295
|
+
You can play with it here - http://codepen.io/dimsemenov/pen/yyBWoR
|
296
|
+
|
297
|
+
*/
|
298
|
+
.pswp__preloader {
|
299
|
+
width: 44px;
|
300
|
+
height: 44px;
|
301
|
+
position: absolute;
|
302
|
+
top: 0;
|
303
|
+
left: 50%;
|
304
|
+
margin-left: -22px;
|
305
|
+
opacity: 0;
|
306
|
+
-webkit-transition: opacity 0.25s ease-out;
|
307
|
+
transition: opacity 0.25s ease-out;
|
308
|
+
will-change: opacity;
|
309
|
+
direction: ltr; }
|
310
|
+
|
311
|
+
.pswp__preloader__icn {
|
312
|
+
width: 20px;
|
313
|
+
height: 20px;
|
314
|
+
margin: 12px; }
|
315
|
+
|
316
|
+
.pswp__preloader--active {
|
317
|
+
opacity: 1; }
|
318
|
+
.pswp__preloader--active .pswp__preloader__icn {
|
319
|
+
/* We use .gif in browsers that don't support CSS animation */
|
320
|
+
background: url(preloader.gif) 0 0 no-repeat; }
|
321
|
+
|
322
|
+
.pswp--css_animation .pswp__preloader--active {
|
323
|
+
opacity: 1; }
|
324
|
+
.pswp--css_animation .pswp__preloader--active .pswp__preloader__icn {
|
325
|
+
-webkit-animation: clockwise 500ms linear infinite;
|
326
|
+
animation: clockwise 500ms linear infinite; }
|
327
|
+
.pswp--css_animation .pswp__preloader--active .pswp__preloader__donut {
|
328
|
+
-webkit-animation: donut-rotate 1000ms cubic-bezier(0.4, 0, 0.22, 1) infinite;
|
329
|
+
animation: donut-rotate 1000ms cubic-bezier(0.4, 0, 0.22, 1) infinite; }
|
330
|
+
|
331
|
+
.pswp--css_animation .pswp__preloader__icn {
|
332
|
+
background: none;
|
333
|
+
opacity: 0.75;
|
334
|
+
width: 14px;
|
335
|
+
height: 14px;
|
336
|
+
position: absolute;
|
337
|
+
left: 15px;
|
338
|
+
top: 15px;
|
339
|
+
margin: 0; }
|
340
|
+
|
341
|
+
.pswp--css_animation .pswp__preloader__cut {
|
342
|
+
/*
|
343
|
+
The idea of animating inner circle is based on Polymer ("material") loading indicator
|
344
|
+
by Keanu Lee https://blog.keanulee.com/2014/10/20/the-tale-of-three-spinners.html
|
345
|
+
*/
|
346
|
+
position: relative;
|
347
|
+
width: 7px;
|
348
|
+
height: 14px;
|
349
|
+
overflow: hidden; }
|
350
|
+
|
351
|
+
.pswp--css_animation .pswp__preloader__donut {
|
352
|
+
-webkit-box-sizing: border-box;
|
353
|
+
box-sizing: border-box;
|
354
|
+
width: 14px;
|
355
|
+
height: 14px;
|
356
|
+
border: 2px solid #FFF;
|
357
|
+
border-radius: 50%;
|
358
|
+
border-left-color: transparent;
|
359
|
+
border-bottom-color: transparent;
|
360
|
+
position: absolute;
|
361
|
+
top: 0;
|
362
|
+
left: 0;
|
363
|
+
background: none;
|
364
|
+
margin: 0; }
|
365
|
+
|
366
|
+
@media screen and (max-width: 1024px) {
|
367
|
+
.pswp__preloader {
|
368
|
+
position: relative;
|
369
|
+
left: auto;
|
370
|
+
top: auto;
|
371
|
+
margin: 0;
|
372
|
+
float: right; } }
|
373
|
+
|
374
|
+
@-webkit-keyframes clockwise {
|
375
|
+
0% {
|
376
|
+
-webkit-transform: rotate(0deg);
|
377
|
+
transform: rotate(0deg); }
|
378
|
+
100% {
|
379
|
+
-webkit-transform: rotate(360deg);
|
380
|
+
transform: rotate(360deg); } }
|
381
|
+
|
382
|
+
@keyframes clockwise {
|
383
|
+
0% {
|
384
|
+
-webkit-transform: rotate(0deg);
|
385
|
+
transform: rotate(0deg); }
|
386
|
+
100% {
|
387
|
+
-webkit-transform: rotate(360deg);
|
388
|
+
transform: rotate(360deg); } }
|
389
|
+
|
390
|
+
@-webkit-keyframes donut-rotate {
|
391
|
+
0% {
|
392
|
+
-webkit-transform: rotate(0);
|
393
|
+
transform: rotate(0); }
|
394
|
+
50% {
|
395
|
+
-webkit-transform: rotate(-140deg);
|
396
|
+
transform: rotate(-140deg); }
|
397
|
+
100% {
|
398
|
+
-webkit-transform: rotate(0);
|
399
|
+
transform: rotate(0); } }
|
400
|
+
|
401
|
+
@keyframes donut-rotate {
|
402
|
+
0% {
|
403
|
+
-webkit-transform: rotate(0);
|
404
|
+
transform: rotate(0); }
|
405
|
+
50% {
|
406
|
+
-webkit-transform: rotate(-140deg);
|
407
|
+
transform: rotate(-140deg); }
|
408
|
+
100% {
|
409
|
+
-webkit-transform: rotate(0);
|
410
|
+
transform: rotate(0); } }
|
411
|
+
|
412
|
+
/*
|
413
|
+
|
414
|
+
6. Additional styles
|
415
|
+
|
416
|
+
*/
|
417
|
+
/* root element of UI */
|
418
|
+
.pswp__ui {
|
419
|
+
-webkit-font-smoothing: auto;
|
420
|
+
visibility: visible;
|
421
|
+
opacity: 1;
|
422
|
+
z-index: 1550; }
|
423
|
+
|
424
|
+
/* top black bar with buttons and "1 of X" indicator */
|
425
|
+
.pswp__top-bar {
|
426
|
+
position: absolute;
|
427
|
+
left: 0;
|
428
|
+
top: 0;
|
429
|
+
height: 44px;
|
430
|
+
width: 100%; }
|
431
|
+
|
432
|
+
.pswp__caption,
|
433
|
+
.pswp__top-bar,
|
434
|
+
.pswp--has_mouse .pswp__button--arrow--left,
|
435
|
+
.pswp--has_mouse .pswp__button--arrow--right {
|
436
|
+
-webkit-backface-visibility: hidden;
|
437
|
+
will-change: opacity;
|
438
|
+
-webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1);
|
439
|
+
transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
|
440
|
+
|
441
|
+
/* pswp--has_mouse class is added only when two subsequent mousemove events occur */
|
442
|
+
.pswp--has_mouse .pswp__button--arrow--left,
|
443
|
+
.pswp--has_mouse .pswp__button--arrow--right {
|
444
|
+
visibility: visible; }
|
445
|
+
|
446
|
+
.pswp__top-bar,
|
447
|
+
.pswp__caption {
|
448
|
+
background-color: rgba(0, 0, 0, 0.5); }
|
449
|
+
|
450
|
+
/* pswp__ui--fit class is added when main image "fits" between top bar and bottom bar (caption) */
|
451
|
+
.pswp__ui--fit .pswp__top-bar,
|
452
|
+
.pswp__ui--fit .pswp__caption {
|
453
|
+
background-color: rgba(0, 0, 0, 0.3); }
|
454
|
+
|
455
|
+
/* pswp__ui--idle class is added when mouse isn't moving for several seconds (JS option timeToIdle) */
|
456
|
+
.pswp__ui--idle .pswp__top-bar {
|
457
|
+
opacity: 0; }
|
458
|
+
|
459
|
+
.pswp__ui--idle .pswp__button--arrow--left,
|
460
|
+
.pswp__ui--idle .pswp__button--arrow--right {
|
461
|
+
opacity: 0; }
|
462
|
+
|
463
|
+
/*
|
464
|
+
pswp__ui--hidden class is added when controls are hidden
|
465
|
+
e.g. when user taps to toggle visibility of controls
|
466
|
+
*/
|
467
|
+
.pswp__ui--hidden .pswp__top-bar,
|
468
|
+
.pswp__ui--hidden .pswp__caption,
|
469
|
+
.pswp__ui--hidden .pswp__button--arrow--left,
|
470
|
+
.pswp__ui--hidden .pswp__button--arrow--right {
|
471
|
+
/* Force paint & create composition layer for controls. */
|
472
|
+
opacity: 0.001; }
|
473
|
+
|
474
|
+
/* pswp__ui--one-slide class is added when there is just one item in gallery */
|
475
|
+
.pswp__ui--one-slide .pswp__button--arrow--left,
|
476
|
+
.pswp__ui--one-slide .pswp__button--arrow--right,
|
477
|
+
.pswp__ui--one-slide .pswp__counter {
|
478
|
+
display: none; }
|
479
|
+
|
480
|
+
.pswp__element--disabled {
|
481
|
+
display: none !important; }
|
482
|
+
|
483
|
+
.pswp--minimal--dark .pswp__top-bar {
|
484
|
+
background: none; }
|