added a framework for the SignPpScreen

This commit is contained in:
Arlo Filley 2022-11-06 23:52:00 +00:00
parent c0247e9e98
commit f6d52f1610
2 changed files with 54 additions and 3 deletions

View File

@ -1,7 +1,7 @@
class API { class API {
constructor() { constructor() {
this.url = "http://127.0.0.1:8000/api/"; this.url = "http://192.168.0.131:8000/api/";
// this is the url of the server // this is the url of the server
// this may have to change later on // this may have to change later on
} }
@ -145,7 +145,16 @@ class API {
// there will be other tests here in later iterations but for now these tests should suffice // there will be other tests here in later iterations but for now these tests should suffice
this.postTest(testType, testLength, testTime, testSeed, quoteId, wpm, accuracy, userId); this.postTest(
testType,
testLength,
testTime,
testSeed,
quoteId,
wpm,
accuracy,
userId
);
} }
/** /**
@ -169,7 +178,7 @@ class API {
xhr.open( xhr.open(
"POST", "POST",
`${this.url}create_user/` `${this.url}create_user/`
) );
xhr.send( xhr.send(
JSON.stringify(user) JSON.stringify(user)

View File

@ -0,0 +1,42 @@
class SignUpScreen {
constructor() {
textboxes = [
new Textbox(
0,0,
0,0,
true,
"#000",
false, "#000",
"#000"
),
new Textbox(
0,0,
0,0,
true,
"#000",
false,"000",
"#000"
)
]
}
/**
* Draws the SignUpScreen class with all
* appropriate elements
*/
draw() {
background("#eeeee4");
for (texbox in this.textboxes) {
textbox.draw();
}
}
/**
*
* @param {key} key
*/
letterTyped(key) {
this.textboxes[0].letterTyped();
}
}