added a framework for the SignPpScreen
This commit is contained in:
parent
c0247e9e98
commit
f6d52f1610
@ -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)
|
||||||
|
42
website/screens/signUpScreen.js
Normal file
42
website/screens/signUpScreen.js
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user