Created
March 13, 2026 17:14
-
-
Save pksbogastro/c2af35410f6147fe3d1d1fed24bcc9f5 to your computer and use it in GitHub Desktop.
Einkaufen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="de"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> | |
| <title>Foodtruck</title> | |
| <style> | |
| body { font-family: sans-serif; background: #f4f7f6; margin: 0; padding: 10px; text-align: center; } | |
| .card { background: white; padding: 15px; border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); margin-bottom: 12px; } | |
| select { width: 100%; padding: 14px; font-size: 18px; border: 2px solid #2196F3; border-radius: 12px; margin-bottom: 12px; background: white; -webkit-appearance: none; } | |
| .btn { width: 100%; padding: 16px; border: none; border-radius: 12px; font-weight: bold; font-size: 16px; margin: 6px 0; cursor: pointer; color: white; display: flex; align-items: center; justify-content: center; } | |
| .btn-row { display: flex; justify-content: space-between; gap: 10px; } | |
| .btn-small { width: 48%; padding: 12px; font-size: 14px; background: #e0e0e0; color: #333; } | |
| .btn-red { background: #e57373; } | |
| .btn-green { background: #81c784; } | |
| .btn-blue { background: #64b5f6; } | |
| .btn-orange { background: #ffb74d; } | |
| .btn-black { background: #333; } | |
| #admin-area { display: none; padding: 15px; border: 2px dashed #ddd; border-radius: 12px; margin-top: 10px; background: #fafafa; } | |
| input { width: 100%; padding: 12px; margin-bottom: 10px; border-radius: 8px; border: 1px solid #ccc; box-sizing: border-box; font-size: 16px; } | |
| .item { background: white; padding: 12px; border-radius: 12px; margin-bottom: 8px; display: flex; align-items: center; text-align: left; border: 1px solid #e0e0e0; position: relative; min-height: 90px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); } | |
| .item img { width: 110px; height: 75px; object-fit: cover; border-radius: 12px; margin-right: 15px; background: #eee; flex-shrink: 0; } | |
| .item-info { flex-grow: 1; display: flex; align-items: center; justify-content: space-between; } | |
| .edit-name { font-size: 1.3em; font-weight: bold; border: none; background: transparent; color: #000; flex-grow: 1; outline: none; width: 50%; } | |
| .edit-qty { width: 65px; height: 45px; border: 1px solid #ddd; border-radius: 10px; text-align: center; font-size: 1.2em; background: white; color: #333; outline: none; } | |
| .shop-checked { opacity: 0.2; filter: grayscale(100%); text-decoration: line-through; } | |
| #img-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 1000; justify-content: center; align-items: center; } | |
| #img-overlay img { max-width: 95%; max-height: 95%; border-radius: 10px; } | |
| .del-btn { position: absolute; top: -5px; right: -5px; background: #e57373; color: white; width: 26px; height: 26px; border-radius: 50%; font-size: 18px; line-height: 24px; text-align: center; cursor: pointer; border: 2px solid white; z-index: 5; } | |
| @media print { .no-print { display: none !important; } .item { border: none; border-bottom: 1px solid #eee; } } | |
| </style> | |
| </head> | |
| <body> | |
| <div id="img-overlay" onclick="this.style.display='none'"><img id="full-img" src=""></div> | |
| <div class="card no-print"> | |
| <select id="listSelect" onchange="updateList()"></select> | |
| <div class="btn-row"> | |
| <button class="btn btn-small" onclick="addList()">+ Neue Liste</button> | |
| <button class="btn btn-red btn-small" onclick="removeList()">Liste löschen</button> | |
| </div> | |
| </div> | |
| <div class="card no-print"> | |
| <button class="btn btn-green" onclick="toggleAdd()">➕ Artikel hinzufügen</button> | |
| <div id="admin-area"> | |
| <input type="text" id="nameInp" placeholder="Name"> | |
| <input type="file" id="imgInp" accept="image/*"> | |
| <button class="btn btn-green" onclick="saveNew()">SPEICHERN</button> | |
| </div> | |
| <button id="modeBtn" class="btn btn-blue" onclick="switchMode()">➡️ Einkaufsmodus</button> | |
| <button class="btn btn-orange" onclick="resetMarkers()">🔄 Alle auf Null</button> | |
| <button class="btn btn-black" onclick="window.print()">📄 Als PDF speichern</button> | |
| </div> | |
| <div id="listCont"></div> | |
| <script> | |
| var STORAGE = 'FOODTRUCK_STABLE_DATA'; | |
| var d = JSON.parse(localStorage.getItem(STORAGE)) || { active: "Foodtruck", lists: { "Foodtruck": [] }, shop: false }; | |
| function render() { | |
| var sel = document.getElementById('listSelect'); | |
| sel.innerHTML = ''; | |
| for (var n in d.lists) { | |
| var o = document.createElement('option'); o.value = n; o.innerText = n; | |
| if(n === d.active) o.selected = true; | |
| sel.appendChild(o); | |
| } | |
| document.getElementById('modeBtn').innerText = d.shop ? "🛒 Planungsmodus" : "➡️ Einkaufsmodus"; | |
| var cont = document.getElementById('listCont'); | |
| cont.innerHTML = ''; | |
| var items = d.lists[d.active] || []; | |
| for (var i = 0; i < items.length; i++) { | |
| (function(idx) { | |
| var it = items[idx]; | |
| var div = document.createElement('div'); | |
| // Ausgrauen NUR im Shop-Modus | |
| div.className = 'item' + (d.shop && it.done ? ' shop-checked' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment