Skip to content

Commit 2ff1968

Browse files
author
Constantin
committed
Merge branch 'dev'
2 parents e8ba3fe + fb316ae commit 2ff1968

File tree

12 files changed

+452
-344
lines changed

12 files changed

+452
-344
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,11 @@ $( '.swipebox' ).swipebox();
6161
```javascript
6262
useCSS : true, // false will force the use of jQuery for animations
6363
initialIndexOnArray: 0, // which image index to init when a array is passed
64-
hideBarsOnMobile : true, // false will show the caption and navbar on mobile devices
65-
hideBarsDelay : 3000, // 0 to always show caption and action bar
64+
hideCloseButtonOnMobile : false, // true will hide the close button on mobile devices
65+
hideBarsDelay : 3000, // delay before hiding bars on desktop
6666
videoMaxWidth : 1140, // videos max width
6767
beforeOpen: function(){} , // called before opening
68+
afterOpen: null, // called after opening
6869
afterClose: function(){}, // called after closing
6970
loopAtEnd: false // true will return to the first image after the last image is reached
7071
```
@@ -73,4 +74,6 @@ loopAtEnd: false // true will return to the first image after the last image is
7374

7475
I want to keep this plugin as simple as possible. I won't merge pull requests for additional features such as download buttons, social like buttons, IE8 compatibility etc... But feel free to fork the project and customize it to suit to your needs. Most wanted PR are for bug fixes. Also, a future improvement will be to allow zoom on touchable devices.
7576

77+
If you want to submit a pull request please be sure to grunt the whole thing (mostly jshintrc validation and minified file) and send me a demo URL. Also, please comment your code.
78+
7679
Thanks for your understanding and thank you all for your helpful support!

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"name": "swipebox",
3-
"version": "1.2.9",
3+
"version": "1.3.0",
44
"main": "src/js/jquery.swipebox.js"
55
}

demo/normalize.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/style.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

grunt/gruntfile.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ module.exports = function(grunt) {
118118
files: ['../scss/*.scss', '../demo/scss/*.scss'],
119119
tasks: [
120120
'sass',
121+
'autoprefixer',
122+
'cssmin',
121123
'notify:scss'
122124
],
123125
},

grunt/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "grunt-swipebox",
3-
"version": "1.2.9",
3+
"version": "1.3.0",
44
"description": "A touchable jQuery lightbox",
55
"devDependencies": {
66
"grunt": "~0.4.2",

index.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<meta itemprop="name" content="Swipebox | A touchable jQuery lightbox">
1414
<meta itemprop="image" content="http://swipebox.csag.co/images/swipe250.jpg">
1515
<meta itemprop="description" content="Swipebox is a jQuery lightbox plugin for desktop, mobile and tablet">
16-
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Noto+Serif:400,700&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
16+
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Merriweather:400,700&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
1717
<link rel="stylesheet" href="demo/normalize.css">
1818
<link rel="stylesheet" href="demo/bagpakk.min.css">
1919
<link rel="stylesheet" href="demo/style.css">
@@ -219,11 +219,14 @@ <h3>Options</h3>
219219
$( '.swipebox' ).swipebox( {
220220
useCSS : true, <span>// false will force the use of jQuery for animations</span>
221221
useSVG : true, <span>// false to force the use of png for buttons</span>
222-
hideBarsOnMobile : true, <span>// false will show the caption and navbar on mobile devices</span>
223-
hideBarsDelay : 3000, <span>// delay before hiding bars</span>
222+
initialIndexOnArray : 0, <span>// which image index to init when a array is passed</span>
223+
hideCloseButtonOnMobile : false, <span>// true will hide the close button on mobile devices</span>
224+
hideBarsDelay : 3000, <span>// delay before hiding bars on desktop</span>
224225
videoMaxWidth : 1140, <span>// videos max width</span>
225226
beforeOpen: function() {}, <span>// called before opening</span>
227+
afterOpen: null, <span>// called after opening</span>
226228
afterClose: function() {} <span>// called after closing</span>
229+
loopAtEnd: false <span>// true will return to the first image after the last image is reached</span>
227230
} );
228231

229232
} )( jQuery );

