a poorly-written personal website
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

258 lines
6.5 KiB

<?php
if(array_key_exists('p', $_GET)) {
$page = $_GET['p'];
}
if(array_key_exists('n', $_GET)) {
if(!is_numeric($_GET['n'])) {
header('Location: .');
die();
}
$subpage = $_GET['n'];
}
if(isset($subpage) == false) {
$subpage = 0;
}
$dirs = array_filter(array_diff(scandir('.'), array('..', '.')), 'is_dir');
if(isset($page) && in_array($page, $dirs, TRUE) ) {
$files = array_map('basename', array_filter(glob($_SERVER['DOCUMENT_ROOT']
. "/art/$page/full/*")) );
if(count($files) <= ($subpage * 15)) {
header('Location: .');
die();
}
}
?>
<!DOCTYPE html>
<html lang="en-GB">
<head>
<title>art - 哀憐の実験</title>
<meta name="description" content="katherine's internet presence - art">
<meta name="keywords" content="katherine,ageha,shmibs,art">
<meta property="og:type" content="website" />
<meta property="og:title" content="art - 隠語 spoken here" />
<meta property="og:description" content="katherine's internet presence - art" />
<meta property="og:url" content="https://airen-no-jikken.icu/art/" />
<?php
include $_SERVER['DOCUMENT_ROOT']."/meta.php"
?>
</head>
<body>
<div id="bg-cover"></div>
<header>
<nav id="header-links">
<span id="header-lhs">
<a id="lhs-main" href="/">隠語 Spoken Here</a>
<a id="lhs-mobile" href="/">about</a>
</span>
<span id="header-rhs">
<a class="header-sel" href="/art/">art</a>
<a href="/projects/">projects</a>
<a href="/blog/">blog</a>
</span>
</nav>
</header>
<main class="appear">
<?php
function bytes2h($bytes) {
$suffices = array('b', 'kb', 'mb', 'gb');
$factor = floor((strlen($bytes) - 1) / 3);
return sprintf("%.2f", $bytes / pow(1024, $factor)) . @$suffices[$factor];
}
if(isset($files)) {
$fslice = array_slice($files, $subpage * 15, 15);
/* try to display specific page of things here */
echo '<section>';
echo '<h2 class="centre">' . $page . "</h2>";
if(file_exists($_SERVER['DOCUMENT_ROOT'] . "/art/$page/desc")) {
$section_desc = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/art/$page/desc");
echo "<p class='centre'>$section_desc</p>";
}
if(count($files) >= 15) {
echo '<p class="links">';
for($i = 0; $i < ceil(count($files) / 15); $i++) {
if($subpage != $i) {
echo "<a href='/art/?p=$page&amp;n=$i'>";
} else {
echo "<a class='sel' href='/art/?p=$page&amp;n=$i'>";
}
$upper = (($i + 1) * 15 - 1);
if($upper >= count($files)) {
$upper = count($files) - 1;
}
if($upper == $i * 15) {
echo ' ' . $i * 15 . ' ';
} else {
echo ' ' . $i * 15 . " - " . $upper . ' ';
}
echo '</a>';
}
echo '</p>';
}
echo '<p class="links">';
for($i = 0; $i < count($dirs); $i+=5) {
foreach(array_slice($dirs, $i, $i+5) as $dir) {
if( !strcmp($dir, $page) ) {
echo "<a class='sel' href='/art/?p=$dir'>$dir</a>\n";
} else {
echo "<a href='/art/?p=$dir'>$dir</a>\n";
}
}
echo '<br>';
}
echo '</p>';
foreach($fslice as $key => $file) {
$is_image = true;
echo '</section>';
echo '<section>';
switch(pathinfo($file, PATHINFO_EXTENSION)) {
case "webm":
case "mp4":
if( $page == "video" ) {
echo "<video controls loop src=\"/art/$page/full/$file\"></video>";
} else {
echo "<a target='_blank' href='/art/$page/full/$file'>";
echo "<video autoplay loop src=\"/art/$page/full/$file\"></video>";
echo '</a>';
}
$is_image = false;
break;
case "gif":
echo "<a target='_blank' href=\"/art/$page/full/$file\">";
echo "<img src=\"/art/$page/full/$file\" />";
echo '</a>';
break;
default:
echo "<a target='_blank' href=\"/art/$page/full/$file\">";
if( file_exists($_SERVER['DOCUMENT_ROOT'] . "/art/$page/thumbs/" . pathinfo($file)['filename'] . ".jpg") ) {
echo "<img src=\"/art/$page/thumbs/" . pathinfo($file)['filename'] . ".jpg\" />";
} else {
echo "<img src=\"/art/$page/thumbs/" . pathinfo($file)['filename'] . ".png\" />";
}
echo '</a>';
}
echo '<p class="centre">';
if($is_image) {
$img_size = getimagesize($_SERVER['DOCUMENT_ROOT'] . "/art/$page/full/$file");
echo pathinfo($file)['filename'] . ": "
. " (" . $img_size[0] . "x" . $img_size[1] . "), "
. bytes2h(filesize($_SERVER['DOCUMENT_ROOT']
. "/art/$page/full/$file")
);
} else {
echo pathinfo($file)['filename'] . ": "
. bytes2h(filesize($_SERVER['DOCUMENT_ROOT']
. "/art/$page/full/$file"));
}
echo "</p>\n";
}
if(count($files) >= 15) {
echo '<p class="links">';
for($i = 0; $i < ceil(count($files) / 15); $i++) {
if($subpage != $i) {
echo "<a href='/art/?p=$page&amp;n=$i'>";
} else {
echo "<a class='sel' href='/art/?p=$page&amp;n=$i'>";
}
$upper = (($i + 1) * 15 - 1);
if($upper >= count($files)) {
$upper = count($files) - 1;
}
if($upper == $i * 15) {
echo ' ' . $i * 15 . ' ';
} else {
echo ' ' . $i * 15 . " - " . $upper . ' ';
}
echo '</a>';
}
echo '</p>';
}
echo '<p class="links">';
for($i = 0; $i < count($dirs); $i+=5) {
foreach(array_slice($dirs, $i, $i+5) as $dir) {
if( !strcmp($dir, $page) ) {
echo "<a class='sel' href='/art/?p=$dir'>$dir</a>\n";
} else {
echo "<a href='/art/?p=$dir'>$dir</a>\n";
}
}
echo '<br>';
}
echo '</p></section>';
} else {
echo "
<section>
<h2>Art?</h2>
<p>i make “remix” stuff, which basically means hashing imagery from
all over the place in weird ways to try to make new things.
lots of “glitch” and “databending” type deals, or collage
stuff. “dreams” is probably the best place to look.</p>
<p>ejemplos:</p>
<p class='thumb_strip'>
<a target='_blank' href='/art/dreams/full/nowhere.png'>
<img src='/art/dreams/thumbs/nowhere.jpg' />
</a>
<a target='_blank' href='/art/dreams/full/fuzzy.jpg'>
<img src='/art/dreams/thumbs/fuzzy.jpg' />
</a>
<a target='_blank' href='/art/glitchity/full/bright.jpg'>
<img src='/art/glitchity/thumbs/bright.jpg' />
</a>
<a target='_blank' href='/art/dreams/full/a backwards glance.jpg'>
<img src='/art/dreams/thumbs/a backwards glance.jpg' />
</a>
</p>
<p class='links'>
</p>
</section>";
echo '<section>';
echo '<h2>Categories</h2>';
echo '<p>click on one of the categories below to start browsing!</p>';
echo '<p class="links">';
for($i = 0; $i < count($dirs); $i+=5) {
foreach(array_slice($dirs, $i, $i+5) as $dir) {
echo "<a href='/art/?p=$dir'>$dir</a>\n";
}
echo "<br>\n";
}
echo '</p></section>';
}
?>
</main>
</body>
</html>