Lines Matching +full:x +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 ---
44 this.vMaxX = 5; // Maximum X velocity range for snow
48 // --- "No user-serviceable parts inside" past this point, yadda yadda ---
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'),
150 this.setXY = function(o, x, y) { argument
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);
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;
353 this.SnowFlake = function(type,x,y) { argument
356 this.x = x||parseInt(rnd(screenX-20),10);
357 this.y = (!isNaN(y)?y:-rnd(screenY)-12);
377 // GPU-accelerated snow.
390 if (isNaN(s.x) || isNaN(s.y)) {
394 storm.setXY(s.o, s.x, s.y);
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;
424 s.x += vX;
426 if (s.x >= screenX || screenX-s.x < storm.flakeWidth) { // X-axis scroll check
427 s.x = 0;
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;
520 this.recycle(); // set up x/y coords etc.
551 var x = parseInt(e.clientX,10);
552 if (x<screenX2) {
553 windOffset = -windMultiplier+(x/screenX2*windMultiplier);
555 x -= screenX2;
556 windOffset = (x/screenX2)*windMultiplier;
565 storm.flakes[storm.flakes.length-1].active = -1;
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.