servel 0.29.0 → 0.30.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/_gallery.haml +7 -6
- data/app/css/gallery.css +63 -39
- data/app/js/gallery.js +34 -7
- data/app/js/index.js +0 -43
- data/lib/servel/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dce6f55af17def653868138167feedca557e981ff15f3010585ece287e5f0e8d
|
4
|
+
data.tar.gz: 8c1e5087a5f219b6523eb3e65daca81d91c149d50cfbe1607cc5bae3a8024dad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 609b927a7d22c511a93b024cdb736a6553da2f6bd26301fa4ef716862a2ab9543f795d0fde3ad768c7bb8501a4fc3590045b0218abdba091e619471127014fc4
|
7
|
+
data.tar.gz: 549e6337e9871ba4db2d851702a246a2ebf9174e3a76e08a9155ec0707a32208fd4514bcbf965b1de0cb54127415ba41b9bcbc49f2a04aa14ee72c13a93f8690
|
data/app/_gallery.haml
CHANGED
@@ -6,9 +6,10 @@
|
|
6
6
|
#page-back.paginator ◀
|
7
7
|
#page-next.paginator ▶
|
8
8
|
#content
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
9
|
+
#scroller
|
10
|
+
%img#image
|
11
|
+
%video#video{controls: false, loop: true}
|
12
|
+
%audio#audio{controls: true}
|
13
|
+
#text
|
14
|
+
%a#text-anchor{href: '#'}
|
15
|
+
#text-content
|
data/app/css/gallery.css
CHANGED
@@ -1,25 +1,85 @@
|
|
1
1
|
#gallery {
|
2
2
|
background: #333;
|
3
3
|
display: none;
|
4
|
-
flex-direction: column;
|
5
4
|
}
|
6
5
|
|
7
6
|
body.has-gallery.gallery #gallery {
|
8
7
|
display: flex;
|
9
8
|
}
|
10
9
|
|
10
|
+
#controls {
|
11
|
+
display: flex;
|
12
|
+
}
|
13
|
+
|
14
|
+
#page-jump-listing {
|
15
|
+
flex-grow: 1;
|
16
|
+
}
|
17
|
+
|
18
|
+
.paginator {
|
19
|
+
display: flex;
|
20
|
+
align-items: center;
|
21
|
+
justify-content: center;
|
22
|
+
height: 75px;
|
23
|
+
|
24
|
+
font-size: 2em;
|
25
|
+
font-weight: bold;
|
26
|
+
text-align: center;
|
27
|
+
background-color: #1f1f1f;
|
28
|
+
color: #858585;
|
29
|
+
|
30
|
+
cursor: pointer;
|
31
|
+
}
|
32
|
+
|
33
|
+
.paginator:hover {
|
34
|
+
background-color: #0f0f0f;
|
35
|
+
color: #c1c1c1;
|
36
|
+
}
|
37
|
+
|
11
38
|
#content {
|
12
39
|
display: flex;
|
13
40
|
align-items: center;
|
14
41
|
justify-content: center;
|
15
42
|
flex-grow: 1;
|
43
|
+
min-width: 0;
|
44
|
+
min-height: 0;
|
45
|
+
}
|
46
|
+
|
47
|
+
#scroller {
|
48
|
+
width: 100%;
|
49
|
+
max-height: 100%;
|
50
|
+
overflow: auto;
|
51
|
+
}
|
52
|
+
|
53
|
+
body.portrait #gallery {
|
54
|
+
flex-direction: column;
|
55
|
+
}
|
56
|
+
|
57
|
+
body.portrait .paginator {
|
58
|
+
width: 100px;
|
59
|
+
}
|
60
|
+
|
61
|
+
body.portrait #page-jump-listing {
|
62
|
+
width: auto;
|
63
|
+
}
|
64
|
+
|
65
|
+
body.landscape #gallery {
|
66
|
+
flex-direction: row;
|
67
|
+
}
|
68
|
+
|
69
|
+
body.landscape #controls {
|
70
|
+
flex-direction: column;
|
71
|
+
flex-shrink: 0;
|
72
|
+
width: 100px;
|
73
|
+
}
|
74
|
+
|
75
|
+
body.landscape #page-jump-listing {
|
76
|
+
writing-mode: vertical-rl;
|
77
|
+
transform: rotate(180deg);
|
16
78
|
}
|
17
79
|
|
18
80
|
#image, #video, #audio, #text {
|
19
81
|
display: none;
|
20
|
-
max-width: 100%;
|
21
82
|
margin: 0 auto 0 auto;
|
22
|
-
padding-top: 75px;
|
23
83
|
}
|
24
84
|
|
25
85
|
#video:focus, #audio:focus {
|
@@ -51,36 +111,6 @@ body.has-gallery.gallery #gallery {
|
|
51
111
|
display: block;
|
52
112
|
}
|
53
113
|
|
54
|
-
#controls {
|
55
|
-
position: fixed;
|
56
|
-
left: 0;
|
57
|
-
right: 0;
|
58
|
-
display: flex;
|
59
|
-
z-index: 10;
|
60
|
-
}
|
61
|
-
|
62
|
-
.paginator {
|
63
|
-
display: flex;
|
64
|
-
align-items: center;
|
65
|
-
justify-content: center;
|
66
|
-
width: 100px;
|
67
|
-
height: 75px;
|
68
|
-
|
69
|
-
font-size: 2em;
|
70
|
-
font-weight: bold;
|
71
|
-
text-align: center;
|
72
|
-
background-color: #000000;
|
73
|
-
color: #ffffff;
|
74
|
-
|
75
|
-
opacity: 0.4;
|
76
|
-
cursor: pointer;
|
77
|
-
}
|
78
|
-
|
79
|
-
#page-jump-listing {
|
80
|
-
flex-grow: 1;
|
81
|
-
width: auto;
|
82
|
-
}
|
83
|
-
|
84
114
|
@media screen and (max-width: 767px) {
|
85
115
|
#gallery.video, #gallery.audio, #gallery.text {
|
86
116
|
padding: 0;
|
@@ -101,9 +131,3 @@ body.has-gallery.gallery #gallery {
|
|
101
131
|
display: none;
|
102
132
|
}
|
103
133
|
}
|
104
|
-
|
105
|
-
@media screen and (min-width: 768px) {
|
106
|
-
.paginator:hover {
|
107
|
-
opacity: 0.7;
|
108
|
-
}
|
109
|
-
}
|
data/app/js/gallery.js
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var Gallery = (function() {
|
4
|
-
var LAYOUT_MODES = ["fit-both", "fit-width", "clamp-width"];
|
4
|
+
var LAYOUT_MODES = ["fit-both", "fit-width", "clamp-width", "full-size"];
|
5
5
|
|
6
|
+
var $body;
|
6
7
|
var $gallery;
|
8
|
+
var $image;
|
7
9
|
var $video;
|
8
10
|
var $audio;
|
9
11
|
var currentIndex;
|
@@ -155,15 +157,38 @@ var Gallery = (function() {
|
|
155
157
|
}
|
156
158
|
|
157
159
|
function layout() {
|
158
|
-
var
|
159
|
-
|
160
|
+
var vw = document.documentElement.clientWidth;
|
161
|
+
var vh = document.documentElement.clientHeight;
|
162
|
+
|
163
|
+
var viewportOrientation = vw > vh ? "landscape" : "portrait";
|
164
|
+
$body.classList.remove("landscape", "portrait");
|
165
|
+
$body.classList.add(viewportOrientation);
|
166
|
+
|
167
|
+
$gallery.style.height = vh + "px";
|
168
|
+
|
169
|
+
var scrollerMaxHeight = viewportOrientation == "landscape" ? vh : vh - 75;
|
160
170
|
|
161
171
|
var layoutMode = LAYOUT_MODES[layoutModeIndex];
|
162
|
-
var maxHeight = layoutMode == "fit-both" ? viewportHeight : "none";
|
163
|
-
var maxWidth = layoutMode == "clamp-width" ? "1000px" : "100%";
|
164
172
|
|
165
|
-
|
166
|
-
|
173
|
+
if(layoutMode == "fit-both") {
|
174
|
+
var maxWidth = "100%";
|
175
|
+
var maxHeight = (scrollerMaxHeight + "px");
|
176
|
+
}
|
177
|
+
else if(layoutMode == "fit-width") {
|
178
|
+
var maxWidth = "100%";
|
179
|
+
var maxHeight = "none";
|
180
|
+
}
|
181
|
+
else if(layoutMode == "clamp-width") {
|
182
|
+
var maxWidth = "1000px";
|
183
|
+
var maxHeight = "none";
|
184
|
+
}
|
185
|
+
else if(layoutMode == "full-size") {
|
186
|
+
var maxWidth = "none";
|
187
|
+
var maxHeight = "none";
|
188
|
+
}
|
189
|
+
|
190
|
+
$image.style.maxWidth = maxWidth;
|
191
|
+
$image.style.maxHeight = maxHeight;
|
167
192
|
$video.style.maxWidth = maxWidth;
|
168
193
|
$video.style.maxHeight = maxHeight;
|
169
194
|
$audio.style.maxWidth = maxWidth;
|
@@ -181,7 +206,9 @@ var Gallery = (function() {
|
|
181
206
|
}
|
182
207
|
|
183
208
|
function init() {
|
209
|
+
$body = $("body");
|
184
210
|
$gallery = $("#gallery");
|
211
|
+
$image = $("#image");
|
185
212
|
$video = $("#video");
|
186
213
|
$audio = $("#audio");
|
187
214
|
|
data/app/js/index.js
CHANGED
@@ -19,51 +19,8 @@ var Index = (function() {
|
|
19
19
|
document.body.classList.add("gallery");
|
20
20
|
}
|
21
21
|
|
22
|
-
function jumpScroll() {
|
23
|
-
if(galleryVisible()) {
|
24
|
-
jumpListing();
|
25
|
-
window.scrollTo(0, 0);
|
26
|
-
}
|
27
|
-
else {
|
28
|
-
jumpGallery();
|
29
|
-
window.scrollTo(0, document.body.scrollHeight);
|
30
|
-
}
|
31
|
-
}
|
32
|
-
|
33
|
-
function atTop() {
|
34
|
-
return window.scrollY == 0;
|
35
|
-
}
|
36
|
-
|
37
|
-
function bottomScrollDown(event) {
|
38
|
-
return galleryVisible() && atBottom() && event.deltaY > 0;
|
39
|
-
}
|
40
|
-
|
41
|
-
function topScrollUp(event) {
|
42
|
-
return listingVisible() && atTop() && event.deltaY < 0;
|
43
|
-
}
|
44
|
-
|
45
|
-
function initEvents() {
|
46
|
-
var scrollSize = 0;
|
47
|
-
|
48
|
-
window.addEventListener("wheel", function(event) {
|
49
|
-
if(bottomScrollDown(event) || topScrollUp(event)) {
|
50
|
-
scrollSize += Math.abs(event.deltaY);
|
51
|
-
|
52
|
-
if(scrollSize >= 1500) {
|
53
|
-
scrollSize = 0;
|
54
|
-
jumpScroll();
|
55
|
-
}
|
56
|
-
}
|
57
|
-
else {
|
58
|
-
scrollSize = 0;
|
59
|
-
}
|
60
|
-
});
|
61
|
-
}
|
62
|
-
|
63
22
|
function init() {
|
64
23
|
jumpListing();
|
65
|
-
|
66
|
-
initEvents();
|
67
24
|
}
|
68
25
|
|
69
26
|
return {
|
data/lib/servel/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: servel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.30.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brenton "B-Train" Fletcher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|