background preloader

Getting Started with GSAP (GreenSock Animation Platform)

Getting Started with GSAP (GreenSock Animation Platform)
The GreenSock Animation Platform (GSAP) animates anything JavaScript can touch (CSS properties, SVG, React, canvas, generic objects, whatever) and solves countless browser inconsistencies, all with blazing speed (up to 20x faster than jQuery). See "Why GSAP?" to learn why it's used by 6,500,000 sites and every major brand. Hang in there through the learning curve and you'll discover how addictive animating with code can be. We promise it's worth your time. Quick links We'll cover the most popular features here but keep the GSAP docs handy for all the details. First, let's talk about what GSAP actually does... GSAP as a property manipulator Animation ultimately boils down to changing property values many times per second, making something appear to move, fade, spin, etc. For example, changing the x coordinate of an object from 0 to 1000 over the course of 1 second makes it move quickly to the right. DOM, SVG, <canvas>, and beyond What's GSAP Exactly? Loading GSAP Banner Ad CDNs Downloading GSAP Related:  Javascript

How to create a parallax scrolling website using Skrollr.js | Tutorial Today’s parallax website tutorial is a detailed explanation of the Parallax Scrolling Effect using Skrollr.js published a few weeks ago. You will learn how to create a simple parallax scrolling website using Skrollr.js plugin. If you haven’t seen the demo already, go and check it out. View Demo Introduction To develop a parallax scrolling website can be a bit scary especially if you do it for the first time, but as you know the practice makes perfect. Please note, that this tutorial is suitable for a more advanced developers and attached files are the final files. 1. As a first step we need to include Skrollr.js preferably before the closing body tag. Initiate the Skrollr inside of the _main.js file. Now lets have a look at the markup and Skrollr settings of the individual slides. 2. Section height – 100% of the viewport, resized on page load Background animationThe background image of .bcg is animating from the initial position (data-center) 50% 0px to 50% -100px. 3. 4. 5. 6. Conclusion

jlmakes/scrollreveal: Easy scroll animations for web and mobile browsers. Reading local files in JavaScript Introduction HTML5 finally provides a standard way to interact with local files, via the File API specification. As example of its capabilities, the File API could be used to create a thumbnail preview of images as they're being sent to the server, or allow an app to save a file reference while the user is offline. Additionally, you could use client-side logic to verify an upload's mimetype matches its file extension or restrict the size of an upload. The spec provides several interfaces for accessing files from a 'local' filesystem: File - an individual file; provides readonly information such as name, file size, mimetype, and a reference to the file handle. When used in conjunction with the above data structures, the FileReader interface can be used to asynchronously read a file through familiar JavaScript event handling. Selecting files The first thing to do is check that your browser fully supports the File API: Using form input for selecting Example: Using form input for selecting.

matteocontrini/nodejs-fundamentals: Fondamentali di Node.js (originariamente pensato per studenti UniTN) Tutto quello che TI SEI PERSO di Javascript [SPIEGONE DEL MESE] Trascizione video Il linguaggio Javascript si è modificato molto rapidamente, soprattutto negli ultimi anni. Ecco, con tutta probabilità ti sei perso qualche passaggio di questa evoluzione. Quindi benvenuto o benvenuta allo spiegone del mese di dicembre! Voglio racchiudere in un unico video tutta l’evoluzione del linguaggio javascript frontend, che va dal 2006 al 2016/2017. Quindi se ti sei perso qualcuno di questi passaggi, stai tranquillo perché li vediamo assieme. Ciao io sono Alberto Olla del sito imparareaprogrammare.it e prima di iniziare con lo spiegone ti volevo dire che mi è finalmente arrivato il libro di Raffaele Gaito sul Growth Hacking. Javascript dal 2006 al 2016/17 L’obiettivo di questo spiegone è quello di riassumerti tutte quelle che sono state le maggiori scoperte e gli strumenti che la comunità Javascript, per quanto riguarda lo sviluppo frontend, ha fatto, a partire dal 2006 fino ad arrivare al 2016/17. Quindi iniziamo da lontano e partiamo dal 2006! Passiamo a React.

