image viewer php

This commit is contained in:
lickthecheese 2020-05-31 19:06:17 -04:00
commit 62f3f9247f
2 changed files with 83 additions and 0 deletions

49
assets/style.css Normal file
View File

@ -0,0 +1,49 @@
body {
background: black;
font-family: monospace;
color: #aea;
}
.preview, .box {
border: 1px solid #aea;
padding: 10px;
border-radius: 10px;
margin-top: 5px;
}
.wrapper {
width: 700px;
margin: 0 auto;
}
a {
text-decoration: none;
color: #aea;
}
a:hover {
text-decoration: underline;
}
code, kbd, pre {
background: #333;
color: #aea;
}
pre {
padding: 10px;
border-radius: 2px;
border: 1px solid #aea;
}
@media screen and (max-width:700px) {
.wrapper {
width: 100%;
}
}

34
index.php Normal file
View File

@ -0,0 +1,34 @@
<!DOCTYPE HTML>
<link rel="stylesheet" type="text/css" href="assets/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<h1>LickStock</h1>
lmao making my own stock photos to pay for a vps
<div class='wrapper'>
<?php
$images = glob("stock/*.{png,jpg}", GLOB_BRACE);
foreach($images as $image) {
$title = str_replace("_", " ", $image);
$title = str_replace("stock/", "", $title);
$title = str_replace(".png", "", $title);
$title = str_replace(".jpg", "", $title);
$anchor = str_replace(" ", "", $title);
?>
<div class='preview'>
<a name="<?php echo $anchor; ?>">
</a>
<h1><a href="#<?php echo $anchor; ?>">#</a> <?php echo $title; ?></h1>
<img width="100%" src="<?php echo $image; ?>">
</div>
<?php
}
?>