CS-Coursework/websites/Typing/api/user.js

48 lines
1.5 KiB
JavaScript
Raw Normal View History

2022-11-28 11:04:49 +00:00
/**
* @file This file provides an abstraction of all the data about the user
* @author Arlo Filley
*
* TODO:
* - save user preferences about colours
* - make greater useage of localstorage to store tests before signup/login
* and post them to the database if a login is made.
*/
/**
* this class displays a number of textboxes that allows the user to input a
* username and password. Then find out the user_id of that account through the
* necessary api routes.
*/
2022-11-11 13:04:13 +00:00
class User {
constructor() {
this.username = "not logged in";
this.userId = 0;
2023-09-05 08:52:28 +01:00
this.secret;
2023-09-04 21:01:22 +01:00
2022-11-18 11:33:25 +00:00
this.leaderboard;
2022-11-18 14:51:05 +00:00
this.time = 15;
2022-11-28 11:04:49 +00:00
this.tests;
this.lastTest;
this.nextTest = `satisfy powerful pleasant bells disastrous mean kited is gusted romantic past taste immolate productive leak close show crabby awake handsails finicky betray long-term incompetent wander show manage toys convey hop constitute number send like off ice aboard well-made vast vacuous tramp seed force divergent flower porter fire untidy soggy fetch`;
2022-12-01 14:41:14 +00:00
this.colorScheme = {
2023-09-05 08:52:28 +01:00
background: "#160C1C",
text: "#FBB",
2022-12-01 14:41:14 +00:00
timerBar: "#50C5B7",
timerText: "#000",
testGood: "#0A0",
testBad: "#A00",
buttonBG: "#000",
buttonText: "#fff",
buttonBorder: "#000",
2023-09-05 08:52:28 +01:00
buttonHoverBG: "#FBB",
2022-12-01 14:41:14 +00:00
buttonHoverText: "#000",
buttonHoverBorder: "#000"
}
2022-11-11 13:04:13 +00:00
}
}