-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
232 lines (217 loc) · 12 KB
/
Copy pathindex.html
File metadata and controls
232 lines (217 loc) · 12 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
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MTG Scanner - Simple Version</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="app">
<!-- Notification Container -->
<div id="notificationContainer" class="notification-container"></div>
<header>
<h1>🎴 MTG Scanner</h1>
<div class="disclaimer">
<p class="disclaimer-text">
⚠️ <strong>Inoffizielles Fan-Projekt</strong> • Keine Verbindung zu Wizards of the Coast oder Hasbro
</p>
</div>
</header>
<main>
<!-- Camera Section -->
<section id="cameraSection" class="camera-section">
<!-- Start camera controls (always visible) -->
<div class="start-camera-controls">
<button id="startCamera" class="btn primary">📷 Kamera starten</button>
<div class="upload-divider">oder</div>
<input type="file" id="fileInput" accept="image/*" hidden>
<button id="uploadCard" class="btn secondary">📁 Bild hochladen</button>
</div>
<!-- Camera container (hidden when camera stopped) -->
<div id="cameraContainer" class="camera-container" hidden>
<video id="video" autoplay playsinline></video>
<div class="alignment-grid">
<div class="grid-lines horizontal">
<div class="grid-line"></div>
<div class="grid-line"></div>
<div class="grid-line"></div>
</div>
<div class="grid-lines vertical">
<div class="grid-line"></div>
<div class="grid-line"></div>
<div class="grid-line"></div>
</div>
<div class="grid-center">
<div class="alignment-hint">📐 Karte orthogonal ausrichten</div>
</div>
</div>
<canvas id="canvas" hidden></canvas>
</div>
<!-- Camera operation buttons (directly under video, hidden when camera stopped) -->
<div id="cameraOperationControls" class="camera-operation-controls" hidden>
<button id="captureCard" class="btn success">📸 Karte scannen</button>
<button id="flashToggle" class="btn secondary" hidden>🔦 Blitz</button>
<button id="stopCamera" class="btn danger">⏹️ Stoppen</button>
</div>
<!-- Alignment instructions (hidden when camera stopped) -->
<div id="alignmentInstructions" class="alignment-instructions" hidden>
<div class="instruction-text">
📐 <strong>Ausrichtungs-Hilfe:</strong> Richten Sie die Karte parallel zu den Rasterlinien aus.
Die Kartenkanten sollten den horizontalen und vertikalen Linien folgen.
</div>
</div>
</section>
<!-- Debug Section (hidden by default, toggled from footer) -->
<section id="debugSection" class="debug-section" hidden>
<h3>🔧 Debug-Tools</h3>
<div class="debug-images">
<div class="debug-buttons">
<h4>🔍 Automatische Erkennung - Debug Schritte</h4>
<div class="debug-button-grid">
<button onclick="mtgScanner.showCapturedImage()" class="btn small">📷 Original</button>
<button onclick="mtgScanner.showQuadrantImage()" class="btn small">📐 Quadrant</button>
<button onclick="mtgScanner.showBottomCroppedImage()" class="btn small">⬇️ Unterer Rand</button>
<button onclick="mtgScanner.showLeftCroppedImage()" class="btn small">⬅️ Linker Rand</button>
<button onclick="mtgScanner.showTextAreaImage()" class="btn small">📝 Textbereich</button>
<button onclick="mtgScanner.showFinalImage()" class="btn small">🎯 Final</button>
</div>
<div class="debug-ocr-section">
<h5>🔍 OCR-Resultate</h5>
<button onclick="mtgScanner.showOCRResults()" class="btn small">📝 OCR Details</button>
</div>
<div class="debug-stats" id="debugStats">
<h5>🔧 Erkennungs-Parameter</h5>
<div id="debugStatsContent">Führen Sie einen Scan durch, um Debug-Informationen zu sehen</div>
</div>
</div>
<div class="debug-image-display" id="debugImageDisplay" hidden>
<h6 id="debugImageTitle">Debug Image</h6>
<div class="debug-image-info" id="debugImageInfo"></div>
<img id="debugImage" alt="Debug Image" src="">
<button onclick="mtgScanner.hideDebugImage()" class="btn small">✕ Close</button>
</div>
</div>
</section>
<!-- Processing Section -->
<section id="processingSection" class="processing-section" hidden>
<h3>🔍 Verarbeitung...</h3>
<div class="progress">
<div class="progress-bar" id="progressBar"></div>
</div>
<div id="statusText">Bild wird verarbeitet...</div>
</section>
<!-- Collection Section -->
<section id="collectionSection" class="collection-section">
<div class="collection-header">
<h3>📚 <span id="currentCollectionName">Meine Sammlung</span> (<span id="cardCount">0</span>)</h3>
<div class="collection-selector">
<select id="collectionSelect" class="collection-dropdown">
<!-- Options will be populated dynamically -->
</select>
</div>
</div>
<div class="collection-controls">
<button id="manageCollectionsBtn" class="btn secondary">📚 Sammlungen verwalten</button>
<button id="exportCollection" class="btn">💾 Exportieren</button>
<button id="clearCollection" class="btn danger">🗑️ Leeren</button>
</div>
<div id="cardList" class="card-list"></div>
</section>
</main>
<footer class="app-footer">
<div class="footer-content">
<p class="footer-text">
🔓 <strong>Open Source:</strong>
<a href="https://github.com/grimbixcode/mtgscan" target="_blank" rel="noopener noreferrer" class="github-link">
📂 View on GitHub
</a>
</p>
<div class="footer-actions">
<button id="toggleDebug" class="btn small">🛠️ Debug ein-/ausblenden</button>
</div>
<p class="footer-subtitle">Simple • Focused • Language Independent</p>
<p class="footer-disclaimer">
⚠️ Inoffizielles Fan-Projekt • Keine Verbindung zu Wizards of the Coast, Magic: The Gathering oder Hasbro • Alle Kartendaten von Scryfall API
</p>
<div class="footer-legal">
<a href="/privacy.html" class="legal-link">🔐 Datenschutz</a>
<span class="separator">•</span>
<a href="/terms.html" class="legal-link">📋 Nutzungsbedingungen</a>
<span class="separator">•</span>
<a href="/imprint.html" class="legal-link">📄 Impressum</a>
<span class="separator">•</span>
<a href="/legal-en.html" class="legal-link">🇺🇸 English</a>
</div>
</div>
</footer>
</div>
<!-- Collection Management Modal -->
<div id="collectionModal" class="modal-overlay" hidden>
<div class="modal-content collection-modal">
<div class="modal-header">
<h3>📚 Sammlungen verwalten</h3>
<button id="collectionModalCloseBtn" class="modal-close" aria-label="Modal schließen">✕</button>
</div>
<div class="modal-body">
<!-- Create New Collection -->
<div class="collection-create-section">
<h4>➕ Neue Sammlung erstellen</h4>
<div class="input-group">
<input type="text" id="newCollectionName" placeholder="Name der neuen Sammlung..." maxlength="50">
<button id="createCollectionBtn" class="btn primary">Erstellen</button>
</div>
</div>
<!-- Collections List -->
<div class="collections-list-section">
<h4>📂 Vorhandene Sammlungen</h4>
<div id="collectionsList" class="collections-list">
<!-- Collections will be populated here -->
</div>
</div>
</div>
</div>
</div>
<!-- Card Modal -->
<div id="cardModal" class="modal-overlay" hidden>
<div class="modal-content">
<div class="modal-header">
<h3 id="modalCardName">Card Name</h3>
<button id="modalCloseBtn" class="modal-close" aria-label="Close modal">✕</button>
</div>
<div class="modal-body">
<div class="modal-card-display">
<img id="modalCardImage" alt="Card Image" class="modal-card-image" src="">
<div class="modal-card-info">
<p id="modalCardSet" class="modal-card-set">Set Name</p>
<p id="modalCardLanguage" class="modal-card-language">🌍 Language: <span id="modalLanguageText">English</span></p>
<!-- Foil Toggle Section -->
<div class="foil-toggle-section">
<button id="foilToggleBtn" class="foil-toggle-btn" aria-label="Toggle foil status">
<span class="foil-toggle-icon">✨</span>
<span id="foilToggleText">Normal Card</span>
</button>
</div>
<div class="quantity-section">
<h4>Quantity in Collection</h4>
<div id="previousQuantityInfo" class="previous-quantity-info">
<span class="previous-quantity-label">Vorherige Anzahl:</span>
<span id="previousQuantity" class="previous-quantity-value">0</span>
</div>
<div class="quantity-controls">
<button id="decreaseQuantity" class="quantity-btn decrease" aria-label="Decrease quantity">−</button>
<span id="currentQuantity" class="quantity-display">0</span>
<button id="increaseQuantity" class="quantity-btn increase" aria-label="Increase quantity">+</button>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button id="backToScannerBtn" class="btn primary">📷 Back to Scanner</button>
</div>
</div>
</div>
<script type="module" src="src/main.js"></script>
</body>
</html>