-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbody.php
65 lines (65 loc) · 2.47 KB
/
body.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
ini_set("zlib.output_compression", 0);
// error_reporting(E_ALL);
// ini_set("display_errors", 1);
header("Content-Type: text/html");
?>
<noscript id="deferred-stylesheets">
<link rel="stylesheet" href="/pomf.css" importance="high">
</noscript>
<style>
body {
background-attachment: fixed;
background-color: rgb(45, 45, 45);
}
main, main + footer { transition: transform 0.5s cubic-bezier(0, 0, 0.8, 1.2); }
main { transform: translateY(-500%); }
main + footer { transform: translateY(500%); }
#smutty-bg {
align-items: center;
display: flex;
bottom: 0;
flex-direction: column;
position: fixed;
right: 0;
transition: transform 0.5s cubic-bezier(0, 0, 0.5, 1.2);
transform: translateX(500%);
}
#smutty-bg figcaption { font-size: xx-small; }
#smutty-bg figcaption a[target="_blank"]::after {
background-position: center;
background-size: 8px 8px;
height: 8px;
width: 8px;
}
@media (max-width: 84rem) {
#smutty-bg {
left: 0;
margin: auto;
}
#smutty-bg img {
max-height: 50vh;
max-width: 100%;
}
}
@media (prefers-reduced-motion: reduce) {
main, main + footer, #smutty-bg { transition: none !important; }
}
</style>
<?php
if (isset($_SERVER["HTTP_SAVE_DATA"]) && strtolower($_SERVER["HTTP_SAVE_DATA"]) === "on")
exit;
require_once "includes/grill.inc.php";
$grills = getGrill(["small", "medium", "large"], true);
$artistMetadata = array_map(function(string $artistName): string { return "<link itemprop=\"author\" href=\"" . DERPIBOORU_URL . "/tags/artist-colon-{$artistName}\" rel=\"author\">"; }, $grills["artists"]);
$mimeTypeAttribute = empty($grills["mime"]) ? "" : " type=\"{$grills["mime"]}\"";
?>
<figure id="smutty-bg" itemscope itemtype="https://schema.org/ImageObject" role="presentation">
<img alt="" importance="high" role="presentation" sizes="(min-width: 84rem) 30vw, 75vw" src="<?= $grills[0] ?>" srcset="<?= $grills[2] ?> 1280w, <?= $grills[1] ?> 800w, <?= $grills[0] ?> 320w"<?= $mimeTypeAttribute ?>>
<?= implode("\n", $artistMetadata) ?>
<link itemprop="contentUrl" href="<?= $grills[0] ?>"<?= $mimeTypeAttribute ?>>
<link itemprop="contentUrl" href="<?= $grills[1] ?>"<?= $mimeTypeAttribute ?>>
<link itemprop="contentUrl" href="<?= $grills[2] ?>"<?= $mimeTypeAttribute ?>>
<meta itemprop="encodingFormat" content="<?= $grills["mime"] ?>">
<figcaption><a href="<?= $grills["url"] ?>" itemprop="discussionUrl image mainEntityOfPage sameAs url" rel="external noopener" target="_blank">[Image Source]</a></figcaption>
</figure>