forked from kozakdenys/qr-code-styling
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFINAL-TEST.html
More file actions
113 lines (103 loc) · 3.31 KB
/
Copy pathFINAL-TEST.html
File metadata and controls
113 lines (103 loc) · 3.31 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FINAL TEST - Leaf & Teardrop</title>
<style>
body {
font-family: monospace;
padding: 40px;
background: #1e1e1e;
color: #fff;
}
.box {
background: #2d2d2d;
padding: 30px;
margin: 20px 0;
border-radius: 8px;
}
h1 { color: #4ec9b0; }
h2 { color: #9cdcfe; }
#qr { margin: 20px 0; }
.info {
background: #1e1e1e;
padding: 15px;
border-left: 3px solid #4ec9b0;
margin-top: 20px;
}
</style>
</head>
<body>
<h1>FINAL TEST - Leaf & Teardrop Corner Styles</h1>
<p>Build time check: <script>document.write(Date.now())</script></p>
<div class="box">
<h2>QR Code with Leaf (outer) + Teardrop (inner)</h2>
<div id="qr"></div>
<div class="info">
<strong>Config:</strong><br>
cornerSquareOptions: { type: "leaf", color: "#FF0000" }<br>
cornerDotOptions: { type: "teardrop", color: "#0000FF" }
</div>
</div>
<div class="box">
<h2>Console Output</h2>
<div id="console" style="background: #1e1e1e; padding: 10px; font-size: 12px;"></div>
</div>
<script>
const log = (...args) => {
console.log(...args);
const div = document.getElementById('console');
div.innerHTML += args.join(' ') + '<br>';
};
log('Loading library...');
</script>
<script src="./lib/qr-code-styling.js"></script>
<script>
log('Library loaded successfully');
log('Creating QR code...');
try {
const qr = new QRCodeStyling({
width: 400,
height: 400,
data: "https://example.com/test",
margin: 10,
cornerSquareOptions: {
color: "#FF0000",
type: "leaf"
},
cornerDotOptions: {
color: "#0000FF",
type: "teardrop"
},
dotsOptions: {
color: "#FFFFFF",
type: "square"
},
backgroundOptions: {
color: "#000000"
}
});
qr.append(document.getElementById("qr"));
log('QR code rendered');
setTimeout(() => {
const svg = document.querySelector('#qr svg');
if (svg) {
log('SVG found');
const paths = svg.querySelectorAll('path');
log(`Total paths: ${paths.length}`);
// Log first few paths
for(let i = 0; i < Math.min(5, paths.length); i++) {
const d = paths[i].getAttribute('d');
log(`Path ${i}: ${d ? d.substring(0, 80) + '...' : 'no d attribute'}`);
}
} else {
log('ERROR: No SVG element found!');
}
}, 100);
} catch(e) {
log('ERROR:', e.message);
}
</script>
</body>
</html>