diff --git a/public/index.php b/public/index.php index 843bb27..b79db36 100644 --- a/public/index.php +++ b/public/index.php @@ -5,9 +5,22 @@ -Response + + +

Day $i

+ + + "; +} ?> + + + \ No newline at end of file diff --git a/public/main.js b/public/main.js new file mode 100644 index 0000000..519c8f1 --- /dev/null +++ b/public/main.js @@ -0,0 +1,11 @@ +for (let i = 1; i <= 25; i++){ + let buttons = document.querySelectorAll(`#day-${i} > button`); + + buttons.forEach(button => { + button.addEventListener('click', async () => { + const response = await (await fetch(button.dataset['url'])).json(); + + document.getElementById('response').innerText = response.result; + }); + }); +} \ No newline at end of file diff --git a/public/run.php b/public/run.php index b76c368..646bb29 100644 --- a/public/run.php +++ b/public/run.php @@ -30,9 +30,9 @@ if ($dayNumber){ 'data' => null ]; - echo json_encode($response); die(); } } -} \ No newline at end of file +} +echo json_encode([]); \ No newline at end of file diff --git a/public/styles.css b/public/styles.css index f6de69f..e0d9443 100644 --- a/public/styles.css +++ b/public/styles.css @@ -4,7 +4,10 @@ body { background-color: rgb(30, 30, 30); } -* { +body > * { color: white; +} + +* { font-family: "Red Hat Mono", serif; } \ No newline at end of file