From 8ec131548913282b13c88e68dd0fcda8683637d0 Mon Sep 17 00:00:00 2001 From: Simon Farnsworth Date: Mon, 28 Oct 2024 13:59:17 +0000 Subject: [PATCH 1/2] Add a squared paper background --- index.html | 1 + script.js | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index d0d73e9..067678b 100644 --- a/index.html +++ b/index.html @@ -37,6 +37,7 @@

DATE

+ diff --git a/script.js b/script.js index cc1cfb3..1187a41 100644 --- a/script.js +++ b/script.js @@ -110,6 +110,8 @@ let redBlueLineImage = new Image(); redBlueLineImage.src = "red-blue-lines.png"; let greyDottedLineImage = new Image(); greyDottedLineImage.src = "grey-dotted-lines.png"; +let squaresImage = new Image(); +squaresImage.src = "squares.png"; let quillImage = new Image(); quillImage.src = "quill.svg"; @@ -265,7 +267,14 @@ backgroundButton4.onclick = function() selectedPageButton = 3; selectPageButton(); } - +backgroundButton5.onclick = function() +{ + selectedBackground = squaresImage; + resetcanvasWriter(ctx); + storedLines = []; + selectedPageButton = 4; + selectPageButton(); +} function selectPageButton() { if (selectedPageButton == 0) @@ -274,6 +283,7 @@ function selectPageButton() document.getElementById("backgroundButton2").innerHTML = "Background 2"; document.getElementById("backgroundButton3").innerHTML = "Background 3"; document.getElementById("backgroundButton4").innerHTML = "Background 4"; + document.getElementById("backgroundButton5").innerHTML = "Background 5"; } else if (selectedPageButton == 1) { @@ -281,6 +291,7 @@ function selectPageButton() document.getElementById("backgroundButton2").innerHTML = "Background 2"; document.getElementById("backgroundButton3").innerHTML = "Background 3"; document.getElementById("backgroundButton4").innerHTML = "Background 4"; + document.getElementById("backgroundButton5").innerHTML = "Background 5"; } else if (selectedPageButton == 2) { @@ -288,6 +299,7 @@ function selectPageButton() document.getElementById("backgroundButton2").innerHTML = "Background 2"; document.getElementById("backgroundButton3").innerHTML = "Background 3"; document.getElementById("backgroundButton4").innerHTML = "Background 4"; + document.getElementById("backgroundButton5").innerHTML = "Background 5"; } else if (selectedPageButton == 3) { @@ -295,6 +307,15 @@ function selectPageButton() document.getElementById("backgroundButton2").innerHTML = "Background 2"; document.getElementById("backgroundButton3").innerHTML = "Background 3"; document.getElementById("backgroundButton4").innerHTML = "Background 4"; + document.getElementById("backgroundButton5").innerHTML = "Background 5"; + } + else if (selectedPageButton == 4) + { + document.getElementById("backgroundButton1").innerHTML = "Background 1"; + document.getElementById("backgroundButton2").innerHTML = "Background 2"; + document.getElementById("backgroundButton3").innerHTML = "Background 3"; + document.getElementById("backgroundButton4").innerHTML = "Background 4"; + document.getElementById("backgroundButton5").innerHTML = "Background 5"; } } From f27742a94b79dc4c31ab0f44fb69782b19ae6927 Mon Sep 17 00:00:00 2001 From: Simon Farnsworth Date: Mon, 28 Oct 2024 14:11:06 +0000 Subject: [PATCH 2/2] Missed the squared paper background --- squares.png | Bin 0 -> 9765 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 squares.png diff --git a/squares.png b/squares.png new file mode 100644 index 0000000000000000000000000000000000000000..1393b66d5f8816662fd49b821b490d4d5f865809 GIT binary patch literal 9765 zcmeAS@N?(olHy`uVBq!ia0y~yV76sS zD=lONrC0x#grF!`_5bCH7=#Hx*8j_aJCRISwff)k#YJ!{KuZ7myFW!(0c8D}-#6-z z(GYKX0#j`Em=qF8l>u(xY~E&c5}2UJBN%a+xd_ECmOUkVC@z61*1)Z z(MA$-t8ld0INFdVqnsM;T8wtKM!TQLRms40$X~oYi`<2a{c0~w#&Ckb|9)zYall#} zumKdo(MI)XqnhMK_2`h+=pY~RxajDx=jcH2=+HPBwL5KU->T|j=>O~8l7$%o%b7^_e1V9j?N8_&Xy0M&Q|-qduSb_ w&1ATq@8jq)56BSKXp>;HNidX~1b>t>9=0y^pUmk6T>i!2>FVdQ&MBb@0N}_2RR910 literal 0 HcmV?d00001