Compacting layout

This commit is contained in:
hbrain 2026-06-04 15:24:01 +02:00
parent 469243897b
commit 11877b63b1

View file

@ -132,6 +132,7 @@ function render_blank_page(){
<link rel="icon" type="image/png" href="assets/img/moto_travel.png"> <link rel="icon" type="image/png" href="assets/img/moto_travel.png">
<link rel="stylesheet" href="style.css?v=20260531u"> <link rel="stylesheet" href="style.css?v=20260531u">
<style>html,body{height:100%;overflow:hidden}body{height:100dvh}main{flex:1;min-height:0}</style> <style>html,body{height:100%;overflow:hidden}body{height:100dvh}main{flex:1;min-height:0}</style>
<?php if ($articleId !== ''): ?><style>main{padding-bottom:0}</style><?php endif; ?>
</head> </head>
<body> <body>
<?php include __DIR__ . '/_header.php'; ?> <?php include __DIR__ . '/_header.php'; ?>
@ -257,7 +258,9 @@ $articleId = trim((string)($_GET['id'] ?? ''));
if ($articleId !== '' && (!preg_match('/^[0-9]{14}[a-f0-9]{16}$/', $articleId) || count(array_diff_key($_GET, ['id' => true])) > 0)) { if ($articleId !== '' && (!preg_match('/^[0-9]{14}[a-f0-9]{16}$/', $articleId) || count(array_diff_key($_GET, ['id' => true])) > 0)) {
render_404_page(); render_404_page();
} }
render_blank_page(); if ($articleId === '') {
render_blank_page();
}
if ($articleId !== '') { if ($articleId !== '') {
$videos = array_values(array_filter($videos, function($v) use ($articleId, $config) { $videos = array_values(array_filter($videos, function($v) use ($articleId, $config) {
@ -333,15 +336,19 @@ $baseParams = ($rawKeyword !== '') ? ['q' => $rawKeyword] : [];
$defaultOgImageUrl = 'https://bubulescu.org/assets/img/bubulescuorg.jpg'; $defaultOgImageUrl = 'https://bubulescu.org/assets/img/bubulescuorg.jpg';
$ogImageUrl = $defaultOgImageUrl; $ogImageUrl = $defaultOgImageUrl;
$ogImageAlt = 'MVLog: journal of an unreliable narrator.'; $ogImageAlt = 'MVLog: journal of an unreliable narrator.';
$pageTitle = 'MVLog';
if ($articleId !== '') { if ($articleId !== '') {
$customOg = article_og_image_url($articleId); $customOg = article_og_image_url($articleId);
if ($customOg !== '') { if ($customOg !== '') {
$ogImageUrl = $customOg; $ogImageUrl = $customOg;
if (!empty($slice)) { }
$firstVideo = basename((string)$slice[0]); if (!empty($slice)) {
$firstMeta = $videoCache[$firstVideo]['metadata'] ?? video_metadata($slice[0]); $firstVideo = basename((string)$slice[0]);
$firstTitle = trim((string)($firstMeta['title'] ?? '')); $firstMeta = $videoCache[$firstVideo]['metadata'] ?? video_metadata($slice[0]);
if ($firstTitle !== '') $ogImageAlt = 'MVLog: ' . $firstTitle; $firstTitle = trim((string)($firstMeta['title'] ?? ''));
if ($firstTitle !== '') {
$ogImageAlt = 'MVLog: ' . $firstTitle;
$pageTitle = 'MVLog: ' . $firstTitle;
} }
} }
} }
@ -354,7 +361,7 @@ $brandUrl = '?id=' . rawurlencode($articleId);
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<title>MVLog</title> <title><?=h($pageTitle)?></title>
<!-- Basic Open Graph --> <!-- Basic Open Graph -->
<meta property="og:type" content="website"> <meta property="og:type" content="website">
@ -392,6 +399,9 @@ $brandUrl = '?id=' . rawurlencode($articleId);
.video-row-title a{color:inherit;text-decoration:none} .video-row-title a{color:inherit;text-decoration:none}
.video-row-title a:hover{text-decoration:underline} .video-row-title a:hover{text-decoration:underline}
.video-row-head-mobile{display:none} .video-row-head-mobile{display:none}
.video-row-head-mobile .video-row-title{margin:0 0 .15rem}
.video-row-head-mobile .meta{margin:0 0 .25rem}
.video-row-head-mobile .description-teaser{margin:.1rem 0 .3rem}
.video-info .video-row-title{margin:0 0 .35rem} .video-info .video-row-title{margin:0 0 .35rem}
.video-info .meta{margin:0 0 .45rem} .video-info .meta{margin:0 0 .45rem}
.description-teaser{margin:.15rem 0 .45rem;color:#EADFC9} .description-teaser{margin:.15rem 0 .45rem;color:#EADFC9}
@ -413,6 +423,7 @@ $brandUrl = '?id=' . rawurlencode($articleId);
#videos .video-info .description{margin-top:.8rem} #videos .video-info .description{margin-top:.8rem}
} }
</style> </style>
<?php if ($articleId !== ''): ?><style>main{padding-bottom:0}</style><?php endif; ?>
</head> </head>
<body> <body>
<?php include __DIR__ . '/_header.php'; ?> <?php include __DIR__ . '/_header.php'; ?>