scss/swipebox.scss

Lines changed: 132 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,14 @@ html.swipebox-html.swipebox-touch {
3535
user-select: none;
3636
}
3737

38+
#swipebox-container{
39+
position: relative;
40+
width: 100%;
41+
height: 100%;
42+
}
43+
3844
#swipebox-slider {
45+
transition : transform 0.4s ease;
3946
height: 100%;
4047
left: 0;
4148
top: 0;
@@ -78,9 +85,6 @@ html.swipebox-html.swipebox-touch {
7885
width: 100%;
7986
padding:5%;
8087
box-sizing: border-box;
81-
-webkit-box-sizing: border-box;
82-
-moz-box-sizing: border-box;
83-
8488
.swipebox-video{
8589
width: 100%;
8690
height: 0;
@@ -103,121 +107,175 @@ html.swipebox-html.swipebox-touch {
103107

104108
}
105109

106-
#swipebox-action,
107-
#swipebox-caption{
110+
#swipebox-bottom-bar,
111+
#swipebox-top-bar{
112+
transition : 0.5s;
108113
position: absolute;
109114
left: 0;
110115
z-index: 999;
111116
height: 50px;
112117
width: 100%;
113118
}
114119

115-
#swipebox-action {
120+
#swipebox-bottom-bar {
116121
bottom: -50px;
117122

118123
&.visible-bars {
119-
-moz-transform: translateY(-50px);
120-
-ms-transform: translateY(-50px);
121-
-webkit-transform: translateY(-50px);
122-
transform: translateY(-50px);
124+
transform: translate3d(0,-50px,0);
123125
}
126+
}
124127

125-
#swipebox-prev,
126-
#swipebox-next,
127-
#swipebox-close {
128-
background-image: url(../img/icons.png);
129-
background-repeat: no-repeat;
130-
border: none!important;
131-
text-decoration: none!important;
132-
cursor: pointer;
133-
position: absolute;
134-
width: 50px;
135-
height: 50px;
136-
top: 0;
128+
#swipebox-top-bar {
129+
top: -50px;
130+
131+
&.visible-bars {
132+
transform: translate3d(0,50px,0);
137133
}
134+
}
138135

139-
#swipebox-prev{
140-
background-position: -32px 13px;
141-
right: 100px;
142-
}
136+
#swipebox-title{
137+
display:block;
138+
width: 100%;
139+
text-align: center;
140+
}
141+
142+
#swipebox-prev,
143+
#swipebox-next,
144+
#swipebox-close {
145+
background-image: url(../img/icons.png);
146+
background-repeat: no-repeat;
147+
border: none!important;
148+
text-decoration: none!important;
149+
cursor: pointer;
150+
//position: absolute;
151+
width: 50px;
152+
height: 50px;
153+
top: 0;
154+
}
155+
156+
#swipebox-arrows{
157+
display: block;
158+
margin: 0 auto;
159+
width: 100%;
160+
height: 50px;
161+
}
162+
163+
#swipebox-prev{
164+
background-position: -32px 13px;
165+
float: left;
166+
}
167+
168+
#swipebox-next{
169+
background-position: -78px 13px;
170+
float: right;
171+
}
143172

144-
#swipebox-next{
145-
background-position: -78px 13px;
146-
right: 40px;
173+
#swipebox-close{
174+
top: 0;
175+
right: 0;
176+
position: absolute;
177+
z-index: 9999;
178+
background-position: 15px 12px;
179+
}
180+
181+
.swipebox-no-close-button #swipebox-close{
182+
display: none;
183+
}
184+
185+
#swipebox-prev,
186+
#swipebox-next{
187+
&.disabled{
188+
opacity: 0.3;
147189
}
190+
}
148191

149-
#swipebox-close{
150-
background-position: 15px 12px;
151-
left: 40px;
192+
.swipebox-no-touch{
193+
#swipebox-overlay.rightSpring #swipebox-slider {
194+
animation : rightSpring 0.3s;
152195
}
153196

