Skip to content

Instantly share code, notes, and snippets.

View ievgennaida's full-sized avatar

Ievgen Naida ievgennaida

View GitHub Profile
@ievgennaida
ievgennaida / fit_svg_element_into_the_bounds
Created October 17, 2020 20:23
Transform and fit any svg element into the given screeen bounds.
<html style="margin: 0px; padding: 0px;">
<body style="margin: 0px; padding: 0px;">
<svg width="1380" height="1340" xmlns="http://www.w3.org/2000/svg">
<g transform="skewX(10) translate(-3,4) rotate(30)">
<g transform="skewX(30) translate(-3,4) rotate(30)">
<g transform="skewX(10) translate(-3,4) rotate(10)">
<g transform="translate(350,30) skewX(10) rotate(30)">
<rect id="source" transform="scale(2) rotate(30) skewX(10)" x="20" y="50" width="30" height="30"
fill="red" />