Dateien nach "/" hochladen
This commit is contained in:
70
index.html
Normal file
70
index.html
Normal file
@@ -0,0 +1,70 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>ZIR - Live Preview</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
margin: 0; padding: 0;
|
||||
background-color: #f4f4f7; color: #333;
|
||||
display: flex; flex-direction: column; align-items: center; min-height: 100vh;
|
||||
}
|
||||
header {
|
||||
background-color: #0078d7; color: white; width: 100%;
|
||||
padding: 16px 24px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||
text-align: center; font-size: 1.2rem; font-weight: 600;
|
||||
}
|
||||
main { flex: 1; display:flex; align-items:center; justify-content:center; width:100%; padding:20px; box-sizing:border-box; }
|
||||
.preview-container {
|
||||
background-color: white; padding: 16px; border-radius: 12px;
|
||||
box-shadow: 0 6px 18px rgba(0,0,0,0.08); max-width: 1000px; width: 100%; text-align: center; position: relative;
|
||||
}
|
||||
.preview-container img { border: 1px solid #e0e0e0; max-width: 100%; height: auto; border-radius: 8px; display: none; }
|
||||
.info { margin-top: 12px; font-size: 0.95rem; color: #555; }
|
||||
footer { padding: 12px 24px; text-align:center; font-size:0.8rem; color:#888; }
|
||||
.spinner { border:6px solid #f3f3f3; border-top:6px solid #0078d7; border-radius:50%; width:48px; height:48px; animation:spin 1s linear infinite; margin: 26px auto; }
|
||||
@keyframes spin { 0%{transform:rotate(0deg)} 100%{transform:rotate(360deg)} }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<header>ZIR – Live Preview</header>
|
||||
<main>
|
||||
<div class="preview-container">
|
||||
<div class="spinner" id="spinner"></div>
|
||||
<img id="labelImage" src="" alt="Label preview" />
|
||||
<div class="info"><code id="inputPath"></code> Neue Labels werden automatisch angezeigt.</div>
|
||||
</div>
|
||||
</main>
|
||||
<footer>© 2025 ZIR Viewer</footer>
|
||||
|
||||
<script>
|
||||
const { ipcRenderer, remote } = require('electron');
|
||||
const img = document.getElementById('labelImage');
|
||||
const spinner = document.getElementById('spinner');
|
||||
const inputPath = document.getElementById('inputPath');
|
||||
|
||||
// Zeige Input-Pfad (wird per ipc vom Main ggf. gesetzt)
|
||||
ipcRenderer.on('show-input-path', (ev, p) => {
|
||||
inputPath.textContent = p;
|
||||
});
|
||||
|
||||
ipcRenderer.on('show-png', (ev, filePath) => {
|
||||
spinner.style.display = 'block';
|
||||
img.style.display = 'none';
|
||||
img.src = filePath + "?t=" + Date.now();
|
||||
img.onload = () => {
|
||||
spinner.style.display = 'none';
|
||||
img.style.display = 'block';
|
||||
};
|
||||
img.onerror = () => {
|
||||
spinner.style.display = 'none';
|
||||
img.style.display = 'none';
|
||||
};
|
||||
});
|
||||
|
||||
// Request main to send input path (in case main wants to show it)
|
||||
ipcRenderer.send('request-input-path');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user