<!DOCTYPE html>
<
html
lang
=
"en"
>
<
head
>
<
meta
charset
=
"UTF-8"
>
<
meta
name
=
"viewport"
content
=
"width=device-width, initial-scale=1"
>
<
title
>jQuery DrawSVG Plugin</
title
>
<
link
rel
=
"stylesheet"
href
=
<
link
rel
=
"stylesheet"
href
=
"style.css"
>
<
script
async
src
=
"//assets.codepen.io/assets/embed/ei.js"
>
</
script
>
<
script
src
=
</
script
>
<
script
src
=
</
script
>
<
script
src
=
"jquery.drawsvg.min.js"
></
script
>
<
style
>
body {
background: green;
text-align: center;
}
.wrapper {
height: 1800px;
}
/* For visibility */
svg {
position: fixed;
margin: auto;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
</
style
>
</
head
>
<
body
>
<
h1
style
=
"color:white"
>GeeksforGeeks</
h1
>
<
b
>Draw On Scroll, Please scroll down and up</
b
>
<
div
class
=
"wrapper"
>
<
svg
style
=
"background-color:#ffffff00"
width
=
"200"
height
=
"150"
viewBox
=
"0 0 200 150"
>
<
g
stroke
=
"#FFFFFF"
stroke-width
=
"2"
fill
=
"none"
>
<
path
d="M137.484 69.432c0 37.536-30.425 67.96-67.97
67.96-37.535 0-67.953-30.424-67.953-67.96C1.56
31.9 31.98 1.474 69.516 1.474c37.544 0 67.97
30.425 67.97 67.958z" />
<
path
d="M118.228 68.774c0 26.78-21.702 48.488-48.496
48.488-26.772 0-48.48-21.71-48.48-48.488 0-26.776
21.708-48.48 48.48-48.48 26.794 0 48.496 21.704
48.496 48.48z" />
<
path
d
=
"M37 68.998C37 50.773 51.55 36 69.495 36"
/>
<
path
d="M128.008 104.035l54.93 55.05c5.754 5.764 5.758
15.208.007 20.98l-2.886 2.894c-5.752 5.772-15.174
5.783-20.94.024l-55.128-55.078" />
</
g
>
</
svg
>
</
div
>
<
script
>
var $docVar = $(document),
$winVar = $(window),
$svgVar = $('svg').drawsvg(),
max = $docVar.height() - $winVar.height();
$winVar.on('scroll', function() {
var p = $winVar.scrollTop() / max;
$svgVar.drawsvg('progress', p);
});
</
script
>
</
body
>
</
html
>