release: promote beta to main (gyms, brand colours, JPEG XL, SEO per gym) #3

Merged
andre merged 74 commits from beta into main 2026-10-26 19:47:48 +00:00
12 changed files with 93 additions and 58 deletions
Showing only changes of commit 725f5b9c26 - Show all commits

No files matched your search

+4
View File
@@ -81,6 +81,10 @@ backoffice has an "a editar" gym switcher (`admin_gym_id()` /
`admin_gym()` in `config/functions_gyms.php`). `/` and `/home` 301 to the default gym (`is_default`); the other published gyms appear as highlighted buttons (`.gym-switch-btn`) at the right end of the public navbar (`site/includes/navbar.php`). `site/gym_chooser.php` is no longer used.
Each gym has a brand colour (`gyms.brand_color`, `#RRGGBB`, migration `migration_20261013_gym_brand_color.sql`; gym 1 = green `#C2D500`, gym 2 = red): set in Gestão → Ginásios, emitted as `:root` overrides by `gym_brand_css()` in `site/includes/include.php`. New components must use `--fitme-accent*` / `--fitme-on-accent`, never a hard-coded colour; the CrossFit nav pill follows the brand colour too. The public navbar's bottom edge is an always-on, slow (14s) sweep in the brand colour (`.header-section::before/::after`, `nav-sweep`, static with reduced motion). On the home page and the CrossFit page (`$nav_center_logo` set in `site/index.php` / `site/crossfit.php`, shared by `_open.php`; the CrossFit video header no longer prints its own logo, only a `visually-hidden` h1) the header starts taller (desktop >= 992px) with a second, big copy of the logo centred (fixed 52px height, so tall logos like the CrossFit one clear the links) (`.navbar-brand-hero`, `aria-hidden`); once `scrollY >= 40` (script in `navbar.php` toggles `.is-top`) the bar shrinks, the big logo fades out and the 150px left logo fades in (opacity crossfade, no movement). The hero gets `padding-top: 120px` on desktop so its event card clears the tall bar. On desktop the brand is absolute at the left and the links are centred on the full bar width; nav padding and logo width live in CSS, not inline. The other-gym buttons (`.gym-switch`) sit in the **match head**, a glimpse into the other site: painted in the first other gym's brand (`navbar.php` puts `gym_brand_vars()` of `$other_gyms[0]` on `.gym-switch`), a 5px strip in its accent on the slash, the face a shade darker (`--fitme-accent-dark` to 82% of it mixed with black) with a shadow inside the cut so the strip reads, and its logo in that gym's on-accent ink (`brightness(0)`, plus `invert(1)` with `.gym-switch--light-ink` when the on-accent is white). Paint is shared; geometry per breakpoint: desktop = absolute block at the right end of the bar (full height, width follows its buttons), left side cut on the brand slash (22px); below 992px = a full-width band across the bottom of the open menu, top edge slashed (18px). 992-1199px: links shrink (`.8125rem`, `--bs-navbar-nav-link-padding-x: .35rem`) so the 3070 menu clears the logo and head. Menu links are `.875rem` bold. Below 992px the open menu fills the screen under the bar (absolute, `100dvh - var(--nav-h)`, `--nav-h` = the header's real height, set by the `navbar.php` script, links/buttons centred, opacity fade; not `position:fixed` because the header's backdrop-filter is its containing block). The bar is liquid glass in Chromium: `backdrop-filter: url(#nav-glass) blur(6px) saturate(180%)` (`#nav-glass` in `include.php`: blurred low-frequency `feTurbulence` -> `feDisplacementMap`, bends the page behind it), gated by `@supports (-webkit-app-region: drag)` (Chromium-only property); Safari/Firefox keep the plain blur. **Brand slash template:** the cut corners of the "in" box are one rule in `style.css` ("Brand slash (template)"): `class="fx-slash"` (both ends) or `fx-slash-start` (left only), size via `--slash` (default 4px); pseudo-elements are added to that rule's selector list. Used by the nav and section-title underlines and the CrossFit pill (`--slash: 8px`, no radius); never paste the polygon again. The hero text has no glow, only a tight `0 1px 2px` shadow (h1, `.hero-brand`, `.hero-tagline`) and the hero frosted-band blur (`.hero-section .container::before`) is at opacity .8. The hero subtitle (`.hero-text h1 span`, gym `hero_subtitle`) is a block strapline at `.42em` of the h1, weight 600, tracked out. The hero event card's border is solid `--ev-accent`, the same colour as its button (button text stays `--fitme-on-accent`). Logos (`.navbar-brand img`, `.gym-switch-logo`) get the same `#pt-noise` grain filter as h1/h2, and `.hero-event-go`, `.cta-btn`, `.btn-primary` joined the `--noise` button list. Section-title underlines (`.section-title.deco h2:after`) use the same slashed 4px bar as the nav underline. The hero event button text uses `--fitme-on-accent` (white on red). The nav underline (`.nav-link:after`) is a 4px bar 3px under the text with slashed ends (`clip-path`, like the "in" box of the FitMe in logo). The hero event card (`.hero-event`) is square (no radius on card, badge or button), taller (88px min) and has a defocus gradient: `::after` is a `backdrop-filter: blur()` layer masked left->right, sharp on the left and most blurred on the right; the card itself must not get filter/backdrop-filter/opacity/mask or the blur stops reaching the hero photo. Each gym can have a `logo` (same migration, plus `migration_20261026_gym_logo.sql`: the column was added to the 2026-10-13 file after it had already run on dev, so dev had no `logo` column until 2026-10-26 — never edit a migration that has run, add a new one); the header image and the logo are uploaded in Gestão → Ginásios (`gyms_save_image()` → `uploads/gyms/`, valLine truncated
An unpublished gym 404s publicly but previews for staff.
- **SEO per gym (2026-10-26):** `site/includes/include.php` builds title/description per page from the gym (`$gym_name`, `$loc_in` = «na Zona …»/«em Mira»); gym 1 keeps hand-written texts, other gyms get generated ones (never the 3070 texts). The gym's own `seo_title` / `seo_description` (Gestão → Ginásios) override the homepage each on its own. Keywords, author, og:site_name, favicon (gym logo if SVG) and the JSON-LD logo (`seo.php`) follow the gym. FitMe in's SEO texts were set in the dev DB only; production needs them entered in Gestão → Ginásios.
- `site/crossfit.php` decides the 404 for gyms without `has_crossfit` before `_open.php`, so it is a real 404 status.
- **Events per gym:** Eventos form «Mostrar em» writes `events.gym_id` (NULL = all gyms; `site_active_events()` filters on it). `site/evento.php` renders the event in its gym's brand/name/info. The hero event button text uses `--ev-on` (white/black computed from the event colour), not the page gym's on-accent.
- Navbar: the desktop bottom sweep line stops before the other-gym head via `--switch-w` (set by `setNavH` in `navbar.php`). The hero blur (`.hero-section .container::before`) has a second diagonal mask, so it is weaker at the top left. The «Marca uma aula experimental» link was removed; `#trialModal` stays (only reopened by `?agendar=erro`).
## Imagens / JPEG XL (2026-10-26)
Fleet transition to JPEG XL (root `Y:\GitTea\CLAUDE.md`, "Images"); fitme3070 is the reference site. Uploads already accept `.jxl` (gyms header/logo, gallery photos).
+6 -3
View File
@@ -15,6 +15,7 @@ function events_defaults(): array {
'location' => '', 'event_starts_at' => null, 'event_ends_at' => null,
'publish_from' => '', 'publish_until' => '', 'is_active' => 1,
'cta_label' => '', 'cta_url' => '', 'show_lead_form' => 1,
'gym_id' => null, // NULL = shown on every gym's homepage
];
}
@@ -117,8 +118,8 @@ function db_events_create(PDO $pdo, array $data): int {
INSERT INTO events
(slug, title, subtitle, summary, description, hero_image, cor, location,
event_starts_at, event_ends_at, publish_from, publish_until,
is_active, cta_label, cta_url, show_lead_form)
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
is_active, cta_label, cta_url, show_lead_form, gym_id)
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
");
$stmt->execute([
$d['slug'], $d['title'], $d['subtitle'], $d['summary'], $d['description'],
@@ -127,6 +128,7 @@ function db_events_create(PDO $pdo, array $data): int {
str_replace('T', ' ', (string) $d['publish_from']),
str_replace('T', ' ', (string) $d['publish_until']),
(int) $d['is_active'], $d['cta_label'], $d['cta_url'], (int) $d['show_lead_form'],
$d['gym_id'] ? (int) $d['gym_id'] : null,
]);
$__id = (int) $pdo->lastInsertId();
audit_change($pdo, 'event', 'events', 'e_id', (int) $__id, 'create', null, 'title');
@@ -141,7 +143,7 @@ function db_events_update(PDO $pdo, int $id, array $data): bool {
slug = ?, title = ?, subtitle = ?, summary = ?, description = ?,
hero_image = ?, cor = ?, location = ?,
event_starts_at = ?, event_ends_at = ?, publish_from = ?, publish_until = ?,
is_active = ?, cta_label = ?, cta_url = ?, show_lead_form = ?
is_active = ?, cta_label = ?, cta_url = ?, show_lead_form = ?, gym_id = ?
WHERE e_id = ?
");
$stmt->execute([
@@ -151,6 +153,7 @@ function db_events_update(PDO $pdo, int $id, array $data): bool {
str_replace('T', ' ', (string) $d['publish_from']),
str_replace('T', ' ', (string) $d['publish_until']),
(int) $d['is_active'], $d['cta_label'], $d['cta_url'], (int) $d['show_lead_form'],
$d['gym_id'] ? (int) $d['gym_id'] : null,
$id,
]);
$__r = $stmt->rowCount() > 0;
+11 -22
View File
@@ -600,7 +600,7 @@ section[id] {
content: '';
position: absolute;
left: 0;
right: 0;
right: var(--switch-w, 0px); /* ends where the other-gym head starts (navbar.php JS) */
bottom: -1px;
height: 2px;
pointer-events: none;
@@ -894,7 +894,15 @@ section[id] {
-webkit-mask-image: linear-gradient(to bottom, transparent 18%, rgba(0, 0, 0, .55) 36%, #000 50%, rgba(0, 0, 0, .55) 64%, transparent 82%);
mask-image: linear-gradient(to bottom, transparent 18%, rgba(0, 0, 0, .55) 36%, #000 50%, rgba(0, 0, 0, .55) 64%, transparent 82%);
}
/* The blur fades in diagonally: lightest at the top left, full at the bottom
right (second mask layer, intersected with the band above). */
.hero-section .container::before {
-webkit-mask-image: linear-gradient(to bottom, transparent 18%, rgba(0, 0, 0, .55) 36%, #000 50%, rgba(0, 0, 0, .55) 64%, transparent 82%),
linear-gradient(135deg, rgba(0, 0, 0, .15) 15%, #000 75%);
mask-image: linear-gradient(to bottom, transparent 18%, rgba(0, 0, 0, .55) 36%, #000 50%, rgba(0, 0, 0, .55) 64%, transparent 82%),
linear-gradient(135deg, rgba(0, 0, 0, .15) 15%, #000 75%);
-webkit-mask-composite: source-in;
mask-composite: intersect;
-webkit-backdrop-filter: blur(22px) saturate(1.1);
backdrop-filter: blur(22px) saturate(1.1);
opacity: .8;
@@ -962,31 +970,12 @@ section[id] {
.hero-cta-row {
display: flex;
flex-direction: column; /* the button, then the trial link as plain text under it */
flex-direction: column;
align-items: center;
gap: 14px;
margin-top: 2.5rem;
}
/* "Marca uma aula experimental": text only, under the main button. */
.hero-text-link {
background: none;
border: 0;
padding: 4px 8px;
color: #fff;
font: inherit;
font-weight: 300;
letter-spacing: .02em;
text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
cursor: pointer;
transition: color .3s ease;
}
.hero-text-link:hover,
.hero-text-link:focus-visible {
color: var(--fitme-accent);
text-decoration: none;
}
.hero-cta-row .site-btn {
margin-top: 0;
}
@@ -3541,7 +3530,7 @@ h3.contact-title {
font-size: .92rem;
font-weight: 700;
white-space: nowrap;
color: var(--fitme-on-accent); /* white on the red gym, dark on lime */
color: var(--ev-on, var(--fitme-on-accent)); /* set from the event colour (index.php) */
background: var(--ev-accent);
}
.hero-event-go i { transition: transform var(--fitme-transition); }
+6 -2
View File
@@ -12,9 +12,13 @@ if (($_GET['gym'] ?? '') === '') {
exit;
}
// Only gyms with a CrossFit box have this page: a real 404 status, so decide before any output.
require_once __DIR__ . '/../config/db.php';
require_once __DIR__ . '/../config/functions.php';
$cf_gym = site_gym($pdo);
if ($cf_gym && empty($cf_gym['has_crossfit'])) { require __DIR__ . '/404.php'; exit; }
require __DIR__ . '/_open.php';
// Only gyms with a CrossFit box have this page.
if (empty($gym['has_crossfit'])) { ob_get_level() && ob_end_clean(); require __DIR__ . '/404.php'; exit; }
$data = [
'title' => 'CrossFit',
+8 -4
View File
@@ -105,8 +105,12 @@ $seo_desc = $event['summary'] !== ''
: trim(mb_substr(strip_tags((string) ($event['subtitle'] ?: $event['description'])), 0, 200));
$current_uri_2 = 'evento';
// An event tied to one gym (Eventos → «Mostrar em») renders in that gym's brand.
$ev_gym = !empty($event['gym_id']) ? db_gyms_get($pdo, (int) $event['gym_id']) : null;
if ($ev_gym && empty($_GET['gym'])) $_GET['gym'] = $ev_gym['slug'];
$ev_gym = $ev_gym ?? site_gym($pdo) ?? gym_fallback();
$GLOBALS['_page_meta_override'] = [
($event['title'] !== '' ? $event['title'] : 'Evento') . ' | FitMe 3070',
($event['title'] !== '' ? $event['title'] : 'Evento') . ' | ' . $ev_gym['name'],
$seo_desc,
];
$GLOBALS['_canonical_override'] = $event_url;
@@ -114,7 +118,7 @@ $GLOBALS['_og_type_override'] = 'article';
if ($hero_url !== '') $GLOBALS['_og_image_override'] = $hero_url;
// Event structured data (schema.org/Event) for rich link previews / search.
$info = site_info($pdo);
$info = site_info($pdo, (int) $ev_gym['id']);
$ld_event = [
'@context' => 'https://schema.org',
'@type' => 'Event',
@@ -130,11 +134,11 @@ if (!empty($event['event_ends_at'])) $ld_event['endDate'] = str_replace(' ',
$ld_event['location'] = $event['location'] !== ''
? ['@type' => 'Place', 'name' => $event['location']]
: ['@type' => 'Place',
'name' => ($info['name'] ?? '') !== '' ? $info['name'] : 'FitMe 3070',
'name' => ($info['name'] ?? '') !== '' ? $info['name'] : $ev_gym['name'],
'address' => $info['adress'] ?? ''];
$ld_event['organizer'] = [
'@type' => 'Organization',
'name' => ($info['name'] ?? '') !== '' ? $info['name'] : 'FitMe 3070',
'name' => ($info['name'] ?? '') !== '' ? $info['name'] : $ev_gym['name'],
'url' => base_url(),
];
$GLOBALS['_jsonld_extra'] = $ld_event;
+33 -23
View File
@@ -2,27 +2,37 @@
// Per-page metadata, keyed by $current_uri_2. The canonical URL comes from
// base_url(), which matches the https + non-www redirect in .htaccess.
$page = $current_uri_2 ?? '';
$page_meta = [
'' => ['FitMe 3070 — Ginásio & CrossFit em Mira',
'Ginásio em Mira (Lagoa) com musculação, CrossFit, aulas de grupo, personal trainers, nutrição e fisioterapia. Inscreve-te já no FitMe 3070!'],
'crossfit' => ['CrossFit 3070 — Box de CrossFit em Mira | FitMe 3070',
'Box de CrossFit em Mira (Lagoa). Aulas para todos os níveis com treinadores certificados. Marca a tua aula experimental no CrossFit 3070!'],
'privacidade' => ['Política de Privacidade | FitMe 3070',
'Política de privacidade do FitMe 3070 — como recolhemos, usamos e protegemos os teus dados pessoais.'],
'termos' => ['Termos e Condições | FitMe 3070',
'Termos e condições de utilização do website do FitMe 3070.'],
];
// The gym's homepage uses the gym's own SEO title/description when set
// (Gestão → Ginásios); a new gym without them gets a generic one from its name
// and locality rather than the 3070 texts above.
// Titles ~50-60 characters, descriptions ~140-160 (what Google shows).
$gym_meta = current_gym();
if ($page === '' && ($gym_meta['seo_title'] ?? '') !== '') {
$page_meta[''] = [$gym_meta['seo_title'], ($gym_meta['seo_description'] ?? '') !== '' ? $gym_meta['seo_description'] : $page_meta[''][1]];
} elseif ($page === '' && (int) $gym_meta['id'] !== 1) {
$loc = ($gym_meta['locality'] ?? '') !== '' ? ' em ' . $gym_meta['locality'] : '';
$page_meta[''] = [$gym_meta['name'] . ' — Ginásio' . $loc,
($gym_meta['seo_description'] ?? '') !== '' ? $gym_meta['seo_description'] : 'Ginásio ' . $gym_meta['name'] . $loc . ': treino, aulas de grupo e acompanhamento.'];
$gym_name = ($gym_meta['name'] ?? '') !== '' ? $gym_meta['name'] : 'FitMe 3070';
$is_main = (int) ($gym_meta['id'] ?? 1) === 1;
$loc = ($gym_meta['locality'] ?? '') !== '' ? $gym_meta['locality'] : 'Mira';
$loc_in = (preg_match('/^(zona|rua|avenida|praia|vila)/iu', $loc) ? 'na ' : 'em ') . $loc; // «na Zona Industrial de Mira»
$page_meta = [
'' => $is_main
? ['FitMe 3070 — Ginásio e CrossFit em Mira',
'Ginásio em Mira (Lagoa) com musculação, CrossFit, aulas de grupo, personal trainers, nutrição e fisioterapia. Vê horários e mensalidades e inscreve-te!']
// Other gyms without their own texts get them from name and locality, never the 3070 ones.
: [$gym_name . ' — Ginásio ' . $loc_in,
$gym_name . ', ginásio ' . $loc_in . ': musculação, cardio e treino funcional com acompanhamento. Vê horários e mensalidades e inscreve-te já!'],
'crossfit' => $is_main
? ['CrossFit 3070 — Box de CrossFit em Mira | FitMe 3070',
'Box de CrossFit em Mira (Lagoa) com treinadores certificados e aulas para todos os níveis, do primeiro treino à competição. Vê o horário e treina connosco!']
: ['CrossFit — Box ' . $loc_in . ' | ' . $gym_name,
'Box de CrossFit do ' . $gym_name . ' ' . $loc_in . ': aulas para todos os níveis com treinadores certificados. Vê o horário e treina connosco!'],
'privacidade' => ['Política de Privacidade | ' . $gym_name,
'Política de privacidade do ' . $gym_name . ': que dados pessoais recolhemos, para quê, durante quanto tempo e como exerces os teus direitos (RGPD).'],
'termos' => ['Termos e Condições | ' . $gym_name,
'Termos e condições de utilização do site do ' . $gym_name . ': pedidos de inscrição, preços, horários, eventos e limites de responsabilidade.'],
];
// The gym's own SEO title/description (Gestão → Ginásios) win on its homepage, each on its own.
if ($page === '') {
if (($gym_meta['seo_title'] ?? '') !== '') $page_meta[''][0] = $gym_meta['seo_title'];
if (($gym_meta['seo_description'] ?? '') !== '') $page_meta[''][1] = $gym_meta['seo_description'];
}
// Favicon: the gym's own logo when it is an SVG.
$gym_logo_rel = gym_logo($gym_meta);
$favicon_rel = str_ends_with(strtolower($gym_logo_rel), '.svg') ? $gym_logo_rel : 'site/assets/img/logos/logo_black.svg';
// A dynamic page (e.g. an event landing page) can set its own title/description
// and canonical via these globals before requiring _open.php.
[$page_title, $page_desc] = $GLOBALS['_page_meta_override'] ?? $page_meta[$page] ?? $page_meta[''];
@@ -37,8 +47,8 @@ $canonical = $GLOBALS['_canonical_override'] ?? match ($page) {
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="<?= htmlspecialchars($page_desc) ?>">
<meta name="keywords" content="fitness, ginásio, exercício, personal trainer, crossfit, box, aveiro, mira">
<meta name="author" content="FitMe 3070">
<meta name="keywords" content="<?= htmlspecialchars('ginásio, fitness, musculação, personal trainer, ' . (!empty($gym_meta['has_crossfit']) ? 'crossfit, box, ' : '') . mb_strtolower($loc) . ', ' . $gym_name) ?>">
<meta name="author" content="<?= htmlspecialchars($gym_name) ?>">
<meta name="theme-color" content="<?= htmlspecialchars(($gym_meta['brand_color'] ?? '') !== '' ? $gym_meta['brand_color'] : '#C2D500') ?>">
<title><?= htmlspecialchars($page_title) ?></title>
<link rel="canonical" href="<?= htmlspecialchars($canonical) ?>">
@@ -68,13 +78,13 @@ $canonical = $GLOBALS['_canonical_override'] ?? match ($page) {
<?= link_tag('site/assets/css/style.css') ?>
<!-- Favicon -->
<link rel="icon" type="image/svg+xml" href="<?= base_url('site/assets/img/logos/logo_black.svg') ?>">
<link rel="icon" type="image/svg+xml" href="<?= htmlspecialchars(base_url($favicon_rel)) ?>">
<link rel="apple-touch-icon" sizes="180x180" href="<?= base_url('site/assets/img/logos/apple-touch-icon.png') ?>">
<!-- Open Graph / link previews -->
<meta property="og:url" content="<?= htmlspecialchars($canonical) ?>">
<meta property="og:type" content="<?= htmlspecialchars($GLOBALS['_og_type_override'] ?? 'website') ?>">
<meta property="og:site_name" content="FitMe 3070">
<meta property="og:site_name" content="<?= htmlspecialchars($gym_name) ?>">
<meta property="og:locale" content="pt_PT">
<meta property="og:title" content="<?= htmlspecialchars($page_title) ?>">
<meta property="og:description" content="<?= htmlspecialchars($page_desc) ?>">
+8 -1
View File
@@ -109,8 +109,15 @@ $center_logo = !empty($nav_center_logo);
/* ── Mobile menu fills the screen below the bar (style.css --nav-h) ──── */
var hdr = document.querySelector('.header-section');
if (hdr) {
var setNavH = function() { hdr.style.setProperty('--nav-h', hdr.offsetHeight + 'px'); };
// Desktop: the bottom sweep line stops at the other-gym head (style.css --switch-w).
var sw = hdr.querySelector('.gym-switch');
var setNavH = function() {
hdr.style.setProperty('--nav-h', hdr.offsetHeight + 'px');
var w = (sw && window.innerWidth >= 992) ? hdr.getBoundingClientRect().right - sw.getBoundingClientRect().left + 5 : 0;
hdr.style.setProperty('--switch-w', Math.max(0, w) + 'px');
};
window.addEventListener('resize', setNavH, { passive: true });
window.addEventListener('load', setNavH);
setNavH();
}
+1 -1
View File
@@ -8,7 +8,7 @@ $ld = [
'name' => $ld_gym['name'] !== '' ? $ld_gym['name'] : (($info['name'] ?? '') !== '' ? $info['name'] : 'FitMe 3070'),
'url' => gym_url($ld_gym),
'image' => base_url(img_compat_rel(($ld_gym['hero_image'] ?? '') !== '' ? $ld_gym['hero_image'] : 'site/assets/img/home.jpg')),
'logo' => base_url('site/assets/img/logos/logo_black.svg'),
'logo' => base_url(img_compat_rel(gym_logo($ld_gym) ?: 'site/assets/img/logos/logo_black.svg')),
];
if (!empty($info['phone'])) $ld['telephone'] = site_tel($info['phone']);
if (!empty($info['email'])) $ld['email'] = $info['email'];
+3 -2
View File
@@ -61,10 +61,12 @@ $hero_img = $gym['hero_image'] !== '' ? $gym['hero_image'] : 'site/assets/img
<div class="hero-events">
<?php foreach ($events as $ev):
$ac = $ev['cor'] !== '' ? $ev['cor'] : '#C2D500';
// Button text follows the event's colour, not the page gym's (red event on lime 3070).
$ev_on = str_contains(gym_brand_vars(['brand_color' => $ac]), 'on-accent:#FFFFFF') ? '#FFFFFF' : '#0B0B0D';
$ev_img = $ev['hero_image'] !== '' ? base_url('uploads/events/' . rawurlencode($ev['hero_image'])) : '';
?>
<a class="hero-event<?= $ev_img ? ' has-img' : '' ?>" href="<?= base_url('evento/' . rawurlencode($ev['slug'])) ?>"
style="--ev-accent:<?= htmlspecialchars($ac, ENT_QUOTES) ?><?= $ev_img ? ';--ev-img:url(\'' . htmlspecialchars($ev_img, ENT_QUOTES) . '\')' : '' ?>">
style="--ev-accent:<?= htmlspecialchars($ac, ENT_QUOTES) ?>;--ev-on:<?= $ev_on ?><?= $ev_img ? ';--ev-img:url(\'' . htmlspecialchars($ev_img, ENT_QUOTES) . '\')' : '' ?>">
<span class="hero-event-badge"><span class="event-live-dot"></span><i class="fas fa-bolt"></i> Evento</span>
<span class="hero-event-text">
<strong class="hero-event-title"><?= htmlspecialchars($ev['title']) ?></strong>
@@ -78,7 +80,6 @@ $hero_img = $gym['hero_image'] !== '' ? $gym['hero_image'] : 'site/assets/img
<h1><?= htmlspecialchars($gym['hero_title'] !== '' ? $gym['hero_title'] : $gym['name']) ?><?php if ($gym['hero_subtitle'] !== ''): ?><br><span><?= htmlspecialchars($gym['hero_subtitle']) ?></span><?php endif; ?></h1>
<div class="hero-cta-row">
<a href="?assunto=insc#contactos" class="site-btn">Inscreve-te Já!</a>
<button type="button" class="hero-text-link" data-bs-toggle="modal" data-bs-target="#trialModal">Marca uma aula experimental</button>
</div>
</div>
</div>
+11
View File
@@ -21,6 +21,17 @@ $dt = static function ($v): string {
<input type="color" class="form-control form-control-color" name="cor" value="<?= htmlspecialchars($data['cor'] ?? '#C2D500') ?>">
</div>
<div class="col-md-6">
<label class="form-label">Mostrar em</label>
<select class="form-select" name="gym_id">
<option value="">Todos os ginásios</option>
<?php foreach (db_gyms_list($pdo) as $g): ?>
<option value="<?= (int) $g['id'] ?>"<?= (int) ($data['gym_id'] ?? 0) === (int) $g['id'] ? ' selected' : '' ?>><?= htmlspecialchars($g['name']) ?></option>
<?php endforeach; ?>
</select>
<div class="form-text">Ginásio em cujo topo da página inicial o destaque aparece.</div>
</div>
<div class="col-12">
<label class="form-label">Subtítulo</label>
<input class="form-control" name="subtitle" maxlength="255" value="<?= htmlspecialchars($data['subtitle'] ?? '') ?>">
+1
View File
@@ -24,6 +24,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
'cta_label' => trim($_POST['cta_label'] ?? ''),
'cta_url' => trim($_POST['cta_url'] ?? ''),
'show_lead_form' => isset($_POST['show_lead_form']) ? 1 : 0,
'gym_id' => (int) ($_POST['gym_id'] ?? 0) ?: null,
'hero_image' => '',
];
+1
View File
@@ -48,6 +48,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['save_event'])) {
'cta_label' => trim($_POST['cta_label'] ?? ''),
'cta_url' => trim($_POST['cta_url'] ?? ''),
'show_lead_form' => isset($_POST['show_lead_form']) ? 1 : 0,
'gym_id' => (int) ($_POST['gym_id'] ?? 0) ?: null,
'hero_image' => $item['hero_image'],
];