From 9f78423f0a018600cfce733e6385fe6dbeac8c0b Mon Sep 17 00:00:00 2001 From: quegzacov Date: Tue, 27 Dec 2022 19:28:56 +0100 Subject: [PATCH] 3.14159265358979 --- index.php | 1 + script.js | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/index.php b/index.php index fefa9ef..97ff08a 100755 --- a/index.php +++ b/index.php @@ -16,6 +16,7 @@ var_dump($res); ?> + diff --git a/script.js b/script.js index c30a630..23b0eb0 100755 --- a/script.js +++ b/script.js @@ -1,17 +1,14 @@ function draw_roulette(nb_person, x, y){ + let chart = document.getElementById("roulette") let angle = 0; for (let i=0; i < 1; i++){ let coo_arr = new Array(250 - 50 * Math.cos(2 * Math.PI / nb_person), 200 - 50 * Math.sin(2 * Math.PI / nb_person)); - let svg = document.createElement('svg'); - svg.setAttribute("width", 800); - svg.setAttribute('height', 800); let new_path = document.createElement("path"); new_path.setAttribute('fill', 'green'); new_path.setAttribute('d', "M 200 200 A 50 50 0 0 1 " + coo_arr[0] + " " + coo_arr[1] + " L 250 200 Z"); - svg.appendChild(new_path); - document.getElementsByTagNames('body')[0].appendChild(svg); - console.log(svg) + chart.appendChild(new_path); + chart.innerHTML += ' '; console.log(new_path.getAttribute('d')); } };