Mastering SVG: Ace web animations, visualizations, and vector graphics with HTML, CSS, and JavaScript
Book information
Description
Take the plunge and develop cross-browser-compatible and responsive web designs with SVG Key FeaturesMaster the art of custom animations and visualizations with SVG, CSS, and JavaScriptCombine SVG with third-party libraries and frameworks such as React, JQuery, D3, and Snap.svg for GUI-rich appsCreate an awesome user experience with high-performance graphics for your web applicationsBook Description SVG is the most powerful image format in use on the web. In addition to producing resolution-independent images for today's multi-device world, SVG allows you to create animations and visualizations to add to your sites and applications. The simplicity of cross-platform markup, mixed with familiar modern web languages, such as CSS and JavaScript, creates a winning combination for designers and developers alike. In this book, you will learn how to author an SVG document using common SVG features, such as elements and attributes, and serve SVG on the web using simple configuration tips for common web servers. You will also use SVG elements and images in HTML documents. Further, you will use SVG images for a variety of common tasks, such as manipulating SVG elements, adding animations using CSS, mastering the basic JavaScript SVG (API) using Document Object Model (DOM) methods, and interfacing SVG with common libraries and frameworks, such as React, jQuery, and Angular. You will then build an understanding of the Snap.svg and SVG.js APIs, along with the basics of D3, and take a look at how to implement interesting visualizations using the library. By the end of the book, you will have mastered creating animations with SVG. What you will learnDeliver the elements that make up an SVG image Replace your old CSS sprites with SVGUnderstand animation and data visualization with SVG are explained in pure JavaScript and using common librariesUse SVG to scale images across multiple devices easily Harness the power of CSS animations and transformations to manipulate your SVG images in a replicable, remixable wayInterface SVG with common libraries and frameworks, such as jQuery, React, and AngularWho this book is for This book is for web developers and designers looking to add animation to their projects. Some experience with HTML, CSS, and JavaScript is required. Cover Title Page Copyright and Credits PacktPub.com Contributors Table of Contents Preface Chapter 1: Introducing Scalable Vector Graphics Creating a simple SVG image Using SVG as a content image Drawing with code Scalable + vector graphics Using SVG in CSS Gradients in SVG Directly embedding SVG in an HTML document Feature detection and Modernizr Summary Chapter 2: Getting Started with Authoring SVG Positioning in SVG viewBox and viewport in SVG Introducing paths More on basic shapes The line element The ellipse element The polygon element The polyline element More on fills and strokes stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-opacity linearGradient and radialGradient The pattern element Authoring programs Summary Chapter 3: Digging Deeper with SVG Authoring Transformations translate scale rotate skew Clipping and masking Clipping Masking Importing images into SVG Filters Serving SVG on the web Apache nginx IIS Summary Chapter 4: Using SVG in HTML SVG, HTML, and accessibility SVG as an image src Inline SVG SVG and responsive web design The srcset attribute The srcset and sizes attributes The picture element Additional details on inline SVG in an HTML document Caching Complexity Authoring The Document Object Model Summary Chapter 5: Working with SVG and CSS CSS background images Data URLs for SVG background images SVG sprites and icon sets Styling inline SVG Using common CSS properties to manipulate SVGs Basic font properties Text properties Miscellaneous CSS properties Using SVG-specific CSS properties to manipulate SVGs Color and painting properties Stroke properties Text properties Compositing properties Interactivity properties Styles in standalone SVG images Basic CSS animations and transitions with SVG CSS animations Basic animation format Animating a clip path Animating multiple properties and assigning multiple animations to an element CSS transitions Summary Chapter 6: JavaScript and SVG JavaScript Versions and tools JavaScript Versions ECMAScript 5 ECMAScript 2015 TypeScript Tooling The DOM interface to SVG Initial exploration The SVG DOM manipulator Summary Chapter 7: Common JavaScript Libraries and SVG Manipulating SVG with jQuery Working with AngularJS and SVG Manipulating SVG with Angular Getting started with Angular Installing Node, npm, and Angular Cli Working with React and SVG Summary Chapter 8: SVG Animation and Visualizations Creating an SVG data visualization General techniques for animating SVG Animating with pure JavaScript Animating with CSS Animating SVG with SMIL Animating SVG with Vivus Animating SVG with GSAP Summary Chapter 9: Helper Libraries Snap.svg and SVG.js Working with Snap.svg Getting started with Snap.svg Animation with Snap Snap.svg utilities Snap.svg events Custom data visualization with Snap.svg Working with SVG.js Getting started with SVG.js Animation with SVG.js SVG.js utilities SVG.js events Custom data visualization with SVG.js Summary Chapter 10: Working with D3.js Getting started with D3 D3's enter and exit Implementing a donut chart with D3 Implementing a chord diagram in D3 Summary Chapter 11: Tools to Optimize Your SVG Serving compressed SVG gzipping SVG on Apache SVG compression on nginx SVG compression on IIS SVGO SVGOMG SVGO authoring plugins svgcleaner Summary Other Books You May Enjoy Index
Similar books
The HTML and CSS Workshop: A New, Interactive Approach to Learning HTML and CSS
2019 · EPUB
HTML5 CSS3 编程入门经典
2014 · PDF
The Uncertain Web: Web development in a changing landscape
2014 · PDF
Professional jQuery
2012 · PDF
Beginning HTML and CSS
2013 · PDF
Professional jQuery
2012 · PDF
The Uncertain Web
2014 · PDF
The Uncertain Web
2014 · PDF