Pijama ninja falling
How do I make an pijama ninja falling?
Playing around with clouds. What is a pijama ninja falling? How do you make a pijama ninja falling? This script and codes were developed by David A. on 28 November 2022, Monday.
Pijama ninja falling - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>pijama ninja falling</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body>
<div id="main" role="main"> <div id="viewport"> <div class="world"></div> </div> <div id="timeline"> <section data-timeline="0"> <h1 class="hidden">1800</h1> </section> <section data-timeline="1"> <h1 class="hidden">1810</h1> </section> <section data-timeline="1.5"> <h1 class="hidden">1815</h1> </section> <section data-timeline="2"> <h1 class="hidden">1820</h1> </section> <section data-timeline="3"> <h1 class="hidden">1830</h1> </section> <section data-timeline="4"> <h1 class="hidden">1840</h1> </section> <section data-timeline="5"> <h1 class="hidden">1850</h1> </section> <section data-timeline="10"> <h1 class="hidden">1900</h1> </section> </div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Pijama ninja falling - Script Codes CSS Codes
@import url(https://fonts.googleapis.com/css?family=Fira+Sans:300,700);
html, body { height: 100%; overflow: hidden; font-family: 'Fira Sans', sans-serif; font-weight: 300;
}
body { background: #000; background-image: -webkit-linear-gradient(top, #68a8bd, #fff); background-image: linear-gradient(180deg, #68a8bd, #fff); background-image: url(http://1.bp.blogspot.com/-Y9j-6p9E3R0/VeTNvz67INI/AAAAAAAAHpI/ZNciLjfz3A4/s1600/Vertigo.gif); background-size: cover; background-repeat: no-repeat; background-position: center center;
}
.hidden { display: none;
}
h1 { position: absolute; top: 0; right: 40px; font-size: 50px; color: #fff; font-weight: 300;
}
#viewport, #viewport .world, .worldLayer { position: absolute;
}
#viewport { top: 0; right: 0; bottom: 0; left: 0; -webkit-perspective: 600; perspective: 600; overflow: hidden;
}
#viewport .world, #viewport .worldLayer { height: 512px; width: 512px; top: 50%; left: 50%; margin: -256px 0 0 -256px; -webkit-transform-style: preserve-3d; transform-style: preserve-3d;
}
#viewport .worldLayer:after { content: ""; display: block; position: absolute; top: 20px; bottom: 20px; left: 20px; right: 20px;
}
#viewport .cloud, #viewport .cloudPart { position: absolute; width: 256px; height: 386px; margin: -128px 0 0 -128px; top: 0; left: 0;
}
#viewport .cloud { -webkit-transform-style: preserve-3d; transform-style: preserve-3d; -webkit-animation: cloudRotation 40s infinite linear; animation: cloudRotation 40s infinite linear;
}
#viewport .cloud .cloudPart { background: url(http://vignette4.wikia.nocookie.net/adventuretimewithfinnandjake/images/f/fe/Pajama_ninja.png/revision/latest?cb=20100710023015) no-repeat;
}
.worldLayer:nth-child(4n) .content { right: 0; left: auto;
}
.worldLayer:nth-child(3n) .content { top: auto; bottom: 0;
}
.content { display: none; position: absolute; top: 0; left: 0; padding: 20px; width: 258px; font-size: 20px; color: #000; text-transform: uppercase; font-weight: 700; -webkit-transform: translate3d(0, 0, 25px); transform: translate3d(0, 0, 25px);
}
.content strong { font-size: 80px; font-weight: 300; margin-left: -0.075em;
}
@-webkit-keyframes cloudRotation { from { -webkit-transform: rotate(0deg); transform: rotate(0deg); } to { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}
Pijama ninja falling - Script Codes JS Codes
var TimeLine, Layer, World, /* Constats */ $doc, nameSpace, /* helpers */ nameSpaced;
$doc = $(document);
nameSpace = "TimeLine";
nameSpaced = function( eventNames,ns ){ var i, events, nameSpaced; events = eventNames.split(" "); for(i = 0; i < events.length; i++){ events[i] = events[i] + "." +(ns || nameSpace); } return events.join(" ");
};
TimeLine = function( $timeLine,groupsSelector,layersSelector,$world,$viewport ){ this.$timeLine = $timeLine; this.groupsSelector = groupsSelector; this.layersSelector = layersSelector; this.$world = $world; this.$viewport = $viewport;
};
/* TimeLine Methods */
TimeLine.prototype.init = function(){ var self = this; self.World = new World( self.$world,self.$viewport ); self._parseTimeline();
};
TimeLine.prototype._parseTimeline = function(){ var self = this;
};
TimeLine.prototype.addLayer = function(){
};
TimeLine.prototype.addGroup = function(){
};
Layer = function( $layer ){
};
World = function( $world,$viewport ){ var self = this; this.$world = $world; this.$viewport = $viewport; this.viewPortWidth = 0; this.viewPortHeight = 0; this.worldXAngle = 0; this.worldYAngle = 0; this.d = 0; //actual depth of the world this.depth = 300; //default death between layers this.initInteraction(); this.clouds = []; this.layers = []; this.stepSpeed = 1; for( var j = 0; j < 100; j++) { var $layer = this.addLayer(j, $("<div class='content'>Cloud Group<br/><strong class='layernr'>Nr. " + j + "</strong></div>")); for ( var i = 0; i < 2; i++) { $layer.append( this.addCloud(2,5) ); } } function animate(){ self.d = self.d - self.stepSpeed; self.updateView(); requestAnimationFrame(animate); } animate();
};
/* World Methods */
World.prototype.initInteraction = function(){ var self = this; self.$viewport.on( nameSpaced("mousemove") , function( e ){ self.worldYAngle = -( 0.5 - ( e.clientX / window.innerWidth ) ) * 2; self.worldXAngle = ( 0.5 - ( e.clientY / window.innerHeight ) ) * 2; //self.updateView(); }); self.$viewport.on( nameSpaced("mousewheel DOMMouseScroll") , function( e ){ e = e ? e : window.event; self.d = self.d - ( e.originalEvent.detail ? e.originalEvent.detail * -5 : e.originalEvent.wheelDelta / 8 ); //self.updateView(); }); self.$viewport.on( nameSpaced("click"), function(){ self.stepSpeed = 0; console.log() } );
};
World.prototype.updateView = function(){ var self = this; //calculate the visible layer //console.log( (-self.d / self.depth) ); self.$world.css('transform', 'translateZ( ' + self.d + 'px ) rotateX( ' + self.worldXAngle + 'deg) rotateY( ' + self.worldYAngle + 'deg)'); /*for(var i = 0; i < self.clouds.length; i++){ self.clouds[i].css('transform', 'rotateX( ' + -1 * self.worldXAngle + 'deg) rotateY( ' + -1 * self.worldYAngle + 'deg)'); }*/
};
World.prototype.addLayer = function( layerdepth,$content ){ var t, $layer, layerHTML = "<div class='worldLayer'></div>"; $layer = $(layerHTML); t = 'translateZ( ' + (layerdepth * this.depth) + 'px )'; $layer.css("transform", t); if( $content ){ $layer.append( $content ); } if(layerdepth > 10){ $layer.css("display", "none"); } this.layers.push( $layer ); this.$world.append( $layer ); return $layer;
};
World.prototype.addCloud = function( minParticles,maxParticles,position ){ var x,y,z,a,s,i,t, layers, $cloud, $cloudPart, cloudHtml = "<div class='cloud'></div>", cloudPartHtml = "<div class='cloudPart'></div>"; $cloud = $(cloudHtml); layers = []; for(i = 0; i < (minParticles || 2) + Math.round( Math.random() * ( maxParticles || 10) ); i++){ $cloudPart = $(cloudPartHtml); x = 256 - ( Math.random() * 256 ); y = 256 - ( Math.random() * 256 ); z = 100 - ( Math.random() * 200 ); a = Math.random() * 360; s = 0.25 + Math.random(); t = 'translateX( ' + x + 'px ) translateY( ' + y + 'px ) translateZ( ' + z + 'px ) rotateZ( ' + a + 'deg ) scale( ' + s + ' )'; $cloudPart.data({ x: x, y: y, z: z, a: a, s: s }).css("transform", t); $cloud.append( $cloudPart ); } $cloud.css({"top": ( Math.random() * 100 ) + "%", "left": ( Math.random() * 100 ) + "%", "transform": "translateZ(" + (Math.random() < 0.5 ? -1 : 1) * Math.random() * 100 + "px)"}); //this.$world.append( $cloud ); return $cloud;
};
/*** init ***/
var TL = new TimeLine( $('#timeline'),"> section","*[data-layer]",$(".world"),$("#viewport") );
TL.init();
Developer | David A. |
Username | meodai |
Uploaded | November 28, 2022 |
Rating | 4.5 |
Size | 5,513 Kb |
Views | 14,168 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Color Watch | 7,929 Kb |
Easy Parallax, 9 lines of vanilla JS | 156,603 Kb |
Cymk logo generator | 4,415 Kb |
Animated scroll timeline | 5,222 Kb |
We Simplify animation | 48,169 Kb |
Infinite ping-pong | 3,266 Kb |
Color palette distribution for different color spaces | 10,909 Kb |
Color fan | 117,778 Kb |
All the 16k color names from the color-name-list API | 6,006 Kb |
DOM explosions | 8,919 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Touch Carousel - last, no gaps. | Berkin | 4,332 Kb |
Css3 loader | Clknap | 2,391 Kb |
Blackberry Mock | Zacharyolson | 1,865 Kb |
My Interests | Anshusaxenaarora | 2,015 Kb |
Feedback Page | TessDiNapoli | 2,836 Kb |
Gradients | Karpovsystems | 2,394 Kb |
Word Wrap Algorithm for Multiline Canvas Text | Peterhry | 2,349 Kb |
Loading animation with css | Icebob | 2,947 Kb |
Scroll to view if element partially out of view port height | ChrisMaki | 2,104 Kb |
Perspective Origin Demo | Agelber | 3,614 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!