-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
29 lines (27 loc) · 984 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var fillColor;
var strokeColor;
var strokeWidth;
var queryStringValues = window.location.href.substring(window.location.href.indexOf('?')).replace('?','').split('&');
for(var i=0;i<queryStringValues.length;i++)
{
debugger;
if(queryStringValues[i].indexOf('fillcolor') > -1)
{
fillColor = queryStringValues[i].substring(queryStringValues[i].lastIndexOf('=')+1);
fillColor = fillColor.replace('%23','#');
}
if(queryStringValues[i].indexOf('strokecolor') > -1)
{
strokeColor = queryStringValues[i].substring(queryStringValues[i].lastIndexOf('=')+1);
strokeColor = strokeColor.replace('%23','#');
}
if(queryStringValues[i].indexOf('strokewidth') > -1)
{
strokeWidth = queryStringValues[i].substring(queryStringValues[i].lastIndexOf('=')+1);
}
}
console.log('fill-color' + fillColor);
var circle = document.getElementById('circle');
circle.setAttribute('stroke', strokeColor);
circle.setAttribute('fill', fillColor);
circle.setAttribute('stroke-width', strokeWidth);