jekyll-swift-theme 0.2.0 → 0.3.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/README.md +10 -1
- data/_includes/head.html +6 -1
- data/_includes/shorts/flickr-album.html +10 -0
- data/_includes/shorts/gallery.html +7 -5
- data/_sass/swift/_comments.sass +6 -0
- data/assets/galleria/galleria.js +6987 -0
- data/assets/galleria/galleria.min.js +12 -0
- data/assets/galleria/plugins/flickr/demo.html +62 -0
- data/assets/galleria/plugins/flickr/galleria.flickr.js +399 -0
- data/assets/galleria/plugins/flickr/galleria.flickr.min.js +10 -0
- data/assets/galleria/plugins/history/demo.html +98 -0
- data/assets/galleria/plugins/history/galleria.history.js +164 -0
- data/assets/galleria/plugins/history/galleria.history.min.js +10 -0
- data/assets/galleria/themes/azur/demo-cdn.html +118 -0
- data/assets/galleria/themes/azur/demo-retina.html +120 -0
- data/assets/galleria/themes/azur/demo.html +120 -0
- data/assets/galleria/themes/azur/galleria.azur.css +403 -0
- data/assets/galleria/themes/azur/galleria.azur.js +312 -0
- data/assets/galleria/themes/azur/galleria.azur.min.css +1 -0
- data/assets/galleria/themes/azur/galleria.azur.min.js +10 -0
- data/assets/galleria/themes/classic/demo-cdn.html +103 -0
- data/assets/galleria/themes/classic/demo-retina.html +106 -0
- data/assets/galleria/themes/classic/demo.html +106 -0
- data/assets/galleria/themes/classic/galleria.classic.css +217 -0
- data/assets/galleria/themes/classic/galleria.classic.js +117 -0
- data/assets/galleria/themes/classic/galleria.classic.min.css +1 -0
- data/assets/galleria/themes/classic/galleria.classic.min.js +10 -0
- data/assets/galleria/themes/folio/demo-cdn.html +106 -0
- data/assets/galleria/themes/folio/demo-retina.html +108 -0
- data/assets/galleria/themes/folio/demo.html +108 -0
- data/assets/galleria/themes/folio/galleria.folio.css +185 -0
- data/assets/galleria/themes/folio/galleria.folio.js +488 -0
- data/assets/galleria/themes/folio/galleria.folio.min.css +1 -0
- data/assets/galleria/themes/folio/galleria.folio.min.js +10 -0
- data/assets/galleria/themes/fullscreen/demo-cdn.html +103 -0
- data/assets/galleria/themes/fullscreen/demo-retina.html +105 -0
- data/assets/galleria/themes/fullscreen/demo.html +103 -0
- data/assets/galleria/themes/fullscreen/galleria.fullscreen.css +219 -0
- data/assets/galleria/themes/fullscreen/galleria.fullscreen.js +197 -0
- data/assets/galleria/themes/fullscreen/galleria.fullscreen.min.css +1 -0
- data/assets/galleria/themes/fullscreen/galleria.fullscreen.min.js +10 -0
- data/assets/galleria/themes/fullscreen/index.html +0 -0
- data/assets/galleria/themes/miniml/demo-cdn.html +113 -0
- data/assets/galleria/themes/miniml/demo-retina.html +115 -0
- data/assets/galleria/themes/miniml/demo.html +115 -0
- data/assets/galleria/themes/miniml/galleria.miniml.css +224 -0
- data/assets/galleria/themes/miniml/galleria.miniml.js +171 -0
- data/assets/galleria/themes/miniml/galleria.miniml.min.css +1 -0
- data/assets/galleria/themes/miniml/galleria.miniml.min.js +10 -0
- data/assets/galleria/themes/twelve/demo-cdn.html +120 -0
- data/assets/galleria/themes/twelve/demo-retina.html +121 -0
- data/assets/galleria/themes/twelve/demo.html +121 -0
- data/assets/galleria/themes/twelve/galleria.twelve.css +296 -0
- data/assets/galleria/themes/twelve/galleria.twelve.js +301 -0
- data/assets/galleria/themes/twelve/galleria.twelve.min.css +1 -0
- data/assets/galleria/themes/twelve/galleria.twelve.min.js +10 -0
- data/assets/js/jquery-3.6.0.min.js +2 -0
- metadata +55 -2
@@ -0,0 +1,312 @@
|
|
1
|
+
/**
|
2
|
+
* Galleria Azur Theme
|
3
|
+
*
|
4
|
+
*
|
5
|
+
* Copyright (c) 2010 - 2019 worse is better UG
|
6
|
+
* Licensed under the MIT License.
|
7
|
+
*/
|
8
|
+
|
9
|
+
( function( window, factory ) {
|
10
|
+
if ( typeof define == 'function' && define.amd ) {
|
11
|
+
define( ['../galleria', 'jquery' ], function( Galleria, jQuery ) {
|
12
|
+
return factory( window, Galleria, jQuery );
|
13
|
+
});
|
14
|
+
} else if ( typeof module == 'object' && module.exports ) {
|
15
|
+
module.exports = factory(
|
16
|
+
window,
|
17
|
+
require('galleria'),
|
18
|
+
require('jquery')
|
19
|
+
);
|
20
|
+
} else {
|
21
|
+
factory(
|
22
|
+
window,
|
23
|
+
window.Galleria,
|
24
|
+
window.jQuery
|
25
|
+
);
|
26
|
+
}
|
27
|
+
}( window, function factory( window, Galleria, $ ) {
|
28
|
+
/*global jQuery, Galleria, window */
|
29
|
+
|
30
|
+
Galleria.addTheme({
|
31
|
+
name: 'azur',
|
32
|
+
version: 1.60,
|
33
|
+
author: 'Galleria',
|
34
|
+
css: 'galleria.azur.css',
|
35
|
+
// begin site script
|
36
|
+
defaults: {
|
37
|
+
transition: 'fade',
|
38
|
+
transitionSpeed: 500,
|
39
|
+
imageCrop: true,
|
40
|
+
thumbCrop: 'height',
|
41
|
+
idleMode: 'hover',
|
42
|
+
idleSpeed: 500,
|
43
|
+
fullscreenTransition: false,
|
44
|
+
|
45
|
+
_locale: {
|
46
|
+
show_captions: 'Show captions',
|
47
|
+
hide_captions: 'Hide captions',
|
48
|
+
play: 'Play slideshow',
|
49
|
+
pause: 'Pause slideshow',
|
50
|
+
enter_fullscreen: 'Enter fullscreen',
|
51
|
+
exit_fullscreen: 'Exit fullscreen',
|
52
|
+
next: 'Next image',
|
53
|
+
prev: 'Previous image',
|
54
|
+
showing_image: 'Showing image %s of %s'
|
55
|
+
},
|
56
|
+
|
57
|
+
_toggleCaption: true,
|
58
|
+
_showCaption: true,
|
59
|
+
_showTooltip: true
|
60
|
+
},
|
61
|
+
init: function(options) {
|
62
|
+
|
63
|
+
Galleria.requires( 1.6, 'This version of Azur theme requires Galleria version 1.6 or later');
|
64
|
+
|
65
|
+
// add some elements
|
66
|
+
this.addElement('bar','fullscreen','play','progress').append({
|
67
|
+
'stage' : 'progress',
|
68
|
+
'container': 'bar',
|
69
|
+
'bar' : ['fullscreen','play','thumbnails-container']
|
70
|
+
}).prependChild( 'stage', 'info' ).appendChild( 'container', 'tooltip' );
|
71
|
+
|
72
|
+
// copy the scope
|
73
|
+
var gallery = this,
|
74
|
+
document = window.document,
|
75
|
+
lang = options._locale,
|
76
|
+
canvSupport = ( 'getContext' in document.createElement('canvas') );
|
77
|
+
|
78
|
+
// progress animation
|
79
|
+
(function() {
|
80
|
+
|
81
|
+
if ( !canvSupport ) {
|
82
|
+
|
83
|
+
gallery.addElement( 'progressbar' ).appendChild( 'progress', 'progressbar' );
|
84
|
+
gallery.$( 'progress' ).addClass('nocanvas');
|
85
|
+
|
86
|
+
var w = gallery.$( 'progress' ).width();
|
87
|
+
|
88
|
+
gallery.bind( 'progress', function(e) {
|
89
|
+
gallery.$( 'progressbar' ).width( e.percent/100 * w );
|
90
|
+
});
|
91
|
+
|
92
|
+
return;
|
93
|
+
}
|
94
|
+
|
95
|
+
var dim = 24,
|
96
|
+
canvas = document.createElement('canvas'),
|
97
|
+
ctx = canvas.getContext('2d'),
|
98
|
+
radius = function( degrees ) {
|
99
|
+
return degrees * ( Math.PI/180 );
|
100
|
+
},
|
101
|
+
arc = function( degrees, color ) {
|
102
|
+
ctx.strokeStyle = color || '#000';
|
103
|
+
ctx.lineWidth = 3;
|
104
|
+
ctx.clearRect( 0, 0, dim, dim );
|
105
|
+
ctx.beginPath();
|
106
|
+
ctx.arc( dim/2, dim/2, dim/2-2, radius(-90), radius(degrees-90), false );
|
107
|
+
ctx.stroke();
|
108
|
+
ctx.closePath();
|
109
|
+
};
|
110
|
+
|
111
|
+
canvas.width = dim;
|
112
|
+
canvas.height = dim;
|
113
|
+
|
114
|
+
$( canvas ).css({
|
115
|
+
zIndex: 10000,
|
116
|
+
position: 'absolute',
|
117
|
+
right:10,
|
118
|
+
top:10
|
119
|
+
}).appendTo( gallery.get('container') );
|
120
|
+
|
121
|
+
gallery.bind( 'progress', function(e) {
|
122
|
+
$( canvas ).fadeIn(200);
|
123
|
+
arc( e.percent*3.6, 'rgba(255,255,255,.7)' );
|
124
|
+
});
|
125
|
+
|
126
|
+
gallery.bind( 'pause', function() {
|
127
|
+
$( canvas ).fadeOut( 200, function() {
|
128
|
+
ctx.clearRect( 0, 0, dim, dim );
|
129
|
+
});
|
130
|
+
});
|
131
|
+
|
132
|
+
}());
|
133
|
+
|
134
|
+
// loader
|
135
|
+
(function() {
|
136
|
+
|
137
|
+
var requestFrame = (function(){
|
138
|
+
var r = 'RequestAnimationFrame';
|
139
|
+
return window.requestAnimationFrame ||
|
140
|
+
window['webkit'+r] ||
|
141
|
+
window['moz'+r] ||
|
142
|
+
window['o'+r] ||
|
143
|
+
window['ms'+r] ||
|
144
|
+
function( callback ) {
|
145
|
+
window.setTimeout(callback, 1000 / 60);
|
146
|
+
};
|
147
|
+
}());
|
148
|
+
|
149
|
+
if ( !canvSupport ) {
|
150
|
+
gallery.$( 'loader' ).addClass( 'nocanvas' );
|
151
|
+
return;
|
152
|
+
}
|
153
|
+
|
154
|
+
var elem = document.createElement('canvas'),
|
155
|
+
ctx = elem.getContext('2d'),
|
156
|
+
M = Math,
|
157
|
+
_restore = function( ctx, size, back ) {
|
158
|
+
var n = back ? -2 : 2;
|
159
|
+
ctx.translate( size/n, size/n );
|
160
|
+
},
|
161
|
+
step = 28;
|
162
|
+
|
163
|
+
$(elem).hide().appendTo( gallery.get('loader') ).fadeIn(500);
|
164
|
+
|
165
|
+
var draw = function( ctx, st ) {
|
166
|
+
|
167
|
+
var size = 48,
|
168
|
+
lines = 28,
|
169
|
+
l;
|
170
|
+
|
171
|
+
ctx.clearRect(0, 0, size, size);
|
172
|
+
ctx.lineWidth = 1.5;
|
173
|
+
|
174
|
+
for (var i=0; i < lines; i++) {
|
175
|
+
|
176
|
+
l = i+st >= lines ? i-lines+st : i+st;
|
177
|
+
|
178
|
+
ctx.strokeStyle = 'rgba(255,255,255,' + M.max(0, l/lines ) + ')';
|
179
|
+
ctx.lineWidth = 1;
|
180
|
+
ctx.beginPath();
|
181
|
+
|
182
|
+
ctx.moveTo( size/2, size/2-16 );
|
183
|
+
ctx.lineTo( size/2, 0 );
|
184
|
+
ctx.stroke();
|
185
|
+
_restore( ctx, size, false );
|
186
|
+
ctx.rotate( ( 360/lines ) * M.PI/180 );
|
187
|
+
_restore( ctx, size, true );
|
188
|
+
}
|
189
|
+
|
190
|
+
ctx.save();
|
191
|
+
_restore( ctx, size, false );
|
192
|
+
|
193
|
+
ctx.rotate( -1 * ( 360/lines/8 ) * M.PI/180 );
|
194
|
+
_restore( ctx, size, true );
|
195
|
+
};
|
196
|
+
|
197
|
+
(function loop() {
|
198
|
+
requestFrame(loop);
|
199
|
+
draw(ctx, step);
|
200
|
+
step = step === 0 ? 28 : step-1;
|
201
|
+
}())
|
202
|
+
}());
|
203
|
+
|
204
|
+
var infoState = Galleria.IE < 9 ? { bottom: -100 } : { bottom: -50, opacity: 0 },
|
205
|
+
counterState = Galleria.IE < 9 ? { top: -20 } : { opacity: 0, top: -20 };
|
206
|
+
|
207
|
+
this.bind( 'play', function() {
|
208
|
+
|
209
|
+
this.$( 'play' ).addClass( 'pause' );
|
210
|
+
if ( !canvSupport ) {
|
211
|
+
this.$( 'progress' ).show();
|
212
|
+
}
|
213
|
+
|
214
|
+
}).bind( 'pause', function() {
|
215
|
+
|
216
|
+
this.$( 'play' ).removeClass( 'pause' );
|
217
|
+
if ( !canvSupport ) {
|
218
|
+
this.$( 'progress' ).hide();
|
219
|
+
}
|
220
|
+
|
221
|
+
}).bind( 'loadstart', function(e) {
|
222
|
+
|
223
|
+
if ( !e.cached ) {
|
224
|
+
this.$( 'loader' ).show();
|
225
|
+
}
|
226
|
+
|
227
|
+
}).bind( 'loadfinish', function(e) {
|
228
|
+
|
229
|
+
if ( canvSupport ) {
|
230
|
+
this.$( 'loader' ).fadeOut(100);
|
231
|
+
} else {
|
232
|
+
this.$( 'loader' ).hide();
|
233
|
+
}
|
234
|
+
|
235
|
+
});
|
236
|
+
|
237
|
+
this.addIdleState( this.get('info'), infoState, Galleria.IE < 9 ? {} : { opacity: 1 }, true)
|
238
|
+
.addIdleState( this.get('image-nav-left'), { opacity: 0, left: 0 }, { opacity: 1 }, true)
|
239
|
+
.addIdleState( this.get('image-nav-right'), { opacity: 0, right: 0 }, { opacity: 1 }, true)
|
240
|
+
.addIdleState( this.get('counter'), counterState, Galleria.IE < 9 ? {} : { opacity: 0.9 }, true);
|
241
|
+
|
242
|
+
this.$( 'fullscreen' ).on('click:fast', function(e) {
|
243
|
+
|
244
|
+
e.preventDefault();
|
245
|
+
gallery.toggleFullscreen();
|
246
|
+
|
247
|
+
});
|
248
|
+
|
249
|
+
this.$( 'play' ).on('click:fast', function(e) {
|
250
|
+
|
251
|
+
e.preventDefault();
|
252
|
+
gallery.playToggle();
|
253
|
+
|
254
|
+
});
|
255
|
+
|
256
|
+
if ( options._toggleCaption ) {
|
257
|
+
|
258
|
+
this.$( 'info' ).addClass( 'toggler' );
|
259
|
+
this.addElement( 'captionopen' ).appendChild( 'stage', 'captionopen' );
|
260
|
+
this.addElement( 'captionclose' ).appendChild( 'info', 'captionclose' );
|
261
|
+
|
262
|
+
this.$( 'captionopen' ).on('click:fast', function() {
|
263
|
+
gallery.$( 'info' ).addClass( 'open' );
|
264
|
+
$(this).hide();
|
265
|
+
}).html( lang.show_captions );
|
266
|
+
|
267
|
+
this.bind( 'loadstart', function() {
|
268
|
+
this.$( 'captionopen' ).toggle( !gallery.$( 'info' ).hasClass( 'open' ) && this.hasInfo() );
|
269
|
+
});
|
270
|
+
|
271
|
+
this.$( 'captionclose' ).on('click:fast', function() {
|
272
|
+
gallery.$( 'info' ).removeClass( 'open' );
|
273
|
+
if ( gallery.hasInfo() ) {
|
274
|
+
gallery.$( 'captionopen' ).show();
|
275
|
+
}
|
276
|
+
}).html('×');
|
277
|
+
|
278
|
+
if ( options._showCaption ) {
|
279
|
+
this.$( 'captionopen' ).trigger('click:fast');
|
280
|
+
}
|
281
|
+
|
282
|
+
}
|
283
|
+
|
284
|
+
if ( options._showTooltip ) {
|
285
|
+
|
286
|
+
this.bindTooltip({
|
287
|
+
|
288
|
+
'fullscreen': function() {
|
289
|
+
return gallery.isFullscreen() ? lang.exit_fullscreen : lang.enter_fullscreen;
|
290
|
+
},
|
291
|
+
|
292
|
+
'play': function() {
|
293
|
+
return gallery.isPlaying() ? lang.pause : lang.play;
|
294
|
+
},
|
295
|
+
|
296
|
+
'captionclose': lang.hide_captions,
|
297
|
+
|
298
|
+
'image-nav-right': lang.next,
|
299
|
+
|
300
|
+
'image-nav-left': lang.prev,
|
301
|
+
|
302
|
+
'counter': function() {
|
303
|
+
return lang.showing_image.replace( /\%s/, gallery.getIndex() + 1 ).replace( /\%s/, gallery.getDataLength() );
|
304
|
+
}
|
305
|
+
});
|
306
|
+
}
|
307
|
+
}
|
308
|
+
// end site script
|
309
|
+
});
|
310
|
+
|
311
|
+
return Galleria;
|
312
|
+
}));
|