diff options
| author | Horus3 | 2014-11-16 21:20:41 +0100 |
|---|---|---|
| committer | Horus3 | 2014-11-16 21:20:41 +0100 |
| commit | 4168f7aff52f6e7cf7320e42252227dac5169c4a (patch) | |
| tree | f73e5e93e8bc8d9b5ad8ef415b59ede323663f76 | |
| download | tools.iamfabulous.de-4168f7aff52f6e7cf7320e42252227dac5169c4a.tar.gz | |
Initial commit.
| -rw-r--r-- | header/index.php | 200 | ||||
| -rw-r--r-- | index.php | 30 | ||||
| -rw-r--r-- | linkshorter/.gitignore | 4 | ||||
| -rw-r--r-- | linkshorter/db.php | 16 | ||||
| -rw-r--r-- | linkshorter/error.php | 13 | ||||
| -rw-r--r-- | linkshorter/functions.php | 58 | ||||
| -rw-r--r-- | linkshorter/goto.php | 13 | ||||
| -rw-r--r-- | linkshorter/header.php | 18 | ||||
| -rw-r--r-- | linkshorter/index.html | 50 | ||||
| -rw-r--r-- | linkshorter/index.php | 108 | ||||
| -rw-r--r-- | linkshorter/insert.php | 36 | ||||
| -rw-r--r-- | linkshorter/style.css | 21 | ||||
| -rw-r--r-- | robots.txt | 2 | ||||
| -rw-r--r-- | tools/favicon.ico | bin | 0 -> 5242 bytes | |||
| -rw-r--r-- | tools/footer.php | 9 | ||||
| -rw-r--r-- | tools/navbar.php | 27 | ||||
| -rw-r--r-- | tools/style.css | 54 |
17 files changed, 659 insertions, 0 deletions
diff --git a/header/index.php b/header/index.php new file mode 100644 index 0000000..1a027ab --- /dev/null +++ b/header/index.php @@ -0,0 +1,200 @@ +<?php + +if ( isset($_REQUEST['url']) && $_REQUEST['url'] != "" ) + $set = true; +else + $set = false; +?> +<!doctype html> +<html> +<head> + <meta charset="utf-8"> + <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> + <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> + <style> + <?php echo file_get_contents("../tools/style.css"); ?> + </style> + <noscript><style>.navbar{margin-bottom:0;}</style></noscript> + <?php if ( ! $set) { ?> + <title>Check HTTP Headers online!</title> + <?php } else { + echo '<title>Header: ' . htmlentities($_REQUEST['url']) .'</title>'; + } + ?> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <link rel='shortcut icon' href='../tools/favicon.ico' type='image/x-icon'> +</head> +<body> + <?php require("../tools/navbar.php"); ?> +<div class="container"> + <div class="text-center"> + <div class="row"> +<?php +if ( $set ){ + function getInfo($url, $method = "get", $customHeader = array()){ + + $redis = new Redis(); + $redis ->connect("/var/run/redis/redis.sock"); + $redis->ping(); + $redis->select(9); + + $key = md5( $url . serialize($customHeader) ); + + if( $redis->exists( $key ) ){ + return unserialize( $redis->get( $key ) ); + } + + $agent = "Retrieve HTTP headers online. v0.1"; + $ch = curl_init($url); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_HEADER, 1); + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); + curl_setopt($ch, CURLOPT_USERAGENT, $agent); + curl_setopt($ch, CURLINFO_HEADER_OUT, 1); + + switch($method){ + case("head"): + curl_setopt($ch, CURLOPT_NOBODY, true); + break; + case("post"): + curl_setopt($ch, CURLOPT_POST, true); + default: + break; + } + + if ( ! empty($customHeader) ){ + curl_setopt($ch, CURLOPT_HTTPHEADER, $customHeader); + } + + $response = curl_exec($ch); + if ( ! $response ) + return false; + $request = curl_getinfo($ch, CURLINFO_HEADER_OUT); + $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); + $header = substr($response, 0, $header_size); + $host = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL); + + $result = array($request, $header, $host); + + # redis. remove this line if no redis + $redis->set( $key, serialize($result), 60 ); + + return $result; + } + if ( ! isset($_REQUEST['method']) || $_REQUEST['method'] != "" ){ + $_REQUEST['method'] = 'get'; + } else { + $_REQUEST['method'] = strtolower($_REQUEST['method']); + } + $header_info = getInfo($_REQUEST['url'], $_REQUEST['method'], $_REQUEST['header']); + if ( ! $header_info ){ + echo "<h1>Failure!</h1><h3>Requested URL: \"".htmlentities($_REQUEST['url'])."\"</h3><hr></pre><pre>Couldn't retrieve URL. Please check whether the website is available and try again.</pre>"; + } else { + ?> + <h1>Success!</h1> + <br> + <h4><pre>Requested URL: "<u><?php echo strtolower(htmlentities($_REQUEST['url'])); ?></u>" +Host: "<u><?php echo strtolower(htmlentities($header_info[2])); ?></u>"</pre></h4> + <br> + + <h3>Request Header:</h3> + <?php + echo "<pre>".htmlentities($header_info[0])."</pre>"; + ?> + <h3>Response Header:</h3> + <?php + echo "<pre>"; + echo htmlentities($header_info[1]); + echo "</pre>"; + } + ?> + <p>Entries are cached for 60 seconds.</p> +<?php +} else { +?> + <h3>Retrieve HTTP Headers Online!</h3> + <p>Check the response headers for websites. <br> Enter a URL and hit the submit button.</p> + <br> +<form class="form-horizontal"> +<fieldset> + +<legend></legend> +<!-- Form Name --> + + +<!-- Text input--> +<div class="form-group"> + <label class="col-md-4 control-label" for="textinput">http://</label> + <div class="col-md-5"> + <input id="url" name="url" placeholder="Insert URL here." class="form-control input-md" required="" type="text"> + </div> +</div> + +<!-- Multiple Radios (inline) --> +<div class="form-group"> + <label class="col-md-4 control-label" for="method">Method</label> + <div class="col-md-4"> + <label class="radio-inline" for="method-0"> + <input name="method" id="method-0" value="GET" checked="checked" type="radio"> + GET + </label> + <label class="radio-inline" for="method-1"> + <input name="method" id="method-1" value="POST" type="radio"> + POST + </label> + <label class="radio-inline" for="method-2"> + <input name="method" id="method-2" value="HEAD" type="radio"> + HEAD + </label> + </div> +</div> + +<br> + +<!-- Text input--> +<div class="form-group"> + <label class="col-md-4 control-label" for="header[]">(optional)</label> + <div class="col-md-4"> + <div class="input-group"> + <input name="header[]" placeholder="Custom request header here." class="form-control input-md" type="text"> + +<span class="input-group-btn"> + <button type="button" class="btn btn-default addButton" title="Add more header." onclick="addInput('moreInput')"><i class="fa fa-plus"></i></button> +</span> +</div> + <span class="help-block text-left">Add any header, which are sent to the server.</span> + </div> +</div> + +<span id="moreInput"></span> + +<!-- Button --> +<div class="form-group"> + <label class="col-md-4 control-label" for=""></label> + <div class="col-md-4"> + <button id="" name="" class="btn btn-primary">Submit</button> + </div> +</div> + +</fieldset> +</form> + +<?php +} +?> + </div> + </div> +</div> + <?php require("../tools/footer.php"); ?> +<script> + +//window.onload = function(){ +//}; +function addInput(divName){ + var newdiv = document.createElement('div'); + newdiv.className = newdiv.className + "form-group" + newdiv.innerHTML = "<label class='col-md-4 control-label' for='header[]'></label><div class='col-md-4'> <input type='text' name='header[]' placeholder='More header.' class='form-control input-md' ></input></div>"; + document.getElementById(divName).appendChild(newdiv); +} +</script> +</body> diff --git a/index.php b/index.php new file mode 100644 index 0000000..99a8458 --- /dev/null +++ b/index.php @@ -0,0 +1,30 @@ +<!doctype html> +<html> +<head> + <meta charset="utf-8"> + <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> + <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> + <style> + <?php echo file_get_contents("../tools/style.css"); ?> + </style> + <noscript><style>.navbar{margin-bottom:0;}</style></noscript> + <?php if ( ! $set) { ?> + <title>Check HTTP Headers online!</title> + <?php } else { + echo '<title>Header: ' . htmlentities($_REQUEST['url']) .'</title>'; + } + ?> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <link rel='shortcut icon' href='../tools/favicon.ico' type='image/x-icon'> +</head> +<body> + <?php require("../tools/navbar.php"); ?> +<div class="container"> + <div class="text-center"> + <div class="row"> + + </div> + </div> + </div> + + <?php require("../tools/footer.php"); ?> diff --git a/linkshorter/.gitignore b/linkshorter/.gitignore new file mode 100644 index 0000000..f7f0c78 --- /dev/null +++ b/linkshorter/.gitignore @@ -0,0 +1,4 @@ +*.swp +*~ +*.tmp +*notmin* diff --git a/linkshorter/db.php b/linkshorter/db.php new file mode 100644 index 0000000..4dcf58a --- /dev/null +++ b/linkshorter/db.php @@ -0,0 +1,16 @@ +<?php + +$db = new Redis(); +$db->connect('/var/run/redis/redis.sock'); + +try { + $db->ping(); +} catch (Exception $e){ + do_output("<p>No connection to the database established.</p>", "500 Server Failure", false, "<h1>Redis went away</h1>"); +} + +try { + $db->select(1); +} catch (Exception $e){ + do_output("<p>No connection to the database established.</p>", "500 Server Failure", false, "<h1>Redis went away</h1>"); +} diff --git a/linkshorter/error.php b/linkshorter/error.php new file mode 100644 index 0000000..92ba713 --- /dev/null +++ b/linkshorter/error.php @@ -0,0 +1,13 @@ +<?php + +require 'functions.php'; +ob_start("sanitize_output"); + +switch($_GET["e"]){ + case("404"): + do_output("<p><strong>The requested url ( ".htmlentities($_SERVER['REQUEST_URI'])." ) wasn't found on this server.</strong></p>", "404 Not Found", false, "<h1>400 - Not Found</h1>"); + break; + + default: + do_output("<p>There was a failure and your request can't be proceeded.</p>", "500 Error", false, "<h1>Error!</h1>"); +} diff --git a/linkshorter/functions.php b/linkshorter/functions.php new file mode 100644 index 0000000..f6f021a --- /dev/null +++ b/linkshorter/functions.php @@ -0,0 +1,58 @@ +<?php + +function do_output($reason, $httpcode, $ajax = true, $heading = NULL){ + header ($_SERVER['SERVER_PROTOCOL'] . " " . $httpcode); + if( $ajax ){ + echo $reason; + ob_end_flush(); + exit; + } +?> +<!doctype html> +<html> +<head> + <meta charset="utf-8"> + <title>Link Shorter</title> + <!--style>html{position:relative;min-height:100%}body{margin-bottom:60px}.footer{position:absolute;bottom:0;width:100%}#copyright-text{text-decoration:underline;color:#333}</style--> + <style> + <?php echo file_get_contents("../tools/style.css"); ?> + </style> + <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> + <link rel='shortcut icon' href='../tools/favicon.ico' type='image/x-icon'> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> +</head> + <?php require("../tools/navbar.php"); ?> +<div class="container text-center pagination-centered"> + <div class="row"> + <?php echo $heading; ?> + <hr> + </div> + <div class="text-center"> + <?php echo $reason; ?> + </div> +</div> + <?php require("../tools/footer.php"); ?> +</body> +<?php + ob_end_flush(); + exit; +} + +function sanitize_output($buffer) { + + $search = array( + '/\>[^\S ]+/s', // strip whitespaces after tags, except space + '/[^\S ]+\</s', // strip whitespaces before tags, except space + '/(\s)+/s' // shorten multiple whitespace sequences + ); + + $replace = array( + '>', + '<', + '\\1' + ); + + $buffer = preg_replace($search, $replace, $buffer); + + return $buffer; +} diff --git a/linkshorter/goto.php b/linkshorter/goto.php new file mode 100644 index 0000000..d77e1e2 --- /dev/null +++ b/linkshorter/goto.php @@ -0,0 +1,13 @@ +<?php +require 'functions.php'; +ob_start("sanitize_output"); +require 'db.php'; + +$url = $db->get($_GET["goto"]); +if( ! $url || $url == "" ){ + do_output("<p>This url wasn't found on this server.</p>", "404 Not Found", false, "<h1>404 - Not found</h1>"); +} + +header($_SERVER['SERVER_PROTOCOL'] . " 301 Moved Permanently"); +header("Location: ".$url); +exit; diff --git a/linkshorter/header.php b/linkshorter/header.php new file mode 100644 index 0000000..c207321 --- /dev/null +++ b/linkshorter/header.php @@ -0,0 +1,18 @@ + <nav class="navbar navbar-default navbar-custom" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbarCollapse"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="/">Home</a> + </div> + <div class="collapse navbar-collapse" id="navbarCollapse"> + <ul class="nav navbar-nav"> + <li> + <a href="/rules" >Help</a> + </li> + </ul> + </div> + </div> + </nav> diff --git a/linkshorter/index.html b/linkshorter/index.html new file mode 100644 index 0000000..62ff295 --- /dev/null +++ b/linkshorter/index.html @@ -0,0 +1,50 @@ +<!doctype html> +<html> +<head> +<meta charset=utf-8> +<title>Link Shorter</title> +<link rel='shortcut icon' href='/favicon.ico' type='image/x-icon'> +<link rel=stylesheet href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> +<style>html{position:relative;min-height:100%}body{margin-bottom:60px}.footer{position:absolute;bottom:0;width:100%}#copyright-text{text-decoration:underline;color:#333}</style> +<meta name=viewport content="width=device-width, initial-scale=1.0"> +</head> +<nav class="navbar navbar-default navbar-custom" role=navigation> +<div class=container> +<div class=navbar-header> +<button type=button class=navbar-toggle data-toggle=collapse data-target="#navbarCollapse"> +<span class=sr-only>Toggle navigation</span> +<span class=icon-bar></span> +</button> +<a class=navbar-brand href="">Home</a> +</div> +</div> +</nav> +<div class=container> +<div class=text-center> +<div class="row center-block vertical-center"> +<form class="form-horizontal " method=POST action=insert> +<fieldset> +<legend class=text-centered><h1>Amazing Linkshorter</h1></legend> +<div class=form-group> +<label class="col-md-4 control-label" for=url>Link:</label> +<div class=col-md-5> +<input id=url name=url placeholder="http://www.moehm.org/" class="form-control input-md" required> +</div> +</div> +<div class=form-group> +<label class="col-md-4 control-label" for=singlebutton></label> +<div class=col-md-4> +<button id=singlebutton name=singlebutton class="btn btn-info" type=submit>Short!</button> +</div> +</div> +</fieldset> +</form> +</div> +</div> +</div> +<div class="footer text-right"> +<div class=container> +<p> Copyright 2014 <a id=copyright-text href="//www.moehm.org/" target=_blank>Maximilian Möhring</a></p> +</div> +</div> +</body> diff --git a/linkshorter/index.php b/linkshorter/index.php new file mode 100644 index 0000000..75ac9aa --- /dev/null +++ b/linkshorter/index.php @@ -0,0 +1,108 @@ +<?php +require 'functions.php'; +require 'db.php'; + +ob_start("sanitize_output"); + +if ( $_SERVER['REQUEST_METHOD'] != 'POST'){ + + $key = "lscache_" . md5( strtolower($_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"].$_SERVER["QUERY_STRING"])); + if ( $db->exists($key) ) { + header("X-Cache: Hit"); + echo $db->get($key); + ob_end_flush(); + exit; + } + +?> +<!doctype html> +<html> +<head> + <meta charset="utf-8"> + <title>Link Shorter</title> + <!--style>html{position:relative;min-height:100%}body{margin-bottom:60px}.footer{position:absolute;bottom:0;width:100%}#copyright-text{text-decoration:underline;color:#333}</style--> + <style> + <?php echo file_get_contents("../tools/style.css"); ?> + </style> + <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> + <link rel='shortcut icon' href='../tools/favicon.ico' type='image/x-icon'> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> +</head> + <?php require("../tools/navbar.php"); ?> + <div class="container"> + <div class="text-center"> + <div class="row center-block vertical-center"> + <form class="form-horizontal " method="POST"> + <fieldset> + + <legend class="text-centered"><h1>Amazing Linkshorter</h1></legend> + + <div class="form-group"> + <label class="col-md-4 control-label" for="url">Link:</label> + <div class="col-md-5"> + <input id="url" name="url" placeholder="http://www.moehm.org/" class="form-control input-md" required="" type="text"> + + </div> + </div> + + <div class="form-group"> + <label class="col-md-4 control-label" for="short">(optional)</label> + <div class="col-md-4"> + <input id="short" name="short" placeholder="Your own query string here." class="form-control input-md" type="text"> + + </div> + </div> + + <div class="form-group"> + <label class="col-md-4 control-label" for="singlebutton"></label> + <div class="col-md-4"> + <button id="singlebutton" name="singlebutton" class="btn btn-info" type="submit">Short!</button> + </div> + </div> + + </fieldset> + </form> + </div> + </div> + </div> + <?php require("../tools/footer.php"); ?> +</body> +<?php + $html = ob_get_contents(); + $db->set($key, $html, 3600); + ob_end_flush(); + +} else { + + if ( empty($_POST["url"]) || $_POST["url"] == "" ){ + do_output("<p>We need a link to be shortened.</p>", "400 Client Failed", false, "<h1>Missing URL</h1>"); + } + + if ( ! preg_match("/^[a-z]+:\/\/[a-z0-9_]+/i", $_POST["url"]) ){ + do_output("<p>Only schemas like http:// or ftp:// are supported.</p>", "400 Client Failed", false, "<h1>This does not look like an url</h1>"); + } + + + $hash = md5($_POST["url"]); + if( ! empty($_POST["short"]) && $_POST["short"] != "" ) { + $short = $_POST["short"]; + if ( $db->exists($short) == 1 && $_POST["url"] != $db->get($short) ) + do_output("<p>Someone else has already a registered entry under '".htmlentities($short)."'.</p>", "422 Unprocessable Entity", false, "<h1>Query string already exists.</h1>"); + } else { + if( ! $short = $db->get($hash) ){ + $arr = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"); + + do { + $short=""; + for ($i=0;$i<5;$i++){ + $r = mt_rand(0, count($arr)-1); + $short.=$arr[$r]; + } + } while ( $db->exists($short) ); + $db->set($hash, $short); + } + } + $db->set($short, $_POST["url"]); + + do_output("<p>Your short link for <a href=\"".htmlentities($_POST["url"])."\">".htmlentities($_POST["url"])."</a> is <br> http://".$_SERVER["HTTP_HOST"]."/".$short."</p>", "200 OK", false, "<h1>Success</h1>"); +} diff --git a/linkshorter/insert.php b/linkshorter/insert.php new file mode 100644 index 0000000..94d01a3 --- /dev/null +++ b/linkshorter/insert.php @@ -0,0 +1,36 @@ +<?php + +if ( $_SERVER['REQUEST_METHOD'] != 'POST'){ + header($_SERVER['SERVER_PROTOCOL'] . " 301 Moved Permanently"); + header("Location: http://". $_SERVER["HTTP_HOST"] . "/"); + exit; +} + +require 'functions.php'; + +if ( empty($_POST["url"]) || $_POST["url"] == "" ){ + failure("<p>We need a link to be shortened.</p>", false, "400 Client Failed", "<h1>Missing URL</h1>"); +} + +if ( ! preg_match("/^[a-z]+:\/\/[a-z0-9_]+/i", $_POST["url"]) ){ + failure("<p>Only schemas like http:// or ftp:// are supported.</p>", false, "400 Client Failed", "<h1>This does not look like an url</h1>"); +} + +require 'db.php'; + +$hash = md5($_POST["url"]); +if( ! $short = $db->get($hash)){ + + $arr = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"); + + $short=""; + for ($i=0;$i<5;$i++){ + $r = mt_rand(0, count($arr)-1); + $short.=$arr[$r]; + } + + $db->set($short, $_POST["url"]); + $db->set($hash, $short);; +} + +failure("<p>Your short link for <a href=\"".htmlentities($_POST["url"])."\">".htmlentities($_POST["url"])."</a> is <br> <a href=\"http://".$_SERVER["HTTP_HOST"] . "/-" . $short ."\">http://".$_SERVER["HTTP_HOST"]."/-".$short."</a></p>", false, "200 OK", "<h1>Success</h1>"); diff --git a/linkshorter/style.css b/linkshorter/style.css new file mode 100644 index 0000000..c762039 --- /dev/null +++ b/linkshorter/style.css @@ -0,0 +1,21 @@ +html { + position: relative; + min-height: 100%; +} + +body { + margin-bottom: 60px; +} + +/* footer */ + +.footer { + position: absolute; + bottom: 0; + width: 100%; +} + +#copyright-text { + text-decoration: underline; + color: #333; +} diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..1f53798 --- /dev/null +++ b/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / diff --git a/tools/favicon.ico b/tools/favicon.ico Binary files differnew file mode 100644 index 0000000..41f6475 --- /dev/null +++ b/tools/favicon.ico diff --git a/tools/footer.php b/tools/footer.php new file mode 100644 index 0000000..9bc6c55 --- /dev/null +++ b/tools/footer.php @@ -0,0 +1,9 @@ + <div class="footer"> + <div class="container"> + <div class="row"> + <div class="text-right"> + <p><span class="fa fa-copyright"></span> Copyright 2014 <a class="footer-a" href="//www.moehm.org/" target="_blank" title="https://www.moehm.org/">Maximilian Möhring</a></p> + </div> + </div> + </div> + </div> diff --git a/tools/navbar.php b/tools/navbar.php new file mode 100644 index 0000000..b676fa2 --- /dev/null +++ b/tools/navbar.php @@ -0,0 +1,27 @@ + <nav class="navbar navbar-default navbar-custom" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbarCollapse"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="/"><span class="glyphicon glyphicon-home"></span> Tools</a> + </div> + <div class="collapse navbar-collapse" id="navbarCollapse"> + <ul class="nav navbar-nav navbar-left"> + <li> + <a href="/header/" title="Check HTTP header online!" id="httpheader"> Header</a> + </li> + </ul> + </div> + </div> + </nav> + <noscript> + <div class="noscript"> + <div class="container"> + <div class="row text-center noscript"> + <h5>Please enable JavaScript to view this site in all beauty.</h5> + </div> + </div> + </div> + </noscript> diff --git a/tools/style.css b/tools/style.css new file mode 100644 index 0000000..c42a75b --- /dev/null +++ b/tools/style.css @@ -0,0 +1,54 @@ +html { + position: relative; + min-height: 100%; +} + +body { + margin-bottom: 60px; +} + +a { + color: #3083D6; +} + +/* navbar */ + +.navbar-default { + background-color: #3083D6 ; + border-color: #3083D6 ; + background: #3083D6 ; +} + +.navbar-default .navbar-brand { + color: white; +} + +.navbar-default .navbar-brand:hover, +.navbar-default .navbar-brand:focus { +} + +.navbar-default .navbar-nav > li > a { + color: white; +} + + +/* footer */ + +.footer { + background-color: #3083D6 ; + border-color: #3083D6 ; + background: #3083D6 ; + color: white ; + position: absolute; + bottom: 0; + width: 100%; +} + +.footer-a { + color: white; +} + +.footer-a:hover { + color: white; + text-decoration: underline; +} |
