<!DOCTYPE html>
<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">
    <meta name="description" content="ben @ tilde.team unix group">
    <meta name="author" content="Ben Harris">

    <meta property="og:title" content="ben@tilde.team">
    <meta property="og:site_name" content="ben at tilde dot team">
    <meta property="og:url" content="https://tilde.team/~ben/">
    <meta property="og:description" content="my tilde page">
    <meta property="og:type" content="website">
    <meta property="og:image" content="https://tilde.team/apple-icon.png">

    <title>ben~tilde.team</title>

    <link rel="icon" type="image/png" sizes="32x32" href="https://tilde.team/favicon-32x32.png">

    <style><?php include "gruvbox/gruvbox.min.css"; ?></style>
    <link rel="stylesheet" href="https://tilde.team/css/fork-awesome.min.css">
</head>

<body>
    <main id="app">
        <div>
            <div class="pull-right">
                <p><a href="https://tilde.team/">&lt;- back to tilde team</a></p>
            </div>
            <h1>~ben</h1>
            <?php $taglines = file("taglines.txt"); ?>
            <p><?=$taglines[array_rand($taglines)]?></p>
            <hr>
        </div>

        <p>i built and maintain tilde.team. come join the tilde team
            <a href="https://tilde.team/signup/">:)</a>
        </p>
        <p>pitch in for hosting costs if you're able: <a href="https://bhh.sh/donate/">donate here</a></p>
        <p>the best place to find me is irc: i'm ben on <a href="https://tilde.chat">tilde.chat</a>
            and benharri on <a href="https://freenode.net">freenode</a>.
        <p>here are some other places to find me</p>

        <?php include "links.php"; ?>

        <p>here are some of my things</p>

        <?php include "mypages.php"; ?>

        <div>
            <hr>
            <strong>
                <h3>play with some ascii art</h3>
            </strong>
            <form>
                <div>
                    <label for="font">pick a font</label>
                    <select id="font">
                        <?php $figfonts = array_map(function($f) { return basename($f, ".flf"); }, glob("api/fonts/*.flf"));
                        foreach ($figfonts as $font): ?>
                            <option<?=$font == "slant" ? ' selected="selected"' : ""?> value="<?=$font?>"><?=$font?></option>
                        <?php endforeach; ?>
                    </select>
                </div>

                <div>
                    <label for="input">type here</label>
                    <input id="input">
                </div>

                <div>
                    <pre id="output">
                   _ _               __
  ____ ___________(_|_)  ____ ______/ /_
 / __ `/ ___/ ___/ / /  / __ `/ ___/ __/
/ /_/ (__  ) /__/ / /  / /_/ / /  / /_
\__,_/____/\___/_/_/   \__,_/_/   \__/
</pre>
                </div>
            </form>
        </div>

        <hr>


        <h3>page hits as of jan 2020</h3>
        <script type="text/javascript" src="counter/gcount.php?page=index"></script>

        <hr>
		<!-- tilde.team ring fragment-->
		<div id="newring">
			<center>
			[<a href="https://tilde.team/ring/?action=prev&me=ben">previous page</a>]
			[<a href="https://tilde.team/ring/?action=random&me=ben">random page</a>]
            [<a href="https://tilde.team/ring/?action=next&me=ben">next page</a>]
			<br>
			<a href="https://tilde.team/ring/">how to join this webring</a>
			</center>
		</div>

		<hr>
        <footer>
            <a href="https://tildegit.org/ben/tilde">page source</a>
        </footer>
    </main>

    <script>
        var font   = document.getElementById("font");
        var input  = document.getElementById("input");
        var output = document.getElementById("output");

        font.addEventListener("change", figlet);
        input.addEventListener("input", figlet);

        function figlet() {
            var xmlHttp = new XMLHttpRequest();
            xmlHttp.onreadystatechange = function() {
                if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
                    output.innerHTML = xmlHttp.responseText;
            };
            xmlHttp.open("GET", `api/?font=${font.value}&text=${input.value}`, true);
            xmlHttp.send(null);
        }
    </script>
</body>
</html>
