diff options
author | dweller <dweller@cabin.digital> | 2024-02-26 11:47:32 +0200 |
---|---|---|
committer | dweller <dweller@cabin.digital> | 2024-02-26 11:47:32 +0200 |
commit | f0181813ecf9867f13a206d87fc46b15d295acbc (patch) | |
tree | b1b6f94e6a2318010cb322bbd119356b46076dd4 /index.php | |
parent | a87359aaacac66655af6baa80ced112ac842f651 (diff) |
wire up frontend with PHP, badly
Diffstat (limited to '')
-rw-r--r-- | index.php (renamed from index.html) | 36 |
1 files changed, 26 insertions, 10 deletions
@@ -1,3 +1,6 @@ +<?php + require 'common.php'; +?> <!DOCTYPE html> <html lang="en"> <head> @@ -26,28 +29,37 @@ </header> <section id="logo"> <h1> - <span id="gc-let">Let</span> - <span id="gc-me">me</span> - <code id="gc-man">man</code> - <span id="gc-that">that</span> - <span id="gc-for">For</span> - <span id="gc-you">you</span> + <span id="logo-let">Let</span> + <span id="logo-me">me</span> + <code id="logo-man">man</code> + <span id="logo-that">that</span> + <span id="logo-for">For</span> + <span id="logo-you">you</span> </h1> - <div id="version_wrap"> - <span id="version">BETA!</span> + <div id="logo-ver_wrap"> + <span id="logo-ver">BETA!</span> </div> </section> <nav id="search_pane"> - <form> + <form action="/search.php"> <div id="query_wrap"> <div id="query_icon"></div> - <input id="query" type='search' value='' name='query' required autofocus/> + <input id="query" type='search' value='<?php if($action === 'lmmtfy') echo $query;?>' name='query' required autofocus/> + <button id="def" type='submit' value='man' name='action' class="btn-def" aria-hidden="true" tabindex="-1"></button> + <?php + if($action === 'lmmtfy') + echo '<input id="sect" type="hidden" value="' . $section . '" name= "section"/>'; + ?> </div> <div> <button id="mank" type='submit' value='apropos' name='action' title="apropos(1)">man -k</button> <button id="man" type='submit' value='man' name='action' title="Feeling lucky, punk?">man</button> </div> </form> + <?php + if($action === 'lmmtfy') + echo '<noscript class="center"><p>No JavaScript means you have to manually press the <code>man</code> button.</p></noscript>'; + ?> <p class="hint center">Write "man" if you have no idea what to do...</p> </nav> @@ -72,4 +84,8 @@ </nav> </div> </body> + +<?php + if($action === 'lmmtfy') echo '<script src="js/lmmtfy.js"></script>'; +?> </html> |