Add image bkgrounds

This commit is contained in:
Kenwood 2025-07-02 11:34:14 -04:00
parent 663edf97cd
commit 5370e12afb
7 changed files with 178 additions and 133 deletions

BIN
www/Composite.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

BIN
www/characters/zae.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 817 KiB

BIN
www/characters/zae.png~ Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 MiB

View File

@ -7,20 +7,21 @@
"url": "https://www.f-list.net/c/alice%20prairie" "url": "https://www.f-list.net/c/alice%20prairie"
}, },
{ {
"name": "Bear Cum", "name": "Zae & Kan'vi Cum",
"volume": 9, "volume": 81,
"color": "#523a33", "color": "#FF56BD",
"url": "https://www.f-list.net/c/Glyren" "url": "https://www.f-list.net/c/Zae",
"image": "characters/zae.png"
}, },
{ {
"name": "Kan'vi Cum (Glowing)", "name": "Dog Cum",
"volume": 18, "volume": 8,
"color": "#FF56BD", "color": "#940619",
"url": "https://www.f-list.net/c/Zae" "url": "https://www.f-list.net/c/maxene%20sita/"
} }
], ],
"settings": { "settings": {
"tankTopOffset": 265, "tankTopOffset": 360,
"tankBottomOffset": 101 "tankBottomOffset": 101
} }
} }

