Update script.js
This commit is contained in:
parent
b4b95a18f0
commit
4165705816
@ -60,12 +60,9 @@ const drawLogo = (logo, element) => {
|
|||||||
element.style.filter = `brightness(0.5) sepia(1) saturate(10000%) hue-rotate(${logo.dColorWheel}rad)`;
|
element.style.filter = `brightness(0.5) sepia(1) saturate(10000%) hue-rotate(${logo.dColorWheel}rad)`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const makeSvg = (coords) => {
|
|
||||||
const makeLine = (a, b, color='white') => `<line x1="${a.x}" x2="${b.x}" y1="${a.y}" y2="${b.y}" stroke="${color}" />`;
|
const makeLine = (a, b, color='white') => `<line x1="${a.x}" x2="${b.x}" y1="${a.y}" y2="${b.y}" stroke="${color}" />`;
|
||||||
|
const makeSvg = (coords) => `
|
||||||
return `
|
|
||||||
<svg xmlns='http://www.w3.org/2000/svg' width='${window.innerWidth}px' height='${window.innerHeight}px'>
|
<svg xmlns='http://www.w3.org/2000/svg' width='${window.innerWidth}px' height='${window.innerHeight}px'>
|
||||||
<rect x="0" y="0" width="${window.innerWidth}" height="${window.innerHeight}" fill="${document.body.style.backgroundColor || "black"}"/>
|
|
||||||
${coords.map((_,i) => {
|
${coords.map((_,i) => {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
return;
|
return;
|
||||||
@ -74,7 +71,6 @@ const makeSvg = (coords) => {
|
|||||||
}).join('')}
|
}).join('')}
|
||||||
</svg>
|
</svg>
|
||||||
`;
|
`;
|
||||||
}
|
|
||||||
|
|
||||||
const setBackgroundToSvg = (svg) => {
|
const setBackgroundToSvg = (svg) => {
|
||||||
document.getElementById("container").style.background = 'url(data:image/svg+xml;base64,'+btoa(svg)+')';
|
document.getElementById("container").style.background = 'url(data:image/svg+xml;base64,'+btoa(svg)+')';
|
||||||
|
Loading…
Reference in New Issue
Block a user