Add files via upload
This commit is contained in:
parent
ed0b1036b9
commit
c393d81f72
53
ASAshop.html
53
ASAshop.html
|
|
@ -391,7 +391,7 @@
|
||||||
<footer>
|
<footer>
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<div style="display:flex; align-items:center; gap:8px; flex-wrap:wrap">
|
<div style="display:flex; align-items:center; gap:8px; flex-wrap:wrap">
|
||||||
<div class="muted">© <span id="year"></span> Obli Studios</div>
|
<div class="muted">© <span id="year"></span> Oblistudios LLC</div>
|
||||||
<div class="muted">— Build anywhere, don’t block obelisks. Be kind.</div>
|
<div class="muted">— Build anywhere, don’t block obelisks. Be kind.</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -406,7 +406,7 @@
|
||||||
</header>
|
</header>
|
||||||
<div class="modal__body">
|
<div class="modal__body">
|
||||||
<p><strong>Exclusive to you and your tribe.</strong></p>
|
<p><strong>Exclusive to you and your tribe.</strong></p>
|
||||||
<p>🏝 <strong>Server Setup:</strong> Mirrors main cluster (PVP, breeding, rates). <strong>20 slots</strong>, password-secured.</p>
|
<p>🏝 <strong>1 Server Setup:</strong> Mirrors main cluster (PVP, breeding, rates). <strong>20 slots</strong>, password-secured.</p>
|
||||||
<p>⚙️ <strong>Tools & Perks:</strong> Creature Management Tool + <strong>10× Mutation Potions</strong> per tier.</p>
|
<p>⚙️ <strong>Tools & Perks:</strong> Creature Management Tool + <strong>10× Mutation Potions</strong> per tier.</p>
|
||||||
<p>🎁 <strong>Starting Bonus:</strong> <strong>100,000 points</strong> at the start of each wipe.</p>
|
<p>🎁 <strong>Starting Bonus:</strong> <strong>100,000 points</strong> at the start of each wipe.</p>
|
||||||
<p>⏳ <strong>Setup:</strong> Usually <strong>≤ 2 business days</strong>. Never wipes while subscribed.</p>
|
<p>⏳ <strong>Setup:</strong> Usually <strong>≤ 2 business days</strong>. Never wipes while subscribed.</p>
|
||||||
|
|
@ -427,7 +427,7 @@
|
||||||
</header>
|
</header>
|
||||||
<div class="modal__body">
|
<div class="modal__body">
|
||||||
<p><strong>Exclusive to you and your tribe.</strong></p>
|
<p><strong>Exclusive to you and your tribe.</strong></p>
|
||||||
<p>🏝 <strong>Server Setup:</strong> Mirrors main cluster (PVP, breeding, rates). <strong>30 slots</strong>, password-secured.</p>
|
<p>🏝 <strong>2 Server Setup:</strong> Mirrors main cluster (PVP, breeding, rates). <strong>30 slots</strong>, password-secured.</p>
|
||||||
<p>⚙️ <strong>Tools & Perks:</strong> Creature Management Tool + <strong>10× Mutation Potions</strong> per tier.</p>
|
<p>⚙️ <strong>Tools & Perks:</strong> Creature Management Tool + <strong>10× Mutation Potions</strong> per tier.</p>
|
||||||
<p>🎁 <strong>Starting Bonus:</strong> <strong>200,000 points</strong> at the start of each wipe.</p>
|
<p>🎁 <strong>Starting Bonus:</strong> <strong>200,000 points</strong> at the start of each wipe.</p>
|
||||||
<p>⏳ <strong>Setup:</strong> Usually <strong>≤ 2 business days</strong>. Never wipes while subscribed.</p>
|
<p>⏳ <strong>Setup:</strong> Usually <strong>≤ 2 business days</strong>. Never wipes while subscribed.</p>
|
||||||
|
|
@ -448,7 +448,7 @@
|
||||||
</header>
|
</header>
|
||||||
<div class="modal__body">
|
<div class="modal__body">
|
||||||
<p><strong>Exclusive to you and your tribe.</strong></p>
|
<p><strong>Exclusive to you and your tribe.</strong></p>
|
||||||
<p>🏝 <strong>Server Setup:</strong> Mirrors main cluster (PVP, breeding, rates). <strong>50 slots</strong>, password-secured.</p>
|
<p>🏝 <strong>3 Server Setup:</strong> Mirrors main cluster (PVP, breeding, rates). <strong>30 slots</strong>, password-secured.</p>
|
||||||
<p>⚙️ <strong>Tools & Perks:</strong> Creature Management Tool + <strong>10× Mutation Potions</strong> per tier.</p>
|
<p>⚙️ <strong>Tools & Perks:</strong> Creature Management Tool + <strong>10× Mutation Potions</strong> per tier.</p>
|
||||||
<p>🎁 <strong>Starting Bonus:</strong> <strong>300,000 points</strong> at the start of each wipe.</p>
|
<p>🎁 <strong>Starting Bonus:</strong> <strong>300,000 points</strong> at the start of each wipe.</p>
|
||||||
<p>⏳ <strong>Setup:</strong> Usually <strong>≤ 2 business days</strong>. Never wipes while subscribed.</p>
|
<p>⏳ <strong>Setup:</strong> Usually <strong>≤ 2 business days</strong>. Never wipes while subscribed.</p>
|
||||||
|
|
@ -469,7 +469,7 @@
|
||||||
server1: "price_1SELDJDv9LGVOP85Tmvl29iG",
|
server1: "price_1SELDJDv9LGVOP85Tmvl29iG",
|
||||||
server2: "price_1SELEGDv9LGVOP85f22Gldvc",
|
server2: "price_1SELEGDv9LGVOP85f22Gldvc",
|
||||||
server3: "price_1SELLTDv9LGVOP85tgk0E7a8",
|
server3: "price_1SELLTDv9LGVOP85tgk0E7a8",
|
||||||
slot30: "price_1SELM0Dv9LGVOP85vvEWN8XA",
|
slot30: "price_1SPrq0Dv9LGVOP85TWi8As7L",
|
||||||
mutants: "price_1SELMXDv9LGVOP85iEACTDNB",
|
mutants: "price_1SELMXDv9LGVOP85iEACTDNB",
|
||||||
starter: "price_1SELMzDv9LGVOP851QbLAPv9",
|
starter: "price_1SELMzDv9LGVOP851QbLAPv9",
|
||||||
supporter1: "price_1SELNPDv9LGVOP85AbSjJjsq",
|
supporter1: "price_1SELNPDv9LGVOP85AbSjJjsq",
|
||||||
|
|
@ -483,9 +483,21 @@
|
||||||
"map-large": "price_1SELQZDv9LGVOP85GNbTyOHH"
|
"map-large": "price_1SELQZDv9LGVOP85GNbTyOHH"
|
||||||
};
|
};
|
||||||
|
|
||||||
// Which SKUs count against the 12-unit capacity
|
// No capacity limits — all servers unlimited
|
||||||
const CAPACITY_IDS = new Set(['server1', 'server2', 'server3']);
|
// Unlimited servers: no capacity accounting at all
|
||||||
const CAPACITY_TOTAL = 12;
|
const SERVER_CAPACITY = {};
|
||||||
|
const CAPACITY_IDS = new Set(); // no IDs are capacity-limited
|
||||||
|
const CAPACITY_TOTAL = Infinity;
|
||||||
|
|
||||||
|
function capacityUsed() { return 0; }
|
||||||
|
function canAddServers() { return true; }
|
||||||
|
|
||||||
|
// isServer will always be false with an empty set, which is fine
|
||||||
|
const isServer = id => CAPACITY_IDS.has(id);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ===== products (unchanged from your file) =====
|
// ===== products (unchanged from your file) =====
|
||||||
const products = [
|
const products = [
|
||||||
|
|
@ -493,7 +505,7 @@
|
||||||
{ id: 'server2', name: 'Server Class 2', price: 50.00, category: 'servers', tag: 'Server monthly', img: 'img/PrivateServerCLASS02.png' },
|
{ id: 'server2', name: 'Server Class 2', price: 50.00, category: 'servers', tag: 'Server monthly', img: 'img/PrivateServerCLASS02.png' },
|
||||||
{ id: 'server3', name: 'Server Class 3', price: 75.00, category: 'servers', tag: 'Server monthly', img: 'img/PrivateServerCLASS03.png' },
|
{ id: 'server3', name: 'Server Class 3', price: 75.00, category: 'servers', tag: 'Server monthly', img: 'img/PrivateServerCLASS03.png' },
|
||||||
|
|
||||||
{ id: 'slot30', name: 'ASA Server Slot x30 days', price: 5.00, category: 'perks', tag: 'Server Perk monthly', img: 'img/ServerSlotX30.png' },
|
{ id: 'slot30', name: 'ASA Server Slot x30 days', price: 2.50, category: 'perks', tag: 'Server Perk monthly', img: 'img/ServerSlotX30.png' },
|
||||||
{ id: 'mutants', name: 'Mutated Creatures', price: 1.50, category: 'bundles', tag: 'Dino Pack One Time Payment 10 non-breedable', img: 'img/MutatedCretures.png' },
|
{ id: 'mutants', name: 'Mutated Creatures', price: 1.50, category: 'bundles', tag: 'Dino Pack One Time Payment 10 non-breedable', img: 'img/MutatedCretures.png' },
|
||||||
{ id: 'starter', name: 'Starter Pack', price: 1.50, category: 'bundles', tag: 'Starter Pack One Time Payment', img: 'img/StarterPack.png' },
|
{ id: 'starter', name: 'Starter Pack', price: 1.50, category: 'bundles', tag: 'Starter Pack One Time Payment', img: 'img/StarterPack.png' },
|
||||||
|
|
||||||
|
|
@ -517,15 +529,11 @@
|
||||||
function loadCart() { try { return JSON.parse(localStorage.getItem('obli.cart') || '{}'); } catch { return {}; } }
|
function loadCart() { try { return JSON.parse(localStorage.getItem('obli.cart') || '{}'); } catch { return {}; } }
|
||||||
function cartCount() { return Object.values(state.cart).reduce((a, b) => a + b, 0); }
|
function cartCount() { return Object.values(state.cart).reduce((a, b) => a + b, 0); }
|
||||||
function cartTotal() { return Object.entries(state.cart).reduce((s, [id, q]) => { const p = products.find(p => p.id === id); return s + (p ? p.price * q : 0) }, 0); }
|
function cartTotal() { return Object.entries(state.cart).reduce((s, [id, q]) => { const p = products.find(p => p.id === id); return s + (p ? p.price * q : 0) }, 0); }
|
||||||
const isServer = id => CAPACITY_IDS.has(id);
|
|
||||||
const serversInCart = () => Object.entries(state.cart).reduce((n, [id, qty]) => n + (CAPACITY_IDS.has(id) ? Number(qty || 0) : 0), 0);
|
|
||||||
const canAddServers = (qty) => serversInCart() + qty <= CAPACITY_TOTAL;
|
|
||||||
|
|
||||||
function cardHtml(p) {
|
function cardHtml(p) {
|
||||||
const inCart = state.cart[p.id] || 0;
|
const inCart = state.cart[p.id] || 0;
|
||||||
const capRow = isServer(p.id)
|
const capRow = `<div class="rem-row text-muted">Unlimited</div>`;
|
||||||
? `<div class="rem-row">Remaining: <span class="remN" data-rem-for="${p.id}">${Math.max(0, CAPACITY_TOTAL - serversInCart())}</span>/${CAPACITY_TOTAL}</div>`
|
|
||||||
: `<div class="rem-row text-muted">Unlimited</div>`;
|
|
||||||
|
|
||||||
let infoBtn = '';
|
let infoBtn = '';
|
||||||
if (p.id === 'server1') infoBtn = `<button class="btn btn-secondary" data-info="server-class-1">Info</button>`;
|
if (p.id === 'server1') infoBtn = `<button class="btn btn-secondary" data-info="server-class-1">Info</button>`;
|
||||||
|
|
@ -541,7 +549,9 @@
|
||||||
<div class="chip">${p.category}</div>
|
<div class="chip">${p.category}</div>
|
||||||
${capRow}
|
${capRow}
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<button class="btn" data-add="${p.id}" ${isServer(p.id) && !canAddServers(1) ? 'disabled' : ''}>${inCart ? 'Add another' : 'Add to cart'}</button>
|
<button class="btn" data-add="${p.id}">
|
||||||
|
${inCart ? 'Add another' : 'Add to cart'}
|
||||||
|
</button>
|
||||||
${infoBtn}
|
${infoBtn}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -583,7 +593,8 @@
|
||||||
document.querySelectorAll('[data-rem-for]').forEach(el => {
|
document.querySelectorAll('[data-rem-for]').forEach(el => {
|
||||||
const id = el.dataset.remFor;
|
const id = el.dataset.remFor;
|
||||||
if (isServer(id)) {
|
if (isServer(id)) {
|
||||||
const left = Math.max(0, CAPACITY_TOTAL - serversInCart());
|
const left = Math.max(0, CAPACITY_TOTAL - capacityUsed());
|
||||||
|
|
||||||
el.textContent = left;
|
el.textContent = left;
|
||||||
const card = el.closest('[data-product]');
|
const card = el.closest('[data-product]');
|
||||||
const btn = card?.querySelector(`[data-add="${id}"]`);
|
const btn = card?.querySelector(`[data-add="${id}"]`);
|
||||||
|
|
@ -606,12 +617,16 @@
|
||||||
const dec = e.target.closest('[data-dec]');
|
const dec = e.target.closest('[data-dec]');
|
||||||
if (add) {
|
if (add) {
|
||||||
const id = add.getAttribute('data-add');
|
const id = add.getAttribute('data-add');
|
||||||
if (isServer(id) && !canAddServers(1)) return alert(`Sold out or limit reached. Remaining: ${Math.max(0, CAPACITY_TOTAL - serversInCart())}`);
|
if (isServer(id) && !canAddServers(1))
|
||||||
|
return alert(`Sold out or limit reached. Remaining: ${Math.max(0, CAPACITY_TOTAL - capacityUsed())}`);
|
||||||
|
|
||||||
state.cart[id] = (state.cart[id] || 0) + 1; saveCart(); render();
|
state.cart[id] = (state.cart[id] || 0) + 1; saveCart(); render();
|
||||||
}
|
}
|
||||||
if (inc) {
|
if (inc) {
|
||||||
const id = inc.getAttribute('data-inc');
|
const id = inc.getAttribute('data-inc');
|
||||||
if (isServer(id) && !canAddServers(1)) return alert(`Sold out or limit reached. Remaining: ${Math.max(0, CAPACITY_TOTAL - serversInCart())}`);
|
if (isServer(id) && !canAddServers(1))
|
||||||
|
return alert(`Sold out or limit reached. Remaining: ${Math.max(0, CAPACITY_TOTAL - capacityUsed())}`);
|
||||||
|
|
||||||
state.cart[id] = (state.cart[id] || 0) + 1; saveCart(); updateCartUi();
|
state.cart[id] = (state.cart[id] || 0) + 1; saveCart(); updateCartUi();
|
||||||
}
|
}
|
||||||
if (dec) {
|
if (dec) {
|
||||||
|
|
|
||||||
|
|
@ -510,7 +510,7 @@
|
||||||
<!-- Footer -->
|
<!-- Footer -->
|
||||||
<footer>
|
<footer>
|
||||||
<div class="container foot">
|
<div class="container foot">
|
||||||
<small>© <span id="y"></span> ObliStudios. All rights reserved.</small>
|
<small>© <span id="y"></span> ObliStudios LLC. All rights reserved.</small>
|
||||||
<div class="social" id="subscribe" aria-label="Social links">
|
<div class="social" id="subscribe" aria-label="Social links">
|
||||||
<a href="https://twitter.com/obli_studios" title="Follow on X (Twitter)">
|
<a href="https://twitter.com/obli_studios" title="Follow on X (Twitter)">
|
||||||
<!-- simple X mark -->
|
<!-- simple X mark -->
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue