├── .gitignore ├── CHANGELOG.md ├── README.md ├── bower.json ├── component.json ├── dist ├── overlays │ ├── 01.png │ ├── 02.png │ ├── 03.png │ ├── 04.png │ ├── 05.png │ ├── 06.png │ ├── 07.png │ ├── 08.png │ └── 09.png ├── vegas.css ├── vegas.js ├── vegas.min.css ├── vegas.min.css.map ├── vegas.min.js └── vegas.min.js.map ├── gulpfile.js ├── package-lock.json ├── package.json └── src ├── overlays ├── 01.png ├── 02.png ├── 03.png ├── 04.png ├── 05.png ├── 06.png ├── 07.png ├── 08.png └── 09.png ├── sass ├── animations │ ├── kenburns-down-left.sass │ ├── kenburns-down-right.sass │ ├── kenburns-down.sass │ ├── kenburns-left.sass │ ├── kenburns-right.sass │ ├── kenburns-up-left.sass │ ├── kenburns-up-right.sass │ ├── kenburns-up.sass │ └── kenburns.sass ├── main │ └── vegas.sass ├── transitions │ ├── blur.sass │ ├── burn.sass │ ├── fade.sass │ ├── flash.sass │ ├── negative.sass │ ├── slide-down.sass │ ├── slide-left.sass │ ├── slide-right.sass │ ├── slide-up.sass │ ├── swirl-left.sass │ ├── swirl-right.sass │ ├── zoom-in.sass │ └── zoom-out.sass └── vegas.sass └── vegas.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Vegas jQuery Plugin 2 | 3 | ## CHANGE LOG 4 | 5 | ### Vegas 2.6.0 2024-07-30 6 | 7 | * Play video inline 8 | 9 | ### Vegas 2.5.4 2021-01-30 10 | 11 | * Use relative URL for overlay image (Thanks paescuj) 12 | 13 | ### Vegas 2.5.3 2020-12-18 14 | 15 | * Fix padding issue on Firefox (Thanks qzminski) 16 | 17 | ### Vegas 2.5.1 2020-04-24 18 | 19 | * Fix the height of the container when Vegas is in a div 20 | 21 | ### Vegas 2.5.0 2020-04-24 22 | 23 | * add metro 4 support 24 | * Try to fix some responsive issues on Vegas in a div 25 | 26 | ### Vegas 2.4.4 2018-10-30 27 | 28 | * Merge pull request #182 from davide93/patch-1 29 | * Update README.md 30 | * Update README.md http:// to https:// link. 31 | 32 | ### Vegas 2.4.2 2018-09-18 33 | 34 | * Update dev packages 35 | * Code formating 36 | * Remove IOS7 css hack. 37 | 38 | ### Vegas 2.4.1 2018-09-17 39 | 40 | * Optimise overlay png with tinypng 41 | * Fix a glitch on blur transition effect 42 | * Autplay Enabled - Jump to a specific slide fix 43 | 44 | ### Vegas 2.4.0 2017-01-04 45 | 46 | * Add will-change CSS property to slides 47 | * Add slidesToKeep option to set the number of slides kept behind the main slide 48 | 49 | ### Vegas 2.3.1 2016-09-18 50 | 51 | Fix slide src path names that contain blank characters 52 | 53 | ### Vegas 2.3.0 2016-09-17 54 | 55 | * Add firstTransition and firstTransitionDuration options 56 | * Add Loop option to settings and end callback 57 | * Check image complete property in addition to onload before changing slide. 58 | 59 | ### Vegas 2.2.1 2016-05-04 60 | 61 | * Fixed _random to match last item also 62 | 63 | ### Vegas 2.2.0 2016-01-18 64 | 65 | * Add cover:repeat option to display background as tiled and not resized #75 66 | 67 | ### Vegas 2.1.3 2015-04-28 68 | 69 | * Fix 'TypeError' on destroy #79 70 | 71 | ### Vegas 2.1.2 2015-04-15 72 | 73 | * Fix #76 with video preloading issue 74 | 75 | ### Vegas 2.1.1 2015-04-08 76 | 77 | * Fix overlay destruction #74 (sumomostudio) 78 | 79 | ### Vegas 2.1.0 2015-04-02 80 | 81 | * Add `destroy` method 82 | 83 | ### Vegas 2.0.5 2015-03-18 84 | 85 | * Remove video canplay event not triggered properly on Firefox 86 | * Timer color set to neutral white by default 87 | 88 | ### Vegas 2.0.4 2015-03-12 89 | 90 | * New video options mute and loop 91 | * Enhance quick transition change 92 | 93 | ### Vegas 2.0.3 2015-03-06 94 | 95 | * Restore missing overlays 96 | 97 | ### Vegas 2.0.2 2015-03-06 98 | 99 | * Fix a bug with random transitions 100 | * Remove Transition/Animation auto-detection 101 | * Aad TransitionRegister/AnimationRegister options instead 102 | 103 | ### Vegas 2.0.1 2015-03-05 104 | 105 | * Remove dev folder 106 | 107 | ### Vegas 2.0.0 2015-03-05 108 | 109 | * Brand new Vegas V2 110 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Vegas – Backgrounds and Slideshows 2 | ================================== 3 | 4 | [![NPM version](https://badge.fury.io/js/vegas.svg)](https://badge.fury.io/js/vegas) 5 | [![Bower version](https://badge.fury.io/bo/vegas.svg)](https://badge.fury.io/bo/vegas) 6 | 7 | Vegas is a [jQuery](https://jquery.com)/[Zepto](https://zeptojs.com) plugin 8 | to add beautiful backgrounds and Slideshows to DOM elements. 9 | 10 | **Important note:** Vegas 2 is not a drop-in replacement for version 1.x. It's a brand new plugin. 11 | 12 | #### Install 13 | 14 | Download the [last version](https://jaysalvat.github.io/vegas/releases/latest/vegas.zip). 15 | 16 | Or use [Bower](https://bower.io/): 17 | 18 | bower install vegas 19 | 20 | Or use [NPM](https://www.npmjs.org/): 21 | 22 | npm install vegas 23 | 24 | #### Get started 25 | 26 | First, include either [jQuery](https://jquery.com) or [Zepto](https://zeptojs.com). 27 | 28 | Then... 29 | 30 | $(function() { 31 | $('body').vegas({ 32 | slides: [ 33 | { src: 'img1.jpg' }, 34 | { src: 'img2.jpg' }, 35 | { src: 'img3.jpg' } 36 | ] 37 | }); 38 | }); 39 | 40 | ### Official website 41 | https://vegas.jaysalvat.com/ 42 | 43 | ### Sin City demo 44 | https://vegas.jaysalvat.com/demo/ 45 | 46 | ### Documentation 47 | https://vegas.jaysalvat.com/documentation/ 48 | 49 | #### Looking for Vegas v1? 50 | 51 | The [Vegas v1 website](http://v1.vegas.jaysalvat.com) is still available but this version is not maintained anymore. 52 | 53 | Contributing 54 | ------------ 55 | 56 | Please don't edit files in the `dist` directory as they are generated via [Gulp](https://gulpjs.com). 57 | You'll find source code in the `src` directory! 58 | 59 | Install dependencies. 60 | 61 | npm install 62 | 63 | Run watch task before editing code. 64 | 65 | gulp watch 66 | 67 | Regarding code style like indentation and whitespace, **follow the conventions you see used in the source already.** 68 | 69 | License 70 | ------- 71 | 72 | **The MIT License (MIT)** 73 | 74 | Copyright 2024 Jay Salvat 75 | 76 | Permission is hereby granted, free of charge, to any person obtaining a copy 77 | of this software and associated documentation files (the "Software"), to deal 78 | in the Software without restriction, including without limitation the rights 79 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 80 | copies of the Software, and to permit persons to whom the Software is 81 | furnished to do so, subject to the following conditions: 82 | 83 | The above copyright notice and this permission notice shall be included in 84 | all copies or substantial portions of the Software. 85 | 86 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 87 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 88 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 89 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 90 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 91 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 92 | THE SOFTWARE. 93 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vegas", 3 | "version": "2.6.0", 4 | "main": [ 5 | "dist/vegas.min.js", 6 | "dist/vegas.min.css" 7 | ], 8 | "ignore": [ 9 | "src", 10 | "gulpfile.js", 11 | "package.json", 12 | "component.json" 13 | ], 14 | "dependencies": { 15 | "jquery": ">=1.9" 16 | } 17 | } -------------------------------------------------------------------------------- /component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vegas", 3 | "version": "2.6.0", 4 | "description": "Vegas - Fullscreen Backgrounds and Slideshows.", 5 | "homepage": "http://vegas.jaysalvat.com", 6 | "author": "Jay Salvat", 7 | "license": "MIT", 8 | "main": [ 9 | "dist/vegas.min.js", 10 | "dist/vegas.min.css" 11 | ], 12 | "repository": { 13 | "type": "git", 14 | "url": "git@github.com:jaysalvat/vegas.git" 15 | }, 16 | "keywords": [ 17 | "background", 18 | "slideshow", 19 | "fullscreen", 20 | "vegas", 21 | "jquery-plugin", 22 | "jquery", 23 | "zepto" 24 | ] 25 | } -------------------------------------------------------------------------------- /dist/overlays/01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaysalvat/vegas/5fb29500e9d0fcdcf11b22b83cf13856ab5537fc/dist/overlays/01.png -------------------------------------------------------------------------------- /dist/overlays/02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaysalvat/vegas/5fb29500e9d0fcdcf11b22b83cf13856ab5537fc/dist/overlays/02.png -------------------------------------------------------------------------------- /dist/overlays/03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaysalvat/vegas/5fb29500e9d0fcdcf11b22b83cf13856ab5537fc/dist/overlays/03.png -------------------------------------------------------------------------------- /dist/overlays/04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaysalvat/vegas/5fb29500e9d0fcdcf11b22b83cf13856ab5537fc/dist/overlays/04.png -------------------------------------------------------------------------------- /dist/overlays/05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaysalvat/vegas/5fb29500e9d0fcdcf11b22b83cf13856ab5537fc/dist/overlays/05.png -------------------------------------------------------------------------------- /dist/overlays/06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaysalvat/vegas/5fb29500e9d0fcdcf11b22b83cf13856ab5537fc/dist/overlays/06.png -------------------------------------------------------------------------------- /dist/overlays/07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaysalvat/vegas/5fb29500e9d0fcdcf11b22b83cf13856ab5537fc/dist/overlays/07.png -------------------------------------------------------------------------------- /dist/overlays/08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaysalvat/vegas/5fb29500e9d0fcdcf11b22b83cf13856ab5537fc/dist/overlays/08.png -------------------------------------------------------------------------------- /dist/overlays/09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaysalvat/vegas/5fb29500e9d0fcdcf11b22b83cf13856ab5537fc/dist/overlays/09.png -------------------------------------------------------------------------------- /dist/vegas.css: -------------------------------------------------------------------------------- 1 | .vegas-overlay, 2 | .vegas-content-scrollable, 3 | .vegas-timer, 4 | .vegas-slide, 5 | .vegas-slide-inner { 6 | position: absolute; 7 | top: 0; 8 | left: 0; 9 | bottom: 0; 10 | right: 0; 11 | overflow: hidden; 12 | border: none; 13 | padding: 0; 14 | margin: 0; 15 | } 16 | 17 | .vegas-content-scrollable { 18 | position: relative; 19 | height: 100%; 20 | overflow: auto; 21 | } 22 | 23 | .vegas-overlay { 24 | opacity: .5; 25 | background: transparent url("./overlays/02.png") center center repeat; 26 | } 27 | 28 | .vegas-timer { 29 | top: auto; 30 | bottom: 0; 31 | height: 2px; 32 | } 33 | 34 | .vegas-timer-progress { 35 | width: 0%; 36 | height: 100%; 37 | background: white; 38 | transition: width ease-out; 39 | } 40 | 41 | .vegas-timer-running .vegas-timer-progress { 42 | width: 100%; 43 | } 44 | 45 | .vegas-slide, 46 | .vegas-slide-inner { 47 | margin: 0; 48 | padding: 0; 49 | background: transparent center center no-repeat; 50 | transform: translateZ(0); 51 | will-change: transform, opacity; 52 | } 53 | 54 | body .vegas-container { 55 | overflow: hidden !important; 56 | position: relative; 57 | } 58 | 59 | .vegas-video { 60 | min-width: 100%; 61 | min-height: 100%; 62 | width: auto; 63 | height: auto; 64 | } 65 | 66 | body.vegas-container { 67 | overflow: auto; 68 | position: static; 69 | z-index: -2; 70 | } 71 | 72 | body.vegas-container > .vegas-timer, 73 | body.vegas-container > .vegas-overlay, 74 | body.vegas-container > .vegas-slide { 75 | position: fixed; 76 | z-index: -1; 77 | } 78 | 79 | /* Target Safari IOS7+ in order to add 76px */ 80 | /*******************************************/ 81 | /* blur transition */ 82 | /*******************************************/ 83 | .vegas-transition-blur, 84 | .vegas-transition-blur2 { 85 | opacity: 0; 86 | filter: blur(32px) brightness(1.01); 87 | } 88 | 89 | .vegas-transition-blur-in, 90 | .vegas-transition-blur2-in { 91 | opacity: 1; 92 | filter: blur(0px) brightness(1.01); 93 | } 94 | 95 | .vegas-transition-blur2-out { 96 | opacity: 0; 97 | } 98 | 99 | /*******************************************/ 100 | /* burn transition */ 101 | /*******************************************/ 102 | .vegas-transition-burn, 103 | .vegas-transition-burn2 { 104 | opacity: 0; 105 | filter: contrast(1000%) saturate(1000%); 106 | } 107 | 108 | .vegas-transition-burn-in, 109 | .vegas-transition-burn2-in { 110 | opacity: 1; 111 | filter: contrast(100%) saturate(100%); 112 | } 113 | 114 | .vegas-transition-burn2-out { 115 | opacity: 0; 116 | filter: contrast(1000%) saturate(1000%); 117 | } 118 | 119 | /*******************************************/ 120 | /* fade transition */ 121 | /*******************************************/ 122 | .vegas-transition-fade, 123 | .vegas-transition-fade2 { 124 | opacity: 0; 125 | } 126 | 127 | .vegas-transition-fade-in, 128 | .vegas-transition-fade2-in { 129 | opacity: 1; 130 | } 131 | 132 | .vegas-transition-fade2-out { 133 | opacity: 0; 134 | } 135 | 136 | /*******************************************/ 137 | /* flash transition */ 138 | /*******************************************/ 139 | .vegas-transition-flash, 140 | .vegas-transition-flash2 { 141 | opacity: 0; 142 | filter: brightness(25); 143 | } 144 | 145 | .vegas-transition-flash-in, 146 | .vegas-transition-flash2-in { 147 | opacity: 1; 148 | filter: brightness(1); 149 | } 150 | 151 | .vegas-transition-flash2-out { 152 | opacity: 0; 153 | filter: brightness(25); 154 | } 155 | 156 | /*******************************************/ 157 | /* negative transition */ 158 | /*******************************************/ 159 | .vegas-transition-negative, 160 | .vegas-transition-negative2 { 161 | opacity: 0; 162 | filter: invert(100%); 163 | } 164 | 165 | .vegas-transition-negative-in, 166 | .vegas-transition-negative2-in { 167 | opacity: 1; 168 | filter: invert(0); 169 | } 170 | 171 | .vegas-transition-negative2-out { 172 | opacity: 0; 173 | filter: invert(100%); 174 | } 175 | 176 | /*******************************************/ 177 | /* slideDown transition */ 178 | /*******************************************/ 179 | .vegas-transition-slideDown, 180 | .vegas-transition-slideDown2 { 181 | transform: translateY(-100%); 182 | } 183 | 184 | .vegas-transition-slideDown-in, 185 | .vegas-transition-slideDown2-in { 186 | transform: translateY(0%); 187 | } 188 | 189 | .vegas-transition-slideDown2-out { 190 | transform: translateY(100%); 191 | } 192 | 193 | /*******************************************/ 194 | /* slideLeft transition */ 195 | /*******************************************/ 196 | .vegas-transition-slideLeft, 197 | .vegas-transition-slideLeft2 { 198 | transform: translateX(100%); 199 | } 200 | 201 | .vegas-transition-slideLeft-in, 202 | .vegas-transition-slideLeft2-in { 203 | transform: translateX(0%); 204 | } 205 | 206 | .vegas-transition-slideLeft2-out { 207 | transform: translateX(-100%); 208 | } 209 | 210 | /*******************************************/ 211 | /* slideRight transition */ 212 | /*******************************************/ 213 | .vegas-transition-slideRight, 214 | .vegas-transition-slideRight2 { 215 | transform: translateX(-100%); 216 | } 217 | 218 | .vegas-transition-slideRight-in, 219 | .vegas-transition-slideRight2-in { 220 | transform: translateX(0%); 221 | } 222 | 223 | .vegas-transition-slideRight2-out { 224 | transform: translateX(100%); 225 | } 226 | 227 | /*******************************************/ 228 | /* slideUp transition */ 229 | /*******************************************/ 230 | .vegas-transition-slideUp, 231 | .vegas-transition-slideUp2 { 232 | transform: translateY(100%); 233 | } 234 | 235 | .vegas-transition-slideUp-in, 236 | .vegas-transition-slideUp2-in { 237 | transform: translateY(0%); 238 | } 239 | 240 | .vegas-transition-slideUp2-out { 241 | transform: translateY(-100%); 242 | } 243 | 244 | /*******************************************/ 245 | /* swirlLeft transition */ 246 | /*******************************************/ 247 | .vegas-transition-swirlLeft, 248 | .vegas-transition-swirlLeft2 { 249 | transform: scale(2) rotate(35deg); 250 | opacity: 0; 251 | } 252 | 253 | .vegas-transition-swirlLeft-in, 254 | .vegas-transition-swirlLeft2-in { 255 | transform: scale(1) rotate(0deg); 256 | opacity: 1; 257 | } 258 | 259 | .vegas-transition-swirlLeft2-out { 260 | transform: scale(2) rotate(-35deg); 261 | opacity: 0; 262 | } 263 | 264 | /*******************************************/ 265 | /* swirlRight transition */ 266 | /*******************************************/ 267 | .vegas-transition-swirlRight, 268 | .vegas-transition-swirlRight2 { 269 | transform: scale(2) rotate(-35deg); 270 | opacity: 0; 271 | } 272 | 273 | .vegas-transition-swirlRight-in, 274 | .vegas-transition-swirlRight2-in { 275 | transform: scale(1) rotate(0deg); 276 | opacity: 1; 277 | } 278 | 279 | .vegas-transition-swirlRight2-out { 280 | transform: scale(2) rotate(35deg); 281 | opacity: 0; 282 | } 283 | 284 | /*******************************************/ 285 | /* zoomIn transition */ 286 | /*******************************************/ 287 | .vegas-transition-zoomIn, 288 | .vegas-transition-zoomIn2 { 289 | transform: scale(0); 290 | opacity: 0; 291 | } 292 | 293 | .vegas-transition-zoomIn-in, 294 | .vegas-transition-zoomIn2-in { 295 | transform: scale(1); 296 | opacity: 1; 297 | } 298 | 299 | .vegas-transition-zoomIn2-out { 300 | transform: scale(2); 301 | opacity: 0; 302 | } 303 | 304 | /*******************************************/ 305 | /* zoomOut transition */ 306 | /*******************************************/ 307 | .vegas-transition-zoomOut, 308 | .vegas-transition-zoomOut2 { 309 | transform: scale(2); 310 | opacity: 0; 311 | } 312 | 313 | .vegas-transition-zoomOut-in, 314 | .vegas-transition-zoomOut2-in { 315 | transform: scale(1); 316 | opacity: 1; 317 | } 318 | 319 | .vegas-transition-zoomOut2-out { 320 | transform: scale(0); 321 | opacity: 0; 322 | } 323 | 324 | /*******************************************/ 325 | /* kenburns animation */ 326 | /*******************************************/ 327 | .vegas-animation-kenburns { 328 | animation: kenburns ease-out; 329 | } 330 | 331 | @keyframes kenburns { 332 | 0% { 333 | transform: scale(1.5); 334 | } 335 | 100% { 336 | transform: scale(1); 337 | } 338 | } 339 | 340 | /*******************************************/ 341 | /* kenburnsDownLeft animation */ 342 | /*******************************************/ 343 | .vegas-animation-kenburnsDownLeft { 344 | animation: kenburnsDownLeft ease-out; 345 | } 346 | 347 | @keyframes kenburnsDownLeft { 348 | 0% { 349 | transform: scale(1.5) translate(10%, -10%); 350 | } 351 | 100% { 352 | transform: scale(1) translate(0, 0); 353 | } 354 | } 355 | 356 | /*******************************************/ 357 | /* kenburnsDownRight animation */ 358 | /*******************************************/ 359 | .vegas-animation-kenburnsDownRight { 360 | animation: kenburnsDownRight ease-out; 361 | } 362 | 363 | @keyframes kenburnsDownRight { 364 | 0% { 365 | transform: scale(1.5) translate(-10%, -10%); 366 | } 367 | 100% { 368 | transform: scale(1) translate(0, 0); 369 | } 370 | } 371 | 372 | /*******************************************/ 373 | /* kenburnsDown animation */ 374 | /*******************************************/ 375 | .vegas-animation-kenburnsDown { 376 | animation: kenburnsDown ease-out; 377 | } 378 | 379 | @keyframes kenburnsDown { 380 | 0% { 381 | transform: scale(1.5) translate(0, -10%); 382 | } 383 | 100% { 384 | transform: scale(1) translate(0, 0); 385 | } 386 | } 387 | 388 | /*******************************************/ 389 | /* kenburnsLeft animation */ 390 | /*******************************************/ 391 | .vegas-animation-kenburnsLeft { 392 | animation: kenburnsLeft ease-out; 393 | } 394 | 395 | @keyframes kenburnsLeft { 396 | 0% { 397 | transform: scale(1.5) translate(10%, 0); 398 | } 399 | 100% { 400 | transform: scale(1) translate(0, 0); 401 | } 402 | } 403 | 404 | /*******************************************/ 405 | /* kenburnsRight animation */ 406 | /*******************************************/ 407 | .vegas-animation-kenburnsRight { 408 | animation: kenburnsRight ease-out; 409 | } 410 | 411 | @keyframes kenburnsRight { 412 | 0% { 413 | transform: scale(1.5) translate(-10%, 0); 414 | } 415 | 100% { 416 | transform: scale(1) translate(0, 0); 417 | } 418 | } 419 | 420 | /*******************************************/ 421 | /* kenburnsUpLeft animation */ 422 | /*******************************************/ 423 | .vegas-animation-kenburnsUpLeft { 424 | animation: kenburnsUpLeft ease-out; 425 | } 426 | 427 | @keyframes kenburnsUpLeft { 428 | 0% { 429 | transform: scale(1.5) translate(10%, 10%); 430 | } 431 | 100% { 432 | transform: scale(1) translate(0, 0); 433 | } 434 | } 435 | 436 | /*******************************************/ 437 | /* kenburnsUpRight animation */ 438 | /*******************************************/ 439 | .vegas-animation-kenburnsUpRight { 440 | animation: kenburnsUpRight ease-out; 441 | } 442 | 443 | @keyframes kenburnsUpRight { 444 | 0% { 445 | transform: scale(1.5) translate(-10%, 10%); 446 | } 447 | 100% { 448 | transform: scale(1) translate(0, 0); 449 | } 450 | } 451 | 452 | /*******************************************/ 453 | /* kenburnsUp animation */ 454 | /*******************************************/ 455 | .vegas-animation-kenburnsUp { 456 | animation: kenburnsUp ease-out; 457 | } 458 | 459 | @keyframes kenburnsUp { 460 | 0% { 461 | transform: scale(1.5) translate(0, 10%); 462 | } 463 | 100% { 464 | transform: scale(1) translate(0, 0); 465 | } 466 | } 467 | -------------------------------------------------------------------------------- /dist/vegas.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------------------------- 2 | * Vegas - Fullscreen Backgrounds and Slideshows. 3 | * v2.6.0 - built 2024-07-30 4 | * Licensed under the MIT License. 5 | * http://vegas.jaysalvat.com/ 6 | * ---------------------------------------------------------------------------- 7 | * Copyright (C) 2010-2024 Jay Salvat 8 | * http://jaysalvat.com/ 9 | * --------------------------------------------------------------------------*/ 10 | 11 | (function ($) { 12 | 'use strict'; 13 | 14 | var defaults = { 15 | slide: 0, 16 | delay: 5000, 17 | loop: true, 18 | preload: false, 19 | preloadImage: false, 20 | preloadVideo: false, 21 | timer: true, 22 | overlay: false, 23 | autoplay: true, 24 | shuffle: false, 25 | cover: true, 26 | color: null, 27 | align: 'center', 28 | valign: 'center', 29 | firstTransition: null, 30 | firstTransitionDuration: null, 31 | transition: 'fade', 32 | transitionDuration: 1000, 33 | transitionRegister: [], 34 | animation: null, 35 | animationDuration: 'auto', 36 | animationRegister: [], 37 | slidesToKeep: 1, 38 | init: function () {}, 39 | play: function () {}, 40 | pause: function () {}, 41 | walk: function () {}, 42 | slides: [ 43 | // { 44 | // src: null, 45 | // color: null, 46 | // delay: null, 47 | // align: null, 48 | // valign: null, 49 | // transition: null, 50 | // transitionDuration: null, 51 | // animation: null, 52 | // animationDuration: null, 53 | // cover: true, 54 | // video: { 55 | // src: [], 56 | // muted: true, 57 | // loop: true 58 | // } 59 | // ... 60 | ] 61 | }; 62 | 63 | var videoCache = {}; 64 | var instances = 0; 65 | 66 | var Vegas = function (elmt, options) { 67 | this.elmt = elmt; 68 | this.settings = $.extend({}, defaults, $.vegas.defaults, options); 69 | this.slide = this.settings.slide; 70 | this.total = this.settings.slides.length; 71 | this.noshow = this.total < 2; 72 | this.paused = !this.settings.autoplay || this.noshow; 73 | this.ended = false; 74 | this.$elmt = $(elmt); 75 | this.$timer = null; 76 | this.$overlay = null; 77 | this.$slide = null; 78 | this.timeout = null; 79 | this.first = true; 80 | 81 | this.instance = instances++; 82 | 83 | this.transitions = [ 84 | 'fade', 'fade2', 85 | 'blur', 'blur2', 86 | 'flash', 'flash2', 87 | 'negative', 'negative2', 88 | 'burn', 'burn2', 89 | 'slideLeft', 'slideLeft2', 90 | 'slideRight', 'slideRight2', 91 | 'slideUp', 'slideUp2', 92 | 'slideDown', 'slideDown2', 93 | 'zoomIn', 'zoomIn2', 94 | 'zoomOut', 'zoomOut2', 95 | 'swirlLeft', 'swirlLeft2', 96 | 'swirlRight', 'swirlRight2' 97 | ]; 98 | 99 | this.animations = [ 100 | 'kenburns', 101 | 'kenburnsLeft', 'kenburnsRight', 102 | 'kenburnsUp', 'kenburnsUpLeft', 'kenburnsUpRight', 103 | 'kenburnsDown', 'kenburnsDownLeft', 'kenburnsDownRight' 104 | ]; 105 | 106 | if (!(this.settings.transitionRegister instanceof Array)) { 107 | this.settings.transitionRegister = [ this.settings.transitionRegister ]; 108 | } 109 | 110 | if (!(this.settings.animationRegister instanceof Array)) { 111 | this.settings.animationRegister = [ this.settings.animationRegister ]; 112 | } 113 | 114 | this.transitions = this.transitions.concat(this.settings.transitionRegister); 115 | this.animations = this.animations.concat(this.settings.animationRegister); 116 | 117 | this.support = { 118 | objectFit: 'objectFit' in document.body.style, 119 | transition: 'transition' in document.body.style || 'WebkitTransition' in document.body.style 120 | }; 121 | 122 | if (this.settings.shuffle === true) { 123 | this.shuffle(); 124 | } 125 | this._init(); 126 | }; 127 | 128 | Vegas.prototype = { 129 | _init: function () { 130 | var $content, 131 | $contentScroll, 132 | $overlay, 133 | $timer, 134 | isBody = this.elmt.tagName === 'BODY', 135 | timer = this.settings.timer, 136 | overlay = this.settings.overlay, 137 | self = this; 138 | 139 | // Preloading 140 | this._preload(); 141 | 142 | // Div with scrollable content 143 | if (!isBody) { 144 | $contentScroll = $('
'); 145 | 146 | $content = $('
') 147 | .css('overflow', this.$elmt.css('overflow')) 148 | .css('padding', this.$elmt.css('padding')); 149 | 150 | // Some browsers don't compute padding shorthand 151 | if (!this.$elmt.css('padding')) { 152 | $content 153 | .css('padding-top', this.$elmt.css('padding-top')) 154 | .css('padding-bottom', this.$elmt.css('padding-bottom')) 155 | .css('padding-left', this.$elmt.css('padding-left')) 156 | .css('padding-right', this.$elmt.css('padding-right')); 157 | } 158 | 159 | this.$elmt.css('padding', 0); 160 | 161 | this.$elmt.clone(true).children().appendTo($content); 162 | this.elmt.innerHTML = ''; 163 | } 164 | 165 | // Timer 166 | if (timer && this.support.transition) { 167 | $timer = $('
'); 168 | this.$timer = $timer; 169 | this.$elmt.prepend($timer); 170 | } 171 | 172 | // Overlay 173 | if (overlay) { 174 | $overlay = $('
'); 175 | 176 | if (typeof overlay === 'string') { 177 | $overlay.css('background-image', 'url(' + overlay + ')'); 178 | } 179 | 180 | this.$overlay = $overlay; 181 | this.$elmt.prepend($overlay); 182 | } 183 | 184 | // Container 185 | this.$elmt.addClass('vegas-container'); 186 | 187 | if (!isBody) { 188 | this.$elmt.append($contentScroll); 189 | $contentScroll.append($content); 190 | } 191 | 192 | setTimeout(function () { 193 | self.trigger('init'); 194 | self._goto(self.slide); 195 | 196 | if (self.settings.autoplay) { 197 | self.trigger('play'); 198 | } 199 | }, 1); 200 | }, 201 | 202 | _preload: function () { 203 | var img, i; 204 | 205 | for (i = 0; i < this.settings.slides.length; i++) { 206 | if (this.settings.preload || this.settings.preloadImages) { 207 | if (this.settings.slides[i].src) { 208 | img = new Image(); 209 | img.src = this.settings.slides[i].src; 210 | } 211 | } 212 | 213 | if (this.settings.preload || this.settings.preloadVideos) { 214 | if (this.settings.slides[i].video) { 215 | if (this.settings.slides[i].video instanceof Array) { 216 | this._video(this.settings.slides[i].video); 217 | } else { 218 | this._video(this.settings.slides[i].video.src); 219 | } 220 | } 221 | } 222 | } 223 | }, 224 | 225 | _random: function (array) { 226 | return array[Math.floor(Math.random() * array.length)]; 227 | }, 228 | 229 | _slideShow: function () { 230 | var self = this; 231 | 232 | if (this.total > 1 && !this.ended && !this.paused && !this.noshow) { 233 | this.timeout = setTimeout(function () { 234 | self.next(); 235 | }, this._options('delay')); 236 | } 237 | }, 238 | 239 | _timer: function (state) { 240 | var self = this; 241 | 242 | clearTimeout(this.timeout); 243 | 244 | if (!this.$timer) { 245 | return; 246 | } 247 | 248 | this.$timer 249 | .removeClass('vegas-timer-running') 250 | .find('div') 251 | .css('transition-duration', '0ms'); 252 | 253 | if (this.ended || this.paused || this.noshow) { 254 | return; 255 | } 256 | 257 | if (state) { 258 | setTimeout(function () { 259 | self.$timer 260 | .addClass('vegas-timer-running') 261 | .find('div') 262 | .css('transition-duration', self._options('delay') - 100 + 'ms'); 263 | }, 100); 264 | } 265 | }, 266 | 267 | _video: function (srcs) { 268 | var video, 269 | source, 270 | cacheKey = this.instance + srcs.toString(); 271 | 272 | if (videoCache[cacheKey]) { 273 | return videoCache[cacheKey]; 274 | } 275 | 276 | if (!(srcs instanceof Array)) { 277 | srcs = [ srcs ]; 278 | } 279 | 280 | video = document.createElement('video'); 281 | video.preload = true; 282 | video.playsInline = true; 283 | video.controls = false; 284 | 285 | srcs.forEach(function (src) { 286 | source = document.createElement('source'); 287 | source.src = src; 288 | video.appendChild(source); 289 | }); 290 | 291 | videoCache[cacheKey] = video; 292 | 293 | return video; 294 | }, 295 | 296 | _fadeOutSound: function (video, duration) { 297 | var self = this, 298 | delay = duration / 10, 299 | volume = video.volume - 0.09; 300 | 301 | if (volume > 0) { 302 | video.volume = volume; 303 | 304 | setTimeout(function () { 305 | self._fadeOutSound(video, duration); 306 | }, delay); 307 | } else { 308 | video.pause(); 309 | } 310 | }, 311 | 312 | _fadeInSound: function (video, duration) { 313 | var self = this, 314 | delay = duration / 10, 315 | volume = video.volume + 0.09; 316 | 317 | if (volume < 1) { 318 | video.volume = volume; 319 | 320 | setTimeout(function () { 321 | self._fadeInSound(video, duration); 322 | }, delay); 323 | } 324 | }, 325 | 326 | _options: function (key, i) { 327 | if (i === undefined) { 328 | i = this.slide; 329 | } 330 | 331 | if (this.settings.slides[i][key] !== undefined) { 332 | return this.settings.slides[i][key]; 333 | } 334 | 335 | return this.settings[key]; 336 | }, 337 | 338 | _goto: function (nb) { 339 | if (typeof this.settings.slides[nb] === 'undefined') { 340 | nb = 0; 341 | } 342 | 343 | this.slide = nb; 344 | 345 | var $slide, 346 | $inner, 347 | $video, 348 | $slides = this.$elmt.children('.vegas-slide'), 349 | src = this.settings.slides[nb].src, 350 | videoSettings = this.settings.slides[nb].video, 351 | delay = this._options('delay'), 352 | align = this._options('align'), 353 | valign = this._options('valign'), 354 | cover = this._options('cover'), 355 | color = this._options('color') || this.$elmt.css('background-color'), 356 | self = this, 357 | total = $slides.length, 358 | video, 359 | img; 360 | 361 | var transition = this._options('transition'), 362 | transitionDuration = this._options('transitionDuration'), 363 | animation = this._options('animation'), 364 | animationDuration = this._options('animationDuration'); 365 | 366 | if (this.settings.firstTransition && this.first) { 367 | transition = this.settings.firstTransition || transition; 368 | } 369 | 370 | if (this.settings.firstTransitionDuration && this.first) { 371 | transitionDuration = this.settings.firstTransitionDuration || transitionDuration; 372 | } 373 | 374 | if (this.first) { 375 | this.first = false; 376 | } 377 | 378 | if (cover !== 'repeat') { 379 | if (cover === true) { 380 | cover = 'cover'; 381 | } else if (cover === false) { 382 | cover = 'contain'; 383 | } 384 | } 385 | 386 | if (transition === 'random' || transition instanceof Array) { 387 | if (transition instanceof Array) { 388 | transition = this._random(transition); 389 | } else { 390 | transition = this._random(this.transitions); 391 | } 392 | } 393 | 394 | if (animation === 'random' || animation instanceof Array) { 395 | if (animation instanceof Array) { 396 | animation = this._random(animation); 397 | } else { 398 | animation = this._random(this.animations); 399 | } 400 | } 401 | 402 | if (transitionDuration === 'auto' || transitionDuration > delay) { 403 | transitionDuration = delay; 404 | } 405 | 406 | if (animationDuration === 'auto') { 407 | animationDuration = delay; 408 | } 409 | 410 | $slide = $('
'); 411 | 412 | if (this.support.transition && transition) { 413 | $slide.addClass('vegas-transition-' + transition); 414 | } 415 | 416 | // Video 417 | 418 | if (videoSettings) { 419 | if (videoSettings instanceof Array) { 420 | video = this._video(videoSettings); 421 | } else { 422 | video = this._video(videoSettings.src); 423 | } 424 | 425 | video.loop = videoSettings.loop !== undefined ? videoSettings.loop : true; 426 | video.muted = videoSettings.muted !== undefined ? videoSettings.muted : true; 427 | 428 | if (video.muted === false) { 429 | video.volume = 0; 430 | this._fadeInSound(video, transitionDuration); 431 | } else { 432 | video.pause(); 433 | } 434 | 435 | $video = $(video) 436 | .addClass('vegas-video') 437 | .css('background-color', color); 438 | 439 | if (this.support.objectFit) { 440 | $video 441 | .css('object-position', align + ' ' + valign) 442 | .css('object-fit', cover) 443 | .css('width', '100%') 444 | .css('height', '100%'); 445 | } else if (cover === 'contain') { 446 | $video 447 | .css('width', '100%') 448 | .css('height', '100%'); 449 | } 450 | 451 | $slide.append($video); 452 | 453 | // Image 454 | 455 | } else { 456 | img = new Image(); 457 | 458 | $inner = $('
') 459 | .css('background-image', 'url("' + src + '")') 460 | .css('background-color', color) 461 | .css('background-position', align + ' ' + valign); 462 | 463 | if (cover === 'repeat') { 464 | $inner.css('background-repeat', 'repeat'); 465 | } else { 466 | $inner.css('background-size', cover); 467 | } 468 | 469 | if (this.support.transition && animation) { 470 | $inner 471 | .addClass('vegas-animation-' + animation) 472 | .css('animation-duration', animationDuration + 'ms'); 473 | } 474 | 475 | $slide.append($inner); 476 | } 477 | 478 | if (!this.support.transition) { 479 | $slide.css('display', 'none'); 480 | } 481 | 482 | if (total) { 483 | $slides.eq(total - 1).after($slide); 484 | } else { 485 | this.$elmt.prepend($slide); 486 | } 487 | 488 | $slides 489 | .css('transition', 'all 0ms') 490 | .each(function () { 491 | this.className = 'vegas-slide'; 492 | 493 | if (this.tagName === 'VIDEO') { 494 | this.className += ' vegas-video'; 495 | } 496 | 497 | if (transition) { 498 | this.className += ' vegas-transition-' + transition; 499 | this.className += ' vegas-transition-' + transition + '-in'; 500 | } 501 | } 502 | ); 503 | 504 | self._timer(false); 505 | 506 | function go () { 507 | self._timer(true); 508 | 509 | setTimeout(function () { 510 | if (transition) { 511 | if (self.support.transition) { 512 | $slides 513 | .css('transition', 'all ' + transitionDuration + 'ms') 514 | .addClass('vegas-transition-' + transition + '-out'); 515 | 516 | $slides.each(function () { 517 | var video = $slides.find('video').get(0); 518 | 519 | if (video) { 520 | video.volume = 1; 521 | self._fadeOutSound(video, transitionDuration); 522 | } 523 | }); 524 | 525 | $slide 526 | .css('transition', 'all ' + transitionDuration + 'ms') 527 | .addClass('vegas-transition-' + transition + '-in'); 528 | } else { 529 | $slide.fadeIn(transitionDuration); 530 | } 531 | } 532 | 533 | for (var i = 0; i < $slides.length - self.settings.slidesToKeep; i++) { 534 | $slides.eq(i).remove(); 535 | } 536 | 537 | self.trigger('walk'); 538 | self._slideShow(); 539 | }, 100); 540 | } 541 | if (video) { 542 | if (video.readyState === 4) { 543 | video.currentTime = 0; 544 | } 545 | 546 | video.play(); 547 | go(); 548 | } else { 549 | img.src = src; 550 | 551 | if (img.complete) { 552 | go(); 553 | } else { 554 | img.onload = go; 555 | } 556 | } 557 | }, 558 | 559 | _end: function () { 560 | this.ended = !this.settings.autoplay; 561 | this._timer(false); 562 | this.trigger('end'); 563 | }, 564 | 565 | shuffle: function () { 566 | var temp, 567 | rand; 568 | 569 | for (var i = this.total - 1; i > 0; i--) { 570 | rand = Math.floor(Math.random() * (i + 1)); 571 | temp = this.settings.slides[i]; 572 | 573 | this.settings.slides[i] = this.settings.slides[rand]; 574 | this.settings.slides[rand] = temp; 575 | } 576 | }, 577 | 578 | play: function () { 579 | if (this.paused) { 580 | this.paused = false; 581 | this.next(); 582 | this.trigger('play'); 583 | } 584 | }, 585 | 586 | pause: function () { 587 | this._timer(false); 588 | this.paused = true; 589 | this.trigger('pause'); 590 | }, 591 | 592 | toggle: function () { 593 | if (this.paused) { 594 | this.play(); 595 | } else { 596 | this.pause(); 597 | } 598 | }, 599 | 600 | playing: function () { 601 | return !this.paused && !this.noshow; 602 | }, 603 | 604 | current: function (advanced) { 605 | if (advanced) { 606 | return { 607 | slide: this.slide, 608 | data: this.settings.slides[this.slide] 609 | }; 610 | } 611 | return this.slide; 612 | }, 613 | 614 | jump: function (nb) { 615 | if (nb < 0 || nb > this.total - 1 || nb === this.slide) { 616 | return; 617 | } 618 | 619 | this.slide = nb; 620 | this._goto(this.slide); 621 | }, 622 | 623 | next: function () { 624 | this.slide++; 625 | 626 | if (this.slide >= this.total) { 627 | if (!this.settings.loop) { 628 | return this._end(); 629 | } 630 | 631 | this.slide = 0; 632 | } 633 | 634 | this._goto(this.slide); 635 | }, 636 | 637 | previous: function () { 638 | this.slide--; 639 | 640 | if (this.slide < 0) { 641 | if (!this.settings.loop) { 642 | this.slide++; 643 | return; 644 | } else { 645 | this.slide = this.total - 1; 646 | } 647 | } 648 | 649 | this._goto(this.slide); 650 | }, 651 | 652 | trigger: function (fn) { 653 | var params = []; 654 | 655 | if (fn === 'init') { 656 | params = [ this.settings ]; 657 | } else { 658 | params = [ 659 | this.slide, 660 | this.settings.slides[this.slide] 661 | ]; 662 | } 663 | 664 | this.$elmt.trigger('vegas' + fn, params); 665 | 666 | if (typeof this.settings[fn] === 'function') { 667 | this.settings[fn].apply(this.$elmt, params); 668 | } 669 | }, 670 | 671 | options: function (key, value) { 672 | var oldSlides = this.settings.slides.slice(); 673 | 674 | if (typeof key === 'object') { 675 | this.settings = $.extend({}, defaults, $.vegas.defaults, key); 676 | } else if (typeof key === 'string') { 677 | if (value === undefined) { 678 | return this.settings[key]; 679 | } 680 | this.settings[key] = value; 681 | } else { 682 | return this.settings; 683 | } 684 | 685 | // In case slides have changed 686 | if (this.settings.slides !== oldSlides) { 687 | this.total = this.settings.slides.length; 688 | this.noshow = this.total < 2; 689 | this._preload(); 690 | } 691 | }, 692 | 693 | destroy: function () { 694 | clearTimeout(this.timeout); 695 | 696 | this.$elmt.removeClass('vegas-container'); 697 | this.$elmt.find('> .vegas-slide').remove(); 698 | this.$elmt.find('> .vegas-wrapper').clone(true).children().appendTo(this.$elmt); 699 | this.$elmt.find('> .vegas-wrapper').remove(); 700 | 701 | if (this.settings.timer) { 702 | this.$timer.remove(); 703 | } 704 | 705 | if (this.settings.overlay) { 706 | this.$overlay.remove(); 707 | } 708 | 709 | this.elmt._vegas = null; 710 | } 711 | }; 712 | 713 | $.fn.vegas = function(options) { 714 | var args = arguments, 715 | error = false, 716 | returns; 717 | 718 | if (options === undefined || typeof options === 'object') { 719 | return this.each(function () { 720 | if (!this._vegas) { 721 | this._vegas = new Vegas(this, options); 722 | } 723 | }); 724 | } else if (typeof options === 'string') { 725 | this.each(function () { 726 | var instance = this._vegas; 727 | 728 | if (!instance) { 729 | throw new Error('No Vegas applied to this element.'); 730 | } 731 | 732 | if (typeof instance[options] === 'function' && options[0] !== '_') { 733 | returns = instance[options].apply(instance, [].slice.call(args, 1)); 734 | } else { 735 | error = true; 736 | } 737 | }); 738 | 739 | if (error) { 740 | throw new Error('No method "' + options + '" in Vegas.'); 741 | } 742 | 743 | return returns !== undefined ? returns : this; 744 | } 745 | }; 746 | 747 | $.vegas = {}; 748 | $.vegas.defaults = defaults; 749 | 750 | $.vegas.isVideoCompatible = function () { 751 | return true; 752 | }; 753 | 754 | })(window.jQuery || window.Zepto || window.m4q); 755 | -------------------------------------------------------------------------------- /dist/vegas.min.css: -------------------------------------------------------------------------------- 1 | .vegas-content-scrollable,.vegas-overlay,.vegas-slide,.vegas-slide-inner,.vegas-timer{position:absolute;top:0;left:0;bottom:0;right:0;overflow:hidden;border:none;padding:0;margin:0}.vegas-content-scrollable{position:relative;height:100%;overflow:auto}.vegas-overlay{opacity:.5;background:url(./overlays/02.png) center center}.vegas-timer{top:auto;bottom:0;height:2px}.vegas-timer-progress{width:0%;height:100%;background:#fff;transition:width ease-out}.vegas-timer-running .vegas-timer-progress{width:100%}.vegas-slide,.vegas-slide-inner{margin:0;padding:0;background:center center no-repeat;transform:translateZ(0);will-change:transform,opacity}body .vegas-container{overflow:hidden!important;position:relative}.vegas-video{min-width:100%;min-height:100%;width:auto;height:auto}body.vegas-container{overflow:auto;position:static;z-index:-2}body.vegas-container>.vegas-overlay,body.vegas-container>.vegas-slide,body.vegas-container>.vegas-timer{position:fixed;z-index:-1}.vegas-transition-blur,.vegas-transition-blur2{opacity:0;filter:blur(32px) brightness(1.01)}.vegas-transition-blur-in,.vegas-transition-blur2-in{opacity:1;filter:blur(0) brightness(1.01)}.vegas-transition-blur2-out{opacity:0}.vegas-transition-burn,.vegas-transition-burn2{opacity:0;filter:contrast(1000%) saturate(1000%)}.vegas-transition-burn-in,.vegas-transition-burn2-in{opacity:1;filter:contrast(100%) saturate(100%)}.vegas-transition-burn2-out{opacity:0;filter:contrast(1000%) saturate(1000%)}.vegas-transition-fade,.vegas-transition-fade2{opacity:0}.vegas-transition-fade-in,.vegas-transition-fade2-in{opacity:1}.vegas-transition-fade2-out{opacity:0}.vegas-transition-flash,.vegas-transition-flash2{opacity:0;filter:brightness(25)}.vegas-transition-flash-in,.vegas-transition-flash2-in{opacity:1;filter:brightness(1)}.vegas-transition-flash2-out{opacity:0;filter:brightness(25)}.vegas-transition-negative,.vegas-transition-negative2{opacity:0;filter:invert(100%)}.vegas-transition-negative-in,.vegas-transition-negative2-in{opacity:1;filter:invert(0)}.vegas-transition-negative2-out{opacity:0;filter:invert(100%)}.vegas-transition-slideDown,.vegas-transition-slideDown2{transform:translateY(-100%)}.vegas-transition-slideDown-in,.vegas-transition-slideDown2-in{transform:translateY(0)}.vegas-transition-slideDown2-out{transform:translateY(100%)}.vegas-transition-slideLeft,.vegas-transition-slideLeft2{transform:translateX(100%)}.vegas-transition-slideLeft-in,.vegas-transition-slideLeft2-in{transform:translateX(0)}.vegas-transition-slideLeft2-out,.vegas-transition-slideRight,.vegas-transition-slideRight2{transform:translateX(-100%)}.vegas-transition-slideRight-in,.vegas-transition-slideRight2-in{transform:translateX(0)}.vegas-transition-slideRight2-out{transform:translateX(100%)}.vegas-transition-slideUp,.vegas-transition-slideUp2{transform:translateY(100%)}.vegas-transition-slideUp-in,.vegas-transition-slideUp2-in{transform:translateY(0)}.vegas-transition-slideUp2-out{transform:translateY(-100%)}.vegas-transition-swirlLeft,.vegas-transition-swirlLeft2{transform:scale(2) rotate(35deg);opacity:0}.vegas-transition-swirlLeft-in,.vegas-transition-swirlLeft2-in{transform:scale(1) rotate(0);opacity:1}.vegas-transition-swirlLeft2-out,.vegas-transition-swirlRight,.vegas-transition-swirlRight2{transform:scale(2) rotate(-35deg);opacity:0}.vegas-transition-swirlRight-in,.vegas-transition-swirlRight2-in{transform:scale(1) rotate(0);opacity:1}.vegas-transition-swirlRight2-out{transform:scale(2) rotate(35deg);opacity:0}.vegas-transition-zoomIn,.vegas-transition-zoomIn2{transform:scale(0);opacity:0}.vegas-transition-zoomIn-in,.vegas-transition-zoomIn2-in{transform:scale(1);opacity:1}.vegas-transition-zoomIn2-out,.vegas-transition-zoomOut,.vegas-transition-zoomOut2{transform:scale(2);opacity:0}.vegas-transition-zoomOut-in,.vegas-transition-zoomOut2-in{transform:scale(1);opacity:1}.vegas-transition-zoomOut2-out{transform:scale(0);opacity:0}.vegas-animation-kenburns{animation:kenburns ease-out}@keyframes kenburns{0%{transform:scale(1.5)}100%{transform:scale(1)}}.vegas-animation-kenburnsDownLeft{animation:kenburnsDownLeft ease-out}@keyframes kenburnsDownLeft{0%{transform:scale(1.5) translate(10%,-10%)}100%{transform:scale(1) translate(0,0)}}.vegas-animation-kenburnsDownRight{animation:kenburnsDownRight ease-out}@keyframes kenburnsDownRight{0%{transform:scale(1.5) translate(-10%,-10%)}100%{transform:scale(1) translate(0,0)}}.vegas-animation-kenburnsDown{animation:kenburnsDown ease-out}@keyframes kenburnsDown{0%{transform:scale(1.5) translate(0,-10%)}100%{transform:scale(1) translate(0,0)}}.vegas-animation-kenburnsLeft{animation:kenburnsLeft ease-out}@keyframes kenburnsLeft{0%{transform:scale(1.5) translate(10%,0)}100%{transform:scale(1) translate(0,0)}}.vegas-animation-kenburnsRight{animation:kenburnsRight ease-out}@keyframes kenburnsRight{0%{transform:scale(1.5) translate(-10%,0)}100%{transform:scale(1) translate(0,0)}}.vegas-animation-kenburnsUpLeft{animation:kenburnsUpLeft ease-out}@keyframes kenburnsUpLeft{0%{transform:scale(1.5) translate(10%,10%)}100%{transform:scale(1) translate(0,0)}}.vegas-animation-kenburnsUpRight{animation:kenburnsUpRight ease-out}@keyframes kenburnsUpRight{0%{transform:scale(1.5) translate(-10%,10%)}100%{transform:scale(1) translate(0,0)}}.vegas-animation-kenburnsUp{animation:kenburnsUp ease-out}@keyframes kenburnsUp{0%{transform:scale(1.5) translate(0,10%)}100%{transform:scale(1) translate(0,0)}} 2 | /*# sourceMappingURL=vegas.min.css.map */ 3 | -------------------------------------------------------------------------------- /dist/vegas.min.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"names":[],"mappings":"","sources":["vegas.css"],"sourcesContent":[".vegas-overlay,\n.vegas-content-scrollable,\n.vegas-timer,\n.vegas-slide,\n.vegas-slide-inner {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n overflow: hidden;\n border: none;\n padding: 0;\n margin: 0;\n}\n\n.vegas-content-scrollable {\n position: relative;\n height: 100%;\n overflow: auto;\n}\n\n.vegas-overlay {\n opacity: .5;\n background: transparent url(\"./overlays/02.png\") center center repeat;\n}\n\n.vegas-timer {\n top: auto;\n bottom: 0;\n height: 2px;\n}\n\n.vegas-timer-progress {\n width: 0%;\n height: 100%;\n background: white;\n transition: width ease-out;\n}\n\n.vegas-timer-running .vegas-timer-progress {\n width: 100%;\n}\n\n.vegas-slide,\n.vegas-slide-inner {\n margin: 0;\n padding: 0;\n background: transparent center center no-repeat;\n transform: translateZ(0);\n will-change: transform, opacity;\n}\n\nbody .vegas-container {\n overflow: hidden !important;\n position: relative;\n}\n\n.vegas-video {\n min-width: 100%;\n min-height: 100%;\n width: auto;\n height: auto;\n}\n\nbody.vegas-container {\n overflow: auto;\n position: static;\n z-index: -2;\n}\n\nbody.vegas-container > .vegas-timer,\nbody.vegas-container > .vegas-overlay,\nbody.vegas-container > .vegas-slide {\n position: fixed;\n z-index: -1;\n}\n\n/* Target Safari IOS7+ in order to add 76px */\n/*******************************************/\n/* blur transition */\n/*******************************************/\n.vegas-transition-blur,\n.vegas-transition-blur2 {\n opacity: 0;\n filter: blur(32px) brightness(1.01);\n}\n\n.vegas-transition-blur-in,\n.vegas-transition-blur2-in {\n opacity: 1;\n filter: blur(0px) brightness(1.01);\n}\n\n.vegas-transition-blur2-out {\n opacity: 0;\n}\n\n/*******************************************/\n/* burn transition */\n/*******************************************/\n.vegas-transition-burn,\n.vegas-transition-burn2 {\n opacity: 0;\n filter: contrast(1000%) saturate(1000%);\n}\n\n.vegas-transition-burn-in,\n.vegas-transition-burn2-in {\n opacity: 1;\n filter: contrast(100%) saturate(100%);\n}\n\n.vegas-transition-burn2-out {\n opacity: 0;\n filter: contrast(1000%) saturate(1000%);\n}\n\n/*******************************************/\n/* fade transition */\n/*******************************************/\n.vegas-transition-fade,\n.vegas-transition-fade2 {\n opacity: 0;\n}\n\n.vegas-transition-fade-in,\n.vegas-transition-fade2-in {\n opacity: 1;\n}\n\n.vegas-transition-fade2-out {\n opacity: 0;\n}\n\n/*******************************************/\n/* flash transition */\n/*******************************************/\n.vegas-transition-flash,\n.vegas-transition-flash2 {\n opacity: 0;\n filter: brightness(25);\n}\n\n.vegas-transition-flash-in,\n.vegas-transition-flash2-in {\n opacity: 1;\n filter: brightness(1);\n}\n\n.vegas-transition-flash2-out {\n opacity: 0;\n filter: brightness(25);\n}\n\n/*******************************************/\n/* negative transition */\n/*******************************************/\n.vegas-transition-negative,\n.vegas-transition-negative2 {\n opacity: 0;\n filter: invert(100%);\n}\n\n.vegas-transition-negative-in,\n.vegas-transition-negative2-in {\n opacity: 1;\n filter: invert(0);\n}\n\n.vegas-transition-negative2-out {\n opacity: 0;\n filter: invert(100%);\n}\n\n/*******************************************/\n/* slideDown transition */\n/*******************************************/\n.vegas-transition-slideDown,\n.vegas-transition-slideDown2 {\n transform: translateY(-100%);\n}\n\n.vegas-transition-slideDown-in,\n.vegas-transition-slideDown2-in {\n transform: translateY(0%);\n}\n\n.vegas-transition-slideDown2-out {\n transform: translateY(100%);\n}\n\n/*******************************************/\n/* slideLeft transition */\n/*******************************************/\n.vegas-transition-slideLeft,\n.vegas-transition-slideLeft2 {\n transform: translateX(100%);\n}\n\n.vegas-transition-slideLeft-in,\n.vegas-transition-slideLeft2-in {\n transform: translateX(0%);\n}\n\n.vegas-transition-slideLeft2-out {\n transform: translateX(-100%);\n}\n\n/*******************************************/\n/* slideRight transition */\n/*******************************************/\n.vegas-transition-slideRight,\n.vegas-transition-slideRight2 {\n transform: translateX(-100%);\n}\n\n.vegas-transition-slideRight-in,\n.vegas-transition-slideRight2-in {\n transform: translateX(0%);\n}\n\n.vegas-transition-slideRight2-out {\n transform: translateX(100%);\n}\n\n/*******************************************/\n/* slideUp transition */\n/*******************************************/\n.vegas-transition-slideUp,\n.vegas-transition-slideUp2 {\n transform: translateY(100%);\n}\n\n.vegas-transition-slideUp-in,\n.vegas-transition-slideUp2-in {\n transform: translateY(0%);\n}\n\n.vegas-transition-slideUp2-out {\n transform: translateY(-100%);\n}\n\n/*******************************************/\n/* swirlLeft transition */\n/*******************************************/\n.vegas-transition-swirlLeft,\n.vegas-transition-swirlLeft2 {\n transform: scale(2) rotate(35deg);\n opacity: 0;\n}\n\n.vegas-transition-swirlLeft-in,\n.vegas-transition-swirlLeft2-in {\n transform: scale(1) rotate(0deg);\n opacity: 1;\n}\n\n.vegas-transition-swirlLeft2-out {\n transform: scale(2) rotate(-35deg);\n opacity: 0;\n}\n\n/*******************************************/\n/* swirlRight transition */\n/*******************************************/\n.vegas-transition-swirlRight,\n.vegas-transition-swirlRight2 {\n transform: scale(2) rotate(-35deg);\n opacity: 0;\n}\n\n.vegas-transition-swirlRight-in,\n.vegas-transition-swirlRight2-in {\n transform: scale(1) rotate(0deg);\n opacity: 1;\n}\n\n.vegas-transition-swirlRight2-out {\n transform: scale(2) rotate(35deg);\n opacity: 0;\n}\n\n/*******************************************/\n/* zoomIn transition */\n/*******************************************/\n.vegas-transition-zoomIn,\n.vegas-transition-zoomIn2 {\n transform: scale(0);\n opacity: 0;\n}\n\n.vegas-transition-zoomIn-in,\n.vegas-transition-zoomIn2-in {\n transform: scale(1);\n opacity: 1;\n}\n\n.vegas-transition-zoomIn2-out {\n transform: scale(2);\n opacity: 0;\n}\n\n/*******************************************/\n/* zoomOut transition */\n/*******************************************/\n.vegas-transition-zoomOut,\n.vegas-transition-zoomOut2 {\n transform: scale(2);\n opacity: 0;\n}\n\n.vegas-transition-zoomOut-in,\n.vegas-transition-zoomOut2-in {\n transform: scale(1);\n opacity: 1;\n}\n\n.vegas-transition-zoomOut2-out {\n transform: scale(0);\n opacity: 0;\n}\n\n/*******************************************/\n/* kenburns animation */\n/*******************************************/\n.vegas-animation-kenburns {\n animation: kenburns ease-out;\n}\n\n@keyframes kenburns {\n 0% {\n transform: scale(1.5);\n }\n 100% {\n transform: scale(1);\n }\n}\n\n/*******************************************/\n/* kenburnsDownLeft animation */\n/*******************************************/\n.vegas-animation-kenburnsDownLeft {\n animation: kenburnsDownLeft ease-out;\n}\n\n@keyframes kenburnsDownLeft {\n 0% {\n transform: scale(1.5) translate(10%, -10%);\n }\n 100% {\n transform: scale(1) translate(0, 0);\n }\n}\n\n/*******************************************/\n/* kenburnsDownRight animation */\n/*******************************************/\n.vegas-animation-kenburnsDownRight {\n animation: kenburnsDownRight ease-out;\n}\n\n@keyframes kenburnsDownRight {\n 0% {\n transform: scale(1.5) translate(-10%, -10%);\n }\n 100% {\n transform: scale(1) translate(0, 0);\n }\n}\n\n/*******************************************/\n/* kenburnsDown animation */\n/*******************************************/\n.vegas-animation-kenburnsDown {\n animation: kenburnsDown ease-out;\n}\n\n@keyframes kenburnsDown {\n 0% {\n transform: scale(1.5) translate(0, -10%);\n }\n 100% {\n transform: scale(1) translate(0, 0);\n }\n}\n\n/*******************************************/\n/* kenburnsLeft animation */\n/*******************************************/\n.vegas-animation-kenburnsLeft {\n animation: kenburnsLeft ease-out;\n}\n\n@keyframes kenburnsLeft {\n 0% {\n transform: scale(1.5) translate(10%, 0);\n }\n 100% {\n transform: scale(1) translate(0, 0);\n }\n}\n\n/*******************************************/\n/* kenburnsRight animation */\n/*******************************************/\n.vegas-animation-kenburnsRight {\n animation: kenburnsRight ease-out;\n}\n\n@keyframes kenburnsRight {\n 0% {\n transform: scale(1.5) translate(-10%, 0);\n }\n 100% {\n transform: scale(1) translate(0, 0);\n }\n}\n\n/*******************************************/\n/* kenburnsUpLeft animation */\n/*******************************************/\n.vegas-animation-kenburnsUpLeft {\n animation: kenburnsUpLeft ease-out;\n}\n\n@keyframes kenburnsUpLeft {\n 0% {\n transform: scale(1.5) translate(10%, 10%);\n }\n 100% {\n transform: scale(1) translate(0, 0);\n }\n}\n\n/*******************************************/\n/* kenburnsUpRight animation */\n/*******************************************/\n.vegas-animation-kenburnsUpRight {\n animation: kenburnsUpRight ease-out;\n}\n\n@keyframes kenburnsUpRight {\n 0% {\n transform: scale(1.5) translate(-10%, 10%);\n }\n 100% {\n transform: scale(1) translate(0, 0);\n }\n}\n\n/*******************************************/\n/* kenburnsUp animation */\n/*******************************************/\n.vegas-animation-kenburnsUp {\n animation: kenburnsUp ease-out;\n}\n\n@keyframes kenburnsUp {\n 0% {\n transform: scale(1.5) translate(0, 10%);\n }\n 100% {\n transform: scale(1) translate(0, 0);\n }\n}\n"],"file":"vegas.min.css"} -------------------------------------------------------------------------------- /dist/vegas.min.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------------------------- 2 | * Vegas - Fullscreen Backgrounds and Slideshows. 3 | * v2.6.0 - built 2024-07-30 4 | * Licensed under the MIT License. 5 | * http://vegas.jaysalvat.com/ 6 | * ---------------------------------------------------------------------------- 7 | * Copyright (C) 2010-2024 Jay Salvat 8 | * http://jaysalvat.com/ 9 | * --------------------------------------------------------------------------*/ 10 | !function(y){"use strict";function t(t,s){this.elmt=t,this.settings=y.extend({},e,y.vegas.defaults,s),this.slide=this.settings.slide,this.total=this.settings.slides.length,this.noshow=this.total<2,this.paused=!this.settings.autoplay||this.noshow,this.ended=!1,this.$elmt=y(t),this.$timer=null,this.$overlay=null,this.$slide=null,this.timeout=null,this.first=!0,this.instance=i++,this.transitions=["fade","fade2","blur","blur2","flash","flash2","negative","negative2","burn","burn2","slideLeft","slideLeft2","slideRight","slideRight2","slideUp","slideUp2","slideDown","slideDown2","zoomIn","zoomIn2","zoomOut","zoomOut2","swirlLeft","swirlLeft2","swirlRight","swirlRight2"],this.animations=["kenburns","kenburnsLeft","kenburnsRight","kenburnsUp","kenburnsUpLeft","kenburnsUpRight","kenburnsDown","kenburnsDownLeft","kenburnsDownRight"],this.settings.transitionRegister instanceof Array||(this.settings.transitionRegister=[this.settings.transitionRegister]),this.settings.animationRegister instanceof Array||(this.settings.animationRegister=[this.settings.animationRegister]),this.transitions=this.transitions.concat(this.settings.transitionRegister),this.animations=this.animations.concat(this.settings.animationRegister),this.support={objectFit:"objectFit"in document.body.style,transition:"transition"in document.body.style||"WebkitTransition"in document.body.style},!0===this.settings.shuffle&&this.shuffle(),this._init()}var e={slide:0,delay:5e3,loop:!0,preload:!1,preloadImage:!1,preloadVideo:!1,timer:!0,overlay:!1,autoplay:!0,shuffle:!1,cover:!0,color:null,align:"center",valign:"center",firstTransition:null,firstTransitionDuration:null,transition:"fade",transitionDuration:1e3,transitionRegister:[],animation:null,animationDuration:"auto",animationRegister:[],slidesToKeep:1,init:function(){},play:function(){},pause:function(){},walk:function(){},slides:[]},n={},i=0;t.prototype={_init:function(){var t,s,i="BODY"===this.elmt.tagName,e=this.settings.timer,n=this.settings.overlay,o=this;this._preload(),i||(s=y('
'),t=y('
').css("overflow",this.$elmt.css("overflow")).css("padding",this.$elmt.css("padding")),this.$elmt.css("padding")||t.css("padding-top",this.$elmt.css("padding-top")).css("padding-bottom",this.$elmt.css("padding-bottom")).css("padding-left",this.$elmt.css("padding-left")).css("padding-right",this.$elmt.css("padding-right")),this.$elmt.css("padding",0),this.$elmt.clone(!0).children().appendTo(t),this.elmt.innerHTML=""),e&&this.support.transition&&(e=y('
'),this.$timer=e,this.$elmt.prepend(e)),n&&(e=y('
'),"string"==typeof n&&e.css("background-image","url("+n+")"),this.$overlay=e,this.$elmt.prepend(e)),this.$elmt.addClass("vegas-container"),i||(this.$elmt.append(s),s.append(t)),setTimeout(function(){o.trigger("init"),o._goto(o.slide),o.settings.autoplay&&o.trigger("play")},1)},_preload:function(){for(var t=0;t
'),this.support.transition&&c&&s.addClass("vegas-transition-"+c),t?((i=t instanceof Array?this._video(t):this._video(t.src)).loop=void 0===t.loop||t.loop,i.muted=void 0===t.muted||t.muted,!1===i.muted?(i.volume=0,this._fadeInSound(i,p)):i.pause(),a=y(i).addClass("vegas-video").css("background-color",d),this.support.objectFit?a.css("object-position",r+" "+h).css("object-fit",l).css("width","100%").css("height","100%"):"contain"===l&&a.css("width","100%").css("height","100%"),s.append(a)):(e=new Image,t=y('
').css("background-image",'url("'+o+'")').css("background-color",d).css("background-position",r+" "+h),"repeat"===l?t.css("background-repeat","repeat"):t.css("background-size",l),this.support.transition&&m&&t.addClass("vegas-animation-"+m).css("animation-duration",f+"ms"),s.append(t)),this.support.transition||s.css("display","none"),u?n.eq(u-1).after(s):this.$elmt.prepend(s),n.css("transition","all 0ms").each(function(){this.className="vegas-slide","VIDEO"===this.tagName&&(this.className+=" vegas-video"),c&&(this.className+=" vegas-transition-"+c,this.className+=" vegas-transition-"+c+"-in")}),g._timer(!1),i?(4===i.readyState&&(i.currentTime=0),i.play(),v()):(e.src=o,e.complete?v():e.onload=v)},_end:function(){this.ended=!this.settings.autoplay,this._timer(!1),this.trigger("end")},shuffle:function(){for(var t,s,i=this.total-1;0this.total-1||t===this.slide||(this.slide=t,this._goto(this.slide))},next:function(){if(this.slide++,this.slide>=this.total){if(!this.settings.loop)return this._end();this.slide=0}this._goto(this.slide)},previous:function(){if(this.slide--,this.slide<0){if(!this.settings.loop)return void this.slide++;this.slide=this.total-1}this._goto(this.slide)},trigger:function(t){var s=[],s="init"===t?[this.settings]:[this.slide,this.settings.slides[this.slide]];this.$elmt.trigger("vegas"+t,s),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,s)},options:function(t,s){var i=this.settings.slides.slice();if("object"==typeof t)this.settings=y.extend({},e,y.vegas.defaults,t);else{if("string"!=typeof t)return this.settings;if(void 0===s)return this.settings[t];this.settings[t]=s}this.settings.slides!==i&&(this.total=this.settings.slides.length,this.noshow=this.total<2,this._preload())},destroy:function(){clearTimeout(this.timeout),this.$elmt.removeClass("vegas-container"),this.$elmt.find("> .vegas-slide").remove(),this.$elmt.find("> .vegas-wrapper").clone(!0).children().appendTo(this.$elmt),this.$elmt.find("> .vegas-wrapper").remove(),this.settings.timer&&this.$timer.remove(),this.settings.overlay&&this.$overlay.remove(),this.elmt._vegas=null}},y.fn.vegas=function(s){var i,e=arguments,n=!1;if(void 0===s||"object"==typeof s)return this.each(function(){this._vegas||(this._vegas=new t(this,s))});if("string"==typeof s){if(this.each(function(){var t=this._vegas;if(!t)throw new Error("No Vegas applied to this element.");"function"==typeof t[s]&&"_"!==s[0]?i=t[s].apply(t,[].slice.call(e,1)):n=!0}),n)throw new Error('No method "'+s+'" in Vegas.');return void 0!==i?i:this}},y.vegas={},y.vegas.defaults=e,y.vegas.isVideoCompatible=function(){return!0}}(window.jQuery||window.Zepto||window.m4q); 11 | //# sourceMappingURL=vegas.min.js.map 12 | -------------------------------------------------------------------------------- /dist/vegas.min.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"vegas.min.js","sources":["vegas.min.js"],"sourcesContent":["/*!-----------------------------------------------------------------------------\n * Vegas - Fullscreen Backgrounds and Slideshows.\n * v2.6.0 - built 2024-07-30\n * Licensed under the MIT License.\n * http://vegas.jaysalvat.com/\n * ----------------------------------------------------------------------------\n * Copyright (C) 2010-2024 Jay Salvat\n * http://jaysalvat.com/\n * --------------------------------------------------------------------------*/\n\n(function ($) {\n 'use strict';\n\n var defaults = {\n slide: 0,\n delay: 5000,\n loop: true,\n preload: false,\n preloadImage: false,\n preloadVideo: false,\n timer: true,\n overlay: false,\n autoplay: true,\n shuffle: false,\n cover: true,\n color: null,\n align: 'center',\n valign: 'center',\n firstTransition: null,\n firstTransitionDuration: null,\n transition: 'fade',\n transitionDuration: 1000,\n transitionRegister: [],\n animation: null,\n animationDuration: 'auto',\n animationRegister: [],\n slidesToKeep: 1,\n init: function () {},\n play: function () {},\n pause: function () {},\n walk: function () {},\n slides: [\n // {\n // src: null,\n // color: null,\n // delay: null,\n // align: null,\n // valign: null,\n // transition: null,\n // transitionDuration: null,\n // animation: null,\n // animationDuration: null,\n // cover: true,\n // video: {\n // src: [],\n // muted: true,\n // loop: true\n // }\n // ...\n ]\n };\n\n var videoCache = {};\n var instances = 0;\n\n var Vegas = function (elmt, options) {\n this.elmt = elmt;\n this.settings = $.extend({}, defaults, $.vegas.defaults, options);\n this.slide = this.settings.slide;\n this.total = this.settings.slides.length;\n this.noshow = this.total < 2;\n this.paused = !this.settings.autoplay || this.noshow;\n this.ended = false;\n this.$elmt = $(elmt);\n this.$timer = null;\n this.$overlay = null;\n this.$slide = null;\n this.timeout = null;\n this.first = true;\n\n this.instance = instances++;\n\n this.transitions = [\n 'fade', 'fade2',\n 'blur', 'blur2',\n 'flash', 'flash2',\n 'negative', 'negative2',\n 'burn', 'burn2',\n 'slideLeft', 'slideLeft2',\n 'slideRight', 'slideRight2',\n 'slideUp', 'slideUp2',\n 'slideDown', 'slideDown2',\n 'zoomIn', 'zoomIn2',\n 'zoomOut', 'zoomOut2',\n 'swirlLeft', 'swirlLeft2',\n 'swirlRight', 'swirlRight2'\n ];\n\n this.animations = [\n 'kenburns',\n 'kenburnsLeft', 'kenburnsRight',\n 'kenburnsUp', 'kenburnsUpLeft', 'kenburnsUpRight',\n 'kenburnsDown', 'kenburnsDownLeft', 'kenburnsDownRight'\n ];\n\n if (!(this.settings.transitionRegister instanceof Array)) {\n this.settings.transitionRegister = [ this.settings.transitionRegister ];\n }\n\n if (!(this.settings.animationRegister instanceof Array)) {\n this.settings.animationRegister = [ this.settings.animationRegister ];\n }\n\n this.transitions = this.transitions.concat(this.settings.transitionRegister);\n this.animations = this.animations.concat(this.settings.animationRegister);\n\n this.support = {\n objectFit: 'objectFit' in document.body.style,\n transition: 'transition' in document.body.style || 'WebkitTransition' in document.body.style\n };\n\n if (this.settings.shuffle === true) {\n this.shuffle();\n }\n this._init();\n };\n\n Vegas.prototype = {\n _init: function () {\n var $content,\n $contentScroll,\n $overlay,\n $timer,\n isBody = this.elmt.tagName === 'BODY',\n timer = this.settings.timer,\n overlay = this.settings.overlay,\n self = this;\n\n // Preloading\n this._preload();\n\n // Div with scrollable content\n if (!isBody) {\n $contentScroll = $('
');\n\n $content = $('
')\n .css('overflow', this.$elmt.css('overflow'))\n .css('padding', this.$elmt.css('padding'));\n\n // Some browsers don't compute padding shorthand\n if (!this.$elmt.css('padding')) {\n $content\n .css('padding-top', this.$elmt.css('padding-top'))\n .css('padding-bottom', this.$elmt.css('padding-bottom'))\n .css('padding-left', this.$elmt.css('padding-left'))\n .css('padding-right', this.$elmt.css('padding-right'));\n }\n\n this.$elmt.css('padding', 0);\n\n this.$elmt.clone(true).children().appendTo($content);\n this.elmt.innerHTML = '';\n }\n\n // Timer\n if (timer && this.support.transition) {\n $timer = $('
');\n this.$timer = $timer;\n this.$elmt.prepend($timer);\n }\n\n // Overlay\n if (overlay) {\n $overlay = $('
');\n\n if (typeof overlay === 'string') {\n $overlay.css('background-image', 'url(' + overlay + ')');\n }\n\n this.$overlay = $overlay;\n this.$elmt.prepend($overlay);\n }\n\n // Container\n this.$elmt.addClass('vegas-container');\n\n if (!isBody) {\n this.$elmt.append($contentScroll);\n $contentScroll.append($content);\n }\n\n setTimeout(function () {\n self.trigger('init');\n self._goto(self.slide);\n\n if (self.settings.autoplay) {\n self.trigger('play');\n }\n }, 1);\n },\n\n _preload: function () {\n var img, i;\n\n for (i = 0; i < this.settings.slides.length; i++) {\n if (this.settings.preload || this.settings.preloadImages) {\n if (this.settings.slides[i].src) {\n img = new Image();\n img.src = this.settings.slides[i].src;\n }\n }\n\n if (this.settings.preload || this.settings.preloadVideos) {\n if (this.settings.slides[i].video) {\n if (this.settings.slides[i].video instanceof Array) {\n this._video(this.settings.slides[i].video);\n } else {\n this._video(this.settings.slides[i].video.src);\n }\n }\n }\n }\n },\n\n _random: function (array) {\n return array[Math.floor(Math.random() * array.length)];\n },\n\n _slideShow: function () {\n var self = this;\n\n if (this.total > 1 && !this.ended && !this.paused && !this.noshow) {\n this.timeout = setTimeout(function () {\n self.next();\n }, this._options('delay'));\n }\n },\n\n _timer: function (state) {\n var self = this;\n\n clearTimeout(this.timeout);\n\n if (!this.$timer) {\n return;\n }\n\n this.$timer\n .removeClass('vegas-timer-running')\n .find('div')\n .css('transition-duration', '0ms');\n\n if (this.ended || this.paused || this.noshow) {\n return;\n }\n\n if (state) {\n setTimeout(function () {\n self.$timer\n .addClass('vegas-timer-running')\n .find('div')\n .css('transition-duration', self._options('delay') - 100 + 'ms');\n }, 100);\n }\n },\n\n _video: function (srcs) {\n var video,\n source,\n cacheKey = this.instance + srcs.toString();\n\n if (videoCache[cacheKey]) {\n return videoCache[cacheKey];\n }\n\n if (!(srcs instanceof Array)) {\n srcs = [ srcs ];\n }\n\n video = document.createElement('video');\n video.preload = true;\n video.playsInline = true;\n video.controls = false;\n\n srcs.forEach(function (src) {\n source = document.createElement('source');\n source.src = src;\n video.appendChild(source);\n });\n\n videoCache[cacheKey] = video;\n\n return video;\n },\n\n _fadeOutSound: function (video, duration) {\n var self = this,\n delay = duration / 10,\n volume = video.volume - 0.09;\n\n if (volume > 0) {\n video.volume = volume;\n\n setTimeout(function () {\n self._fadeOutSound(video, duration);\n }, delay);\n } else {\n video.pause();\n }\n },\n\n _fadeInSound: function (video, duration) {\n var self = this,\n delay = duration / 10,\n volume = video.volume + 0.09;\n\n if (volume < 1) {\n video.volume = volume;\n\n setTimeout(function () {\n self._fadeInSound(video, duration);\n }, delay);\n }\n },\n\n _options: function (key, i) {\n if (i === undefined) {\n i = this.slide;\n }\n\n if (this.settings.slides[i][key] !== undefined) {\n return this.settings.slides[i][key];\n }\n\n return this.settings[key];\n },\n\n _goto: function (nb) {\n if (typeof this.settings.slides[nb] === 'undefined') {\n nb = 0;\n }\n\n this.slide = nb;\n\n var $slide,\n $inner,\n $video,\n $slides = this.$elmt.children('.vegas-slide'),\n src = this.settings.slides[nb].src,\n videoSettings = this.settings.slides[nb].video,\n delay = this._options('delay'),\n align = this._options('align'),\n valign = this._options('valign'),\n cover = this._options('cover'),\n color = this._options('color') || this.$elmt.css('background-color'),\n self = this,\n total = $slides.length,\n video,\n img;\n\n var transition = this._options('transition'),\n transitionDuration = this._options('transitionDuration'),\n animation = this._options('animation'),\n animationDuration = this._options('animationDuration');\n\n if (this.settings.firstTransition && this.first) {\n transition = this.settings.firstTransition || transition;\n }\n\n if (this.settings.firstTransitionDuration && this.first) {\n transitionDuration = this.settings.firstTransitionDuration || transitionDuration;\n }\n\n if (this.first) {\n this.first = false;\n }\n\n if (cover !== 'repeat') {\n if (cover === true) {\n cover = 'cover';\n } else if (cover === false) {\n cover = 'contain';\n }\n }\n\n if (transition === 'random' || transition instanceof Array) {\n if (transition instanceof Array) {\n transition = this._random(transition);\n } else {\n transition = this._random(this.transitions);\n }\n }\n\n if (animation === 'random' || animation instanceof Array) {\n if (animation instanceof Array) {\n animation = this._random(animation);\n } else {\n animation = this._random(this.animations);\n }\n }\n\n if (transitionDuration === 'auto' || transitionDuration > delay) {\n transitionDuration = delay;\n }\n\n if (animationDuration === 'auto') {\n animationDuration = delay;\n }\n\n $slide = $('
');\n\n if (this.support.transition && transition) {\n $slide.addClass('vegas-transition-' + transition);\n }\n\n // Video\n\n if (videoSettings) {\n if (videoSettings instanceof Array) {\n video = this._video(videoSettings);\n } else {\n video = this._video(videoSettings.src);\n }\n\n video.loop = videoSettings.loop !== undefined ? videoSettings.loop : true;\n video.muted = videoSettings.muted !== undefined ? videoSettings.muted : true;\n\n if (video.muted === false) {\n video.volume = 0;\n this._fadeInSound(video, transitionDuration);\n } else {\n video.pause();\n }\n\n $video = $(video)\n .addClass('vegas-video')\n .css('background-color', color);\n\n if (this.support.objectFit) {\n $video\n .css('object-position', align + ' ' + valign)\n .css('object-fit', cover)\n .css('width', '100%')\n .css('height', '100%');\n } else if (cover === 'contain') {\n $video\n .css('width', '100%')\n .css('height', '100%');\n }\n\n $slide.append($video);\n\n // Image\n\n } else {\n img = new Image();\n\n $inner = $('
')\n .css('background-image', 'url(\"' + src + '\")')\n .css('background-color', color)\n .css('background-position', align + ' ' + valign);\n\n if (cover === 'repeat') {\n $inner.css('background-repeat', 'repeat');\n } else {\n $inner.css('background-size', cover);\n }\n\n if (this.support.transition && animation) {\n $inner\n .addClass('vegas-animation-' + animation)\n .css('animation-duration', animationDuration + 'ms');\n }\n\n $slide.append($inner);\n }\n\n if (!this.support.transition) {\n $slide.css('display', 'none');\n }\n\n if (total) {\n $slides.eq(total - 1).after($slide);\n } else {\n this.$elmt.prepend($slide);\n }\n\n $slides\n .css('transition', 'all 0ms')\n .each(function () {\n this.className = 'vegas-slide';\n\n if (this.tagName === 'VIDEO') {\n this.className += ' vegas-video';\n }\n\n if (transition) {\n this.className += ' vegas-transition-' + transition;\n this.className += ' vegas-transition-' + transition + '-in';\n }\n }\n );\n\n self._timer(false);\n\n function go () {\n self._timer(true);\n\n setTimeout(function () {\n if (transition) {\n if (self.support.transition) {\n $slides\n .css('transition', 'all ' + transitionDuration + 'ms')\n .addClass('vegas-transition-' + transition + '-out');\n\n $slides.each(function () {\n var video = $slides.find('video').get(0);\n\n if (video) {\n video.volume = 1;\n self._fadeOutSound(video, transitionDuration);\n }\n });\n\n $slide\n .css('transition', 'all ' + transitionDuration + 'ms')\n .addClass('vegas-transition-' + transition + '-in');\n } else {\n $slide.fadeIn(transitionDuration);\n }\n }\n\n for (var i = 0; i < $slides.length - self.settings.slidesToKeep; i++) {\n $slides.eq(i).remove();\n }\n\n self.trigger('walk');\n self._slideShow();\n }, 100);\n }\n if (video) {\n if (video.readyState === 4) {\n video.currentTime = 0;\n }\n\n video.play();\n go();\n } else {\n img.src = src;\n\n if (img.complete) {\n go();\n } else {\n img.onload = go;\n }\n }\n },\n\n _end: function () {\n this.ended = !this.settings.autoplay;\n this._timer(false);\n this.trigger('end');\n },\n\n shuffle: function () {\n var temp,\n rand;\n\n for (var i = this.total - 1; i > 0; i--) {\n rand = Math.floor(Math.random() * (i + 1));\n temp = this.settings.slides[i];\n\n this.settings.slides[i] = this.settings.slides[rand];\n this.settings.slides[rand] = temp;\n }\n },\n\n play: function () {\n if (this.paused) {\n this.paused = false;\n this.next();\n this.trigger('play');\n }\n },\n\n pause: function () {\n this._timer(false);\n this.paused = true;\n this.trigger('pause');\n },\n\n toggle: function () {\n if (this.paused) {\n this.play();\n } else {\n this.pause();\n }\n },\n\n playing: function () {\n return !this.paused && !this.noshow;\n },\n\n current: function (advanced) {\n if (advanced) {\n return {\n slide: this.slide,\n data: this.settings.slides[this.slide]\n };\n }\n return this.slide;\n },\n\n jump: function (nb) {\n if (nb < 0 || nb > this.total - 1 || nb === this.slide) {\n return;\n }\n\n this.slide = nb;\n this._goto(this.slide);\n },\n\n next: function () {\n this.slide++;\n\n if (this.slide >= this.total) {\n if (!this.settings.loop) {\n return this._end();\n }\n\n this.slide = 0;\n }\n\n this._goto(this.slide);\n },\n\n previous: function () {\n this.slide--;\n\n if (this.slide < 0) {\n if (!this.settings.loop) {\n this.slide++;\n return;\n } else {\n this.slide = this.total - 1;\n }\n }\n\n this._goto(this.slide);\n },\n\n trigger: function (fn) {\n var params = [];\n\n if (fn === 'init') {\n params = [ this.settings ];\n } else {\n params = [\n this.slide,\n this.settings.slides[this.slide]\n ];\n }\n\n this.$elmt.trigger('vegas' + fn, params);\n\n if (typeof this.settings[fn] === 'function') {\n this.settings[fn].apply(this.$elmt, params);\n }\n },\n\n options: function (key, value) {\n var oldSlides = this.settings.slides.slice();\n\n if (typeof key === 'object') {\n this.settings = $.extend({}, defaults, $.vegas.defaults, key);\n } else if (typeof key === 'string') {\n if (value === undefined) {\n return this.settings[key];\n }\n this.settings[key] = value;\n } else {\n return this.settings;\n }\n\n // In case slides have changed\n if (this.settings.slides !== oldSlides) {\n this.total = this.settings.slides.length;\n this.noshow = this.total < 2;\n this._preload();\n }\n },\n\n destroy: function () {\n clearTimeout(this.timeout);\n\n this.$elmt.removeClass('vegas-container');\n this.$elmt.find('> .vegas-slide').remove();\n this.$elmt.find('> .vegas-wrapper').clone(true).children().appendTo(this.$elmt);\n this.$elmt.find('> .vegas-wrapper').remove();\n\n if (this.settings.timer) {\n this.$timer.remove();\n }\n\n if (this.settings.overlay) {\n this.$overlay.remove();\n }\n\n this.elmt._vegas = null;\n }\n };\n\n $.fn.vegas = function(options) {\n var args = arguments,\n error = false,\n returns;\n\n if (options === undefined || typeof options === 'object') {\n return this.each(function () {\n if (!this._vegas) {\n this._vegas = new Vegas(this, options);\n }\n });\n } else if (typeof options === 'string') {\n this.each(function () {\n var instance = this._vegas;\n\n if (!instance) {\n throw new Error('No Vegas applied to this element.');\n }\n\n if (typeof instance[options] === 'function' && options[0] !== '_') {\n returns = instance[options].apply(instance, [].slice.call(args, 1));\n } else {\n error = true;\n }\n });\n\n if (error) {\n throw new Error('No method \"' + options + '\" in Vegas.');\n }\n\n return returns !== undefined ? returns : this;\n }\n };\n\n $.vegas = {};\n $.vegas.defaults = defaults;\n\n $.vegas.isVideoCompatible = function () {\n return true;\n };\n\n})(window.jQuery || window.Zepto || window.m4q);\n"],"names":["$","Vegas","elmt","options","this","settings","extend","defaults","vegas","slide","total","slides","length","noshow","paused","autoplay","ended","$elmt","$timer","$overlay","$slide","timeout","first","instance","instances","transitions","animations","transitionRegister","Array","animationRegister","concat","support","objectFit","document","body","style","transition","shuffle","_init","delay","loop","preload","preloadImage","preloadVideo","timer","overlay","cover","color","align","valign","firstTransition","firstTransitionDuration","transitionDuration","animation","animationDuration","slidesToKeep","init","play","pause","walk","videoCache","prototype","$content","$contentScroll","isBody","tagName","self","_preload","css","clone","children","appendTo","innerHTML","prepend","addClass","append","setTimeout","trigger","_goto","i","preloadImages","src","Image","preloadVideos","video","_video","_random","array","Math","floor","random","_slideShow","next","_options","_timer","state","clearTimeout","removeClass","find","srcs","source","cacheKey","toString","createElement","playsInline","controls","forEach","appendChild","_fadeOutSound","duration","volume","_fadeInSound","key","undefined","nb","img","$slides","videoSettings","go","each","get","fadeIn","eq","remove","muted","$video","$inner","after","className","readyState","currentTime","complete","onload","_end","temp","rand","toggle","playing","current","advanced","data","jump","previous","fn","params","apply","value","oldSlides","slice","destroy","_vegas","returns","args","arguments","error","Error","call","isVideoCompatible","window","jQuery","Zepto","m4q"],"mappings":";;;;;;;;+EAUA;CAAA,SAAWA,GACT,aAsDY,SAARC,EAAkBC,EAAMC,GAC1BC,KAAKF,KAAeA,EACpBE,KAAKC,SAAeL,EAAEM,OAAO,GAAIC,EAAUP,EAAEQ,MAAMD,SAAUJ,CAAO,EACpEC,KAAKK,MAAeL,KAAKC,SAASI,MAClCL,KAAKM,MAAeN,KAAKC,SAASM,OAAOC,OACzCR,KAA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,EAAM,CAAC,CAAC,EAElEE,EAAQ,CAAA,CAEZ,CAAC,EAEGA,EACF,MAAM,IAAIC,MAAM,cAAgBxJ,EAAU,aAAa,EAGzD,OAAmB8G,KAAAA,IAAZsC,EAAwBA,EAAUnJ,IAC3C,CACF,EAEAJ,EAAEQ,MAAQ,GACVR,EAAEQ,MAAMD,SAAWA,EAEnBP,EAAEQ,MAAMqJ,kBAAoB,WAC1B,MAAO,CAAA,CACT,CAED,EAAEC,OAAOC,QAAUD,OAAOE,OAASF,OAAOG,GAAG"} -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | /* Utlimate Jay Mega Gulpfile */ 2 | /* global require:true, process:true */ 3 | /* jshint laxbreak:true */ 4 | 5 | (function() { 6 | 'use strict'; 7 | 8 | var pkg = require('./package.json'), 9 | del = require('del'), 10 | yargs = require('yargs'), 11 | exec = require('exec'), 12 | fs = require('fs'), 13 | dateFormat = require('date-format'), 14 | spawn = require('child_process').spawn, 15 | gulp = require('gulp'), 16 | plugins = require('gulp-load-plugins')(); 17 | 18 | var bumpVersion = yargs.argv.type || 'patch'; 19 | 20 | var settings = { 21 | name: 'vegas', 22 | banner: { 23 | content: [ 24 | '/*!-----------------------------------------------------------------------------', 25 | ' * <%= pkg.description %>', 26 | ' * v<%= pkg.version %> - built <%= datetime %>', 27 | ' * Licensed under the MIT License.', 28 | ' * http://vegas.jaysalvat.com/', 29 | ' * ----------------------------------------------------------------------------', 30 | ' * Copyright (C) 2010-<%= year %> Jay Salvat', 31 | ' * http://jaysalvat.com/', 32 | ' * --------------------------------------------------------------------------*/', 33 | '' 34 | ].join('\n'), 35 | vars: { 36 | pkg: pkg, 37 | datetime: dateFormat.asString('yyyy-MM-dd'), 38 | year: dateFormat.asString('yyyy') 39 | } 40 | } 41 | }; 42 | 43 | const getPackageJson = function() { 44 | return JSON.parse(fs.readFileSync('./package.json')); 45 | }; 46 | 47 | function clean(cb) { 48 | return del([ './dist' ], cb); 49 | } 50 | 51 | exports.clean = clean; 52 | 53 | function tmpClean(cb) { 54 | return del([ './tmp' ], cb); 55 | } 56 | 57 | exports.tmpClean = tmpClean; 58 | 59 | function tmpCreate(cb) { 60 | return exec('mkdir -p ./tmp', cb); 61 | } 62 | 63 | exports.tmpCreate = tmpCreate; 64 | 65 | function tmpCopy() { 66 | return gulp.src('./dist/**/*') 67 | .pipe(gulp.dest('./tmp')); 68 | } 69 | 70 | exports.tmpCopy = gulp.series(tmpCreate, tmpCopy); 71 | 72 | function zip() { 73 | const filename = settings.name + '.zip'; 74 | 75 | return gulp.src('./dist/**/*') 76 | .pipe(plugins.zip(filename)) 77 | .pipe(gulp.dest('./tmp')); 78 | } 79 | 80 | exports.zip = gulp.series(tmpCreate, zip); 81 | 82 | function failIfDirty(cb) { 83 | return exec('git diff-index HEAD --', function(err, output) { 84 | if (err) { 85 | return cb(err); 86 | } 87 | if (output) { 88 | return cb('Repository is dirty'); 89 | } 90 | return cb(); 91 | }); 92 | } 93 | 94 | exports.zip = failIfDirty; 95 | 96 | function failIfNotMaster(cb) { 97 | exec('git symbolic-ref -q HEAD', function(err, output) { 98 | if (err) { 99 | return cb(err); 100 | } 101 | if (!/refs\/heads\/master/.test(output)) { 102 | return cb('Branch is not Master'); 103 | } 104 | return cb(); 105 | }); 106 | } 107 | 108 | exports.failIfNotMaster = failIfNotMaster; 109 | 110 | function gitTag(cb) { 111 | const message = 'v' + getPackageJson().version; 112 | 113 | return exec('git tag ' + message, cb); 114 | } 115 | 116 | exports.gitTag = gitTag; 117 | 118 | function gitAdd(cb) { 119 | return exec('git add -A', cb); 120 | } 121 | 122 | exports.gitAdd = gitAdd; 123 | 124 | function gitCommit(cb) { 125 | const message = 'Build v' + getPackageJson().version; 126 | 127 | return exec('git commit -m "' + message + '"', cb); 128 | } 129 | 130 | exports.gitCommit = gulp.series(gitAdd, gitCommit); 131 | 132 | function gitPull(cb) { 133 | return exec('git pull origin master', function(err, output, code) { 134 | if (code !== 0) { 135 | return cb(err + output); 136 | } 137 | return cb(); 138 | }); 139 | } 140 | 141 | exports.gitPull = gitPull; 142 | 143 | function gitPush(cb) { 144 | return exec('git push origin master --tags', function(err, output, code) { 145 | if (code !== 0) { 146 | return cb(err + output); 147 | } 148 | return cb(); 149 | }); 150 | } 151 | 152 | exports.gitCommit = gulp.series(gitAdd, gitCommit, gitPush); 153 | 154 | function npmPublish(cb) { 155 | exec('npm publish', function(err, output, code) { 156 | if (code !== 0) { 157 | return cb(err + output); 158 | } 159 | return cb(); 160 | }); 161 | } 162 | 163 | exports.npmPublish = npmPublish; 164 | 165 | function meta(cb) { 166 | const metadata = { 167 | date: dateFormat.asString('yyyy-MM-dd HH:MM'), 168 | version: 'v' + getPackageJson().version 169 | }, 170 | json = JSON.stringify(metadata, null, 4); 171 | 172 | fs.writeFileSync('tmp/metadata.json', json); 173 | fs.writeFileSync('tmp/metadata.js', '__metadata(' + json + ');'); 174 | 175 | return cb(); 176 | } 177 | 178 | exports.npmPublish = gulp.series(tmpCreate, meta); 179 | 180 | function bump() { 181 | return gulp.src([ 'package.json', 'bower.json', 'component.json' ]) 182 | .pipe(plugins.bump( 183 | /^[a-z]+$/.test(bumpVersion) 184 | ? { type: bumpVersion } 185 | : { version: bumpVersion } 186 | )) 187 | .pipe(gulp.dest('.')); 188 | } 189 | 190 | exports.npmPublish = npmPublish; 191 | 192 | function year() { 193 | return gulp.src([ './README.md' ]) 194 | .pipe(plugins.replace(/(Copyright )(\d{4})/g, '$1' + dateFormat.asString('yyyy'))) 195 | .pipe(gulp.dest('.')); 196 | } 197 | 198 | exports.year = year; 199 | 200 | function lint() { 201 | return gulp.src('./src/**.js') 202 | .pipe(plugins.jshint()) 203 | .pipe(plugins.jshint.reporter('default')); 204 | } 205 | 206 | exports.lint = lint; 207 | 208 | function copy() { 209 | return gulp.src([ './src/**/*', '!./src/sass', '!./src/sass/**' ]) 210 | .pipe(gulp.dest('./dist')); 211 | } 212 | 213 | exports.copy = copy; 214 | 215 | function uglify() { 216 | return gulp.src('./dist/**/!(*.min.js).js') 217 | .pipe(plugins.rename({ suffix: '.min' })) 218 | .pipe(plugins.sourcemaps.init()) 219 | .pipe(plugins.uglify({ 220 | compress: { 221 | 222 | }, 223 | mangle: true, 224 | output: { 225 | comments: /^!/ 226 | } 227 | })) 228 | .on('error', function(err) { console.log(err) }) 229 | .pipe(plugins.sourcemaps.write('.')) 230 | .pipe(gulp.dest('./dist/')); 231 | } 232 | 233 | exports.copy = copy; 234 | 235 | function cssmin() { 236 | return gulp.src('./dist/**/!(*.min.css).css') 237 | .pipe(plugins.sourcemaps.init()) 238 | .pipe(plugins.rename({ suffix: '.min' })) 239 | .pipe(plugins.cssmin()) 240 | .pipe(plugins.sourcemaps.write('.')) 241 | .pipe(gulp.dest('./dist/')); 242 | } 243 | 244 | exports.cssmin = cssmin; 245 | 246 | function sass() { 247 | return gulp.src("./src/sass/vegas.sass") 248 | // .pipe(plugins.sourcemaps.init()) 249 | .pipe(plugins.sass({ 250 | outputStyle: 'expanded', 251 | indentWidth: 4 252 | }).on('error', plugins.sass.logError)) 253 | .pipe(plugins.autoprefixer()) 254 | // .pipe(plugins.sourcemaps.write('.')) 255 | .pipe(gulp.dest("./dist/")); 256 | } 257 | 258 | exports.sass = sass; 259 | 260 | function header() { 261 | settings.banner.vars.pkg = getPackageJson(); 262 | 263 | return gulp.src('./dist/*.js') 264 | .pipe(plugins.header(settings.banner.content, settings.banner.vars )) 265 | .pipe(gulp.dest('./dist/')); 266 | } 267 | 268 | exports.header = header; 269 | 270 | function ghPages(cb) { 271 | var version = getPackageJson().version; 272 | 273 | exec([ 'git checkout gh-pages', 274 | 'rm -rf releases/' + version, 275 | 'mkdir -p releases/' + version, 276 | 'cp -r tmp/* releases/' + version, 277 | 'git add -A releases/' + version, 278 | 'rm -rf releases/latest', 279 | 'mkdir -p releases/latest', 280 | 'cp -r tmp/* releases/latest', 281 | 'git add -A releases/latest', 282 | 'git commit -m "Publish release v' + version + '."', 283 | 'git push origin gh-pages', 284 | 'git checkout -' 285 | ].join(' && '), 286 | function(err, output, code) { 287 | if (code !== 0) { 288 | return cb(err + output); 289 | } 290 | return cb(); 291 | } 292 | ); 293 | } 294 | 295 | exports.ghPages = ghPages; 296 | 297 | function changelog(cb) { 298 | var filename = 'CHANGELOG.md', 299 | editor = process.env.EDITOR || 'vim', 300 | version = getPackageJson().version, 301 | date = dateFormat.asString('yyyy-MM-dd'), 302 | changelog = fs.readFileSync(filename).toString(), 303 | lastDate = /\d{4}-\d{2}-\d{2}/.exec(changelog)[0]; 304 | 305 | exec('git log --since="' + lastDate + ' 00:00:00" --oneline --pretty=format:"%s"', function(err, stdout) { 306 | if (err) { 307 | return cb(err); 308 | } 309 | 310 | if (!stdout) { 311 | return cb(); 312 | } 313 | 314 | const updates = [ 315 | '### Vegas ' + version + ' ' + date, 316 | '', 317 | '* ' + stdout.replace(/\n/g, '\n* ') 318 | ].join('\n'); 319 | 320 | changelog = changelog.replace(/(## CHANGE LOG)/, '$1\n\n' + updates); 321 | 322 | fs.writeFileSync(filename, changelog); 323 | 324 | const vim = spawn(editor, [ filename, '-n', '+7' ], { 325 | stdio: 'inherit' 326 | }); 327 | 328 | vim.on('close', function() { 329 | return cb(); 330 | }); 331 | }); 332 | } 333 | 334 | exports.changelog = changelog; 335 | 336 | function watch() { 337 | return gulp.watch("./src/**/*", build); 338 | } 339 | 340 | exports.watch = watch; 341 | exports.default = watch; 342 | 343 | const build = gulp.series( 344 | lint, 345 | clean, 346 | copy, 347 | sass, 348 | header, 349 | cssmin, 350 | uglify 351 | ); 352 | 353 | exports.build = build; 354 | 355 | const publish = gulp.series( 356 | failIfNotMaster, 357 | failIfDirty, 358 | tmpCreate, 359 | tmpCopy, 360 | meta, 361 | zip, 362 | ghPages, 363 | tmpClean 364 | ); 365 | 366 | exports.publish = publish; 367 | 368 | const release = gulp.series( 369 | failIfNotMaster, 370 | failIfDirty, 371 | gitPull, 372 | bump, 373 | changelog, 374 | year, 375 | clean, 376 | copy, 377 | sass, 378 | header, 379 | uglify, 380 | cssmin, 381 | gitAdd, 382 | gitCommit, 383 | gitTag, 384 | gitPush, 385 | publish, 386 | npmPublish 387 | ); 388 | 389 | exports.release = release; 390 | })(); 391 | 392 | /* 393 | 394 | NPM Installation 395 | ---------------- 396 | 397 | npm install --save-dev del 398 | npm install --save-dev yargs 399 | npm install --save-dev exec 400 | npm install --save-dev jshint 401 | npm install --save-dev gulp 402 | npm install --save-dev gulp-sass 403 | npm install --save-dev gulp-load-plugins 404 | npm install --save-dev gulp-bump 405 | npm install --save-dev gulp-header 406 | npm install --save-dev gulp-cssmin 407 | npm install --save-dev gulp-autoprefixer 408 | npm install --save-dev gulp-uglify 409 | npm install --save-dev gulp-sourcemaps 410 | npm install --save-dev gulp-jshint 411 | npm install --save-dev gulp-util 412 | npm install --save-dev gulp-zip 413 | npm install --save-dev gulp-rename 414 | npm install --save-dev gulp-replace 415 | 416 | Gh-pages creation 417 | ----------------- 418 | 419 | git checkout --orphan gh-pages 420 | git rm -rf . 421 | rm -fr 422 | echo 'Welcome' > index.html 423 | git add index.html 424 | git commit -a -m 'First commit' 425 | git push origin gh-pages 426 | git checkout - 427 | 428 | */ 429 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vegas", 3 | "version": "2.6.0", 4 | "description": "Vegas - Fullscreen Backgrounds and Slideshows.", 5 | "homepage": "http://vegas.jaysalvat.com", 6 | "author": "Jay Salvat", 7 | "license": "MIT", 8 | "main": "dist/vegas.min.js", 9 | "repository": { 10 | "type": "git", 11 | "url": "git@github.com:jaysalvat/vegas.git" 12 | }, 13 | "scripts": { 14 | "dev": "gulp", 15 | "build": "gulp build", 16 | "release:patch": "gulp release --type patch", 17 | "release:minor": "gulp release --type minor", 18 | "release:major": "gulp release --type major" 19 | }, 20 | "keywords": [ 21 | "background", 22 | "slideshow", 23 | "fullscreen", 24 | "vegas", 25 | "jquery-plugin", 26 | "jquery", 27 | "zepto" 28 | ], 29 | "devDependencies": { 30 | "date-format": "^3.0.0", 31 | "del": "^6.1.1", 32 | "exec": "^0.2.1", 33 | "gulp": "^4.0.2", 34 | "gulp-autoprefixer": "^7.0.1", 35 | "gulp-bump": "^3.2.0", 36 | "gulp-cssmin": "^0.2.0", 37 | "gulp-header": "^2.0.9", 38 | "gulp-jshint": "^2.1.0", 39 | "gulp-load-plugins": "^2.0.8", 40 | "gulp-rename": "^2.0.0", 41 | "gulp-replace": "^1.1.4", 42 | "gulp-sass": "^4.1.1", 43 | "gulp-sourcemaps": "^3.0.0", 44 | "gulp-sync": "^0.1.4", 45 | "gulp-uglify": "^3.0.2", 46 | "gulp-util": "^3.0.8", 47 | "gulp-zip": "^5.1.0", 48 | "jshint": "^2.13.6", 49 | "yargs": "^16.2.0" 50 | }, 51 | "dependencies": {} 52 | } 53 | -------------------------------------------------------------------------------- /src/overlays/01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaysalvat/vegas/5fb29500e9d0fcdcf11b22b83cf13856ab5537fc/src/overlays/01.png -------------------------------------------------------------------------------- /src/overlays/02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaysalvat/vegas/5fb29500e9d0fcdcf11b22b83cf13856ab5537fc/src/overlays/02.png -------------------------------------------------------------------------------- /src/overlays/03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaysalvat/vegas/5fb29500e9d0fcdcf11b22b83cf13856ab5537fc/src/overlays/03.png -------------------------------------------------------------------------------- /src/overlays/04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaysalvat/vegas/5fb29500e9d0fcdcf11b22b83cf13856ab5537fc/src/overlays/04.png -------------------------------------------------------------------------------- /src/overlays/05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaysalvat/vegas/5fb29500e9d0fcdcf11b22b83cf13856ab5537fc/src/overlays/05.png -------------------------------------------------------------------------------- /src/overlays/06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaysalvat/vegas/5fb29500e9d0fcdcf11b22b83cf13856ab5537fc/src/overlays/06.png -------------------------------------------------------------------------------- /src/overlays/07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaysalvat/vegas/5fb29500e9d0fcdcf11b22b83cf13856ab5537fc/src/overlays/07.png -------------------------------------------------------------------------------- /src/overlays/08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaysalvat/vegas/5fb29500e9d0fcdcf11b22b83cf13856ab5537fc/src/overlays/08.png -------------------------------------------------------------------------------- /src/overlays/09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaysalvat/vegas/5fb29500e9d0fcdcf11b22b83cf13856ab5537fc/src/overlays/09.png -------------------------------------------------------------------------------- /src/sass/animations/kenburns-down-left.sass: -------------------------------------------------------------------------------- 1 | /*******************************************/ 2 | /* kenburnsDownLeft animation 3 | /*******************************************/ 4 | 5 | .vegas-animation-kenburnsDownLeft 6 | animation: kenburnsDownLeft ease-out 7 | 8 | @keyframes kenburnsDownLeft 9 | 0% 10 | transform: scale($vegas-kenburns-scale) translate($vegas-kenburns-translate, -$vegas-kenburns-translate) 11 | 100% 12 | transform: scale(1) translate(0, 0) -------------------------------------------------------------------------------- /src/sass/animations/kenburns-down-right.sass: -------------------------------------------------------------------------------- 1 | /*******************************************/ 2 | /* kenburnsDownRight animation 3 | /*******************************************/ 4 | 5 | .vegas-animation-kenburnsDownRight 6 | animation: kenburnsDownRight ease-out 7 | 8 | @keyframes kenburnsDownRight 9 | 0% 10 | transform: scale($vegas-kenburns-scale) translate(-$vegas-kenburns-translate, -$vegas-kenburns-translate) 11 | 100% 12 | transform: scale(1) translate(0, 0) -------------------------------------------------------------------------------- /src/sass/animations/kenburns-down.sass: -------------------------------------------------------------------------------- 1 | /*******************************************/ 2 | /* kenburnsDown animation 3 | /*******************************************/ 4 | 5 | .vegas-animation-kenburnsDown 6 | animation: kenburnsDown ease-out 7 | 8 | @keyframes kenburnsDown 9 | 0% 10 | transform: scale($vegas-kenburns-scale) translate(0, -$vegas-kenburns-translate) 11 | 100% 12 | transform: scale(1) translate(0, 0) -------------------------------------------------------------------------------- /src/sass/animations/kenburns-left.sass: -------------------------------------------------------------------------------- 1 | /*******************************************/ 2 | /* kenburnsLeft animation 3 | /*******************************************/ 4 | 5 | .vegas-animation-kenburnsLeft 6 | animation: kenburnsLeft ease-out 7 | 8 | @keyframes kenburnsLeft 9 | 0% 10 | transform: scale($vegas-kenburns-scale) translate($vegas-kenburns-translate, 0) 11 | 100% 12 | transform: scale(1) translate(0, 0) -------------------------------------------------------------------------------- /src/sass/animations/kenburns-right.sass: -------------------------------------------------------------------------------- 1 | /*******************************************/ 2 | /* kenburnsRight animation 3 | /*******************************************/ 4 | 5 | .vegas-animation-kenburnsRight 6 | animation: kenburnsRight ease-out 7 | 8 | @keyframes kenburnsRight 9 | 0% 10 | transform: scale($vegas-kenburns-scale) translate(-$vegas-kenburns-translate, 0) 11 | 100% 12 | transform: scale(1) translate(0, 0) -------------------------------------------------------------------------------- /src/sass/animations/kenburns-up-left.sass: -------------------------------------------------------------------------------- 1 | /*******************************************/ 2 | /* kenburnsUpLeft animation 3 | /*******************************************/ 4 | 5 | .vegas-animation-kenburnsUpLeft 6 | animation: kenburnsUpLeft ease-out 7 | 8 | @keyframes kenburnsUpLeft 9 | 0% 10 | transform: scale($vegas-kenburns-scale) translate($vegas-kenburns-translate, $vegas-kenburns-translate) 11 | 100% 12 | transform: scale(1) translate(0, 0) -------------------------------------------------------------------------------- /src/sass/animations/kenburns-up-right.sass: -------------------------------------------------------------------------------- 1 | /*******************************************/ 2 | /* kenburnsUpRight animation 3 | /*******************************************/ 4 | 5 | .vegas-animation-kenburnsUpRight 6 | animation: kenburnsUpRight ease-out 7 | 8 | @keyframes kenburnsUpRight 9 | 0% 10 | transform: scale($vegas-kenburns-scale) translate(-$vegas-kenburns-translate, $vegas-kenburns-translate) 11 | 100% 12 | transform: scale(1) translate(0, 0) 13 | -------------------------------------------------------------------------------- /src/sass/animations/kenburns-up.sass: -------------------------------------------------------------------------------- 1 | /*******************************************/ 2 | /* kenburnsUp animation 3 | /*******************************************/ 4 | 5 | .vegas-animation-kenburnsUp 6 | animation: kenburnsUp ease-out 7 | 8 | @keyframes kenburnsUp 9 | 0% 10 | transform: scale($vegas-kenburns-scale) translate(0, $vegas-kenburns-translate) 11 | 100% 12 | transform: scale(1) translate(0, 0) -------------------------------------------------------------------------------- /src/sass/animations/kenburns.sass: -------------------------------------------------------------------------------- 1 | /*******************************************/ 2 | /* kenburns animation 3 | /*******************************************/ 4 | 5 | .vegas-animation-kenburns 6 | animation: kenburns ease-out 7 | 8 | @keyframes kenburns 9 | 0% 10 | transform: scale($vegas-kenburns-scale) 11 | 100% 12 | transform: scale(1) -------------------------------------------------------------------------------- /src/sass/main/vegas.sass: -------------------------------------------------------------------------------- 1 | .vegas-overlay, 2 | .vegas-content-scrollable, 3 | .vegas-timer, 4 | .vegas-slide, 5 | .vegas-slide-inner 6 | position: absolute 7 | top: 0 8 | left: 0 9 | bottom: 0 10 | right: 0 11 | overflow: hidden 12 | border: none 13 | padding: 0 14 | margin: 0 15 | 16 | .vegas-content-scrollable 17 | position: relative 18 | height: 100% 19 | overflow: auto 20 | 21 | .vegas-overlay 22 | opacity: .5 23 | background: transparent url('./overlays/02.png') center center repeat 24 | 25 | .vegas-timer 26 | top: auto 27 | bottom: 0 28 | height: 2px 29 | 30 | .vegas-timer-progress 31 | width: 0% 32 | height: 100% 33 | background: $vegas-timer-color 34 | transition: width ease-out 35 | 36 | .vegas-timer-running .vegas-timer-progress 37 | width: 100% 38 | 39 | .vegas-slide, 40 | .vegas-slide-inner 41 | margin: 0 42 | padding: 0 43 | background: transparent center center no-repeat 44 | transform: translateZ(0) 45 | will-change: transform, opacity 46 | 47 | body .vegas-container 48 | overflow: hidden !important 49 | position: relative 50 | 51 | .vegas-video 52 | min-width: 100% 53 | min-height: 100% 54 | width: auto 55 | height: auto 56 | 57 | body.vegas-container 58 | overflow: auto 59 | position: static 60 | z-index: -2 61 | 62 | body.vegas-container > .vegas-timer, 63 | body.vegas-container > .vegas-overlay, 64 | body.vegas-container > .vegas-slide 65 | position: fixed 66 | z-index: -1 67 | 68 | /* Target Safari IOS7+ in order to add 76px */ 69 | // _::full-page-media, _:future, 70 | // :root body.vegas-container > .vegas-slide, 71 | // :root body.vegas-container > .vegas-overlay 72 | // bottom: -76px 73 | -------------------------------------------------------------------------------- /src/sass/transitions/blur.sass: -------------------------------------------------------------------------------- 1 | /*******************************************/ 2 | /* blur transition 3 | /*******************************************/ 4 | 5 | .vegas-transition-blur, 6 | .vegas-transition-blur2 7 | opacity: 0 8 | filter: blur($vegas-blur-value) brightness(1.01) 9 | 10 | .vegas-transition-blur-in, 11 | .vegas-transition-blur2-in 12 | opacity: 1 13 | filter: blur(0px) brightness(1.01) 14 | 15 | .vegas-transition-blur2-out 16 | opacity: 0 17 | -------------------------------------------------------------------------------- /src/sass/transitions/burn.sass: -------------------------------------------------------------------------------- 1 | /*******************************************/ 2 | /* burn transition 3 | /*******************************************/ 4 | 5 | .vegas-transition-burn, 6 | .vegas-transition-burn2 7 | opacity: 0 8 | filter: contrast(1000%) saturate(1000%) 9 | 10 | .vegas-transition-burn-in, 11 | .vegas-transition-burn2-in 12 | opacity: 1 13 | filter: contrast(100%) saturate(100%) 14 | 15 | .vegas-transition-burn2-out 16 | opacity: 0 17 | filter: contrast(1000%) saturate(1000%) -------------------------------------------------------------------------------- /src/sass/transitions/fade.sass: -------------------------------------------------------------------------------- 1 | /*******************************************/ 2 | /* fade transition 3 | /*******************************************/ 4 | 5 | .vegas-transition-fade, 6 | .vegas-transition-fade2 7 | opacity: 0 8 | 9 | .vegas-transition-fade-in, 10 | .vegas-transition-fade2-in 11 | opacity: 1 12 | 13 | .vegas-transition-fade2-out 14 | opacity: 0 -------------------------------------------------------------------------------- /src/sass/transitions/flash.sass: -------------------------------------------------------------------------------- 1 | /*******************************************/ 2 | /* flash transition 3 | /*******************************************/ 4 | 5 | .vegas-transition-flash, 6 | .vegas-transition-flash2 7 | opacity: 0 8 | filter: brightness(25) 9 | 10 | .vegas-transition-flash-in, 11 | .vegas-transition-flash2-in 12 | opacity: 1 13 | filter: brightness(1) 14 | 15 | .vegas-transition-flash2-out 16 | opacity: 0 17 | filter: brightness(25) -------------------------------------------------------------------------------- /src/sass/transitions/negative.sass: -------------------------------------------------------------------------------- 1 | /*******************************************/ 2 | /* negative transition 3 | /*******************************************/ 4 | 5 | .vegas-transition-negative, 6 | .vegas-transition-negative2 7 | opacity: 0 8 | filter: invert(100%) 9 | 10 | .vegas-transition-negative-in, 11 | .vegas-transition-negative2-in 12 | opacity: 1 13 | filter: invert(0) 14 | 15 | .vegas-transition-negative2-out 16 | opacity: 0 17 | filter: invert(100%) -------------------------------------------------------------------------------- /src/sass/transitions/slide-down.sass: -------------------------------------------------------------------------------- 1 | /*******************************************/ 2 | /* slideDown transition 3 | /*******************************************/ 4 | 5 | .vegas-transition-slideDown, 6 | .vegas-transition-slideDown2 7 | transform: translateY(-100%) 8 | 9 | .vegas-transition-slideDown-in, 10 | .vegas-transition-slideDown2-in 11 | transform: translateY(0%) 12 | 13 | .vegas-transition-slideDown2-out 14 | transform: translateY(100%) -------------------------------------------------------------------------------- /src/sass/transitions/slide-left.sass: -------------------------------------------------------------------------------- 1 | /*******************************************/ 2 | /* slideLeft transition 3 | /*******************************************/ 4 | 5 | .vegas-transition-slideLeft, 6 | .vegas-transition-slideLeft2 7 | transform: translateX(100%) 8 | 9 | .vegas-transition-slideLeft-in, 10 | .vegas-transition-slideLeft2-in 11 | transform: translateX(0%) 12 | 13 | .vegas-transition-slideLeft2-out 14 | transform: translateX(-100%) -------------------------------------------------------------------------------- /src/sass/transitions/slide-right.sass: -------------------------------------------------------------------------------- 1 | /*******************************************/ 2 | /* slideRight transition 3 | /*******************************************/ 4 | 5 | .vegas-transition-slideRight, 6 | .vegas-transition-slideRight2 7 | transform: translateX(-100%) 8 | 9 | .vegas-transition-slideRight-in, 10 | .vegas-transition-slideRight2-in 11 | transform: translateX(0%) 12 | 13 | .vegas-transition-slideRight2-out 14 | transform: translateX(100%) -------------------------------------------------------------------------------- /src/sass/transitions/slide-up.sass: -------------------------------------------------------------------------------- 1 | /*******************************************/ 2 | /* slideUp transition 3 | /*******************************************/ 4 | 5 | .vegas-transition-slideUp, 6 | .vegas-transition-slideUp2 7 | transform: translateY(100%) 8 | 9 | .vegas-transition-slideUp-in, 10 | .vegas-transition-slideUp2-in 11 | transform: translateY(0%) 12 | 13 | .vegas-transition-slideUp2-out 14 | transform: translateY(-100%) -------------------------------------------------------------------------------- /src/sass/transitions/swirl-left.sass: -------------------------------------------------------------------------------- 1 | /*******************************************/ 2 | /* swirlLeft transition 3 | /*******************************************/ 4 | 5 | .vegas-transition-swirlLeft, 6 | .vegas-transition-swirlLeft2 7 | transform: scale($vegas-swirl-scale) rotate($vegas-swirl-degree) 8 | opacity: 0 9 | 10 | .vegas-transition-swirlLeft-in, 11 | .vegas-transition-swirlLeft2-in 12 | transform: scale(1) rotate(0deg) 13 | opacity: 1 14 | 15 | .vegas-transition-swirlLeft2-out 16 | transform: scale($vegas-swirl-scale) rotate(-$vegas-swirl-degree) 17 | opacity: 0 -------------------------------------------------------------------------------- /src/sass/transitions/swirl-right.sass: -------------------------------------------------------------------------------- 1 | /*******************************************/ 2 | /* swirlRight transition 3 | /*******************************************/ 4 | 5 | .vegas-transition-swirlRight, 6 | .vegas-transition-swirlRight2 7 | transform: scale($vegas-swirl-scale) rotate(-$vegas-swirl-degree) 8 | opacity: 0 9 | 10 | .vegas-transition-swirlRight-in, 11 | .vegas-transition-swirlRight2-in 12 | transform: scale(1) rotate(0deg) 13 | opacity: 1 14 | 15 | .vegas-transition-swirlRight2-out 16 | transform: scale($vegas-swirl-scale) rotate($vegas-swirl-degree) 17 | opacity: 0 -------------------------------------------------------------------------------- /src/sass/transitions/zoom-in.sass: -------------------------------------------------------------------------------- 1 | /*******************************************/ 2 | /* zoomIn transition 3 | /*******************************************/ 4 | 5 | .vegas-transition-zoomIn, 6 | .vegas-transition-zoomIn2 7 | transform: scale(0) 8 | opacity: 0 9 | 10 | .vegas-transition-zoomIn-in, 11 | .vegas-transition-zoomIn2-in 12 | transform: scale(1) 13 | opacity: 1 14 | 15 | .vegas-transition-zoomIn2-out 16 | transform: scale($vegas-zoom-scale) 17 | opacity: 0 -------------------------------------------------------------------------------- /src/sass/transitions/zoom-out.sass: -------------------------------------------------------------------------------- 1 | /*******************************************/ 2 | /* zoomOut transition 3 | /*******************************************/ 4 | 5 | .vegas-transition-zoomOut, 6 | .vegas-transition-zoomOut2 7 | transform: scale($vegas-zoom-scale) 8 | opacity: 0 9 | 10 | .vegas-transition-zoomOut-in, 11 | .vegas-transition-zoomOut2-in 12 | transform: scale(1) 13 | opacity: 1 14 | 15 | .vegas-transition-zoomOut2-out 16 | transform: scale(0) 17 | opacity: 0 -------------------------------------------------------------------------------- /src/sass/vegas.sass: -------------------------------------------------------------------------------- 1 | // Vegas params 2 | $vegas-timer-color: white !default 3 | 4 | // Animation params 5 | $vegas-kenburns-scale: 1.5 !default 6 | $vegas-kenburns-translate: 10% !default 7 | 8 | // Transition params 9 | $vegas-blur-value: 32px !default // blur transition 10 | $vegas-swirl-degree: 35deg !default // swirl transition 11 | $vegas-swirl-scale: 2 !default // swirl transition 12 | $vegas-zoom-scale: 2 !default // zoom transition 13 | 14 | // Main 15 | @import 'main/vegas' 16 | 17 | // Transitions 18 | @import 'transitions/blur' 19 | @import 'transitions/burn' 20 | @import 'transitions/fade' 21 | @import 'transitions/flash' 22 | @import 'transitions/negative' 23 | @import 'transitions/slide-down' 24 | @import 'transitions/slide-left' 25 | @import 'transitions/slide-right' 26 | @import 'transitions/slide-up' 27 | @import 'transitions/swirl-left' 28 | @import 'transitions/swirl-right' 29 | @import 'transitions/zoom-in' 30 | @import 'transitions/zoom-out' 31 | 32 | // Animations 33 | @import 'animations/kenburns' 34 | @import 'animations/kenburns-down-left' 35 | @import 'animations/kenburns-down-right' 36 | @import 'animations/kenburns-down' 37 | @import 'animations/kenburns-left' 38 | @import 'animations/kenburns-right' 39 | @import 'animations/kenburns-up-left' 40 | @import 'animations/kenburns-up-right' 41 | @import 'animations/kenburns-up' 42 | -------------------------------------------------------------------------------- /src/vegas.js: -------------------------------------------------------------------------------- 1 | 2 | (function ($) { 3 | 'use strict'; 4 | 5 | var defaults = { 6 | slide: 0, 7 | delay: 5000, 8 | loop: true, 9 | preload: false, 10 | preloadImage: false, 11 | preloadVideo: false, 12 | timer: true, 13 | overlay: false, 14 | autoplay: true, 15 | shuffle: false, 16 | cover: true, 17 | color: null, 18 | align: 'center', 19 | valign: 'center', 20 | firstTransition: null, 21 | firstTransitionDuration: null, 22 | transition: 'fade', 23 | transitionDuration: 1000, 24 | transitionRegister: [], 25 | animation: null, 26 | animationDuration: 'auto', 27 | animationRegister: [], 28 | slidesToKeep: 1, 29 | init: function () {}, 30 | play: function () {}, 31 | pause: function () {}, 32 | walk: function () {}, 33 | slides: [ 34 | // { 35 | // src: null, 36 | // color: null, 37 | // delay: null, 38 | // align: null, 39 | // valign: null, 40 | // transition: null, 41 | // transitionDuration: null, 42 | // animation: null, 43 | // animationDuration: null, 44 | // cover: true, 45 | // video: { 46 | // src: [], 47 | // muted: true, 48 | // loop: true 49 | // } 50 | // ... 51 | ] 52 | }; 53 | 54 | var videoCache = {}; 55 | var instances = 0; 56 | 57 | var Vegas = function (elmt, options) { 58 | this.elmt = elmt; 59 | this.settings = $.extend({}, defaults, $.vegas.defaults, options); 60 | this.slide = this.settings.slide; 61 | this.total = this.settings.slides.length; 62 | this.noshow = this.total < 2; 63 | this.paused = !this.settings.autoplay || this.noshow; 64 | this.ended = false; 65 | this.$elmt = $(elmt); 66 | this.$timer = null; 67 | this.$overlay = null; 68 | this.$slide = null; 69 | this.timeout = null; 70 | this.first = true; 71 | 72 | this.instance = instances++; 73 | 74 | this.transitions = [ 75 | 'fade', 'fade2', 76 | 'blur', 'blur2', 77 | 'flash', 'flash2', 78 | 'negative', 'negative2', 79 | 'burn', 'burn2', 80 | 'slideLeft', 'slideLeft2', 81 | 'slideRight', 'slideRight2', 82 | 'slideUp', 'slideUp2', 83 | 'slideDown', 'slideDown2', 84 | 'zoomIn', 'zoomIn2', 85 | 'zoomOut', 'zoomOut2', 86 | 'swirlLeft', 'swirlLeft2', 87 | 'swirlRight', 'swirlRight2' 88 | ]; 89 | 90 | this.animations = [ 91 | 'kenburns', 92 | 'kenburnsLeft', 'kenburnsRight', 93 | 'kenburnsUp', 'kenburnsUpLeft', 'kenburnsUpRight', 94 | 'kenburnsDown', 'kenburnsDownLeft', 'kenburnsDownRight' 95 | ]; 96 | 97 | if (!(this.settings.transitionRegister instanceof Array)) { 98 | this.settings.transitionRegister = [ this.settings.transitionRegister ]; 99 | } 100 | 101 | if (!(this.settings.animationRegister instanceof Array)) { 102 | this.settings.animationRegister = [ this.settings.animationRegister ]; 103 | } 104 | 105 | this.transitions = this.transitions.concat(this.settings.transitionRegister); 106 | this.animations = this.animations.concat(this.settings.animationRegister); 107 | 108 | this.support = { 109 | objectFit: 'objectFit' in document.body.style, 110 | transition: 'transition' in document.body.style || 'WebkitTransition' in document.body.style 111 | }; 112 | 113 | if (this.settings.shuffle === true) { 114 | this.shuffle(); 115 | } 116 | this._init(); 117 | }; 118 | 119 | Vegas.prototype = { 120 | _init: function () { 121 | var $content, 122 | $contentScroll, 123 | $overlay, 124 | $timer, 125 | isBody = this.elmt.tagName === 'BODY', 126 | timer = this.settings.timer, 127 | overlay = this.settings.overlay, 128 | self = this; 129 | 130 | // Preloading 131 | this._preload(); 132 | 133 | // Div with scrollable content 134 | if (!isBody) { 135 | $contentScroll = $('
'); 136 | 137 | $content = $('
') 138 | .css('overflow', this.$elmt.css('overflow')) 139 | .css('padding', this.$elmt.css('padding')); 140 | 141 | // Some browsers don't compute padding shorthand 142 | if (!this.$elmt.css('padding')) { 143 | $content 144 | .css('padding-top', this.$elmt.css('padding-top')) 145 | .css('padding-bottom', this.$elmt.css('padding-bottom')) 146 | .css('padding-left', this.$elmt.css('padding-left')) 147 | .css('padding-right', this.$elmt.css('padding-right')); 148 | } 149 | 150 | this.$elmt.css('padding', 0); 151 | 152 | this.$elmt.clone(true).children().appendTo($content); 153 | this.elmt.innerHTML = ''; 154 | } 155 | 156 | // Timer 157 | if (timer && this.support.transition) { 158 | $timer = $('
'); 159 | this.$timer = $timer; 160 | this.$elmt.prepend($timer); 161 | } 162 | 163 | // Overlay 164 | if (overlay) { 165 | $overlay = $('
'); 166 | 167 | if (typeof overlay === 'string') { 168 | $overlay.css('background-image', 'url(' + overlay + ')'); 169 | } 170 | 171 | this.$overlay = $overlay; 172 | this.$elmt.prepend($overlay); 173 | } 174 | 175 | // Container 176 | this.$elmt.addClass('vegas-container'); 177 | 178 | if (!isBody) { 179 | this.$elmt.append($contentScroll); 180 | $contentScroll.append($content); 181 | } 182 | 183 | setTimeout(function () { 184 | self.trigger('init'); 185 | self._goto(self.slide); 186 | 187 | if (self.settings.autoplay) { 188 | self.trigger('play'); 189 | } 190 | }, 1); 191 | }, 192 | 193 | _preload: function () { 194 | var img, i; 195 | 196 | for (i = 0; i < this.settings.slides.length; i++) { 197 | if (this.settings.preload || this.settings.preloadImages) { 198 | if (this.settings.slides[i].src) { 199 | img = new Image(); 200 | img.src = this.settings.slides[i].src; 201 | } 202 | } 203 | 204 | if (this.settings.preload || this.settings.preloadVideos) { 205 | if (this.settings.slides[i].video) { 206 | if (this.settings.slides[i].video instanceof Array) { 207 | this._video(this.settings.slides[i].video); 208 | } else { 209 | this._video(this.settings.slides[i].video.src); 210 | } 211 | } 212 | } 213 | } 214 | }, 215 | 216 | _random: function (array) { 217 | return array[Math.floor(Math.random() * array.length)]; 218 | }, 219 | 220 | _slideShow: function () { 221 | var self = this; 222 | 223 | if (this.total > 1 && !this.ended && !this.paused && !this.noshow) { 224 | this.timeout = setTimeout(function () { 225 | self.next(); 226 | }, this._options('delay')); 227 | } 228 | }, 229 | 230 | _timer: function (state) { 231 | var self = this; 232 | 233 | clearTimeout(this.timeout); 234 | 235 | if (!this.$timer) { 236 | return; 237 | } 238 | 239 | this.$timer 240 | .removeClass('vegas-timer-running') 241 | .find('div') 242 | .css('transition-duration', '0ms'); 243 | 244 | if (this.ended || this.paused || this.noshow) { 245 | return; 246 | } 247 | 248 | if (state) { 249 | setTimeout(function () { 250 | self.$timer 251 | .addClass('vegas-timer-running') 252 | .find('div') 253 | .css('transition-duration', self._options('delay') - 100 + 'ms'); 254 | }, 100); 255 | } 256 | }, 257 | 258 | _video: function (srcs) { 259 | var video, 260 | source, 261 | cacheKey = this.instance + srcs.toString(); 262 | 263 | if (videoCache[cacheKey]) { 264 | return videoCache[cacheKey]; 265 | } 266 | 267 | if (!(srcs instanceof Array)) { 268 | srcs = [ srcs ]; 269 | } 270 | 271 | video = document.createElement('video'); 272 | video.preload = true; 273 | video.playsInline = true; 274 | video.controls = false; 275 | 276 | srcs.forEach(function (src) { 277 | source = document.createElement('source'); 278 | source.src = src; 279 | video.appendChild(source); 280 | }); 281 | 282 | videoCache[cacheKey] = video; 283 | 284 | return video; 285 | }, 286 | 287 | _fadeOutSound: function (video, duration) { 288 | var self = this, 289 | delay = duration / 10, 290 | volume = video.volume - 0.09; 291 | 292 | if (volume > 0) { 293 | video.volume = volume; 294 | 295 | setTimeout(function () { 296 | self._fadeOutSound(video, duration); 297 | }, delay); 298 | } else { 299 | video.pause(); 300 | } 301 | }, 302 | 303 | _fadeInSound: function (video, duration) { 304 | var self = this, 305 | delay = duration / 10, 306 | volume = video.volume + 0.09; 307 | 308 | if (volume < 1) { 309 | video.volume = volume; 310 | 311 | setTimeout(function () { 312 | self._fadeInSound(video, duration); 313 | }, delay); 314 | } 315 | }, 316 | 317 | _options: function (key, i) { 318 | if (i === undefined) { 319 | i = this.slide; 320 | } 321 | 322 | if (this.settings.slides[i][key] !== undefined) { 323 | return this.settings.slides[i][key]; 324 | } 325 | 326 | return this.settings[key]; 327 | }, 328 | 329 | _goto: function (nb) { 330 | if (typeof this.settings.slides[nb] === 'undefined') { 331 | nb = 0; 332 | } 333 | 334 | this.slide = nb; 335 | 336 | var $slide, 337 | $inner, 338 | $video, 339 | $slides = this.$elmt.children('.vegas-slide'), 340 | src = this.settings.slides[nb].src, 341 | videoSettings = this.settings.slides[nb].video, 342 | delay = this._options('delay'), 343 | align = this._options('align'), 344 | valign = this._options('valign'), 345 | cover = this._options('cover'), 346 | color = this._options('color') || this.$elmt.css('background-color'), 347 | self = this, 348 | total = $slides.length, 349 | video, 350 | img; 351 | 352 | var transition = this._options('transition'), 353 | transitionDuration = this._options('transitionDuration'), 354 | animation = this._options('animation'), 355 | animationDuration = this._options('animationDuration'); 356 | 357 | if (this.settings.firstTransition && this.first) { 358 | transition = this.settings.firstTransition || transition; 359 | } 360 | 361 | if (this.settings.firstTransitionDuration && this.first) { 362 | transitionDuration = this.settings.firstTransitionDuration || transitionDuration; 363 | } 364 | 365 | if (this.first) { 366 | this.first = false; 367 | } 368 | 369 | if (cover !== 'repeat') { 370 | if (cover === true) { 371 | cover = 'cover'; 372 | } else if (cover === false) { 373 | cover = 'contain'; 374 | } 375 | } 376 | 377 | if (transition === 'random' || transition instanceof Array) { 378 | if (transition instanceof Array) { 379 | transition = this._random(transition); 380 | } else { 381 | transition = this._random(this.transitions); 382 | } 383 | } 384 | 385 | if (animation === 'random' || animation instanceof Array) { 386 | if (animation instanceof Array) { 387 | animation = this._random(animation); 388 | } else { 389 | animation = this._random(this.animations); 390 | } 391 | } 392 | 393 | if (transitionDuration === 'auto' || transitionDuration > delay) { 394 | transitionDuration = delay; 395 | } 396 | 397 | if (animationDuration === 'auto') { 398 | animationDuration = delay; 399 | } 400 | 401 | $slide = $('
'); 402 | 403 | if (this.support.transition && transition) { 404 | $slide.addClass('vegas-transition-' + transition); 405 | } 406 | 407 | // Video 408 | 409 | if (videoSettings) { 410 | if (videoSettings instanceof Array) { 411 | video = this._video(videoSettings); 412 | } else { 413 | video = this._video(videoSettings.src); 414 | } 415 | 416 | video.loop = videoSettings.loop !== undefined ? videoSettings.loop : true; 417 | video.muted = videoSettings.muted !== undefined ? videoSettings.muted : true; 418 | 419 | if (video.muted === false) { 420 | video.volume = 0; 421 | this._fadeInSound(video, transitionDuration); 422 | } else { 423 | video.pause(); 424 | } 425 | 426 | $video = $(video) 427 | .addClass('vegas-video') 428 | .css('background-color', color); 429 | 430 | if (this.support.objectFit) { 431 | $video 432 | .css('object-position', align + ' ' + valign) 433 | .css('object-fit', cover) 434 | .css('width', '100%') 435 | .css('height', '100%'); 436 | } else if (cover === 'contain') { 437 | $video 438 | .css('width', '100%') 439 | .css('height', '100%'); 440 | } 441 | 442 | $slide.append($video); 443 | 444 | // Image 445 | 446 | } else { 447 | img = new Image(); 448 | 449 | $inner = $('
') 450 | .css('background-image', 'url("' + src + '")') 451 | .css('background-color', color) 452 | .css('background-position', align + ' ' + valign); 453 | 454 | if (cover === 'repeat') { 455 | $inner.css('background-repeat', 'repeat'); 456 | } else { 457 | $inner.css('background-size', cover); 458 | } 459 | 460 | if (this.support.transition && animation) { 461 | $inner 462 | .addClass('vegas-animation-' + animation) 463 | .css('animation-duration', animationDuration + 'ms'); 464 | } 465 | 466 | $slide.append($inner); 467 | } 468 | 469 | if (!this.support.transition) { 470 | $slide.css('display', 'none'); 471 | } 472 | 473 | if (total) { 474 | $slides.eq(total - 1).after($slide); 475 | } else { 476 | this.$elmt.prepend($slide); 477 | } 478 | 479 | $slides 480 | .css('transition', 'all 0ms') 481 | .each(function () { 482 | this.className = 'vegas-slide'; 483 | 484 | if (this.tagName === 'VIDEO') { 485 | this.className += ' vegas-video'; 486 | } 487 | 488 | if (transition) { 489 | this.className += ' vegas-transition-' + transition; 490 | this.className += ' vegas-transition-' + transition + '-in'; 491 | } 492 | } 493 | ); 494 | 495 | self._timer(false); 496 | 497 | function go () { 498 | self._timer(true); 499 | 500 | setTimeout(function () { 501 | if (transition) { 502 | if (self.support.transition) { 503 | $slides 504 | .css('transition', 'all ' + transitionDuration + 'ms') 505 | .addClass('vegas-transition-' + transition + '-out'); 506 | 507 | $slides.each(function () { 508 | var video = $slides.find('video').get(0); 509 | 510 | if (video) { 511 | video.volume = 1; 512 | self._fadeOutSound(video, transitionDuration); 513 | } 514 | }); 515 | 516 | $slide 517 | .css('transition', 'all ' + transitionDuration + 'ms') 518 | .addClass('vegas-transition-' + transition + '-in'); 519 | } else { 520 | $slide.fadeIn(transitionDuration); 521 | } 522 | } 523 | 524 | for (var i = 0; i < $slides.length - self.settings.slidesToKeep; i++) { 525 | $slides.eq(i).remove(); 526 | } 527 | 528 | self.trigger('walk'); 529 | self._slideShow(); 530 | }, 100); 531 | } 532 | if (video) { 533 | if (video.readyState === 4) { 534 | video.currentTime = 0; 535 | } 536 | 537 | video.play(); 538 | go(); 539 | } else { 540 | img.src = src; 541 | 542 | if (img.complete) { 543 | go(); 544 | } else { 545 | img.onload = go; 546 | } 547 | } 548 | }, 549 | 550 | _end: function () { 551 | this.ended = !this.settings.autoplay; 552 | this._timer(false); 553 | this.trigger('end'); 554 | }, 555 | 556 | shuffle: function () { 557 | var temp, 558 | rand; 559 | 560 | for (var i = this.total - 1; i > 0; i--) { 561 | rand = Math.floor(Math.random() * (i + 1)); 562 | temp = this.settings.slides[i]; 563 | 564 | this.settings.slides[i] = this.settings.slides[rand]; 565 | this.settings.slides[rand] = temp; 566 | } 567 | }, 568 | 569 | play: function () { 570 | if (this.paused) { 571 | this.paused = false; 572 | this.next(); 573 | this.trigger('play'); 574 | } 575 | }, 576 | 577 | pause: function () { 578 | this._timer(false); 579 | this.paused = true; 580 | this.trigger('pause'); 581 | }, 582 | 583 | toggle: function () { 584 | if (this.paused) { 585 | this.play(); 586 | } else { 587 | this.pause(); 588 | } 589 | }, 590 | 591 | playing: function () { 592 | return !this.paused && !this.noshow; 593 | }, 594 | 595 | current: function (advanced) { 596 | if (advanced) { 597 | return { 598 | slide: this.slide, 599 | data: this.settings.slides[this.slide] 600 | }; 601 | } 602 | return this.slide; 603 | }, 604 | 605 | jump: function (nb) { 606 | if (nb < 0 || nb > this.total - 1 || nb === this.slide) { 607 | return; 608 | } 609 | 610 | this.slide = nb; 611 | this._goto(this.slide); 612 | }, 613 | 614 | next: function () { 615 | this.slide++; 616 | 617 | if (this.slide >= this.total) { 618 | if (!this.settings.loop) { 619 | return this._end(); 620 | } 621 | 622 | this.slide = 0; 623 | } 624 | 625 | this._goto(this.slide); 626 | }, 627 | 628 | previous: function () { 629 | this.slide--; 630 | 631 | if (this.slide < 0) { 632 | if (!this.settings.loop) { 633 | this.slide++; 634 | return; 635 | } else { 636 | this.slide = this.total - 1; 637 | } 638 | } 639 | 640 | this._goto(this.slide); 641 | }, 642 | 643 | trigger: function (fn) { 644 | var params = []; 645 | 646 | if (fn === 'init') { 647 | params = [ this.settings ]; 648 | } else { 649 | params = [ 650 | this.slide, 651 | this.settings.slides[this.slide] 652 | ]; 653 | } 654 | 655 | this.$elmt.trigger('vegas' + fn, params); 656 | 657 | if (typeof this.settings[fn] === 'function') { 658 | this.settings[fn].apply(this.$elmt, params); 659 | } 660 | }, 661 | 662 | options: function (key, value) { 663 | var oldSlides = this.settings.slides.slice(); 664 | 665 | if (typeof key === 'object') { 666 | this.settings = $.extend({}, defaults, $.vegas.defaults, key); 667 | } else if (typeof key === 'string') { 668 | if (value === undefined) { 669 | return this.settings[key]; 670 | } 671 | this.settings[key] = value; 672 | } else { 673 | return this.settings; 674 | } 675 | 676 | // In case slides have changed 677 | if (this.settings.slides !== oldSlides) { 678 | this.total = this.settings.slides.length; 679 | this.noshow = this.total < 2; 680 | this._preload(); 681 | } 682 | }, 683 | 684 | destroy: function () { 685 | clearTimeout(this.timeout); 686 | 687 | this.$elmt.removeClass('vegas-container'); 688 | this.$elmt.find('> .vegas-slide').remove(); 689 | this.$elmt.find('> .vegas-wrapper').clone(true).children().appendTo(this.$elmt); 690 | this.$elmt.find('> .vegas-wrapper').remove(); 691 | 692 | if (this.settings.timer) { 693 | this.$timer.remove(); 694 | } 695 | 696 | if (this.settings.overlay) { 697 | this.$overlay.remove(); 698 | } 699 | 700 | this.elmt._vegas = null; 701 | } 702 | }; 703 | 704 | $.fn.vegas = function(options) { 705 | var args = arguments, 706 | error = false, 707 | returns; 708 | 709 | if (options === undefined || typeof options === 'object') { 710 | return this.each(function () { 711 | if (!this._vegas) { 712 | this._vegas = new Vegas(this, options); 713 | } 714 | }); 715 | } else if (typeof options === 'string') { 716 | this.each(function () { 717 | var instance = this._vegas; 718 | 719 | if (!instance) { 720 | throw new Error('No Vegas applied to this element.'); 721 | } 722 | 723 | if (typeof instance[options] === 'function' && options[0] !== '_') { 724 | returns = instance[options].apply(instance, [].slice.call(args, 1)); 725 | } else { 726 | error = true; 727 | } 728 | }); 729 | 730 | if (error) { 731 | throw new Error('No method "' + options + '" in Vegas.'); 732 | } 733 | 734 | return returns !== undefined ? returns : this; 735 | } 736 | }; 737 | 738 | $.vegas = {}; 739 | $.vegas.defaults = defaults; 740 | 741 | $.vegas.isVideoCompatible = function () { 742 | return true; 743 | }; 744 | 745 | })(window.jQuery || window.Zepto || window.m4q); 746 | --------------------------------------------------------------------------------