
Discover how scalable vector graphics enable infinite zoom, crisp logos, and interactive visuals by using inline SVG with CSS styling and JavaScript interactivity.
Learn to render SVG scenes by inline SVG, image tag, or CSS background image. Create rectangles with width, height, and fill, and compare manipulation and performance across methods.
Create SVG shapes by coding with rectangles and circles, defining width, height, x, y positions, circle center coordinates cx, cy, and radius, fill, stroke, and nesting or separating shapes.
Learn to draw lines in SVG by specifying x1, y1, x2, y2, stroke width, and stroke color to connect points inside shapes, using pixels and percent positions.
Learn to define an SVG with explicit width and height, add shapes with fills, and use the viewBox to zoom and crop for scalable web graphics.
Explore how to use the polygon element to create shapes in SVG, defining a series of points as x,y coordinates, then fill and stroke the shape.
Add multiple polygons by specifying polygon points to form inner and outer triangles, close the polygon element, and apply a white fill with a black stroke to complete the scene.
Experiment with svg polygon points to craft multi-point shapes, adjust coordinates like 50 100 and 100 200, fill with gold and dodger blue, and stroke the edges for a web animation.
Explore drawing polygons in SVG by defining points to form a star, closing shapes, and using stroke and fill to reveal lines and structure.
Master how the viewBox and viewport interact in SVG, and learn to zoom and pan by adjusting width, height, x, and y values.
Learn how removing explicit width and height on SVGs with a viewBox enables automatic scaling and responsiveness across window sizes, demonstrating zoom and viewport behavior.
Master Bezier curves by chaining control points to shape svg paths, adjusting start points, curve controls, and stroke attributes to craft smooth squiggles, lines, and simple scenes.
Explore how to compose SVG bezier curves using the C command or the s command for smooth curves, reuse curves, and control fill color to shape complex SVG illustrations.
Explore Bezier curves in SVG by constructing a cubic path with control points and using d, C, and s commands to build increasingly complex shapes.
Explore quadratic bezier curves in svg paths using the q command with a single control point to form simple slopes, and use the t shortcut to extend curves.
Explore how to create arcs in svg using the a command, with rx and ry radii, x-axis rotation, large-arc-flag and sweep-flag, shaping circular or elliptical paths.
Explore overlapping arc shapes in svg using path d, stroke and fill, adjusting large-arc-flag and sweep-flag to control arc direction, drawing order, and layering.
Style inline svg to create scalable graphics, convert text to outlines, and apply inline styling for hover effects, while loading svgs as images or backgrounds.
Learn to use svg as a background image and to scale images with percent-based sizing and media queries, keeping visuals crisp on high-resolution screens with center alignment and no-repeat.
Learn how to modify inline SVGA by adding shapes with JavaScript, including creating a red circle in the center and appending it to the SVGA using the SVGA namespace.
Refactor code to simplify pine trees rendering, introduce a get random function, and add a remove all trees button by removing generated pines from the terrain.
Learn to add oak trees to an svg scene by cloning elements, randomizing ellipse positions, and looping to generate multiple trees for web animation.
Sort oak trees by their y axis to simulate depth in an SVG scene, by collecting trees, sorting them with a comparator, and appending them to the DOM in order.
Refactor JavaScript to fix tree positioning by offsetting the y axis with each tree’s height, and simplify event handling to create and remove oak and pine trees.
Refactor JavaScript by outsourcing repeated attribute assignments to a reusable function that iterates over object keys to set SVG attributes, including class and data-y-axis for oak and pine trees.
Refactors the image download flow by outsourcing logic into a dedicated function, detects format via data attributes, and handles PNG and SVGA downloads with a reusable downloader.
Refactoring part 1 shows making a function do one thing, using callbacks or promises to wait for a draft from an svga url, then downloading the converted image.
Refactor the code by encapsulating three image handling methods into a single object, including save image, convert to png, and download image, using this context for reliability.
Refactor the module to be more encapsulated for reuse and export it. Attach an event listener to read name and format, initialize the saver, and save the image.
Refactor the svg scene by turning the set attributes into a method, moving the order by y axis, invoking random choices, and testing pine and oak tree movements.
Explore cross-browser compatibility when building an svg scene. Test in safari and firefox, diagnose issues with dom access, data attributes and capitalization, adjust viewbox sizing, and ensure reliable downloads.
Learn how to ensure domcontentloaded events fire after the page loads by moving event listeners into the domcontentloaded handler, avoiding early access to elements and enabling reliable save functionality.
Style a web svg scene by applying resets and box-sizing border-box, center an 80vw main container, and build responsive, blue buttons with hover and active states using flexbox.
Calix experiments with button widths, media queries, and responsive flex layouts to keep inputs and controls aligned, wrapping content on small screens and reflowing at the 1165px breakpoint.
Learn to refine SVG scene styling with responsive tweaks: adjust margins, set button widths with 80vw, and add media breakpoints to ensure consistent resizing across Safari and Firefox.
Create a modal overlay to customize PNG dimensions with width and height inputs, a dark page overlay, and download or cancel actions using CSS and JavaScript.
Build a PNG modal workflow by wiring save buttons, validating the PNG format, and toggling the modal and overlay visibility with classList, while refactoring event listeners for reliable download functionality.
Style the modal using flexbox for layout, align items center, and consistent button and input sizing, then apply a slide-in animation with keyframes to reveal the content.
Add a size reset button for the SVG canvas, implement a modal button class to scope reset behavior, and reset width and height using max width and max height values.
Finish the svg scene by enabling a cursor pointer on hover for buttons, enhancing visual feedback and interaction. Tinker with backgrounds, objects, animations, and aspect-ratio preservation.
This course was funded by a wildly successful Kickstarter.
Gain hands-on experience with coding real projects! Make vector graphics by coding in this awesome course for beginners. Scaleable Vector Graphics (SVG) is an image format that uses vectors, in contrast to other image formats like jpg, gif, or pngs, which are raster graphics. SVG is made with math. For this reason, it can scale indefinitely! This makes it great for making logos, icons, and simple designs.
Why use SVG?
Enroll today to join the Mammoth community.