-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
163 lines (125 loc) · 6.46 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Easy peasy writer</title>
<meta name="description" content="Easy Writer - HTML5 canvas based writer.">
<meta name="viewport" id='btnClick' content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="css/easywriteold.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.4/jspdf.min.js"></script>
<script>src="js/math.js"</script>
</head>
<body onselectstart="return false" style = "margin: 0;padding: 0;" >
<div id="signature-pad" class="signature-pad" style= "position: sticky;
position: -webkit-sticky;top: 0;background: #0f0;margin: 0;padding: 0;">
<div class="signature-pad--body" style = "position: sticky; position: -webkit-sticky;
top: 0;background: #fff;margin: 0;padding: 0;">
<canvas id="myCanvas" width=100% height=100% style= "position: absolute;top: 0; overflow: hidden; border:1px solid #fff; background: #def;margin: 0;padding: 0; ">
Your browser does not support the HTML5 canvas tag.</canvas>
<script>
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d"); //the draw/write area
</script>
</div>
<div class="display-pad" id="display-pad" style = "position = relative; overflow = auto;
background: #f00;">
<canvas class = "containB" id="mydisplay" width= 100% style = "overflow = auto; background: #fff;margin: 0;padding: 0;">
Your browser does not support the HTML5 canvas tag.</canvas>
<script>
var c2 = document.getElementById("mydisplay");
var scroll = c2.scrollTop;
c2.width = window.innerWidth;
c2.height = window.innerHeight*6;
var ctx2 = c2.getContext("2d");
</script>
</div>
</div>
<div id = "hide3" style = "height: 1px;
background-color: #fff;
position: absolute;
top: 0;
width: 100%;
margin: 0;
padding: 0;">
<button id = "button1" onclick="copyme()" style = "display:inline-block; width: 32vw; margin: 0;padding: 0;" >Copy</button>
<button id = "button2" onclick="hide()" style = "display:inline-block; width: 32vw; margin: 0;padding: 0;" >Options</button>
<button id = "button3" onclick="hide2()" style = "display:inline-block; width: 32vw; margin: 0;padding: 0;" >Help</button>
</div>
<div id = "hide" style = "width: 20px;
background-color: #fff;
position: absolute;
left: 0;
height: 100%;
display: none;
margin: 0;
padding: 0;">
<textarea id='text' text-size-adjust=none display=none style = "display:inline-block;"></textarea>
<canvas id='textCanvas' height=20 style = "display:inline-block;"></canvas>
<img src="images/S/Delete.png" onclick = "clearme()" data-action = "clear" ></img>
<img src="images/S/Red.png" onclick = "colorR()" ></img>
<img src="images/S/Orange.png" onclick = "colorO()" ></img>
<img src="images/S/Yellow.png" onclick = "colorY()" ></img>
<img src="images/S/Green.png" onclick = "colorG()" ></img>
<img src="images/S/Blue.png" onclick = "colorBl()" ></img>
<img src="images/S/Purple.png" onclick = "colorP()" ></img>
<img src="images/S/Black.png" onclick = "colorB()" ></img>
<img src="images/S/centre.png" onclick = "centre()" ></img>
<img src="images/S/Keep.png" onclick = "copyme()" data-action = "keep" ></img>
<img src="images/S/newline.png" onclick = "mynewline()" ></img>
<img src="images/S/Save.png" onclick = "savePDF()"></img>
<img src="images/S/smooth.png" onclick = "smooth3()"></img>
<img src="images/S/rough.png" onclick = "rough3()"></img>
<script>
const canvastc = document.getElementById("textCanvas");
canvastc.style.font = canvastc.getContext("2d").font;
console.log(canvastc.style.font);
canvastc.style.fontSize = "24px arial";
console.log(canvastc.style.font);
//canvastc.getContext("2d").font = canvastc.style.font;
const ctxtc = canvastc.getContext("2d");
var cFont = ctxtc.font;
var fontArgs = ctxtc.font.split(' ');
var newSize = '24px';
ctxtc.font = newSize + ' ' + fontArgs[fontArgs.length - 1]; /// using the last part
// Match on digit at least once, optional decimal, and optional digits
// Named group `value`
//const match = /(?<value>\d+\.?\d*)/;
//const setFontSize = (size) => ctxtc.font = ctxtc.font.replace(match, size);
//const adjustFontSize = (amount) => {
//const newSize = parseFloat(ctxtc.font.match(match).groups.value + amount);
//return ctxtc.font = ctxtc.font.replace(match, newSize);
//}
document.getElementById("text").value = ' ';
</script>
</div>
<div id = "hide2" style = "background-color: #fff;
position: absolute;
top: 0;
text-align: center;
width: 70%;
display: none;
margin: 20;
padding: 20;"><br>
<H1 >
Click on the HELP button to hide this message.<br>
Click on the COPY button to copy your writing to the PDF.<br>
Click on the OPTIONS button to show or hide additional icons.<br><br>
Easy-peasy writing tool if you struggle with small writing. <br>
You write large in the blue area below and click on COPY to move the writing to the top pdf page. <br>
Use for class, mathematics or any other purpose. Write on your phone or tablet, then press the white check mark or Copy Button to transcribe to the pdf area. <br>
You can also type in the text box and submit the text using the same white check icon or the COPY button. <br> <br>
Use the red PDF icon to download the document in PDF to your computer.<br>
The White X icon deletes the current writing without transferring it to the PDF side.<br>
The Colour icons pick a pen colour.<br>
The C-target icon places the current writing on a new line on the centre of the PDF<br>
The NEW icon moves to a new line in the PDF.<br>
The two icons at the bottom tries to smooth (Green Arrow) the lines more, or less (Red Arrow).<br>
<br>
Click on the HELP button to hide this message.
</H1></div>
<script src="js/signature_pad.js"></script>
<script src="js/app3.js"></script>
</body>
</html>