Lines Matching +full:i +full:- +full:mobile
2 * DHTML Snowstorm! JavaScript-based snow for web pages
4 * -----------------------------------------------------------
16 // --- common properties ---
19 …this.excludeMobile = true; // Snow is likely to be bad news for mobile phones' CPUs (and batt…
23 this.useGPU = true; // Enable transform-based hardware acceleration, reduce CPU load.
25 …this.excludeMobile = true; // Snow is likely to be bad news for mobile phones' CPUs (and batt…
26 …this.flakeBottom = null; // Integer for Y axis snow limit, 0 or null for "full-screen" snow…
31 …null; // element which snow will be appended to (null = document.body) - can be an element ID…
34 …shift vertically when scrolling. May increase CPU load, disabled by default - if enabled, used onl…
35 …lse; // Whether to use pixel values for snow top/left vs. percentages. Auto-enabled if body is po…
37 // --- less-used bits ---
48 // --- "No user-serviceable parts inside" past this point, yadda yadda ---
53 isIE = navigator.userAgent.match(/msie/i),
54 isIE6 = navigator.userAgent.match(/msie 6/i),
55 isMobile = navigator.userAgent.match(/mobile|opera m(ob|in)/i),
81 * http://paulirish.com/2011/requestanimationframe-for-smart-animating/
117 ie: has('-ms-transform'),
158 o.style.left = (x - storm.flakeWidth) + 'px';
159 o.style.top = (y - storm.flakeHeight) + 'px';
163 o.style.right = (100-(x/screenX*100)) + '%';
165 o.style.top = (Math.min(y, docHeight-storm.flakeHeight)) + 'px';
172 o.style.right = (100-(x/screenX*100)) + '%';
173 o.style.bottom = (100-(y/screenY*100)) + '%';
178 o.style.right = (100-(x/screenX*100)) + '%';
179 o.style.top = (Math.min(y, docHeight-storm.flakeHeight)) + 'px';
241 return (parseInt(rnd(2),10)===1?n*-1:n);
245 var i;
249 for (i=0; i<this.flakes.length; i++) {
250 if (this.flakes[i].active) {
251 this.flakes[i].setVelocities();
258 var i;
265 for (i=0; i<storm.flakes.length; i++) {
266 if (storm.flakes[i].active === 0) {
267 storm.flakes[i].stick();
275 screenX = window.innerWidth - 16 - storm.flakeRightOffset;
278 …ntWidth || document.body.clientWidth || document.body.scrollWidth) - (!isIE ? 8 : 0) - storm.flake…
286 screenX = storm.targetElement.offsetWidth - storm.flakeRightOffset;
328 var i;
330 for (i=0; i<this.flakes.length; i++) {
331 this.flakes[i].o.style.display = 'none';
347 var i;
348 for (i=0; i<this.flakes.length; i++) {
349 this.flakes[i].o.style.display = 'block';
356 this.x = x||parseInt(rnd(screenX-20),10);
357 this.y = (!isNaN(y)?y:-rnd(screenY)-12);
377 // GPU-accelerated snow.
399 s.o.style.top = (screenY+scrollY-storm.flakeHeight)+'px';
414 } else if (s.vX<0 && s.vX>-0.2) {
415 s.vX = -0.2;
426 if (s.x >= screenX || screenX-s.x < storm.flakeWidth) { // X-axis scroll check
428 } else if (vX < 0 && s.x-storm.flakeLeftOffset < -storm.flakeWidth) {
429 s.x = screenX-storm.flakeWidth-1; // flakeWidth;
432 yDiff = screenY+scrollY-s.y+storm.flakeHeight;
442 // ~1/1000 chance of melting mid-air, with each frame
454 s.twinkleFrame--;
489 s.o.style.fontSize = s.fontSize-(s.fontSize*(s.meltFrame/s.meltFrameCount))+'px';
513 s.x = parseInt(rnd(screenX-storm.flakeWidth-20),10);
514 s.y = parseInt(rnd(screenY)*-1,10)-storm.flakeHeight;
526 var active = 0, flake = null, i, j;
527 for (i=0, j=storm.flakes.length; i<j; i++) {
528 if (storm.flakes[i].active === 1) {
529 storm.flakes[i].move();
532 if (storm.flakes[i].melting) {
533 storm.flakes[i].melt();
553 windOffset = -windMultiplier+(x/screenX2*windMultiplier);
555 x -= screenX2;
561 var i;
562 for (i=0; i<limit; i++) {
564 if (allowInactive || i>storm.flakesMaxActive) {
565 storm.flakes[storm.flakes.length-1].active = -1;
577 var i;
578 for (i=0; i<storm.meltFrameCount; i++) {
579 storm.meltFrames.push(1-(i/storm.meltFrameCount));
621 // re-map handler to get element instead of screen dimensions
623 //and force-enable pixel positioning
629 … // attempt to determine if body or user-specified snow parent element is relatlively-positioned.