diff --git a/index.html b/index.html deleted file mode 100644 index da64d95..0000000 --- a/index.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - JS Quiz - - - - -
- - - -
- - - - diff --git a/main.css b/main.css deleted file mode 100644 index 8adf9fc..0000000 --- a/main.css +++ /dev/null @@ -1,3 +0,0 @@ -label { - display: block; -} diff --git a/scripts.js b/scripts.js deleted file mode 100644 index 922ffcb..0000000 --- a/scripts.js +++ /dev/null @@ -1,41 +0,0 @@ -// Adding event listeners to the submit button and on the return key - -submit.addEventListener("click", validateForm) -treeHeight.addEventListener("keydown", returnCheck) -treeChar.addEventListener("keydown", returnCheck) - -// Assigning input values to an object after event validation and passing to the buildTree function - -function treeCapture() { - var tree = { - height: treeHeight.value, - char: treeChar.value - }; - buildTree(tree); -} - -// Function to check whether both input fields are completed - -function validateForm() { - if (treeHeight.value == "" || treeChar.value === "") { - alert("Please fill out both fields to continue.") - } else { - treeCapture(); - } -} - -// Function to check whether the enter key was pressed - -function returnCheck() { - if (event.keyCode === 13) { - validateForm(); - } -} - -// Function to build the tree - -function buildTree(tree) { - for (i = 1; i <= tree.height; i++) { - console.log(" ".repeat(tree.height - i) + tree.char.repeat((i * 2) - 1) + " ".repeat(tree.height - i)) - } -}