Produccio estable amb API PHP, HTTPS net i formularis corregits
This commit is contained in:
+4
-1
@@ -102,13 +102,16 @@ function normalizeProduct(array $p): array
|
|||||||
$priceText = number_format($priceNumber, 2, ',', '.') . ' €';
|
$priceText = number_format($priceNumber, 2, ',', '.') . ' €';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$image = normalizeText($p['image_url'] ?? $p['IMAGE_URL'] ?? '');
|
||||||
|
$filename = basename($image);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'product_code' => normalizeText($p['product_code'] ?? $p['Product Code'] ?? $p['PRODUCT CODE'] ?? ''),
|
'product_code' => normalizeText($p['product_code'] ?? $p['Product Code'] ?? $p['PRODUCT CODE'] ?? ''),
|
||||||
'model' => normalizeText($p['model'] ?? $p['MODEL'] ?? ''),
|
'model' => normalizeText($p['model'] ?? $p['MODEL'] ?? ''),
|
||||||
'category' => normalizeText($p['category'] ?? $p['CATEGORIA'] ?? $p['CATEGORY'] ?? ''),
|
'category' => normalizeText($p['category'] ?? $p['CATEGORIA'] ?? $p['CATEGORY'] ?? ''),
|
||||||
'colors' => normalizeText($p['colors'] ?? $p['COLORS'] ?? $p['VIDRE'] ?? ''),
|
'colors' => normalizeText($p['colors'] ?? $p['COLORS'] ?? $p['VIDRE'] ?? ''),
|
||||||
'description' => normalizeText($p['description'] ?? $p['DESCRIPCIO'] ?? $p['DESCRIPTION'] ?? ''),
|
'description' => normalizeText($p['description'] ?? $p['DESCRIPCIO'] ?? $p['DESCRIPTION'] ?? ''),
|
||||||
'image_url' => normalizeText($p['image_url'] ?? $p['IMAGE_URL'] ?? ''),
|
'image_url' => $filename ? "https://kapvoe-portfoli.treblarella.org/assets/products/$filename" : '',
|
||||||
'stock' => normalizeStock($p['stock'] ?? $p['STOCK'] ?? 0),
|
'stock' => normalizeStock($p['stock'] ?? $p['STOCK'] ?? 0),
|
||||||
'top_vendes' => normalizeBool($p['top_vendes'] ?? $p['TOP_VENDES'] ?? false),
|
'top_vendes' => normalizeBool($p['top_vendes'] ?? $p['TOP_VENDES'] ?? false),
|
||||||
'europe_price_number' => $priceNumber,
|
'europe_price_number' => $priceNumber,
|
||||||
|
|||||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 362 KiB |
+33
-12
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>KAPVOE Portfolio · Blood Bros Sports</title>
|
<title>KAPVOE Portfolio · Blood Bros Sports</title>
|
||||||
|
<link rel="icon" type="image/png" href="/assets/logo/bloodbros-sports-logo.png">
|
||||||
<style>
|
<style>
|
||||||
:root{
|
:root{
|
||||||
--bg-1:#040b16;
|
--bg-1:#040b16;
|
||||||
@@ -107,11 +108,19 @@
|
|||||||
background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
|
background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
|
||||||
color:var(--text);padding:0 18px;font-size:15px;outline:none;box-shadow:var(--shadow-soft);
|
color:var(--text);padding:0 18px;font-size:15px;outline:none;box-shadow:var(--shadow-soft);
|
||||||
}
|
}
|
||||||
.field{width:100%;-webkit-appearance:none;appearance:none;color-scheme:dark}
|
.field{
|
||||||
select.field{
|
width:100%;
|
||||||
background:
|
min-height:58px;
|
||||||
linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
|
border-radius:20px;
|
||||||
|
border:1px solid rgba(255,255,255,.10);
|
||||||
|
background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
|
||||||
color:var(--text);
|
color:var(--text);
|
||||||
|
padding:0 18px;
|
||||||
|
font-size:15px;
|
||||||
|
outline:none;
|
||||||
|
box-shadow:var(--shadow-soft);
|
||||||
|
-webkit-appearance:none;
|
||||||
|
appearance:none;
|
||||||
}
|
}
|
||||||
select.field option{
|
select.field option{
|
||||||
background:#14233d;
|
background:#14233d;
|
||||||
@@ -409,6 +418,18 @@
|
|||||||
.media-actions{justify-content:stretch}
|
.media-actions{justify-content:stretch}
|
||||||
.action-btn{flex:1}
|
.action-btn{flex:1}
|
||||||
}
|
}
|
||||||
|
input:-webkit-autofill,
|
||||||
|
input:-webkit-autofill:hover,
|
||||||
|
input:-webkit-autofill:focus,
|
||||||
|
input:-webkit-autofill:active,
|
||||||
|
textarea:-webkit-autofill,
|
||||||
|
select:-webkit-autofill {
|
||||||
|
-webkit-text-fill-color: #f4f7fb !important;
|
||||||
|
transition: background-color 9999s ease-in-out 0s;
|
||||||
|
box-shadow: 0 0 0px 1000px rgba(255,255,255,.05) inset !important;
|
||||||
|
border: 1px solid rgba(255,255,255,.10) !important;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -428,7 +449,7 @@
|
|||||||
|
|
||||||
<div style="margin:8px 0 10px;color:var(--muted);font-size:12px;letter-spacing:.18em;text-transform:uppercase;font-weight:800;">Explora el catàleg</div>
|
<div style="margin:8px 0 10px;color:var(--muted);font-size:12px;letter-spacing:.18em;text-transform:uppercase;font-weight:800;">Explora el catàleg</div>
|
||||||
<section class="controls">
|
<section class="controls">
|
||||||
<input id="searchInput" class="field" type="text" placeholder="🔎 Cerca per codi, model, família, colors o descripció..." />
|
<input id="searchInput" class="field" type="search" autocomplete="off" placeholder="🔎 Cerca per codi, model, família, colors o descripció..." />
|
||||||
<select id="topFilter" class="field">
|
<select id="topFilter" class="field">
|
||||||
<option value="all">🏷️ Tots</option>
|
<option value="all">🏷️ Tots</option>
|
||||||
<option value="top">Només TOP VENDES</option>
|
<option value="top">Només TOP VENDES</option>
|
||||||
@@ -485,13 +506,13 @@
|
|||||||
<div id="buySummary" class="buy-summary"></div>
|
<div id="buySummary" class="buy-summary"></div>
|
||||||
<form id="buyForm">
|
<form id="buyForm">
|
||||||
<div class="buy-grid">
|
<div class="buy-grid">
|
||||||
<input class="buy-input full" name="customer_name" placeholder="Nom complet" required>
|
<input class="buy-input full" name="customer_name" autocomplete="name" placeholder="Nom complet" required>
|
||||||
<input class="buy-input full" name="address" placeholder="Adreça postal" required>
|
<input class="buy-input full" name="address" autocomplete="street-address" placeholder="Adreça postal" required>
|
||||||
<input class="buy-input" name="postal_code" placeholder="Codi postal" required>
|
<input class="buy-input" name="postal_code" autocomplete="postal-code" placeholder="Codi postal" required>
|
||||||
<input class="buy-input" name="city" placeholder="Ciutat" required>
|
<input class="buy-input" name="city" autocomplete="address-level2" placeholder="Ciutat" required>
|
||||||
<input class="buy-input" name="province" placeholder="Província" required>
|
<input class="buy-input" name="province" autocomplete="address-level1" placeholder="Província" required>
|
||||||
<input class="buy-input" name="phone" placeholder="Telèfon" required>
|
<input class="buy-input" name="phone" autocomplete="tel" placeholder="Telèfon" required>
|
||||||
<input class="buy-input full" type="email" name="email" placeholder="Correu electrònic" required>
|
<input class="buy-input full" type="email" name="email" autocomplete="email" placeholder="Correu electrònic" required>
|
||||||
<input type="hidden" name="product_code">
|
<input type="hidden" name="product_code">
|
||||||
<input type="hidden" name="product_name">
|
<input type="hidden" name="product_name">
|
||||||
<input type="hidden" name="price">
|
<input type="hidden" name="price">
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
export const API_URL = 'https://script.googleusercontent.com/macros/echo?user_content_key=AWDtjMVe9JQMYFUTitGGiHSzQsuEyr7VsarNnNpOluFcWHXa-CGnuKhrinmwBYVLw1otHQoBg5rnYNpGlIvCg_I8u1QhCKr-FQwCC2bG9LdttpST6nS_k8TxRcaT5LmmDjeZENcy8A0ujTU1yJwFLoxudMFW-OGjkYtywE5YT_CUJpKQWmqPN8IRV1drNysBtQFfQH1tXUS1JrOODghrxxjAA3T77kqRnz-aaMZJ23YfZntVm4C1KpaBBloFs4OO2wYIcD7Sf1iAYX1OMjIHXsCypvIgFRfIdhMqADWRmluv&lib=MLri0H8XjzrQY2XIy3BzwJ1YbTZr7i_Wa';
|
export const API_URL = '/api/products.php';
|
||||||
export const AUTO_REFRESH_MS = 120000;
|
export const AUTO_REFRESH_MS = 120000;
|
||||||
|
|
||||||
// Si vols el logo real, puja'l a assets i canvia aquesta URL.
|
// Si vols el logo real, puja'l a assets i canvia aquesta URL.
|
||||||
|
|||||||
Reference in New Issue
Block a user