From 4615c296b3fa146e8ebdee42e07a6747938878c1 Mon Sep 17 00:00:00 2001 From: Tyler-A Date: Tue, 10 Sep 2019 01:00:05 -0600 Subject: [PATCH] The beginnings. --- index.html | 39 +++++++++++++++++++++++++++++++++++++++ js/add_choice.js | 10 ++++++++++ style.css | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 index.html create mode 100644 js/add_choice.js create mode 100644 style.css diff --git a/index.html b/index.html new file mode 100644 index 0000000..7f0e1d6 --- /dev/null +++ b/index.html @@ -0,0 +1,39 @@ + + + + + + + Weighted Choice Maker + + + + + + + + + + +

Weighted Choice Maker

+
+

Choices:

+ +
+
+
+
+ + +
+
+
+
+ + \ No newline at end of file diff --git a/js/add_choice.js b/js/add_choice.js new file mode 100644 index 0000000..b310044 --- /dev/null +++ b/js/add_choice.js @@ -0,0 +1,10 @@ +const add_choice = () => { + let index = document.getElementsByClassName("choice").length; + + + let choice_div = document.getElementById("choice-template"); + let clone = choice_div.content.cloneNode(true); + clone.childNodes[1].childNodes[1].id = `text-in-${index}`; + clone.childNodes[1].childNodes[3].id = `weight-in-${index}`; + document.getElementById("choices").appendChild(clone); +} \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..2cbba1d --- /dev/null +++ b/style.css @@ -0,0 +1,34 @@ +h1, h2, h3 { text-align: center; } + + +div.container { + text-align: center; + border-radius: 7px; + margin: 5px auto; + padding: 10px; + width: 95%; +} + + + +div.line { + --margin-height: 15px; + height: 2px; + background-color: #7289da; + margin-top: var(--margin-height); + margin-bottom: var(--margin-height); +} + + + +input[type="text"] { + display: inline-block !important; + margin-right: 0px; + margin-left: 0px; + margin-top: 0px; + margin-bottom: 0px; +} + +/* Move boxes further apart */ +input[type="text"].left { margin-right: 10%; } +input[type="text"].right { margin-left: 10%; } \ No newline at end of file