Create a project named firebase_write_test to write the user's score to firebase:
ask the user their name.
create a button to ADD 1 to the user's score.
display the user's score on the canvas.
when the user clicks on the SUBMIT button their name & score is written to firebase.
On completion:
If you are using P5.js web editor, turn in a share EDIT link to your project.
If your are NOT using P5.js web editor, see me about ways to turn in your work.
Copy your firebase_write _test and create a new project named firebase_write_read_test
Add code to read the user's firebase record once the user has entered their name.
Display the user's firebase score on the screen.
On completion:
If you are using P5.js web editor, turn in a share EDIT link to your project.
If your are NOT using P5.js web editor, zip it up, upload it to Google Drive and turn in the link to it.
1. You will need to copy the module containing the firebase routines into your P5.js project
Copy into your P5 project:
2. You will need to include a link to the newly added firebase module, so add the following line to your index.html:
<script src="firebase.js"></script>
You will need to include the firebase modules on your project; see below for options
2. Run your code via edit/share/present in a new browser TAB
Including firebase module in your p5.js web editor project:
1. You will need to copy the module containing the firebase routines into your P5.js project
Copy into your P5 project:
2. You will need to include a link to the newly added firebase module, so add the following line to your index.html:
<script src="firebase.js"></script>
Replace your <head> section with this:
<head>
<title>firstname.lastname FIREBASE</title>
<meta charset="utf-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.10.2/p5.js"></script>
<!-- firebase start -->
<link type="text/css" rel="stylesheet"
href="https://cdn.firebase.com/libs/firebaseui/3.5.2/firebaseui.css" />
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/7.11.0/firebase-app.js"></script>
<!-- Add Firebase products that you want to use -->
<script src="https://www.gstatic.com/firebasejs/7.11.0/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.11.0/firebase-database.js"></script>
<!-- firebase end -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" type="text/css" href="style.css">
<script defer src="sketch.js"></script>
</head>