-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
42 lines (42 loc) · 1.7 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- CSS only -->
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6"
crossorigin="anonymous"
/>
<!-- I believe that next style tag is not needed, but just in case -->
<!-- It's where I took all the fonty part of the CSS by the way -->
<style>
@import url("https://fonts.googleapis.com/css?family=Open+Sans:400,600,300");
</style>
<link rel="stylesheet" href="styles.css" />
<title>DOM to image</title>
</head>
<body>
<div id="canvas">
<img id="image" src="collage-partitas.jpg" />
<h2 id="name">Name</h2>
<h3 id="country">Country</h3>
</div>
<input type="file" id="input-picture" name="img" accept="image/*" />
<input id="input-name" type="text" placeholder="Name" />
<input id="input-country" type="text" placeholder="Country" />
<button id="jpg" type="button" class="btn btn-secondary">
Download as JPG
</button>
<!-- <button id="png" type="button" class="btn btn-secondary">
Download as PNG
</button> -->
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dom-to-image/2.6.0/dom-to-image.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.0/FileSaver.min.js"></script>
<script src="scripts.js"></script>
</html>