diff --git a/tree/.ipynb_checkpoints/0_start-checkpoint.html b/tree/.ipynb_checkpoints/0_start-checkpoint.html index 7b1e33b..76f013d 100644 --- a/tree/.ipynb_checkpoints/0_start-checkpoint.html +++ b/tree/.ipynb_checkpoints/0_start-checkpoint.html @@ -3,18 +3,25 @@ - start + bench -

start

-

Hello

It's Saturday morning. You are sitting on a bench at the park waiting for your friend Amanda. She seems to be really late. +

Hello

It's Saturday morning. You are sitting on a bench at the park waiting for your friend Amanda. She seems to be really late. You spot a copy of today's newspaper on the bench. Maybe you want to give it a read. You can go for a little walk or just wait for Amanda if you feel like it.

+ + \ No newline at end of file diff --git a/tree/.ipynb_checkpoints/index-checkpoint.html b/tree/.ipynb_checkpoints/index-checkpoint.html index f219729..7ddf281 100644 --- a/tree/.ipynb_checkpoints/index-checkpoint.html +++ b/tree/.ipynb_checkpoints/index-checkpoint.html @@ -9,13 +9,13 @@
- welcome to *name*, in this story you will be someone called
. + welcome to *name*, in this story you will be someone called
.
You will look like -
- -
+ + + or like - +
diff --git a/tree/.ipynb_checkpoints/index-checkpoint.js b/tree/.ipynb_checkpoints/index-checkpoint.js new file mode 100644 index 0000000..bdd4cfb --- /dev/null +++ b/tree/.ipynb_checkpoints/index-checkpoint.js @@ -0,0 +1,15 @@ +//store form's value in localStorage + +var f = document.querySelector("form#avatar_form") +f.onchange = updateAvatar + +document.querySelector("#player1").onchange = updateAvatar +document.querySelector("#player2").onchange = updateAvatar + +function updateAvatar () { + console.log("CHANGE"); + var fd = new FormData(f) + var avatar=fd.get("player_avatar") + console.log("avatar", avatar); + localStorage.myavatar=avatar +} diff --git a/tree/0_start.html b/tree/0_start.html index 7b1e33b..76f013d 100644 --- a/tree/0_start.html +++ b/tree/0_start.html @@ -3,18 +3,25 @@ - start + bench -

start

-

Hello

It's Saturday morning. You are sitting on a bench at the park waiting for your friend Amanda. She seems to be really late. +

Hello

It's Saturday morning. You are sitting on a bench at the park waiting for your friend Amanda. She seems to be really late. You spot a copy of today's newspaper on the bench. Maybe you want to give it a read. You can go for a little walk or just wait for Amanda if you feel like it.

+ + \ No newline at end of file diff --git a/tree/index.html b/tree/index.html index 54e307c..7ddf281 100644 --- a/tree/index.html +++ b/tree/index.html @@ -11,11 +11,11 @@
welcome to *name*, in this story you will be someone called
.
You will look like -
- + + or like - +
diff --git a/tree/index.js b/tree/index.js index e69de29..bdd4cfb 100644 --- a/tree/index.js +++ b/tree/index.js @@ -0,0 +1,15 @@ +//store form's value in localStorage + +var f = document.querySelector("form#avatar_form") +f.onchange = updateAvatar + +document.querySelector("#player1").onchange = updateAvatar +document.querySelector("#player2").onchange = updateAvatar + +function updateAvatar () { + console.log("CHANGE"); + var fd = new FormData(f) + var avatar=fd.get("player_avatar") + console.log("avatar", avatar); + localStorage.myavatar=avatar +}