Browse Source

add web reader for digitised stuffs

master
katherine 2 years ago
parent
commit
cba8438840
  1. 2
      art/index.php
  2. 3
      blog/index.php
  3. 2
      index.php
  4. 64
      main.scss
  5. 3
      meta.php
  6. 138
      projects/digitise/index.php
  7. 30
      projects/index.php
  8. 1
      robots.txt

2
art/index.php

@ -5,6 +5,7 @@
if(array_key_exists('n', $_GET)) {
if(!is_numeric($_GET['n'])) {
header('Location: .');
die();
}
$subpage = $_GET['n'];
}
@ -20,6 +21,7 @@
if(count($files) <= ($subpage * 15)) {
header('Location: .');
die();
}
}
?>

3
blog/index.php

@ -2,6 +2,7 @@
if(array_key_exists('p', $_GET)) {
if(!is_numeric($_GET['p'])) {
header('Location: .');
die();
}
$page = $_GET['p'];
}
@ -41,6 +42,8 @@
<meta property="og:title" content="blog - 隠語 spoken here" />
<meta property="og:description" content="katherine's internet presence - blog" />
<link rel="alternate" type="application/rss+xml" title="katherine's blog" href="https://airen-no-jikken.icu/blog/feed/" />
<?php
include $_SERVER['DOCUMENT_ROOT']."/meta.php"
?>

2
index.php

@ -11,6 +11,8 @@
<meta property="og:description" content="katherine's internet presence" />
<meta property="og:url" content="https://airen-no-jikken.icu/" />
<link rel="alternate" type="application/rss+xml" title="katherine's blog" href="https://airen-no-jikken.icu/blog/feed/" />
<?php
include $_SERVER['DOCUMENT_ROOT']."/meta.php"
?>

64
main.scss

