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.

285 lines
7.8 KiB

<?php
if (array_key_exists('l', $_GET) && $_GET['l'] == 'jp') {
$lang = 'jp';
} else {
$lang = 'en';
}
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();
}
}
?>
7 years ago
<!DOCTYPE html>
<html lang=<?php echo ($lang == 'jp' ? "\"ja-JP\"" : "\"en-GB\""); ?>>
7 years ago
<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"
?>
7 years ago
</head>
<body>
<div id="bg-cover"></div>
7 years ago
<header>
<nav id="header-links">
<span id="header-lhs">
<a id="lhs-main" href=<?php echo ($lang == 'jp' ? '"/?l=jp"' : '"/"'); ?>>隠語 Spoken Here</a>
<a id="lhs-mobile" href=<?php echo ($lang == 'jp' ? '"/?l=jp" class="jp-small">ホーム</a' : '"/">about</a'); ?>>
</span>
<span id="header-rhs"<?php if ($lang == 'jp') echo ' class="jp-small"'; ?>>
<a class="header-sel" href=<?php echo ($lang == 'jp' ? '"/art/?l=jp">画廊' : '"/art/">art'); ?></a>
<a href=<?php echo ($lang == 'jp' ? '"/projects/?l=jp">作品' : '"/projects/">projects'); ?></a>
<a href=<?php echo ($lang == 'jp' ? '"/blog/?l=jp">ブログ' : '"/blog/">blog'); ?></a>
</span>
</nav>
7 years ago
</header>
<main class="appear">
7 years ago
<?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="font-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='font-centre'>$section_desc</p>";
}
if(count($files) > 15) {
4 years ago
echo '<p class="links">';
for($i = 0; $i < ceil(count($files) / 15); $i++) {
echo "<a "
. ($subpage == $i ? "class='sel' " : "")
. "href='/art/?p=$page&amp;n=$i"
. ($lang == 'jp' ? '&amp;l=jp' : '')
. "'>";
$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 . ' ';
}
4 years ago
echo '</a>';
}
echo '</p>';
}
4 years ago
echo '<p class="links">';
4 years ago
for($i = 0; $i < count($dirs); $i+=5) {
foreach(array_slice($dirs, $i, $i+5) as $dir) {
echo "<a "
. (!strcmp($dir, $page) ? "class='sel' " : "")
. "href='/art/?p=$dir"
. ($lang == 'jp' ? "&amp;l=jp" : "")
. "'>$dir</a>\n";
4 years ago
}
echo '<br>';
}
4 years ago
echo '</p>';
4 years ago
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 alt='art gif' 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 alt='art thumnail' src=\"/art/$page/thumbs/" . pathinfo($file)['filename'] . ".jpg\" />";
} else {
echo "<img alt='art thumnail' src=\"/art/$page/thumbs/" . pathinfo($file)['filename'] . ".png\" />";
}
7 years ago
echo '</a>';
}
echo '<p class="font-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";
7 years ago
}
if(count($files) > 15) {
4 years ago
echo '<p class="links">';
for($i = 0; $i < ceil(count($files) / 15); $i++) {
echo "<a "
. ($subpage == $i ? "class='sel' " : "")
. "href='/art/?p=$page&amp;n=$i"
. ($lang == 'jp' ? '&amp;l=jp' : '')
. "'>";
$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 . ' ';
}
4 years ago
echo '</a>';
}
echo '</p>';
}
7 years ago
echo '<p class="links">';
4 years ago
for($i = 0; $i < count($dirs); $i+=5) {
foreach(array_slice($dirs, $i, $i+5) as $dir) {
echo "<a "
. (!strcmp($dir, $page) ? "class='sel' " : "")
. "href='/art/?p=$dir"
. ($lang == 'jp' ? "&amp;l=jp" : "")
. "'>$dir</a>\n";
}
echo '<br>';
}
echo '</p></section>';
} else {
echo "
<section>
";
echo ($lang == 'jp'
? "
<h2>美術?(ではないよね^^;)</h2>
<p>「交雑」したものを作っているの。それは、あっちこっちで拾った
画像と自分で撮った写真をリミックスするという意味なの。
グリッチやデータベンディングのような技法とか、コラージュも
よく使っているよ。まずは「dreams」のカテゴリを見てみるのが良い
かも知れない。。</p>
<p>見本:</p>
"
: "
<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
4 years ago
stuff. “dreams” is probably the best place to look.</p>
4 years ago
<p>ejemplos:</p>
");
echo "
<p class='thumb_strip'>
<a target='_blank' href='/art/dreams/full/nowhere.png'>
<img alt='art thumnail' src='/art/dreams/thumbs/nowhere.jpg' />
</a>
<a target='_blank' href='/art/dreams/full/fuzzy.jpg'>
<img alt='art thumnail' src='/art/dreams/thumbs/fuzzy.jpg' />
5 years ago
</a>
<a target='_blank' href='/art/glitchity/full/bright.jpg'>
<img alt='art thumnail' src='/art/glitchity/thumbs/bright.jpg' />
</a>
<a target='_blank' href='/art/dreams/full/a backwards glance.jpg'>
<img alt='art thumnail' src='/art/dreams/thumbs/a backwards glance.jpg' />
</a>
</p>
";
echo '</section>';
echo '<section>';
echo '<h2>' . ($lang == 'jp' ? 'カテゴリ' : 'Categories') . '</h2>';
echo ($lang == 'jp'
? '<p>下のカテゴリの一つを選んで下さい</p>'
: '<p>click on one of the categories below to start browsing!</p>'
);
echo '<p class="links">';
4 years ago
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>';
7 years ago
}
?>
<?php include $_SERVER['DOCUMENT_ROOT']."/lang-switch.php" ?>
</main>
7 years ago
</body>
</html>