BIN
www/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -1,152 +1,193 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Cumtanks.snowusne.net</title>
<head> <!-- Open Graph / Discord -->
<meta charset="UTF-8" /> <meta property="og:type" content="website" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta property="og:title" content="cumtanks.snowusne.net" />
<title>Cumtanks.snowusne.net</title> <meta property="og:image" content="/preview.png" />
<!-- Open Graph / Discord --> <!-- Twitter -->
<meta property="og:type" content="website" /> <meta name="twitter:card" content="summary_large_image" />
<meta property="og:title" content="cumtanks.snowusne.net" /> <meta name="twitter:title" content="cumtanks.snowusne.net" />
<meta property="og:image" content="/preview.png" /> <meta name="twitter:image" content="/preview.png" />
<!-- Twitter --> <link rel="stylesheet" href="styles.css" />
<meta name="twitter:card" content="summary_large_image" /> </head>
<meta name="twitter:title" content="cumtanks.snowusne.net" />
<meta name="twitter:image" content="/preview.png" />
<link rel="stylesheet" href="styles.css" /> <body>
</head> <div class="container">
<div class="tank-container">
<body> <img
<div class="container"> src="Alice_close_up_sheath_background.png"
<div class="tank-container"> alt="Tank Background Back"
<img src="Alice_close_up_sheath_background.png" alt="Tank Background Back" class="background-image background-image-back"
class="background-image background-image-back" /> />
<img src="Alice_close_up_sheath_shot.png" alt="Tank Background Foreground" <img
class="background-image background-image-fore" /> src="Alice_close_up_sheath_shot.png"
<!-- Liquid layers will be inserted here by JavaScript! --> alt="Tank Background Foreground"
<div class="artist-link"> class="background-image background-image-fore"
<a href="https://x.com/Raven4Seth" target="_blank" rel="noopener noreferrer">Art by SethRaven4</a> />
<!-- Liquid layers will be inserted here by JavaScript! -->
<div class="artist-link">
<a
href="https://x.com/Raven4Seth"
target="_blank"
rel="noopener noreferrer"
>Art by SethRaven4</a
>
</div>
</div>
<div class="settings">
<h2>Settings</h2>
<label>
Tank Top Offset (px):
<input
type="number"
id="tankTopOffset"
value="22"
min="0"
max="800"
/>
</label>
<label>
Tank Bottom Offset (px):
<input
type="number"
id="tankBottomOffset"
value="40"
min="0"
max="800"
/>
</label>
</div> </div>
</div> </div>
<div class="settings">
<h2>Settings</h2>
<label>
Tank Top Offset (px):
<input type="number" id="tankTopOffset" value="22" min="0" max="800" />
</label>
<label>
Tank Bottom Offset (px):
<input type="number" id="tankBottomOffset" value="40" min="0" max="800" />
</label>
</div>
</div>
<script> <script>
let tankData = null; let tankData = null;
const tankContainer = document.querySelector(".tank-container"); const tankContainer = document.querySelector(".tank-container");
const tankTopInput = document.getElementById("tankTop"); const tankTopInput = document.getElementById("tankTop");
const tankBottomInput = document.getElementById("tankBottom"); const tankBottomInput = document.getElementById("tankBottom");
const tankTopOffsetInput = document.getElementById("tankTopOffset"); const tankTopOffsetInput = document.getElementById("tankTopOffset");
const tankBottomOffsetInput = document.getElementById("tankBottomOffset"); const tankBottomOffsetInput = document.getElementById("tankBottomOffset");
async function loadData() { async function loadData() {
try { try {
const response = await fetch("data.json"); const response = await fetch("data.json");
tankData = await response.json(); tankData = await response.json();
updateTank(); updateTank();
} catch (error) { } catch (error) {
console.error("Error loading tank data:", error); console.error("Error loading tank data:", error);
}
} }
}
function updateTank() { function updateTank() {
if (!tankData) return; if (!tankData) return;
// Clear existing liquid layers // Clear existing liquid layers
const existingLayers = document.querySelectorAll(".liquid-layer"); const existingLayers = document.querySelectorAll(".liquid-layer");
existingLayers.forEach((layer) => layer.remove()); existingLayers.forEach((layer) => layer.remove());
const tankContainerHeight = tankContainer.offsetHeight; const tankContainerHeight = tankContainer.offsetHeight;
const tankTopOffset = tankData.settings.tankTopOffset; const tankTopOffset = tankData.settings.tankTopOffset;
const tankBottomOffset = tankData.settings.tankBottomOffset; const tankBottomOffset = tankData.settings.tankBottomOffset;
const tankHeight = tankContainerHeight - tankTopOffset - tankBottomOffset; const tankHeight =
let currentHeight = 0; tankContainerHeight - tankTopOffset - tankBottomOffset;
let cumulativeVolume = 0; let currentHeight = 0;
let cumulativeVolume = 0;
tankData.liquids.forEach((liquid, i) => { tankData.liquids.forEach((liquid, i) => {
const layer = document.createElement("div"); const layer = document.createElement("div");
layer.className = "liquid-layer"; layer.className = "liquid-layer";
layer.style.backgroundColor = liquid.color;
// Create the label // Set background: image if present, else color
const label = document.createElement("div"); if (liquid.image) {
label.className = "liquid-label"; layer.style.backgroundImage = `url(${liquid.image})`;
layer.style.backgroundSize = "660px";
layer.style.backgroundRepeat = "no-repeat";
layer.style.backgroundPosition = "right 110px top 0px";
layer.style.backgroundColor = liquid.color;
} else {
layer.style.backgroundImage = "";
layer.style.backgroundColor = liquid.color;
}
// If there's a URL, make it a clickable link // Create the label
if (liquid.url) { const label = document.createElement("div");
const link = document.createElement("a"); label.className = "liquid-label";
link.href = liquid.url;
link.textContent = `${liquid.name} (${liquid.volume}%)`;
link.className = "liquid-link";
label.appendChild(link);
} else {
label.textContent = `${liquid.name} (${liquid.volume}%)`;
}
cumulativeVolume += liquid.volume; // If there's a URL, make it a clickable link
if (liquid.url) {
const link = document.createElement("a");
link.href = liquid.url;
link.textContent = `${liquid.name} (${liquid.volume}%)`;
link.className = "liquid-link";
label.appendChild(link);
} else {
label.textContent = `${liquid.name} (${liquid.volume}%)`;
}
// Shift label left if cumulative volume is under 20% cumulativeVolume += liquid.volume;
if (cumulativeVolume < 20) {
label.style.left = '18%';
label.style.transform = 'translate(-30%, -50%)';
} else {
label.style.left = '50%';
label.style.transform = 'translate(-50%, -50%)';
}
// Calculate height based on volume percentage // Shift label left if cumulative volume is under 20%
const height = (liquid.volume / 100) * tankHeight; if (cumulativeVolume < 20) {
layer.style.height = `${height}px`; label.style.left = "18%";
label.style.transform = "translate(-30%, -50%)";
} else {
label.style.left = "50%";
label.style.transform = "translate(-50%, -50%)";
}
// Position from bottom, stacking up, starting at tankBottomOffset // Calculate height based on volume percentage
layer.style.bottom = `${currentHeight + tankBottomOffset}px`; const height = (liquid.volume / 100) * tankHeight;
currentHeight += height; layer.style.height = `${height}px`;
// Add the label to the layer // Position from bottom, stacking up, starting at tankBottomOffset
layer.appendChild(label); layer.style.bottom = `${currentHeight + tankBottomOffset}px`;
tankContainer.appendChild(layer); currentHeight += height;
});
}
// Update settings // Add the label to the layer
function updateSettings() { layer.appendChild(label);
if (!tankData) return; tankContainer.appendChild(layer);
});
}
tankData.settings.tankTopOffset = parseInt(tankTopOffsetInput.value); // Update settings
tankData.settings.tankBottomOffset = parseInt(tankBottomOffsetInput.value); function updateSettings() {
updateTank(); if (!tankData) return;
}
// Event listeners tankData.settings.tankTopOffset = parseInt(tankTopOffsetInput.value);
tankTopOffsetInput.addEventListener("change", updateSettings); tankData.settings.tankBottomOffset = parseInt(
tankBottomOffsetInput.addEventListener("change", updateSettings); tankBottomOffsetInput.value
);
updateTank();
}
// Initial load // Event listeners
loadData(); tankTopOffsetInput.addEventListener("change", updateSettings);
</script> tankBottomOffsetInput.addEventListener("change", updateSettings);
<!-- Footer --> // Initial load
<footer class="tiny-footer"> loadData();
<span> </script>
Art by <a href="https://x.com/Raven4Seth" target="_blank" rel="noopener noreferrer">SethRave4</a>
&bull;
Message <a href="mailto:vixi@snowsune.net">vixi@snowsune.net</a> for questions/comments/anything!
</span>
</footer>
</body>
<!-- Footer -->
<footer class="tiny-footer">
<span>
Art by
<a
href="https://x.com/Raven4Seth"
target="_blank"
rel="noopener noreferrer"
>SethRave4</a
>
&bull; Message
<a href="mailto:vixi@snowsune.net">vixi@snowsune.net</a> for
questions/comments/anything!
</span>
</footer>
</body>
</html> </html>

View File

@ -72,6 +72,9 @@ h1 {
transition: all 0.3s ease; transition: all 0.3s ease;
z-index: 2; z-index: 2;
overflow: hidden; overflow: hidden;
background-position: top center;
background-repeat: no-repeat;
background-size: contain;
} }
.liquid-layer > div { .liquid-layer > div {