@ -526,6 +526,38 @@ section {
}
@media (min-aspect-ratio: 7/8) {
/* font modifiers */
.font-left {
text-align: left;
}
.font-centre {
text-align: center;
}
.font-right {
text-align: right;
}
.font-huge {
font-size: 2.5em;
}
.font-verylarge {
font-size: 2em;
}
.font-large {
font-size: 1.5em;
}
.font-semilarge {
font-size: 1.25em;
}
/* end font modifiers */
#header-links {
width: 78%;
max-width: 60rem;
@ -669,6 +701,38 @@ section {
/* once supported, use (max-aspect-ratio: 7/8) and (not (aspect-ratio: 7/8)) */
@media (max-aspect-ratio: 7/8) {
/* font modifiers */
.font-left {
text-align: left;
}
.font-centre {
text-align: center;
}
.font-right {
text-align: right;
}
.font-huge {
font-size: 2.25em;
}
.font-verylarge {
font-size: 2em;
}
.font-large {
font-size: 1.75em;
}
.font-semilarge {
font-size: 1.5em;
}
/* end font modifiers */
main {
font-size: $fs_mbl;
padding : {

3
meta.php

@ -14,6 +14,3 @@
<meta property="og:image:alt" content="隠語 spoken here" />
<link href="/main.css" rel="stylesheet" type="text/css" />
<link rel="alternate" type="application/rss+xml" title="katherine's blog" href="https://airen-no-jikken.icu/blog/feed/" />

138
projects/digitise/index.php

@ -0,0 +1,138 @@
<?php
if (!array_key_exists('p', $_GET)) {
header('Location: /projects/#digitise');
die();
}
$page = $_GET['p'];
if (!is_readable($_SERVER['DOCUMENT_ROOT'] . '/projects/digitise/' . $page)
|| !file_exists($_SERVER['DOCUMENT_ROOT'] . '/projects/digitise/' . $page . '/pages/')
|| !file_exists($_SERVER['DOCUMENT_ROOT'] . '/projects/digitise/' . $page . '/meta.php')
) {
header('Location: /projects/#digitise');
die();
}
include $_SERVER['DOCUMENT_ROOT'] . '/projects/digitise/' . $page . '/meta.php';
if (!isset($title) || !isset($date) || !isset($author) ) {
header('Location: /projects/#digitise');
die();
}
$chapters = array_map('basename', array_filter(glob($page . '/pages/*')) );
sort($chapters);
function test_int($d) {
if (is_int($d)) {
return true;
} elseif (is_string($d)) {
return ctype_digit($d);
}
return false;
}
if(array_key_exists('n', $_GET)) {
$chapter = $_GET['n'];
if(!test_int($chapter) || $chapter >= count($chapters)) {
header('Location: /projects/digitise?p=' . $page);
die();
}
}
?>
<!DOCTYPE html>
<html lang="en-GB">
<head>
<?php
echo '<title>' . $title . ' - ' . $author . '</title>';
echo '<meta property="og:type" content="book" />';
echo '<meta property="book:author" content="'.$author.'" />';
echo '<meta property="book:release_date" content="'.$date.'" />';
echo '<meta property="og:url" content="https://airen-no-jikken.icu/digitise/?p=' . $page . '" />';
echo '<meta name="description" content="' . $title . ' - ' . $author . '" />';
echo '<meta name="keywords" content="' . $title . ',' . $author . ',writing" />';
echo '<meta property="og:title" content="' . $title . ' - ' . $author . '" />';
echo '<meta property="og:description" content="' . $title . ' - ' . $author . '" />';
include $_SERVER['DOCUMENT_ROOT']."/meta.php"
?>
</head>
<body>
<div id="bg-cover"></div>
<main class="appear">
<section>
<?php
if (isset($chapter)) {
preg_match("/ - .*$/", $chapters[$chapter], $matches);
echo '<p><div class="font-centre font-verylarge">' . substr($matches[0], 3) . '</div></p>';
include $_SERVER['DOCUMENT_ROOT'] . '/projects/digitise/' . $page . '/pages/' . $chapters[$chapter];
echo '<footer><div class="links">';
/* first */
if($chapter == 0) {
echo '<span id="first">&lt;&lt;</span>';
} else {
echo '<a id="first" href="/projects/digitise/?p=';
echo $page . '&n=0';
echo '">&lt;&lt;</a>';
}
/* prev */
if($chapter == 0) {
echo '<span id="prev">&lt;</span>';
} else {
echo '<a rel="prev" id="prev" href="/projects/digitise/?p=';
echo $page . '&n=' . ($chapter - 1);
echo '">&lt;</a>';
}
/* index */
echo '<a id="index" href="/projects/digitise/">';
echo 'index';
echo '</a>';
/* next */
if($chapter >= (count($chapters) - 1)) {
echo '<span id="next">&gt;</span>';
} else {
echo '<a rel="next" id="next" href="/projects/digitise/?p=';
echo $page . '&n=' . ($chapter + 1);
echo '">&gt;</a>';
}
/* last */
if($chapter >= (count($chapters) - 1)) {
echo '<span id="last">&gt;&gt;</span>';
} else {
echo '<a id="first" href="/projects/digitise/?p=';
echo $page . '&n=' . (count($chapters) - 1);
echo '">&gt;&gt;</a>';
}
echo '</div></footer>';
} else {
echo '<p>';
echo '<div class="font-centre font-huge">' . $title . '</div>';
echo '<div class="font-centre font-verylarge">' . $author . '</div>';
echo '<div class="font-centre font-large">' . $date . '</div>';
echo '</p>';
echo '</section>';
echo '<section>';
echo '<div class="font-centre font-verylarge">contents</div>';
foreach ($chapters as $key => $value) {
preg_match("/ - .*$/", $value, $matches);
echo '<p class="font-centre"><a href="/projects/digitise/?p=' . $page . '&n=' . $key . '">' . substr($matches[0], 3) . '</a></p>';
}
}
?>
</section>
</main>
</body>
</html>

30
projects/index.php

@ -58,7 +58,7 @@
<table class="project-table">
<tr>
<td>C</td>
<td><a href="https://git.airen-no-jikken.icu/ageha/confconf">confconf</a></td>
<td><a target="_blank" href="https://git.airen-no-jikken.icu/ageha/confconf">confconf</a></td>
<td>utility for generating config file parsers</td>
</tr>
</table>
@ -69,18 +69,18 @@
<table class="project-table">
<tr>
<td>C</td>
<td><a href="https://git.airen-no-jikken.icu/ageha/simple-opt">simple-opt</a></td>
<td><a target="_blank" href="https://git.airen-no-jikken.icu/ageha/simple-opt">simple-opt</a></td>
<td>cli option parsing in a single header file</td>
</tr>
<tr>
<td>C</td>
<td><a href="https://git.airen-no-jikken.icu/ageha/simple-test">simple-test</a></td>
<td><a target="_blank" href="https://git.airen-no-jikken.icu/ageha/simple-test">simple-test</a></td>
<td>unit testing in a single header file</td>
</tr>
<tr>
<td>Crystal</td>
<td><a href="https://git.airen-no-jikken.icu/ageha/xdg_basedir">xdg_basedir</a></td>
<td>interface to the <a href="https://specifications.freedesktop.org/basedir-spec/0.7/">XDG Base Directory Specification</a></td>
<td><a target="_blank" href="https://git.airen-no-jikken.icu/ageha/xdg_basedir">xdg_basedir</a></td>
<td>interface to the <a target="_blank" href="https://specifications.freedesktop.org/basedir-spec/0.7/">XDG Base Directory Specification</a></td>
</tr>
</table>
</p>
@ -93,10 +93,11 @@
<p>
<h3>fiction</h3>
<div class="project-table">
<img class="left-thumb" src="/projects/files/thumbs/small_sad_people.jpg" />
<img class="left-thumb" alt="cover" src="/projects/files/thumbs/small_sad_people.jpg" />
<b>Small Sad People</b><br />
20xx (in progress)<br />
a collection of short stories and poems about growing in the southwest US
a collection of short stories and poems about growing
in the southwest US
</div>
</p>
@ -105,7 +106,7 @@
<table class="project-table">
<tr>
<td>computing</td>
<td><a href="https://git.airen-no-jikken.icu/ageha/tutorials">tutorials</a></td>
<td><a target="_blank" href="https://git.airen-no-jikken.icu/ageha/tutorials">tutorials</a></td>
<td>rambling introductions to different aspects of computing</td>
</tr>
</table>
@ -123,12 +124,12 @@
<table class="project-table">
<tr>
<td>font</td>
<td><a href="https://git.airen-no-jikken.icu/ageha/bachirulo-brush">bachirulo-brush</a></td>
<td><a target="_blank" href="https://git.airen-no-jikken.icu/ageha/bachirulo-brush">bachirulo-brush</a></td>
<td>brush calligraphy font for the galu script</td>
</tr>
<tr>
<td>font</td>
<td><a href="https://git.airen-no-jikken.icu/ageha/bachirulo-type">bachirulo-type</a></td>
<td><a target="_blank" href="https://git.airen-no-jikken.icu/ageha/bachirulo-type">bachirulo-type</a></td>
<td>computer font for the galu script</td>
</tr>
</table>
@ -161,17 +162,18 @@
<p>though mostly now forgotten, modern readers have at least,
it seems, taken some interest in one of her earlier works,
Living Alone. because it has, like, witches and stuff</p>
Living Alone, because it has, like, witches and stuff, and i'm
into that</p>
<div class="project-table">
<img class="left-thumb" src="/projects/files/thumbs/the_little_world.jpg" />
<img class="left-thumb" alt="cover" src="/projects/files/thumbs/the_little_world.jpg" />
<b>The little world</b><br />
1925<br />
a travellogue in snippets, skits, and sarcasm, detailing
time spent riding boats, walking a lot, and driving a poor,
mistreated model-T named Stephanie<br />
(in-progress) <a
href="/projects/digitise/the_little_world/">web</a>
(in-progress) <a target="_blank"
href="/projects/digitise/?p=the-little-world">web</a>
</div>
</section>

1
robots.txt

@ -2,4 +2,5 @@ User-agent: *
Disallow: /tmp/
Disallow: /secret/
Disallow: /img/
Disallow: /projects/digitise/
Sitemap: https://airen-no-jikken.icu/sitemap.xml

Loading…
Cancel
Save