154-
#swipebox-prev,
155-
#swipebox-next{
156-
&.disabled{
157-
opacity: 0.3;
158-
}
197+
#swipebox-overlay.leftSpring #swipebox-slider{
198+
animation : leftSpring 0.3s;
159199
}
160200
}
161201

162-
#swipebox-caption {
163-
top: -50px;
164-
text-align: center;
165-
166-
&.visible-bars {
167-
-moz-transform: translateY(50px);
168-
-ms-transform: translateY(50px);
169-
-webkit-transform: translateY(50px);
170-
transform: translateY(50px);
202+
.swipebox-touch{
203+
#swipebox-container {
204+
&:before,
205+
&:after{
206+
backface-visibility:hidden;
207+
transition : all .3s ease;
208+
content : ' ';
209+
position: absolute;
210+
z-index: 999;
211+
top: 0;
212+
height: 100%;
213+
width: 20px;
214+
opacity: 0;
215+
}
216+
217+
&:before{
218+
left: 0;
219+
box-shadow: inset 10px 0px 10px -8px #656565;
220+
}
221+
222+
&:after{
223+
right: 0;
224+
box-shadow: inset -10px 0px 10px -8px #656565;
225+
}
171226
}
172-
}
173227

174-
#swipebox-slider.rightSpring {
175-
animation : rightSpring 0.3s;
176-
}
228+
#swipebox-overlay.leftSpringTouch #swipebox-container{
229+
&:before{
230+
opacity: 1;
231+
}
232+
}
177233

178-
#swipebox-slider.leftSpring {
179-
animation : leftSpring 0.3s;
234+
235+
#swipebox-overlay.rightSpringTouch #swipebox-container{
236+
&:after{
237+
opacity: 1;
238+
}
239+
}
180240
}
181241

182242
@keyframes rightSpring {
183243
0% {
184-
margin-left: 0px;
244+
left:0;
185245
}
186246

187247
50% {
188-
margin-left: -30px;
248+
left:-30px;
189249
}
190250

191251
100% {
192-
margin-left: 0px;
252+
left:0;
193253
}
194254
}
195255

196256
@keyframes leftSpring {
197257
0% {
198-
margin-left: 0px;
258+
left:0;
199259
}
200260

201261
50% {
202-
margin-left: 30px;
262+
left:30px;
203263
}
204264

205265
100% {
206-
margin-left: 0px;
266+
left:0;
207267
}
208268
}
209269

210-
@media screen and (max-width: 800px) {
211-
#swipebox-action #swipebox-close {
212-
left: 0;
213-
}
270+
@media screen and (min-width: 800px) {
214271

215-
#swipebox-action #swipebox-prev {
216-
right: 60px;
272+
#swipebox-close{
273+
right: 10px;
217274
}
218275

219-
#swipebox-action #swipebox-next {
220-
right: 0;
276+
#swipebox-arrows{
277+
width: 92%;
278+
max-width: 800px;
221279
}
222280
}
223281

@@ -227,19 +285,20 @@ html.swipebox-html.swipebox-touch {
227285
background: #0d0d0d;
228286
}
229287

230-
#swipebox-action,
231-
#swipebox-caption {
288+
#swipebox-bottom-bar,
289+
#swipebox-top-bar {
232290
text-shadow: 1px 1px 1px black;
233-
@include bar(#0d0d0d);
291+
background: #000;
292+
//@include bar(#0d0d0d);
234293
opacity: 0.95;
235294
}
236295

237-
#swipebox-action {
238-
border-top: 1px solid rgba(255, 255, 255, 0.2);
296+
#swipebox-bottom-bar {
297+
//border-top: 1px solid rgba(255, 255, 255, 0.1);
239298
}
240299

241-
#swipebox-caption {
242-
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
300+
#swipebox-top-bar {
301+
//border-bottom: 1px solid rgba(255, 255, 255, 0.1);
243302
color: white!important;
244303
font-size: 15px;
245304
line-height: 43px;

0 commit comments

Comments
 (0)