├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── demo.html └── screen.nw ├── css ├── normalize.css └── style.css ├── images ├── LICENSE-PHOTOS.txt ├── demo1.jpg ├── demo2.jpg ├── demo3.jpg ├── demo4.jpg └── demo5.jpg ├── index.html ├── js ├── app.js ├── background-blur.0.1.3.min.js ├── exif.js ├── grade.1.0.10.min.js ├── imagesloaded.pkgd.min.js ├── jquery-imagefill.js └── jquery.3.1.1.min.js └── package.json /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | 46 | [Dd]ebug/ 47 | [Rr]elease/ 48 | x64/ 49 | build/ 50 | [Bb]in/ 51 | [Oo]bj/ 52 | 53 | # MSTest test Results 54 | [Tt]est[Rr]esult*/ 55 | [Bb]uild[Ll]og.* 56 | 57 | *_i.c 58 | *_p.c 59 | *.ilk 60 | *.meta 61 | *.obj 62 | *.pch 63 | *.pdb 64 | *.pgc 65 | *.pgd 66 | *.rsp 67 | *.sbr 68 | *.tlb 69 | *.tli 70 | *.tlh 71 | *.tmp 72 | *.tmp_proj 73 | *.log 74 | *.vspscc 75 | *.vssscc 76 | .builds 77 | *.pidb 78 | *.log 79 | *.scc 80 | 81 | # Visual C++ cache files 82 | ipch/ 83 | *.aps 84 | *.ncb 85 | *.opensdf 86 | *.sdf 87 | *.cachefile 88 | 89 | # Visual Studio profiler 90 | *.psess 91 | *.vsp 92 | *.vspx 93 | 94 | # Guidance Automation Toolkit 95 | *.gpState 96 | 97 | # ReSharper is a .NET coding add-in 98 | _ReSharper*/ 99 | *.[Rr]e[Ss]harper 100 | 101 | # TeamCity is a build add-in 102 | _TeamCity* 103 | 104 | # DotCover is a Code Coverage Tool 105 | *.dotCover 106 | 107 | # NCrunch 108 | *.ncrunch* 109 | .*crunch*.local.xml 110 | 111 | # Installshield output folder 112 | [Ee]xpress/ 113 | 114 | # DocProject is a documentation generator add-in 115 | DocProject/buildhelp/ 116 | DocProject/Help/*.HxT 117 | DocProject/Help/*.HxC 118 | DocProject/Help/*.hhc 119 | DocProject/Help/*.hhk 120 | DocProject/Help/*.hhp 121 | DocProject/Help/Html2 122 | DocProject/Help/html 123 | 124 | # Click-Once directory 125 | publish/ 126 | 127 | # Publish Web Output 128 | *.Publish.xml 129 | *.pubxml 130 | 131 | # NuGet Packages Directory 132 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 133 | #packages/ 134 | 135 | # Windows Azure Build Output 136 | csx 137 | *.build.csdef 138 | 139 | # Windows Store app package directory 140 | AppPackages/ 141 | 142 | # Others 143 | sql/ 144 | *.Cache 145 | ClientBin/ 146 | [Ss]tyle[Cc]op.* 147 | ~$* 148 | *~ 149 | *.dbmdl 150 | *.[Pp]ublish.xml 151 | *.pfx 152 | *.publishsettings 153 | 154 | # RIA/Silverlight projects 155 | Generated_Code/ 156 | 157 | # Backup & report files from converting an old project file to a newer 158 | # Visual Studio version. Backup files are not needed, because we have git ;-) 159 | _UpgradeReport_Files/ 160 | Backup*/ 161 | UpgradeLog*.XML 162 | UpgradeLog*.htm 163 | 164 | # SQL Server files 165 | App_Data/*.mdf 166 | App_Data/*.ldf 167 | 168 | ############# 169 | ## Windows detritus 170 | ############# 171 | 172 | # Windows image file caches 173 | Thumbs.db 174 | ehthumbs.db 175 | 176 | # Folder config file 177 | Desktop.ini 178 | 179 | # Recycle Bin used on file shares 180 | $RECYCLE.BIN/ 181 | 182 | # Mac crap 183 | .DS_Store 184 | 185 | 186 | ############# 187 | ## Python 188 | ############# 189 | 190 | *.py[co] 191 | 192 | # Packages 193 | *.egg 194 | *.egg-info 195 | dist/ 196 | build/ 197 | eggs/ 198 | parts/ 199 | var/ 200 | sdist/ 201 | develop-eggs/ 202 | .installed.cfg 203 | 204 | # Installer logs 205 | pip-log.txt 206 | 207 | # Unit test / coverage reports 208 | .coverage 209 | .tox 210 | 211 | #Translations 212 | *.mo 213 | 214 | #Mr Developer 215 | .mr.developer.cfg 216 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Marco Krage http://marco.mit-license.org/ 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # html5-screensaver-node-webkit 2 | 3 | > Screensaver made with HTML5, CSS, Javascript and NodeJS driven by [nwjs](https://github.com/nwjs/nw.js) (node-webkit) 4 | 5 | Demo: https://sinky.github.io/html5-screensaver-node-webkit/demo.html 6 | 7 | ## Usage 8 | Download [node-webkit](http://nwjs.io/) and rename the folder to nwjs and move it into the same folder where the ``screen.nw`` folder is located. 9 | 10 | Run ``.\nwjs\nw.exe screen.nw`` from within this directory to test the screensaver. 11 | 12 | Folder structure: 13 | |- screen.nw/ 14 | |- nwjs/ 15 | 16 | 17 | ## Windows Screensaver 18 | Use "runscreensaver" as an Windows Screensaver. "runscreensaver" can be configured to run a command as screensaver. 19 | https://github.com/sinky/runscreensaver 20 | 21 | 22 | ## License 23 | MIT http://marco.mit-license.org/ 24 | -------------------------------------------------------------------------------- /demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Screensaver Demo 7 | 8 | 9 | 10 | 63 | 64 | 65 | 66 |
67 |
68 |
69 | 70 |
71 |
72 |
73 |
74 |
75 | 76 | 77 | -------------------------------------------------------------------------------- /screen.nw/css/normalize.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v2.1.0 | MIT License | git.io/normalize */ 2 | 3 | /* ========================================================================== 4 | HTML5 display definitions 5 | ========================================================================== */ 6 | 7 | /** 8 | * Correct `block` display not defined in IE 8/9. 9 | */ 10 | 11 | article, 12 | aside, 13 | details, 14 | figcaption, 15 | figure, 16 | footer, 17 | header, 18 | hgroup, 19 | main, 20 | nav, 21 | section, 22 | summary { 23 | display: block; 24 | } 25 | 26 | /** 27 | * Correct `inline-block` display not defined in IE 8/9. 28 | */ 29 | 30 | audio, 31 | canvas, 32 | video { 33 | display: inline-block; 34 | } 35 | 36 | /** 37 | * Prevent modern browsers from displaying `audio` without controls. 38 | * Remove excess height in iOS 5 devices. 39 | */ 40 | 41 | audio:not([controls]) { 42 | display: none; 43 | height: 0; 44 | } 45 | 46 | /** 47 | * Address styling not present in IE 8/9. 48 | */ 49 | 50 | [hidden] { 51 | display: none; 52 | } 53 | 54 | /* ========================================================================== 55 | Base 56 | ========================================================================== */ 57 | 58 | /** 59 | * 1. Set default font family to sans-serif. 60 | * 2. Prevent iOS text size adjust after orientation change, without disabling 61 | * user zoom. 62 | */ 63 | 64 | html { 65 | font-family: sans-serif; /* 1 */ 66 | -webkit-text-size-adjust: 100%; /* 2 */ 67 | -ms-text-size-adjust: 100%; /* 2 */ 68 | } 69 | 70 | /** 71 | * Remove default margin. 72 | */ 73 | 74 | body { 75 | margin: 0; 76 | } 77 | 78 | /* ========================================================================== 79 | Links 80 | ========================================================================== */ 81 | 82 | /** 83 | * Address `outline` inconsistency between Chrome and other browsers. 84 | */ 85 | 86 | a:focus { 87 | outline: thin dotted; 88 | } 89 | 90 | /** 91 | * Improve readability when focused and also mouse hovered in all browsers. 92 | */ 93 | 94 | a:active, 95 | a:hover { 96 | outline: 0; 97 | } 98 | 99 | /* ========================================================================== 100 | Typography 101 | ========================================================================== */ 102 | 103 | /** 104 | * Address variable `h1` font-size and margin within `section` and `article` 105 | * contexts in Firefox 4+, Safari 5, and Chrome. 106 | */ 107 | 108 | h1 { 109 | font-size: 2em; 110 | margin: 0.67em 0; 111 | } 112 | 113 | /** 114 | * Address styling not present in IE 8/9, Safari 5, and Chrome. 115 | */ 116 | 117 | abbr[title] { 118 | border-bottom: 1px dotted; 119 | } 120 | 121 | /** 122 | * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome. 123 | */ 124 | 125 | b, 126 | strong { 127 | font-weight: bold; 128 | } 129 | 130 | /** 131 | * Address styling not present in Safari 5 and Chrome. 132 | */ 133 | 134 | dfn { 135 | font-style: italic; 136 | } 137 | 138 | /** 139 | * Address differences between Firefox and other browsers. 140 | */ 141 | 142 | hr { 143 | -moz-box-sizing: content-box; 144 | box-sizing: content-box; 145 | height: 0; 146 | } 147 | 148 | /** 149 | * Address styling not present in IE 8/9. 150 | */ 151 | 152 | mark { 153 | background: #ff0; 154 | color: #000; 155 | } 156 | 157 | /** 158 | * Correct font family set oddly in Safari 5 and Chrome. 159 | */ 160 | 161 | code, 162 | kbd, 163 | pre, 164 | samp { 165 | font-family: monospace, serif; 166 | font-size: 1em; 167 | } 168 | 169 | /** 170 | * Improve readability of pre-formatted text in all browsers. 171 | */ 172 | 173 | pre { 174 | white-space: pre-wrap; 175 | } 176 | 177 | /** 178 | * Set consistent quote types. 179 | */ 180 | 181 | q { 182 | quotes: "\201C" "\201D" "\2018" "\2019"; 183 | } 184 | 185 | /** 186 | * Address inconsistent and variable font size in all browsers. 187 | */ 188 | 189 | small { 190 | font-size: 80%; 191 | } 192 | 193 | /** 194 | * Prevent `sub` and `sup` affecting `line-height` in all browsers. 195 | */ 196 | 197 | sub, 198 | sup { 199 | font-size: 75%; 200 | line-height: 0; 201 | position: relative; 202 | vertical-align: baseline; 203 | } 204 | 205 | sup { 206 | top: -0.5em; 207 | } 208 | 209 | sub { 210 | bottom: -0.25em; 211 | } 212 | 213 | /* ========================================================================== 214 | Embedded content 215 | ========================================================================== */ 216 | 217 | /** 218 | * Remove border when inside `a` element in IE 8/9. 219 | */ 220 | 221 | img { 222 | border: 0; 223 | } 224 | 225 | /** 226 | * Correct overflow displayed oddly in IE 9. 227 | */ 228 | 229 | svg:not(:root) { 230 | overflow: hidden; 231 | } 232 | 233 | /* ========================================================================== 234 | Figures 235 | ========================================================================== */ 236 | 237 | /** 238 | * Address margin not present in IE 8/9 and Safari 5. 239 | */ 240 | 241 | figure { 242 | margin: 0; 243 | } 244 | 245 | /* ========================================================================== 246 | Forms 247 | ========================================================================== */ 248 | 249 | /** 250 | * Define consistent border, margin, and padding. 251 | */ 252 | 253 | fieldset { 254 | border: 1px solid #c0c0c0; 255 | margin: 0 2px; 256 | padding: 0.35em 0.625em 0.75em; 257 | } 258 | 259 | /** 260 | * 1. Correct `color` not being inherited in IE 8/9. 261 | * 2. Remove padding so people aren't caught out if they zero out fieldsets. 262 | */ 263 | 264 | legend { 265 | border: 0; /* 1 */ 266 | padding: 0; /* 2 */ 267 | } 268 | 269 | /** 270 | * 1. Correct font family not being inherited in all browsers. 271 | * 2. Correct font size not being inherited in all browsers. 272 | * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome. 273 | */ 274 | 275 | button, 276 | input, 277 | select, 278 | textarea { 279 | font-family: inherit; /* 1 */ 280 | font-size: 100%; /* 2 */ 281 | margin: 0; /* 3 */ 282 | } 283 | 284 | /** 285 | * Address Firefox 4+ setting `line-height` on `input` using `!important` in 286 | * the UA stylesheet. 287 | */ 288 | 289 | button, 290 | input { 291 | line-height: normal; 292 | } 293 | 294 | /** 295 | * Address inconsistent `text-transform` inheritance for `button` and `select`. 296 | * All other form control elements do not inherit `text-transform` values. 297 | * Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+. 298 | * Correct `select` style inheritance in Firefox 4+ and Opera. 299 | */ 300 | 301 | button, 302 | select { 303 | text-transform: none; 304 | } 305 | 306 | /** 307 | * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` 308 | * and `video` controls. 309 | * 2. Correct inability to style clickable `input` types in iOS. 310 | * 3. Improve usability and consistency of cursor style between image-type 311 | * `input` and others. 312 | */ 313 | 314 | button, 315 | html input[type="button"], /* 1 */ 316 | input[type="reset"], 317 | input[type="submit"] { 318 | -webkit-appearance: button; /* 2 */ 319 | cursor: pointer; /* 3 */ 320 | } 321 | 322 | /** 323 | * Re-set default cursor for disabled elements. 324 | */ 325 | 326 | button[disabled], 327 | html input[disabled] { 328 | cursor: default; 329 | } 330 | 331 | /** 332 | * 1. Address box sizing set to `content-box` in IE 8/9. 333 | * 2. Remove excess padding in IE 8/9. 334 | */ 335 | 336 | input[type="checkbox"], 337 | input[type="radio"] { 338 | box-sizing: border-box; /* 1 */ 339 | padding: 0; /* 2 */ 340 | } 341 | 342 | /** 343 | * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. 344 | * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome 345 | * (include `-moz` to future-proof). 346 | */ 347 | 348 | input[type="search"] { 349 | -webkit-appearance: textfield; /* 1 */ 350 | -moz-box-sizing: content-box; 351 | -webkit-box-sizing: content-box; /* 2 */ 352 | box-sizing: content-box; 353 | } 354 | 355 | /** 356 | * Remove inner padding and search cancel button in Safari 5 and Chrome 357 | * on OS X. 358 | */ 359 | 360 | input[type="search"]::-webkit-search-cancel-button, 361 | input[type="search"]::-webkit-search-decoration { 362 | -webkit-appearance: none; 363 | } 364 | 365 | /** 366 | * Remove inner padding and border in Firefox 4+. 367 | */ 368 | 369 | button::-moz-focus-inner, 370 | input::-moz-focus-inner { 371 | border: 0; 372 | padding: 0; 373 | } 374 | 375 | /** 376 | * 1. Remove default vertical scrollbar in IE 8/9. 377 | * 2. Improve readability and alignment in all browsers. 378 | */ 379 | 380 | textarea { 381 | overflow: auto; /* 1 */ 382 | vertical-align: top; /* 2 */ 383 | } 384 | 385 | /* ========================================================================== 386 | Tables 387 | ========================================================================== */ 388 | 389 | /** 390 | * Remove most spacing between table cells. 391 | */ 392 | 393 | table { 394 | border-collapse: collapse; 395 | border-spacing: 0; 396 | } 397 | -------------------------------------------------------------------------------- /screen.nw/css/style.css: -------------------------------------------------------------------------------- 1 | * { cursor: none; } 2 | 3 | html, body , #slides, .photo, .image { 4 | height: 100%; 5 | width: 100%; 6 | margin: 0; 7 | padding: 0; 8 | overflow: hidden; 9 | } 10 | 11 | body { 12 | background: #000; 13 | } 14 | 15 | #statusPause { 16 | position: absolute; 17 | z-index: 100; 18 | display: inline-block; 19 | font-weight: bold; 20 | font-size: 30px; 21 | letter-spacing: 5px; 22 | color: #fff; 23 | text-shadow: 0 0 5px #000; 24 | padding: 0 5px 0 8px; 25 | margin: 5px; 26 | background: rgba(255,255,255,0.3); 27 | border-radius: 3px; 28 | } 29 | 30 | .hide { 31 | display: none!important; 32 | } 33 | 34 | #debug { 35 | position: absolute; 36 | top: 0; 37 | z-index: 9999; 38 | } 39 | 40 | #slides { 41 | text-align: center; 42 | } 43 | 44 | .photo { 45 | opacity: 0; 46 | position: absolute; 47 | /* CSS animation defined in JS */ 48 | } 49 | 50 | .photo .bg-css3blur, 51 | .photo .bg-svgblur { 52 | position: absolute; 53 | top: 0; 54 | left: 0; 55 | z-index: -1; 56 | } 57 | 58 | .photo .bg-css3blur { 59 | background-size: cover; 60 | background-position: 50% 50%; 61 | filter: blur(20px) opacity(0.5); 62 | height: 100%; 63 | width: 100%; 64 | transform: scale(1.05); 65 | } 66 | 67 | .photo .bg-svgblur { 68 | filter: opacity(0.5); 69 | } 70 | 71 | .photo.portrait .image img { 72 | height: 100%; 73 | } 74 | 75 | .photo .exif { 76 | position: absolute; 77 | bottom: 0; 78 | left: 0; 79 | color: #fff; 80 | background: rgba(0,0,0,0.5); 81 | padding: 5px 8px; 82 | opacity: .5; 83 | font-size: 80%; 84 | } 85 | 86 | .photo .map { 87 | position: absolute; 88 | bottom: 0; 89 | right: 0; 90 | z-index: 100; 91 | } 92 | 93 | .photo .map img { 94 | vertical-align: middle; 95 | } 96 | 97 | .visible { 98 | opacity: 1; 99 | } 100 | 101 | .fadeIn { 102 | opacity: 1; 103 | z-index: 10; 104 | } -------------------------------------------------------------------------------- /screen.nw/images/LICENSE-PHOTOS.txt: -------------------------------------------------------------------------------- 1 | Images by http://unsplash.com/ 2 | Free (http://creativecommons.org/choose/zero/) hi-resolution photos. 3 | -------------------------------------------------------------------------------- /screen.nw/images/demo1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sinky/html5-screensaver-node-webkit/bfb9358f99593442d1946332f95e1d5d9796e6d9/screen.nw/images/demo1.jpg -------------------------------------------------------------------------------- /screen.nw/images/demo2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sinky/html5-screensaver-node-webkit/bfb9358f99593442d1946332f95e1d5d9796e6d9/screen.nw/images/demo2.jpg -------------------------------------------------------------------------------- /screen.nw/images/demo3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sinky/html5-screensaver-node-webkit/bfb9358f99593442d1946332f95e1d5d9796e6d9/screen.nw/images/demo3.jpg -------------------------------------------------------------------------------- /screen.nw/images/demo4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sinky/html5-screensaver-node-webkit/bfb9358f99593442d1946332f95e1d5d9796e6d9/screen.nw/images/demo4.jpg -------------------------------------------------------------------------------- /screen.nw/images/demo5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sinky/html5-screensaver-node-webkit/bfb9358f99593442d1946332f95e1d5d9796e6d9/screen.nw/images/demo5.jpg -------------------------------------------------------------------------------- /screen.nw/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Screensaver 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
II
17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /screen.nw/js/app.js: -------------------------------------------------------------------------------- 1 | var debug = false; 2 | var scr = { 3 | imageDir: 'images/', 4 | random: true, 5 | animation: { 6 | duration: 6000, 7 | fade: 3000 8 | }, 9 | portraitBackground: 'css3blur', // Options: svgblur, css3blur or gradient 10 | exif: { 11 | showData: true, 12 | showMap: false 13 | } 14 | }; 15 | var googleStaticMapsURL = 'http://maps.googleapis.com/maps/api/staticmap?center={{center}}&zoom=2&scale=1&size=350x150&maptype=roadmap&format=png&visual_refresh=true&markers=size:tiny%7Ccolor:0x019cef%7Clabel:%7C{{center}}'; 16 | 17 | var slideInterval, playing; 18 | var mouseDelta = {}; 19 | 20 | var isNode = (typeof process !== "undefined" && typeof require !== "undefined"); 21 | var isNodeWebkit = (function() { 22 | if(isNode) { 23 | try { 24 | return (typeof require('nw.gui') !== "undefined"); 25 | } catch(e) { 26 | return false; 27 | } 28 | }else{ 29 | return false; 30 | } 31 | })(); 32 | 33 | if(isNodeWebkit) { 34 | var win = nw.Window.get(); 35 | var app = nw.App; 36 | 37 | // debug 38 | if(app.fullArgv.indexOf('--debug') != -1){ 39 | debug = true; 40 | win.leaveKioskMode(); 41 | win.showDevTools(); 42 | console.log('win', win); 43 | } 44 | 45 | // Try to get files vom scr.imageDir with nodejs 46 | try { 47 | var fs = require('fs'); 48 | scr.images = fs.readdirSync("./"+scr.imageDir); 49 | console.log("Readdir", scr.images); 50 | // filter only images 51 | scr.images = scr.images.filter(function(el){ 52 | return checkExtension(el, 'jpg,jpeg,png,gif'); 53 | }); 54 | 55 | // Prepend imageDir Path 56 | scr.images = scr.images.map(function(e) { 57 | return scr.imageDir + e; 58 | }); 59 | 60 | console.log("Readdir filtered", scr.images); 61 | }catch(e) { 62 | alert(e); 63 | } 64 | }else{ 65 | // no NWSJ using demo images 66 | scr.images = [ 67 | 'images/demo1.jpg', 68 | 'images/demo2.jpg', 69 | 'images/demo3.jpg', 70 | 'images/demo4.jpg', 71 | 'images/demo5.jpg' 72 | ]; 73 | } 74 | 75 | if(scr.images.length < 1) { 76 | alert('Keine Fotos im Ordner ' + './' + scr.imageDir + ' gefunden.'); 77 | } 78 | 79 | jQuery(function($){ 80 | // Add Transition CSS dynamicly 81 | $('