-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.html
More file actions
472 lines (375 loc) · 18.9 KB
/
Copy pathindex.html
File metadata and controls
472 lines (375 loc) · 18.9 KB
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="UTF-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="mobile-web-app-capable" content="yes">
<meta name="author" content="doassignment">
<meta name="copyright" content="doassignment">
<!---Helps control how search engine bots crawl and index the content on your website.-->
<meta name="robots" content="index, follow">
<meta property="og:type" content="website">
<meta property="og:title" content="assignme">
<meta property="og:description" content="" />
<meta property="og:site_name" content="assignme" />
<title>assignme</title>
<link
href="https://fonts.googleapis.com/css2?family=Homemade+Apple&family=Caveat:wght@400;700&family=Liu+Jian+Mao+Cao&family=Pacifico&family=Indie+Flower&family=Shadows+Into+Light&family=Amatic+SC:wght@400;700&family=Dancing+Script:wght@400;700&family=Satisfy&family=Gloria+Hallelujah&family=Patrick+Hand&family=Kalam:wght@300;400;700&family=Reenie+Beanie&family=Zeyada&family=Handlee&family=Just+Another+Hand&family=Love+Ya+Like+A+Sister&family=Covered+By+Your+Grace&family=Architects+Daughter&family=Sue+Ellen+Francisco&family=Bad+Script&family=Rock+Salt&family=Yesteryear&family=Qwitcher+Grypen&family=Delius+Swash+Caps&family=Give+You+Glory&family=Kaushan+Script&family=Pinyon+Script&family=Pangolin&family=La+Belle+Aurore&family=Redressed&family=Allura&family=Herr+Von+Muellerhoff&display=swap"
rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Gloria+Hallelujah&display=swap" rel="stylesheet">
<!-- fav icon -->
<link rel="shortcut icon" type="image/x-icon" href="image/icon.png">
<!--font awesome cdn link-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css"
integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- CSS -->
<link rel="stylesheet" href="./canvaPage/css/index.css" />
<link rel="stylesheet" href="./canvaPage/css/features.css" />
<link rel="stylesheet" href="style.css">
</head>
<body>
<header class="header">
<section class="flex">
<a href="index.html" class="logo">
<img src="image/logo.png" alt="assignme Logo">
</a>
<nav class="navbar">
<a href="captureimg/index.html"><span>Own Handwriting</span></a>
<a href="docs.html"><span>Docs</span></a>
<a href="#about"><span>About</span></a>
<a href="contactus.html"><span>Feedback</span></a>
</nav>
<div id="menu-btn">Menu</div>
</section>
</header>
<section class="home" id="home">
<div class="row">
<div class="content">
<h3>Yo,<span> Future Scholars!</span></h3>
<p style="font-size: 2rem; font-weight: bold;">Stuck on Assignments or tired of doing ? We've Got Your Back!
get your assignments done in oneclick in your suitable handwriting.</p>
<a href="docs.html" class="btn" style="background-color: black; color: #fff;">Read Docs</a>
</div>
<div class="image">
<img src="image/front.jpg" alt="">
</div>
</div>
</section>
<main>
<h2 style="font-size: 1.75rem;">Upload your assignment questions pdf or image</h2>
<input type="file" id="fileInput"><br>
<input type="text" id="subjectInput" placeholder="Enter subject name"><br>
<button onclick="uploadFile()">Upload</button>
<div id="response"></div>
<section class="generate-image-section">
<br /><br />
<form id="generate-image-form">
<!-- Generate Image Section -->
<div class="display-flex output-grid responsive-flex">
<div class="flex-1 page-container-super">
<div>
<h2 style="margin-top: 0px; font-size: 2rem; ">Paper Sheet</h2>
</div>
<div class="flex-1 page-container">
<div class="page-a ">
<div contenteditable="true" class="top-margin"></div>
<div class="display-flex left-margin-and-content">
<div contenteditable="true" class="left-margin"></div>
<div class="paper-content" id="note" contenteditable="true">
<p>Hey buddy's , </p>
<p>Hope you doing great except in assignments </p>
<p>Got assignments giving you more twists and turns than a rollercoaster?</p>
<p>Well, guess what? We've got the secret sauce to turn those academic acrobatics into a walk in the
park!</p>
<p>Prepare to unleash your inner Einstein and conquer those assignments like a boss!</p>
<p>So grab your thinking caps, buckle up, and get ready for an assignment adventure like no other!
</p>
<p>Let's turn those 'oh no's into 'oh yeah's!</p>
</div>
</div>
<div class="overlay"></div>
</div>
<br />
</div>
</div>
<div class="customization-col">
<div style="padding: 0px 0px 5px 0px;">
</div>
<h3 style="font-size: 1.2rem;">Handwriting Options</h3>
<div class="category-grid">
<div>
<label class="block" for="handwriting-font" style="font-size: 1.25rem;">Handwriting Font</label>
<select id="handwriting-font" style="font-size: 1rem;">
<option selected style="font-family: 'Gloria Hallelujah'" value="'Gloria Hallelujah', cursive">Gloria
Hallelujah</option>
<option value="Beverly Smith">Beverly Smith</option>
<option value="Happy_Font">Happy1 font</option>
<option value="Happy Font">Happy font</option>
<option value="Braden Hill">Braden Hill</option>
<option value="Caroline Mutiboko">Caroline Mutiboko</option>
<option value="David Mergens">David Mergens</option>
<option value="David Reid">David Reid</option>
<option value="David Reid CAP">David Reid (Standard PLUS Version)</option>
<option value="Donald Ross">Donald Ross</option>
<option value="DS Font">DS Font</option>
<option value="Garrett Moretz">Garrett Moretz</option>
<option value="George Hughes">George Hughes</option>
<option value="Harriet DeLaughter Print">Harriet DeLaughter (Print Version)</option>
<option value="Harriet DeLaughter Cursive">Harriet DeLaughter (Cursive Version)</option>
<option value="Herbert Cooper">Herbert Cooper</option>
<option value="Jeff Dungan">Jeff Dungan</option>
<option value="Kate Rothrock">Kate Rothrock</option>
<option value="Hindi_Font">Kruti-dev(Hindi)</option>
<option value="John Caplin">John Caplin</option>
<option value="John Williams">John Williams</option>
<option value="Julian Dean">Julian Dean</option>
<option value="Kevin Knowles">Kevin Knowles</option>
<option value="Kevin Shirley">Kevin Shirley</option>
<option value="Kunjar Bhaduri">Kunjar Bhaduri</option>
<option value="Mamas and Papas">Mamas and Papas</option>
<option value="Pamela Rosenberry">Pamela Rosenberry</option>
<option value="Philip Bean">Philip Bean</option>
<option value="Royston Such">Royston Such</option>
<option value="Royston Such CAP">Royston Such (Standard PLUS Version)</option>
<option value="Rufus">Rufus</option>
<option value="Ruth Stafford">Ruth Stafford</option>
<option value="Sam Roberts">Sam Roberts</option>
<option value="Sam Roberts 2">Sam Roberts (2)</option>
<option value="Scott Williams">Scott Williams</option>
<option value="Tim Doremus">Tim Doremus</option>
<option style="font-family: 'Caveat', cursive; font-size: 13pt;" value="'Caveat', cursive">Caveat
</option>
</select>
</div>
<div class="postfix-input" data-postfix="pt">
<label for="font-size" style="font-size: 1.25rem;">Font Size</label>
<input id="font-size" min="0" step="0.5" value="10" type="number" />
</div>
</div>
<div class="category-grid">
<div class="postfix-input">
<h2 style="font-size: 1.2rem;">Upload your custom font</h2>
<input type="file" id="fontInput" accept=".ttf, .otf, .woff, .woff2"><br>
<button onclick="uploadFont()">Upload Font</button>
<div id="fontResponse"></div>
</div>
</div>
<div class="category-grid">
<div class="postfix-input" data-postfix="px">
<label for="top-padding" style="font-size: 1.25rem;">Vertical Position</label>
<input id="top-padding" min="0" value="5" type="number" />
</div>
<div class="postfix-input" data-postfix="px">
<label for="word-spacing" style="font-size: 1.25rem;">Word Spacing</label>
<input id="word-spacing" min="0" max="100" value="0" type="number" />
</div>
<div class="postfix-input" data-postfix="pt">
<label for="letter-spacing" style="font-size: 1.25rem;">Letter Spacing</label>
<input id="letter-spacing" min="-5" max="40" value="0" type="number" />
</div>
</div>
<div style="display: flex; gap: 20px; justify-content: space-between; flex-wrap: wrap; margin-top: 20px;">
<div style="border: 1px solid #ccc; padding: 20px; flex: 1; min-width: 250px; background-color: #f9f9f9; border-radius: 12px;">
<label style="display: block; margin-bottom: 10px; font-family: Arial, sans-serif; font-size: 1.2rem;"
for="page-effects">
<h2>Effects</h2><br>The effect will be reflected in genrated image
</label>
<select id="page-effects" style="padding: 5px; font-size: 16px; width: 100%; font-family: Arial, sans-serif;">
<option default value="shadows" style="padding: 5px;">Shadows</option>
<option value="scanner" style="padding: 5px;">Scanner</option>
<option value="no-effect" style="padding: 5px;">No Effect</option>
</select>
</div>
<div style="border: 1px solid #ccc; padding: 20px; flex: 1; min-width: 250px; background-color: #f9f9f9; border-radius: 12px;">
<label style="display: block; margin-bottom: 10px; font-family: Arial, sans-serif; font-size: 1.2rem;"
for="paper-file">
<h2>Custom Paper Background</h2><br>Upload a custom paper background image
</label>
<input type="file" id="paper-file" accept="image/jpeg,image/png,image/jpg" style="width: 100%;">
</div>
</div>
<div class="category-grid"
style="background-color: transparent; border: none; box-shadow: none; margin-left: -2rem;">
<div style="background-color: #f9f9f9;">
<label class="block" for="ink-color" style="font-size: 1.25rem;">Pen Color</label>
<select id="ink-color" style="font-size: 1.2rem;">
<option default value="#000f55">Blue</option>
<option value="black">Black</option>
<option value="#ba3807">Red</option>
<option value="green">Green</option>
<option value="#B197FC">Theme Special</option>
</select>
</div>
<div id="color-display"
style="margin-top: 10px; width: 20px; height: 20px; border: 1px solid #ccc; background-color: #000f55;">
</div>
</div>
<!-- GENERATE IMAGE BUTTONS -->
<hr style="
border: 0.3px solid var(--elevation-background);
width: 80%;
" />
<div style="text-align: center; padding: 30px 0px;">
<button type="submit" data-testid="generate-image-button" class="button generate-image-button"
style="font-size: 1.7rem;">
Generate Sheet
</button>
</div>
</div>
</div>
</form>
</section>
<!-- OUTPUT -->
<section>
<h2 id="output-header">Genrated sheet</h2>
<div id="output" class="output" style="text-align: center;">
Click "Generate Sheet" Button to generate response sheet.
</div>
<div style="text-align: center; padding: 30px;">
<button class="imp-button" id="download-as-pdf-button">
Download All Images as PDF
</button>
<button class="delete-button" id="delete-all-button">
Clear all images
</button>
</div>
</section>
</main>
<!-- Fixed Elements -->
<section class="draw-container popup-container">
<button class="close-button">×</button>
<div class="display-flex responsive-flex">
<canvas id="diagram-canvas" style="background-color: #fff;" height="300px" width="600px"></canvas>
<div class="flex-1 buttons-container padding-around">
<button id="add-to-paper-button" style="margin-top: 5px; margin-bottom: 5px;">
Add to Paper
</button>
<button id="draw-download-button" style="margin-top: 5px; margin-bottom: 5px;">
Download Image
</button>
<br /><br />
<input type="file" id="image-to-add-in-canvas" accept="image/x-png,image/jpeg" hidden="hidden" />
<br /><br /><button id="add-new-image-button">Add bg image</button>
<br /><br />
<button id="clear-draw-canvas" class="blue-button" style="background-color: #f30; color: #fff;">
Clear Canvas
</button>
</div>
</div>
</section>
<!--about us-->
<section class="about" id="about">
<h1 class="heading"><span>About</span>us</h1>
<div class="row">
<div class="image">
<img src="image/aboutus.jpg" alt="">
</div>
<div class="content">
<p>Hey there! So, you stumbled upon our little corner of the internet, huh? Buckle up, because things are about
to get funky!
<br><br>
<strong>Story time: </strong> The Stuff of Legends: Once upon a time (well, not that long ago, really),
a bunch of Students decided not to write their assignment because they were fed up so they turn their wild
ideas into reality.
Fast forward through countless bunk of classes, endless scolding of teachers, and a few too many breakup story
nights in my words(randi rone).
Here we are, done with our assignment.
</p>
</div>
</div>
</section>
<!--footer-->
<section class="footer">
<h2>References: Github , Node community , GenAI , Open-source</h2>
<div class="credit">©2024<span>assignme.live</span>| All Rights Reserved.</div>
</section>
<!--custom js file link-->
<script src="js/script.js"></script>
<script src="./canvaPage/js/vendors/html2canvas.min.js" crossorigin="anonymous"></script>
<script type="module" src="/canvaPage/js/app.mjs"></script>
<script defer src="https://unpkg.com/jspdf@^1/dist/jspdf.min.js"></script>
<script>
document.getElementById('ink-color').addEventListener('change', function () {
var color = this.value;
document.getElementById('color-display').style.backgroundColor = color;
});
</script>
<!--updated code 1.5-->
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
const url = "https://test2-sfwm.onrender.com/process-file/";
function uploadFile() {
const fileInput = document.getElementById('fileInput');
const subjectInput = document.getElementById('subjectInput');
const file = fileInput.files[0];
const subject = subjectInput.value;
const noteElement = document.getElementById('note');
if (!file || !subject) {
alert("Please select a file and enter a subject.");
return;
}
noteElement.innerHTML = `
<div style="text-align: center; margin-top:4rem;">
<div class="loader"></div>
<p style="margin-top: 10px;">This may take a few seconds...</p>
</div>
`;
// Use browser's native FormData instead of the Node.js form-data package
const formData = new FormData();
formData.append("file", file);
formData.append("subject", subject);
axios.post(url, formData, {
headers: {
'Content-Type': 'multipart/form-data'
},
})
.then(function (response) {
let formattedResponse = response.data;
formattedResponse = formattedResponse.replace(/\*\*/g, '');
formattedResponse = formattedResponse.replace(/\*/g, '●');
formattedResponse = formattedResponse.split('\n').map(line => `<p>${line}</p>`).join('');
noteElement.innerHTML = formattedResponse;
})
.catch(function (error) {
console.error("Error:", error);
noteElement.innerHTML = "<p>An error occurred while uploading the file. Please try again.</p>";
});
}
function uploadFont() {
const fontInput = document.getElementById('fontInput');
const file = fontInput.files[0];
if (!file) {
alert("Please select a font file.");
return;
}
const reader = new FileReader();
reader.onload = function (event) {
const fontData = event.target.result;
const fontName = file.name.split('.').slice(0, -1).join('.');
// Create a new style element
const style = document.createElement('style');
style.innerHTML = `
@font-face {
font-family: '${fontName}';
src: url(${fontData}) format('truetype');
}
`;
// Append the style element to the document head
document.head.appendChild(style);
// Add the new font to the dropdown menu
const fontDropdown = document.getElementById('handwriting-font');
const option = document.createElement('option');
option.value = fontName;
option.style.fontFamily = fontName;
option.text = fontName;
fontDropdown.add(option);
document.getElementById('fontResponse').innerText = `Your Font "${fontName}" is ready select it from handwriting font section`;
};
reader.readAsDataURL(file);
}
</script>
</body>
</html>