Compacting layout
This commit is contained in:
parent
469243897b
commit
11877b63b1
1 changed files with 18 additions and 7 deletions
17
index.php
17
index.php
|
|
@ -132,6 +132,7 @@ function render_blank_page(){
|
|||
<link rel="icon" type="image/png" href="assets/img/moto_travel.png">
|
||||
<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>
|
||||
<?php if ($articleId !== ''): ?><style>main{padding-bottom:0}</style><?php endif; ?>
|
||||
</head>
|
||||
<body>
|
||||
<?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)) {
|
||||
render_404_page();
|
||||
}
|
||||
render_blank_page();
|
||||
if ($articleId === '') {
|
||||
render_blank_page();
|
||||
}
|
||||
|
||||
if ($articleId !== '') {
|
||||
$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';
|
||||
$ogImageUrl = $defaultOgImageUrl;
|
||||
$ogImageAlt = 'MVLog: journal of an unreliable narrator.';
|
||||
$pageTitle = 'MVLog';
|
||||
if ($articleId !== '') {
|
||||
$customOg = article_og_image_url($articleId);
|
||||
if ($customOg !== '') {
|
||||
$ogImageUrl = $customOg;
|
||||
}
|
||||
if (!empty($slice)) {
|
||||
$firstVideo = basename((string)$slice[0]);
|
||||
$firstMeta = $videoCache[$firstVideo]['metadata'] ?? video_metadata($slice[0]);
|
||||
$firstTitle = trim((string)($firstMeta['title'] ?? ''));
|
||||
if ($firstTitle !== '') $ogImageAlt = 'MVLog: ' . $firstTitle;
|
||||
if ($firstTitle !== '') {
|
||||
$ogImageAlt = 'MVLog: ' . $firstTitle;
|
||||
$pageTitle = 'MVLog: ' . $firstTitle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -354,7 +361,7 @@ $brandUrl = '?id=' . rawurlencode($articleId);
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>MVLog</title>
|
||||
<title><?=h($pageTitle)?></title>
|
||||
|
||||
<!-- Basic Open Graph -->
|
||||
<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:hover{text-decoration:underline}
|
||||
.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 .meta{margin:0 0 .45rem}
|
||||
.description-teaser{margin:.15rem 0 .45rem;color:#EADFC9}
|
||||
|
|
@ -413,6 +423,7 @@ $brandUrl = '?id=' . rawurlencode($articleId);
|
|||
#videos .video-info .description{margin-top:.8rem}
|
||||
}
|
||||
</style>
|
||||
<?php if ($articleId !== ''): ?><style>main{padding-bottom:0}</style><?php endif; ?>
|
||||
</head>
|
||||
<body>
|
||||
<?php include __DIR__ . '/_header.php'; ?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue