-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
155 lines (142 loc) · 5.01 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
<!DOCTYPE html>
<html lang="en">
<head>
<!--
This is the page head - it contains info the browser uses to display the page
You won't see what's in the head in the page
Scroll down to the body element for the page content
-->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
rel="shortcut icon"
type="image/jpg"
href="https://cdn.glitch.com/d08bb326-e251-4744-9266-f454d653c7c1%2Ffavicon.png?v=1624373448629"
/>
<!-- Import the webpage's stylesheet -->
<link rel="stylesheet" href="/font.css" />
<link rel="stylesheet" href="/style.css" />
<title>Tao Táp - Gặp ai cũng Táp</title>
</head>
<body>
<div id="app">
<div
id="card"
v-bind:style="{ 'background-image': 'url(' + background + ')' }"
>
<div id="overlay"></div>
<img
v-if="showLogo"
v-bind:src="logo"
v-bind:style="{ 'width': logoSize + 'px' }"
id="logo"
/>
<div id="qr-code"></div>
<p id="name">
<span
v-bind:style="{ 'font-size': fontSize + 'px', 'font-family': font }"
id="name-content"
>{{name}}</span
>
<span class="hack">_</span>
</p>
</div>
<div id="form-card">
<div>
<h5>1. Logo</h5>
<div>
<label>Đổi logo (Ảnh PNG trong suốt, size > 250px) </label>
<input type="file" @change="changeLogo" accept="image/*" />
<button v-on:click="showLogo = !showLogo">
Ẩn/Hiện Logo
</button>
<button v-on:click="logoSize -= 10">
- Thu nhỏ
</button>
<button v-on:click="logoSize += 10">
+ Phóng to
</button>
</div>
</div>
<div>
<h5>
2. QR Code (Dùng
<a href="https://linktr.ee" target="_blank">linktree</a> hoặc
<a href="https://instabio.cc" target="_blank">instabio</a> hoặc web
tự code)
</h5>
<div>
<input v-model="url" placeholder="URL" id="url" />
<button v-on:click="updateQR(-10)">
- Thu nhỏ
</button>
<button v-on:click="updateQR(10)">
+ Phóng to
</button>
</div>
</div>
<div>
<h5>3. Ảnh nền</h5>
<div id="background-select">
<img
v-bind:src="bg"
v-for="bg in backgrounds"
v-on:click="setBackground(bg)"
/>
</div>
<label>Đổi ảnh nền (Ảnh tỷ lệ 11:7, size > 1100px X 700px) </label>
<input type="file" @change="changeCustomBg" accept="image/*" />
</div>
<div>
<h5>4. Thông tin thẻ (Tên dài quá có thể thu nhỏ chữ)</h5>
<input v-model="name" placeholder="Tên trên thẻ" id="txt-name" />
<select v-model="font">
<option v-for="fnt in fonts" :value="fnt">Font: {{fnt}}</option>
</select>
<button v-on:click="fontSize -= 2">
- Thu nhỏ
</button>
<button v-on:click="fontSize += 2">
+ Phóng to
</button>
</div>
<div>
<h5>5. Xuất file</h5>
<button v-on:click="exportCard">
Tạo thẻ (Ảnh)
</button>
<button v-on:click="exportPDF">
Tạo thẻ (PDF)
</button>
<p>
Nếu xuất file ảnh, các bạn in màu với <b>độ phân giải 300dpi</b> sẽ
được ảnh <b>tầm 8.7cm x 5.5cm</b>. <br />
Nếu xuất file PDF thì đem đi màu A4, chọn <b>Fit to Paper</b> khi in
là ok. <br />
Dán ảnh này lên thẻ NFC trắng <b>(8.55cm X 5.4cm)</b> là được nhé!
</p>
</div>
</div>
</div>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.3.1/jspdf.umd.min.js"
integrity="sha512-VKjwFVu/mmKGk0Z0BxgDzmn10e590qk3ou/jkmRugAkSTMSIRkd4nEnk+n7r5WBbJquusQEQjBidrBD3IQQISQ=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.js"
integrity="sha512-is1ls2rgwpFZyixqKFEExPHVUUL+pPkBEPw47s/6NDQ4n1m6T/ySeDW3p54jp45z2EJ0RSOgilqee1WhtelXfA=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/dom-to-image/2.6.0/dom-to-image.min.js"
integrity="sha512-01CJ9/g7e8cUmY0DFTMcUw/ikS799FHiOA0eyHsUWfOetgbx/t6oV4otQ5zXKQyIrQGTHSmRVPIgrgLcZi/WMA=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script src="/script.js" defer></script>
</body>
</html>