Change image shape with clip-path | HTML, CSS, JavaScript [no SVGs]
In this video, I show you a quick and easy way to change the shape of an image using HTML, CSS and JavaScript - no SVGs required. π Contents: π 00:08 - Project overview 00:40 - Using clip-path to set the shape of an image 01:22 - Browser support for clip-path 01:37 - Setting up CSS variable for the clip-path 02:04 - Writing the JavaScript function to change the image shape 02:14 - Generating a random number with Math.random() and .length 02:46 - Using setProperty to change the image shape 03:12 - Ensuring that a new shape is selected on each click with a conditional π Links: π Clip-path generator: https://bennettfeely.com/clippy/ Can I Use: https://caniuse.com/ Change image shape using SVGs: https://www.youtube.com/watch?v=1KyvCgEulQQ -- const me = { name: "Leanne π©π»", passions: ["coffeeβοΈ", "code π»", "cats π±"], unpopular_opinion: "LOVES CSS β€οΈ", favorite_colors: ["hotpink", "orangered"], channel_aim: "Show the world that CSS is fun and web development rules! π" } -- π€ Say hi on Twitter: https://twitter.com/RybaLeanne
Download
0 formatsNo download links available.