Files
AudioCore/views/site/layout.php

553 lines
15 KiB
PHP
Raw Normal View History

<?php
/** @var string $pageTitle */
/** @var string $content */
use Core\Services\Settings;
$faUrl = Settings::get('fontawesome_pro_url', '');
if ($faUrl === '') {
$faUrl = Settings::get('fontawesome_url', '');
}
$siteTitleSetting = Settings::get('site_title', Settings::get('site_header_title', 'AudioCore V1.5'));
$seoTitleSuffix = trim(Settings::get('seo_title_suffix', $siteTitleSetting));
$seoDefaultDescription = trim(Settings::get('seo_meta_description', ''));
$seoRobotsIndex = Settings::get('seo_robots_index', '1') === '1' ? 'index' : 'noindex';
$seoRobotsFollow = Settings::get('seo_robots_follow', '1') === '1' ? 'follow' : 'nofollow';
$seoOgImage = trim(Settings::get('seo_og_image', ''));
$siteCustomCss = (string)Settings::get('site_custom_css', '');
$pageTitleValue = trim((string)($pageTitle ?? $siteTitleSetting));
$metaTitle = $pageTitleValue;
if ($seoTitleSuffix !== '' && stripos($pageTitleValue, $seoTitleSuffix) === false) {
$metaTitle = $pageTitleValue . ' | ' . $seoTitleSuffix;
}
$siteNotice = null;
if (session_status() === PHP_SESSION_ACTIVE && isset($_SESSION['ac_site_notice']) && is_array($_SESSION['ac_site_notice'])) {
$siteNotice = $_SESSION['ac_site_notice'];
unset($_SESSION['ac_site_notice']);
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?= htmlspecialchars($metaTitle, ENT_QUOTES, 'UTF-8') ?></title>
<?php if ($seoDefaultDescription !== ''): ?>
<meta name="description" content="<?= htmlspecialchars($seoDefaultDescription, ENT_QUOTES, 'UTF-8') ?>">
<?php endif; ?>
<meta name="robots" content="<?= htmlspecialchars($seoRobotsIndex . ',' . $seoRobotsFollow, ENT_QUOTES, 'UTF-8') ?>">
<meta property="og:title" content="<?= htmlspecialchars($metaTitle, ENT_QUOTES, 'UTF-8') ?>">
<?php if ($seoDefaultDescription !== ''): ?>
<meta property="og:description" content="<?= htmlspecialchars($seoDefaultDescription, ENT_QUOTES, 'UTF-8') ?>">
<?php endif; ?>
<?php if ($seoOgImage !== ''): ?>
<meta property="og:image" content="<?= htmlspecialchars($seoOgImage, ENT_QUOTES, 'UTF-8') ?>">
<?php endif; ?>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Syne:wght@500;600;700&family=IBM+Plex+Mono:wght@400;600&display=swap" rel="stylesheet">
<?php if ($faUrl !== ''): ?>
<link rel="stylesheet" href="<?= htmlspecialchars($faUrl, ENT_QUOTES, 'UTF-8') ?>">
<?php endif; ?>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/gh/lipis/flag-icons@7.3.2/css/flag-icons.min.css"
/>
<style>
:root {
color-scheme: dark;
--ink: #0a0b11;
--surface: #14161f;
--text: #f5f7ff;
--muted: #9aa0b2;
--accent: #22f2a5;
--accent2: #10252e;
}
* { box-sizing: border-box; }
body {
margin: 0;
font-family: 'Syne', sans-serif;
background-color: #14151a;
color: var(--text);
position: relative;
min-height: 100vh;
}
body::before {
content: '';
position: fixed;
inset: 0;
z-index: -2;
background:
radial-gradient(120% 70% at 50% 12%, rgba(68, 94, 155, 0.12), transparent 62%),
radial-gradient(140% 90% at 50% 80%, rgba(12, 16, 26, 0.65), transparent 70%),
linear-gradient(180deg, #1a1b1f 0%, #15161b 55%, #111217 100%);
}
body::after {
content: '';
position: fixed;
inset: 0;
z-index: -1;
opacity: 0.12;
pointer-events: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}
.shell { max-width: 1080px; margin: 0 auto; padding: 18px 24px 28px; }
.shell-main { padding-top: 8px; }
.shell-notice { padding-top: 2px; padding-bottom: 4px; }
.site-notice {
border-radius: 14px;
border: 1px solid rgba(255,255,255,0.12);
background: rgba(20, 22, 28, 0.72);
padding: 10px 14px;
font-size: 13px;
color: #dfe7fb;
}
.site-notice-inner {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
.site-notice-action {
display: inline-flex;
align-items: center;
justify-content: center;
height: 30px;
padding: 0 12px;
border-radius: 999px;
border: 1px solid rgba(255,255,255,0.2);
background: rgba(255,255,255,0.07);
color: #eef3ff;
text-decoration: none;
text-transform: uppercase;
letter-spacing: 0.12em;
font-size: 10px;
white-space: nowrap;
}
.site-notice-action:hover {
background: rgba(255,255,255,0.14);
}
.site-notice.ok {
border-color: rgba(34,242,165,0.34);
background: rgba(34,242,165,0.12);
color: #c9fbe7;
}
.site-notice.info {
border-color: rgba(125,149,190,0.34);
background: rgba(125,149,190,0.13);
color: #d7e2ff;
}
.shell-footer { padding-top: 6px; padding-bottom: 18px; }
.card {
border-radius: 24px;
background: rgba(20, 22, 28, 0.75);
border: 1px solid rgba(255,255,255,0.12);
box-shadow: 0 20px 50px rgba(0,0,0,0.3);
padding: 28px;
}
.nav {
display: flex;
flex-wrap: wrap;
gap: 10px;
padding: 10px;
border-radius: 18px;
border: 1px solid rgba(255,255,255,0.12);
background: rgba(255,255,255,0.04);
}
.nav a {
text-decoration: none;
color: var(--muted);
text-transform: uppercase;
font-size: 11px;
letter-spacing: 0.24em;
padding: 8px 14px;
border-radius: 999px;
transition: all 0.2s ease;
}
.nav a:hover { color: var(--text); background: rgba(255,255,255,0.1); }
.nav-actions {
margin-left: auto;
display: inline-flex;
align-items: center;
gap: 8px;
}
.nav-account {
display: inline-flex;
align-items: center;
gap: 8px;
border: 1px solid rgba(255,255,255,0.12);
background: rgba(255,255,255,0.04);
color: var(--text) !important;
}
.nav-cart {
display: inline-flex;
align-items: center;
gap: 8px;
border: 1px solid rgba(255,255,255,0.12);
background: rgba(255,255,255,0.04);
color: var(--text) !important;
}
.nav-cart:hover {
background: rgba(255,255,255,0.1);
}
.nav-cart-sep {
color: rgba(255,255,255,0.5);
margin-right: 2px;
}
.badge {
font-family: 'IBM Plex Mono', monospace;
text-transform: uppercase;
font-size: 10px;
letter-spacing: 0.32em;
color: rgba(255,255,255,0.5);
}
.nav-toggle {
display: none;
margin-top: 14px;
align-items: center;
justify-content: center;
gap: 8px;
height: 38px;
padding: 0 14px;
border-radius: 999px;
border: 1px solid rgba(255,255,255,0.12);
background: rgba(255,255,255,0.04);
color: var(--text);
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.18em;
font-family: 'IBM Plex Mono', monospace;
cursor: pointer;
}
.site-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 24px;
}
.site-brand {
display: flex;
align-items: center;
gap: 16px;
min-width: 0;
}
.site-brand-mark {
width: 56px;
height: 56px;
border-radius: 16px;
background: linear-gradient(135deg, var(--accent), var(--accent2));
display: grid;
place-items: center;
color: #071016;
font-weight: 700;
flex: 0 0 auto;
overflow: hidden;
}
.site-brand-mark i {
font-size: 21px;
line-height: 1;
}
.site-brand-mark-logo {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.site-brand-logo-only {
min-height: 56px;
display: flex;
align-items: center;
}
.site-brand-logo-only-img {
max-height: 56px;
max-width: 360px;
width: auto;
object-fit: contain;
display: block;
}
.site-brand-title {
font-size: 22px;
font-weight: 600;
line-height: 1.1;
}
.site-brand-sub {
font-size: 13px;
color: var(--muted);
line-height: 1.3;
}
.ac-shortcode-empty {
border: 1px solid rgba(255,255,255,0.12);
background: rgba(255,255,255,0.02);
border-radius: 14px;
padding: 12px 14px;
color: var(--muted);
font-size: 13px;
}
.ac-shortcode-release-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 12px;
}
.ac-shortcode-release-card {
text-decoration: none;
color: inherit;
border: 1px solid rgba(255,255,255,0.1);
background: rgba(15,18,24,0.6);
border-radius: 14px;
overflow: hidden;
display: grid;
min-height: 100%;
}
.ac-shortcode-release-cover {
aspect-ratio: 1 / 1;
background: rgba(255,255,255,0.03);
display: grid;
place-items: center;
overflow: hidden;
}
.ac-shortcode-release-cover img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.ac-shortcode-cover-fallback {
color: var(--muted);
font-family: 'IBM Plex Mono', monospace;
font-size: 12px;
letter-spacing: 0.2em;
}
.ac-shortcode-release-meta {
padding: 10px;
display: grid;
gap: 4px;
}
.ac-shortcode-release-title {
font-size: 18px;
line-height: 1.2;
font-weight: 600;
}
.ac-shortcode-release-artist,
.ac-shortcode-release-date {
color: var(--muted);
font-size: 12px;
}
.ac-shortcode-artists-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 12px;
}
.ac-shortcode-artist-card {
text-decoration: none;
color: inherit;
border: 1px solid rgba(255,255,255,0.1);
background: rgba(15,18,24,0.6);
border-radius: 14px;
overflow: hidden;
display: grid;
min-height: 100%;
}
.ac-shortcode-artist-avatar {
aspect-ratio: 1 / 1;
background: rgba(255,255,255,0.03);
display: grid;
place-items: center;
overflow: hidden;
}
.ac-shortcode-artist-avatar img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.ac-shortcode-artist-meta {
padding: 10px;
display: grid;
gap: 4px;
}
.ac-shortcode-artist-name {
font-size: 18px;
line-height: 1.2;
font-weight: 600;
}
.ac-shortcode-artist-country {
color: var(--muted);
font-size: 12px;
}
.ac-shortcode-hero {
border: 1px solid rgba(255,255,255,0.14);
border-radius: 18px;
padding: 18px;
background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
display: grid;
gap: 10px;
}
.ac-shortcode-hero-eyebrow {
font-size: 10px;
letter-spacing: 0.24em;
text-transform: uppercase;
color: var(--muted);
font-family: 'IBM Plex Mono', monospace;
}
.ac-shortcode-hero-title {
font-size: clamp(30px, 5vw, 54px);
line-height: 1.05;
font-weight: 700;
margin: 0;
}
.ac-shortcode-hero-subtitle {
font-size: 15px;
color: #d1d7e7;
max-width: 72ch;
margin: 0;
}
.ac-shortcode-hero-actions {
display: flex;
gap: 8px;
flex-wrap: wrap;
margin-top: 4px;
}
.ac-shortcode-hero-btn {
display: inline-flex;
align-items: center;
justify-content: center;
height: 38px;
padding: 0 14px;
border-radius: 999px;
border: 1px solid rgba(255,255,255,0.16);
background: rgba(255,255,255,0.05);
color: #f5f7ff;
text-decoration: none;
font-size: 11px;
letter-spacing: 0.16em;
text-transform: uppercase;
font-family: 'IBM Plex Mono', monospace;
}
.ac-shortcode-hero-btn.primary {
border-color: rgba(57,244,179,0.6);
background: rgba(57,244,179,0.16);
color: #9ff8d8;
}
.ac-shortcode-sale-list {
list-style: none;
margin: 0;
padding: 0;
display: grid;
gap: 8px;
}
.ac-shortcode-sale-item {
border: 1px solid rgba(255,255,255,0.1);
background: rgba(15,18,24,0.6);
border-radius: 10px;
padding: 10px 12px;
display: grid;
grid-template-columns: auto 1fr auto;
gap: 10px;
align-items: center;
}
.ac-shortcode-sale-rank {
font-family: 'IBM Plex Mono', monospace;
font-size: 11px;
color: var(--muted);
letter-spacing: 0.15em;
}
.ac-shortcode-sale-title {
font-size: 14px;
line-height: 1.3;
}
.ac-shortcode-sale-meta {
font-size: 12px;
color: var(--muted);
white-space: nowrap;
}
@media (max-width: 900px) {
.shell {
padding: 12px 14px 18px;
}
.card {
border-radius: 18px;
padding: 18px;
}
}
@media (max-width: 700px) {
.site-head {
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
grid-template-areas:
"brand toggle"
"badge badge";
align-items: center;
gap: 10px 12px;
}
.site-brand { grid-area: brand; }
.site-badge { grid-area: badge; }
.nav-toggle { grid-area: toggle; margin-top: 0; align-self: start; }
.site-brand-title {
font-size: 20px;
}
.site-brand-sub {
font-size: 12px;
}
.nav {
display: none;
gap: 6px;
padding: 8px;
}
.nav.is-open {
display: flex;
}
.nav-toggle {
display: inline-flex;
}
.nav a {
width: 100%;
text-align: center;
font-size: 10px;
letter-spacing: 0.18em;
padding: 7px 10px;
}
.nav-cart {
width: 100%;
justify-content: center;
}
.nav-actions {
width: 100%;
margin-left: 0;
}
.nav-account {
flex: 1 1 auto;
justify-content: center;
}
.nav-cart {
flex: 1 1 auto;
}
.nav-cart-sep {
display: none;
}
.shell-main {
padding-top: 2px;
}
}
<?php if (trim($siteCustomCss) !== ''): ?>
<?= str_replace('</style', '</ style', $siteCustomCss) . "\n" ?>
<?php endif; ?>
</style>
</head>
<body>
<?php require __DIR__ . '/../partials/header.php'; ?>
<?php if ($siteNotice): ?>
<section class="shell shell-notice">
<div class="site-notice <?= htmlspecialchars((string)($siteNotice['type'] ?? 'info'), ENT_QUOTES, 'UTF-8') ?>">
<div class="site-notice-inner">
<span><?= htmlspecialchars((string)($siteNotice['text'] ?? ''), ENT_QUOTES, 'UTF-8') ?></span>
<a href="/cart" class="site-notice-action">View Cart</a>
</div>
</div>
</section>
<?php endif; ?>
<main class="shell shell-main">
<?= $content ?? '' ?>
</main>
<?php require __DIR__ . '/../partials/footer.php'; ?>
</body>
</html>