Top 14 Templating Engines for JavaScript 2019 If you would like to simplify the process of project creation, use any of the templating engines for JavaScript below. With the powerful and convenient JS, web developers around the world have a chance to create real masterpieces. Plugins have expanded beyond the comprehension of an average developer, and we also saw – highly anticipated – the release of ECMAScript 6; the new JavaScript standard. Frankly, ES6 was already on the way, all that needed to be done is for it to be finalized. Make sure to check out the full spec if you haven’t done so already. ECMAScript 6 improvements include better syntax for classes, along with new methods for strings and Arrays, Promises, Maps and Sets. We keep seeing huge growth with Node.js. A templating engine is basically a way for developers to interpole strings effectively. Mustache Mustache is one of the most widely known templating systems that works for a number of programming languages, including JavaScript, Node.js, PHP, and many others. Visit doT

Cos'è EJS? Impara le basi dei template engine su Express.js - Node Academy Cosa sono i Template Engine È arrivato il momento di affrontare uno dei più classici dei problemi della programmazione lato server, ovvero la separazione del codice di programmazione (in questo caso in Javascript) dall’HTML. Per risolvere questo problema la comunità Javascript ha creato i template engine, in questo articolo approfondiremo come poterne usare uno dei tanti (EJS) all’interno di Express! Fino ad ora, abbiamo restituito il codice HTML direttamente in JavaScript (brutta cosa). res.write('<! Orribile, non è vero? Fortunatamente, Express ci permette di utilizzare i template per uscire da questo inferno. PHP è esso stesso un linguaggio di template che ci permette di fare questo: <p>Sei visitatore n^ <? Ci sono molte altre lingue come Twig, Smarty, Haml, JSP, Jade e EJS. In generale: gestiscono tutti gli elementi essenziali, vale a dire variabili, condizioni e cicli, ecc. Fondamenti di EJS Poiché ci sono molti sistemi di template in giro, ne selezionerò solo uno. npm install ejs

selezione multipla (switch) con diagramma sintattico in javascript Ecco il diagramma sintattico della selezione multipla: si tratta di una buona alternativa alla selezione nidificata nel caso in cui le scelte variano fra più opzioni e riguardano test d'uguaglianza. Come si vede dal diagramma, la sintassi della selezione multipla è: nomeVar è il nome della variabile (va chiusa in parentesi tonde).Seguono poi i vari casi: se il valore assunto dalla variabile è uno di quelli riportati, vengono eseguite le istruzioni relative; break consente di uscire dal costrutto e di passare alla prima istruzione contenuta dopo la parentesi graffa che chiude lo switch. E' opzionale aggiungere, in fondo, la parola chiave default: di seguito vengono scritte le istruzioni da eseguire quando nessuna delle precedenti opzioni è risultata vera. Vogliamo inserire un piccolo oroscopo: allo scopo generiamo un numero casuale compreso fra 0 e 10. Nel body inseriamo poi un bottone attraverso il seguente codice: Otteniamo il seguente risultato:

Attributes and properties When the browser loads the page, it “reads” (another word: “parses”) the HTML and generates DOM objects from it. For element nodes, most standard HTML attributes automatically become properties of DOM objects. For instance, if the tag is <body id="page">, then the DOM object has body.id="page". But the attribute-property mapping is not one-to-one! DOM properties We’ve already seen built-in DOM properties. DOM nodes are regular JavaScript objects. For instance, let’s create a new property in document.body: We can add a method as well: document.body.sayTagName = function() { alert(this.tagName); }; document.body.sayTagName(); // BODY (the value of "this" in the method is document.body) We can also modify built-in prototypes like Element.prototype and add new methods to all elements: Element.prototype.sayHi = function() { alert(`Hello, I'm ${this.tagName}`); }; document.documentElement.sayHi(); // Hello, I'm HTML document.body.sayHi(); // Hello, I'm BODY HTML attributes For instance: Sure. Summary

Related: