Sha256: 756c2f8599c1b6431613f266649a7edf0842114d5a5ab78cd8b477d0086256a2
Contents?: true
Size: 1 KB
Versions: 14
Compression:
Stored size: 1 KB
Contents
<script type="text/javascript"> function svg_aug_contained_image(){ var x_i = document.getElementsByClassName("image--guarantee")[0].offsetWidth ; var y_i = document.getElementsByClassName("image--guarantee")[0].offsetHeight ; /* ge scg labels */ var svg = document.querySelectorAll('.svg__augment > .augment--guarantee'); /* origanal image width in pixels */ var x_0 = {{ page.guarantee.augment.image | split: ', ' | first }} ; var y_0 = {{ page.guarantee.augment.image | split: ', ' | last }} ; for (let i = 0; i < svg.length; i++) { /* origanal x position in pixels */ var dx_0 = parseInt( svg[i].getAttribute('x'), 10 ) / 100 ; var dy_0 = parseInt( svg[i].getAttribute('y'), 10 ) / 100 ; var dx_0Pixel = dx_0 * x_0 ; var dy_0Pixel = dy_0 * y_0 ; svg[i].setAttribute("x", (dx_0Pixel - ( x_0 / 2) + (x_i / 2) ) / x_i * 100 + '%'); svg[i].setAttribute("y", (dy_0Pixel - ( y_0 / 2) + (y_i / 2) ) / y_i * 100 + '%'); }; } //window.setInterval(svg_aug_contained_image, 200 ) </script>
Version data entries
14 entries across 14 versions & 1 rubygems