1+ <!DOCTYPE html>
2+ < html >
3+
4+ < head >
5+ < meta charset ="utf-8 " />
6+ < title > Download Demo - EasyQRCodeJS</ title >
7+ < script src ="../dist/easy.qrcode.min.js " type ="text/javascript " charset ="utf-8 "> </ script >
8+
9+ < style type ="text/css ">
10+ body {
11+ margin : 0 ;
12+ padding : 0 ;
13+ }
14+
15+ # header {
16+ text-align : left;
17+ margin : 0 ;
18+ line-height : 80px ;
19+ background-color : # 007bff ;
20+ color : # fff ;
21+ padding-left : 20px ;
22+ font-size : 36px ;
23+ }
24+
25+ # header a {
26+ color : # FFFF00 ;
27+ }
28+
29+ # header a : hover {
30+ color : # FF9933 ;
31+ }
32+
33+ # container {
34+ width : 1030px ;
35+ margin : 10px auto;
36+ }
37+
38+ .imgblock {
39+ margin : 10px 0 ;
40+ text-align : center;
41+ float : left;
42+ min-height : 420px ;
43+ border-bottom : 1px solid # B4B7B4 ;
44+ }
45+
46+ .qr table {}
47+
48+ .title {
49+ font-size : 15px ;
50+ font-weight : bold;
51+ color : # fff ;
52+ text-align : center;
53+ width : 330px ;
54+ margin : 10px 5px ;
55+ height : 60px ;
56+ background-color : # 0084C6 ;
57+ line-height : 60px ;
58+ }
59+
60+ .download {
61+ margin-top : 20px ;
62+ }
63+
64+ # footer {
65+ margin-top : 20px ;
66+ border-top : 1px solid gainsboro;
67+ line-height : 40px ;
68+ clear : both;
69+ text-align : center;
70+ }
71+
72+ # footer a {
73+ color : # 0084C6 ;
74+ text-decoration : none;
75+ }
76+ </ style >
77+ </ head >
78+
79+ < body >
80+ < div id ="header ">
81+
82+ EasyQRCodeJS Demo
83+
84+
85+ < div style ="float: right;margin-right: 100px; ">
86+ < a href ="http://www.easyproject.cn/easyqrcodejs/tryit.html "> Try It!</ a >
87+ </ div >
88+ </ div >
89+
90+ < div id ="container ">
91+ < div class ="imgblock ">
92+ < div class ="title "> Download - PNG</ div >
93+ < div class ="qr " id ="qrcode_png "> </ div >
94+ < div class ="download " id ="qrcode_png_download ">
95+ < button onclick ="downloadQRcode('png') "> download</ button >
96+ </ div >
97+ </ div >
98+ < div class ="imgblock ">
99+ < div class ="title "> Download - SVG</ div >
100+ < div class ="qr " id ="qrcode_svg "> </ div >
101+ < div class ="download " id ="qrcode_svg_download ">
102+ < button onclick ="downloadQRcode('svg') "> download</ button >
103+ </ div >
104+ </ div >
105+ </ div >
106+
107+
108+ < div id ="footer ">
109+
110+ < a href ="www.easyproject.cn/donation "> www.easyproject.cn/donation</ a >
111+
112+ </ div >
113+
114+
115+ < a href ="https://github.com/ushelp/EasyQRCodeJS " class ="github-corner " aria-label ="View source on GitHub "> < svg width ="80 " height ="80 " viewBox ="0 0 250 250 "
116+ style ="fill:#FD6C6C; color:#fff; position: absolute; top: 0; border: 0; right: 0; " aria-hidden ="true ">
117+ < path d ="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z "> </ path >
118+ < path d ="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2 "
119+ fill ="currentColor " style ="transform-origin: 130px 106px; " class ="octo-arm "> </ path >
120+ < path
121+ d ="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z "
122+ fill ="currentColor " class ="octo-body "> </ path >
123+ </ svg > </ a >
124+ < style >
125+ .github-corner : hover .octo-arm {
126+ animation : octocat-wave 560ms ease-in-out
127+ }
128+
129+ @keyframes octocat-wave {
130+
131+ 0% ,
132+ 100% {
133+ transform : rotate (0 )
134+ }
135+
136+ 20% ,
137+ 60% {
138+ transform : rotate (-25deg )
139+ }
140+
141+ 40% ,
142+ 80% {
143+ transform : rotate (10deg )
144+ }
145+ }
146+
147+ @media (max-width : 500px ) {
148+ .github-corner : hover .octo-arm {
149+ animation : none
150+ }
151+
152+ .github-corner .octo-arm {
153+ animation : octocat-wave 560ms ease-in-out
154+ }
155+ }
156+ </ style >
157+ </ body >
158+
159+ </ html >
160+
161+ < script type ="text/javascript ">
162+ var configPng = {
163+ text : "www.easyproject.cn/donation" ,
164+
165+ width : 240 ,
166+ height : 240 ,
167+ colorDark : "#000000" ,
168+ colorLight : "#ffffff" ,
169+
170+ PI : '#BF3030' ,
171+ PO : '#269926' ,
172+ AI : '#009ACD' ,
173+ AO : '#B03060' ,
174+
175+ correctLevel : QRCode . CorrectLevel . H , // L, M, Q, H
176+
177+ title : 'PNG image' ,
178+ titleHeight : 46 ,
179+
180+ onRenderingEnd :function ( options , dataURL ) {
181+ document . getElementById ( "qrcode_png_download" ) . style . display = 'block' ;
182+ }
183+ }
184+
185+ var configSvg = {
186+ text : "www.easyproject.cn/donation" ,
187+
188+ width : 240 ,
189+ height : 240 ,
190+ colorDark : "#000000" ,
191+ colorLight : "#ffffff" ,
192+
193+ PI : '#f55066' ,
194+ PO : '#aa5b71' ,
195+ AO : '#A67C00' ,
196+ AI : '#A67C00' ,
197+
198+ correctLevel : QRCode . CorrectLevel . H , // L, M, Q, H
199+
200+ title : 'SVG image' ,
201+ titleHeight : 46 ,
202+
203+ drawer : 'svg' ,
204+ onRenderingEnd :function ( options , dataURL ) {
205+ // Display the download button
206+ document . getElementById ( "qrcode_png_download" ) . style . display = 'block' ;
207+ }
208+ }
209+
210+ var qrcodePng = new QRCode ( document . getElementById ( "qrcode_png" ) , configPng ) ;
211+ var qrcodeSvg = new QRCode ( document . getElementById ( "qrcode_svg" ) , configSvg ) ;
212+
213+ function downloadQRcode ( type ) {
214+ fileName = 'easyQRCode'
215+ if ( type == 'png' ) {
216+ qrcodePng . download ( fileName ) ;
217+ } else {
218+ qrcodeSvg . download ( fileName ) ;
219+ }
220+ }
221+ </ script >
0 commit comments