Made background transparent
This commit is contained in:
37
savesvg.js
37
savesvg.js
@@ -1,3 +1,40 @@
|
||||
function doBigWhiteTriangle(id){
|
||||
const svg = document.getElementById(id);
|
||||
|
||||
// Triangle settings
|
||||
const sideLength = 740;
|
||||
const centerX = 435;
|
||||
const centerY = 493;
|
||||
const angleOffset = -90 * (Math.PI / 180); // Start at top
|
||||
|
||||
// Generate 3 equilateral triangle points
|
||||
const points = [];
|
||||
for (let i = 0; i < 3; i++) {
|
||||
const angle = angleOffset + i * (2 * Math.PI / 3); // 120° steps
|
||||
const x = centerX + (sideLength / Math.sqrt(3)) * Math.cos(angle);
|
||||
const y = centerY + (sideLength / Math.sqrt(3)) * Math.sin(angle);
|
||||
points.push(`${x},${y}`);
|
||||
}
|
||||
|
||||
// Create the triangle
|
||||
const triangle = document.createElementNS("http://www.w3.org/2000/svg", "polygon");
|
||||
triangle.setAttribute("points", points.join(" "));
|
||||
triangle.setAttribute("fill", "white");
|
||||
//triangle.setAttribute("stroke", "black"); // Optional
|
||||
//triangle.setAttribute("stroke-width", "2"); // Optional
|
||||
svg.appendChild(triangle);
|
||||
}
|
||||
|
||||
function doLittleWhiteTriangle(){
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function inlineStyles(svgElement) {
|
||||
const allElements = svgElement.querySelectorAll('*');
|
||||
const computedStyles = window.getComputedStyle(svgElement);
|
||||
|
||||
Reference in New Issue
Block a user