From 358c39a0000f6907f2c3ec754606d34fce7117a4 Mon Sep 17 00:00:00 2001 From: Dominic Coelho Date: Sat, 8 Sep 2018 15:44:18 +0100 Subject: [PATCH] remove old files not in use --- simpler-main.css | 97 ---------------------------- simpler-script.js | 156 ---------------------------------------------- simpler.html | 72 --------------------- 3 files changed, 325 deletions(-) delete mode 100644 simpler-main.css delete mode 100644 simpler-script.js delete mode 100644 simpler.html diff --git a/simpler-main.css b/simpler-main.css deleted file mode 100644 index 6232c13..0000000 --- a/simpler-main.css +++ /dev/null @@ -1,97 +0,0 @@ -* { - box-sizing: border-box; -} - -body { - background: linear-gradient(#79d29c, #4062bf); - width: 90vw; - min-height: 100vh; - height: 100%; - background-repeat: no-repeat; - padding: 1.4rem; -} - -/* .notice { - color: mediumvioletred; - font-weight: bold; -} */ - -.notice { - font-size: 1.75rem; - color: #000000; - background-color: hotpink; - font-weight: bold; -} - -p { - font-size: 1.4rem; - margin-bottom: 0; - margin-top: 0.5rem; -} - -h1 { - font-size: 2.8rem; - text-shadow: 0 0 2.8rem lavenderblush; - /* such a pointless text shadow lol */ -} - -input { - font-size: 1.4rem; - background-color: lavender; -} - -#welcome { - width: 100%; -} - -input { - border: 2px solid rgba(0, 0, 0, 0.5); - padding: 3px; - text-align: center; -} - -input[type="submit"] { - margin: 0.35rem; - border: none; -} - -button { - /* put stuff here */ -} - -#stopwatch-area { - display: flex; - flex-wrap: wrap; - justify-content: center; -} - -div[id*='person_'] { - background-color: rgba(10, 10, 233, 0.15); - padding: 1rem; - margin: 0.5rem; - border-style: dotted; - display: flex; - flex-direction: column; - align-items: center; -} - -p[id*='time-taken'] { - text-align: center; - font-size: 2.8rem; -} - -/* button[id*='start-btn'] { - background-color: rgba(10, 10, 233, 0.15); - padding: 0.5rem; - margin: 0.5rem; - border-style: dotted; - font-size: 1.4rem; -} */ - -.start-btn { - background-color: rgba(238, 105, 52, 0.35); - padding: 0.5rem; - margin: 0.5rem; - border-style: dotted; - font-size: 1.4rem; -} \ No newline at end of file diff --git a/simpler-script.js b/simpler-script.js deleted file mode 100644 index 505738f..0000000 --- a/simpler-script.js +++ /dev/null @@ -1,156 +0,0 @@ -var firstPersonBtn = document.getElementById("0-start-btn"); - -firstPersonBtn.addEventListener("click", () => { - console.log("clicked start button!") - countUp(); -}) - -// idea: have an "active person" gloabl variable/property -// ...that gets assigned by the respective "start/resume" clicks -// ...and then a global while loop/settimeout that adds to -// the "global"/total time, as well as ONLY the time of the -// ...person who's denoted by the "active person" -// alternatively do this with a class/id? Might be more clunky tho - -var minsDisplay = document.getElementById("mins"); -var secsDisplay = document.getElementById("secs"); - -function countUp(secs) { - var now = Date.now(); - - () => { - - } - - // minsDisplay.innerText = "5"; -} - - - -// -// -// -//////////////// OLD STUFF BELOW \\\\\\\\\\\\\\\\\ -// -// -// -var timer = document.getElementById("timer"); - -var numberOfPeople = document.getElementsByName("number-of-people")[0]; -var timeInput = document.getElementsByName("time-minutes")[0]; -var namesInput = document.getElementsByName("names")[0]; - -var submit = document.getElementById("submit-btn-1"); -var firstForm = document.getElementById("first-form"); -var welcomeMsg = document.getElementById("welcome-msg"); -var welcome = document.getElementById("welcome"); - -var stopwatchArea = document.getElementById("stopwatch-area"); - -// might not need these as globals -var people = 0; -var startTime = 0; //minutes - -// Note to self... -if (!window) { - console.log("no window object! This scripts gonna fail"); -} else { - console.log("woo theres a window!"); -} - -// first submit -firstForm.addEventListener("submit", function (event) { - event.preventDefault(); - - var peopleInputVal = numberOfPeople.value; - var timeInputVal = timeInput.value; - var peoplesNamesArr = namesInput.value.split(", "); - - if (peopleInputVal.match(/[^0-9]/g) || timeInputVal.match(/[^0-9]/g)) { - stopwatchArea.innerText = ""; - welcomeMsg.innerText = "Please check your number inputs! Thanks"; - welcomeMsg.classList.add("notice"); - } else if (peoplesNamesArr.length != peopleInputVal) { - stopwatchArea.innerText = ""; - welcomeMsg.innerText = - "Please ensure that the number of names that you input matches the number of people presenting"; - welcomeMsg.classList.add("notice"); - } else { - welcomeMsg.innerText = ""; - people = Number(peopleInputVal); - startTime = Number(timeInputVal); - console.log(peoplesNamesArr); - - // future plan: run function to clear window contents and add options to put names of people. Cleaner. See for loop in createSecontForm function that I commented out - - // populate stopwatch area - stopwatchArea.innerText = ""; - - createStopwatchArea(people, startTime, peoplesNamesArr); - } -}); - -// function to create stopwatch area -function createStopwatchArea(ppl, time, pplArr) { - // create "overview" text description - var areaIntro = document.createElement("p"); - - var minsPerPerson = (time / ppl).toPrecision(2); - - areaIntro.textContent = - "There are " + - ppl + - " people (" + - pplArr.join(", ") + - "), and each person has " + - minsPerPerson + - " minutes to present"; - areaIntro.classList.add("notice"); - stopwatchArea.appendChild(areaIntro); - - createTimerObjects(minsPerPerson, pplArr); -} - -// function to make objects to track peoples' time -function createTimerObjects(mins, pplNames) { - pplNames.forEach((p, i) => { - window["presenter_" + i] = { - name: p, - timeAllocSecs: mins * 60, - timeTakenSecs: 0 - }; - }); -} - -// function to create divs for each person, displaying time left, time taken and button to start/stop -function createPeoplesDivs() { - for (var i = 0; i < people; i++) { - // call a function that creates each person's area, then loop through it in here, passing in the pplArr[i] as the argument each time - - //testing things out - var hi = document.createElement("p"); - hi.textContent = window["presenter_" + i]; - stopwatchArea.appendChild(hi); - } -} - -// Future plans... - -// on form reset, check put the last used vals for number of people, total time, and names into form inputs -// edit: ^ this may not be necessary! - -/* -function createSecondForm(ppl, time) { - - welcome.innerText = ""; - - // welcome.innerText = "There are " + ppl + " people, and each person has " + (time / ppl).toPrecision(2) + " minutes to present"; - - //create final inputs - for (var i = 0; i < people; i++) { - console.log("hi"); - } - -} - -*/ \ No newline at end of file diff --git a/simpler.html b/simpler.html deleted file mode 100644 index 72cc8a0..0000000 --- a/simpler.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - Stopwatch test! - - - - - - - Currently feeling lazy, so I'm working on this simple version of my idea below! More advanced version will become available - at index.html eventually - - -

Group stopwatch trial (simpler version)

- - - -
-
-

First person

- -

- 0 : - 0 -

- -
-
-

Second person

- -

0

- -
-
-

Third person

- -

0

- -
-
-

Fourth person

- -

0

- -
-
- -
-

Welcome! Please fill in names above to get started. This has been rushed and is very much a WIP

-
-

Number of people presenting:

- -
-

Total time (minutes):

- -
-

Names (unique, for now, and separated by " , "). Ideally add them in order (left to right):

- - -
-
-
- - - - \ No newline at end of file