added picture logic & started on upload button

This commit is contained in:
2025-01-22 22:30:58 +01:00
parent 9f2ed4e448
commit 11db41a128
7 changed files with 18 additions and 7 deletions

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 121 KiB

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 119 KiB

+5 -5
View File
@@ -58,16 +58,15 @@
<option value="pan-kisser" >Pan-kisser</option>
<option value="trans-kisser" >Trans-kisser</option>
<option value="bytedice" >Byte Dice</option>
<option value="custom" >Custom (upload)</option>
</select><br>
<option value="custom" id="customPic">Custom (upload)</option>
</select><input type="file" id="picUpload" accept=".png,.jpg,.jpeg,.webp"><br>
<!-- picture -->
</form>
<h1>Extra</h1>
<form>
<!-- decorations like
the QR-code
license bg-image/bg-color
the QR-code and other "accessories"
-->
</form>
@@ -77,6 +76,7 @@
license border radius
pic border radius
title gradient (2 colors + direction) or flag
license bg-image/bg-gradient
-->
</form>
</div>
@@ -84,7 +84,7 @@
<div id="licenseContainer" class="blackBorderRect">
<h3 id="titleValue">Boykisser license</h3>
<div style="width: max-content;">
<div id="picContainer" class="blackBorderRect"></div>
<img id="picValue" class="blackBorderRect" src="">
<div id="signatureContainer">
<p id="signatureValue">Byte Dice</p>
+2 -1
View File
@@ -12,9 +12,10 @@
grid-template-columns: repeat(2, auto);
grid-template-rows: repeat(2, auto);
}
#picContainer {
#picValue {
width: 150px;
height: 150px;
display: block;
}
#credits {
position: absolute;
+11 -1
View File
@@ -46,10 +46,16 @@ function setSillyValue(value) {
`;
}
function setPictureValue() {
const picInput = document.getElementById("picInput")
const picValue = document.getElementById("picValue")
function setPictureValue() {
let src = picInput.value != "custom" ? `/assets/boykissers/${picInput.value}.png` : ""
picValue.src = src
}
picInput.oninput = function() { setPictureValue() }
function prependZero(number) {
return number < 10 ? "0" + number : number;
}
@@ -67,4 +73,8 @@ function onLoadLicense() {
if (sillyInput) {
setSillyValue(sillyInput.value);
}
if (picInput) {
setPictureValue()
}
}