diff --git a/web/static/v1_common.png b/web/static/v1_common.png new file mode 100644 index 0000000..0d4b649 Binary files /dev/null and b/web/static/v1_common.png differ diff --git a/web/static/v1_epic.png b/web/static/v1_epic.png new file mode 100644 index 0000000..05f8b6c Binary files /dev/null and b/web/static/v1_epic.png differ diff --git a/web/static/v1_rare.png b/web/static/v1_rare.png new file mode 100644 index 0000000..fedfa39 Binary files /dev/null and b/web/static/v1_rare.png differ diff --git a/web/static/v1_uncommon.png b/web/static/v1_uncommon.png new file mode 100644 index 0000000..97c9b9d Binary files /dev/null and b/web/static/v1_uncommon.png differ diff --git a/web/templates/card_creator.html b/web/templates/card_creator.html index 6ae85a4..47c3c48 100644 --- a/web/templates/card_creator.html +++ b/web/templates/card_creator.html @@ -47,6 +47,13 @@


+ @@ -71,6 +78,8 @@ const artistInput = document.getElementById("artistInput"); const downloadBtn = document.getElementById("downloadBtn"); const uploadArt = document.getElementById("uploadArt"); +const frameSelect = document.getElementById("frameSelect"); +let frameImage = new Image(); let uploadedImage = null; // Generate a unique ID for the card based on pack and card name @@ -87,13 +96,6 @@ async function generateCardId(...args) { return hex.slice(0, 12); } -// Load the card frame image -const frameImage = new Image(); -frameImage.src = "{{ url_for('static', filename='card-frame.png') }}"; // <-- replace with your transparent card frame PNG - -frameImage.onload = () => { - drawCard(); -}; uploadArt.addEventListener("change", function(e) { const file = e.target.files[0]; @@ -107,6 +109,18 @@ uploadArt.addEventListener("change", function(e) { reader.readAsDataURL(file); }); +// Update frame image when selection changes +function updateFrame() { + frameImage.src = "{{ url_for('static', filename='') }}" + frameSelect.value; + frameImage.onload = drawCard; +} + +// Initial frame load +updateFrame(); + +// Change frame when dropdown changes +frameSelect.addEventListener("change", updateFrame); + function drawCard() { ctx.clearRect(0, 0, canvas.width, canvas.height); ctx.fillStyle = "#f5f5f5";