website/index.php

143 lines
3.8 KiB
PHP
Raw Normal View History

2022-03-23 16:52:54 +00:00
<?php
if ($_SERVER['HTTP_HOST'] == 'localhost') {
$main_url = "http://localhost/public_html_git";
} else {
$main_url = "https://tilde.team/~grizzly";
}
if(!isset($_COOKIE['theme'])) {
setcookie('theme', 'dark', time() + (86400 * 30 * 30), "/");
$theme = 'dark';
} else {
$theme = $_COOKIE['theme'];
}
if (@$_GET['theme'] == 'dark') {
setcookie('theme', 'dark', time() + (86400 * 30 * 30), "/");
header("Location: " . $main_url);
}
if (@$_GET['theme'] == 'light') {
setcookie('theme', 'light', time() + (86400 * 30 * 30), "/");
header("Location: " . $main_url);
}
?><!DOCTYPE html>
2022-03-20 09:26:55 +00:00
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
2022-03-23 16:52:54 +00:00
<link rel="icon" href="<?=$main_url?>/components/favicon.svg" />
<link rel="stylesheet" href="<?=$main_url?>/components/css/style.css" />
<?php if ($theme === 'dark') { ?>
<link rel="stylesheet" href="<?=$main_url?>/components/css/dark.css" />
<?php } ?>
2022-03-23 18:00:26 +00:00
<title>grizzlys space</title>
2022-03-20 09:26:55 +00:00
</head>
<body>
<div class="app">
<header>
2022-03-24 17:22:56 +00:00
<span><a href="https://tilde.team/~grizzly" style="float: left;">~grizzly</a></span>
2022-03-24 17:06:53 +00:00
<span class="quote">security does not exist, no system is safe</span>
2022-03-20 09:26:55 +00:00
<span><a href="https://tilde.team/">&lt;- back to tilde.team</a></span>
</header>
<main>
<div class="container">
<div class="content">
2022-03-23 16:52:54 +00:00
<div class="theme">
<?php
if ($theme == 'dark') { echo '<a href="' . $main_url . '/?theme=light">light mode</a>'; }
if ($theme == 'light') { echo '<a href="' . $main_url . '/?theme=dark">dark mode</a>'; }
?>
</div>
2022-03-23 17:57:49 +00:00
<h2>hi, i'm grizzly!</h2>
have a great day! :)
2022-03-21 06:53:17 +00:00
<div class="widgets">
<?=Ascii()?>
<div class="botany">
<h3>botany: my plant</h3>
<?php require_once('components/botany.php'); ?>
2022-03-20 09:26:55 +00:00
</div>
</div>
2022-03-21 06:53:17 +00:00
<?php echo More(); ?>
2022-03-20 09:26:55 +00:00
2022-03-21 06:53:17 +00:00
</div>
<div class="side">
2022-03-23 17:58:29 +00:00
<?php require_once('components/comments/comment.php'); ?>
<?php require_once('components/comments/form.php'); ?>
2022-03-20 09:26:55 +00:00
</div>
</div>
<?php if ($theme === 'dark') { ?>
<style>.plant { background-color: transparent !important; }</style>
<?php } ?>
2022-03-20 09:26:55 +00:00
</main>
<footer>
2022-03-21 06:53:17 +00:00
<?=WebRing()?>
2022-03-23 17:42:02 +00:00
<div>
copyleft echo date("Y");
2022-03-23 17:57:49 +00:00
<p>
2022-03-23 17:42:02 +00:00
sorted to ravenclaw on <a href="https://wizardingworld.com/">wizardingworld</a>
2022-03-23 17:57:49 +00:00
</p>
2022-03-23 17:42:02 +00:00
2022-03-24 20:23:20 +00:00
<p>
<a href="https://tildegit.org/grizzly/website">opensource</a>
</p>
2022-03-23 17:42:02 +00:00
</div>
2022-03-20 09:26:55 +00:00
</footer>
</div>
</body>
</html>
2022-03-21 06:53:17 +00:00
<?php
function Ascii() {
return '
<pre>
_________________
2022-03-23 17:57:49 +00:00
< hello, everyone >
2022-03-21 06:53:17 +00:00
-----------------
\
\
___
{~._.~}
( Y )
()~*~()
(_)-(_)
</pre>';
}
function More() {
return '
<div class="more">
<div class="links">
' . file_get_contents('components/more/Contact.html') . '
' . file_get_contents('components/more/Me.html') . '
' . file_get_contents('components/more/Projects.html') . '
' . file_get_contents('components/more/CoolLinks.html') . '
</div>
</div>';
}
function WebRing() {
return '<!-- tilde.team ring fragment-->
<div class="newring">
[<a href="https://tilde.team/ring/?action=prev&amp;me=grizzly"
>previous</a
>] [<a href="https://tilde.team/ring/?action=random&amp;me=grizzly"
>random</a
>] [<a href="https://tilde.team/ring/?action=next&amp;me=grizzly"
>next</a
>]
<br />
<a href="https://tilde.team/ring/">how to join this webring</a>
</div>';
}
?>