This commit is contained in:
Phyks 2013-10-12 14:00:00 +01:00
parent 5171fded3f
commit 4db1966d52
4 changed files with 29 additions and 146 deletions

BIN
bg.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

View File

@ -1,141 +0,0 @@
/* --- STYLES DE BASE --- */
/* Page */
html {
font-size: 100%; /* Évite un bug d'IE 6-7. (1) */
}
body {
margin: 0;
padding: 1em; /* Remettre à zéro si nécessaire. */
font-family: Arial, Helvetica, "Liberation Sans", FreeSans, sans-serif;
font-size: .8em;
line-height: 1.4; /* À adapter au design. (4) */
color: black;
background-color: grey;
background-image: url('bg.png');
}
pre
{
font-size: 10px;
font-style: normal;
line-height: 11px;
font-weight: normal;
font-family: "Courier New", Courier, mono;
text-align: left;
margin-left: 40%;
}
/* Titres */
h1, h2, h3, h4, h5, h6 {
margin: 1em 0 .5em 0; /* Rapproche le titre du texte.*/
line-height: 1.2;
font-weight: bold; /* Valeur par défaut.*/
font-style: normal;
}
h1 {
font-size: 1.75em;
}
h2 {
font-size: 1.5em;
}
h3 {
font-size: 1.25em;
}
h4 {
font-size: 1em;
}
/* Listes */
ul, ol {
margin: .75em 0 .75em 32px;
padding: 0;
}
/* Paragraphes */
p {
margin: .75em 0; /* Marges plus faibles que par défaut.*/
}
address {
margin: .75em 0;
font-style: normal;
}
/* Liens */
a {
text-decoration: underline;
}
a:link {
color : #0000cd;
}
a:visited {
color : #4b0082;
}
a:hover, a:focus, a:active {
color : #dc143c;
}
a img {
border: none;
}
/* Divers éléments de type en-ligne*/
em {
font-style: italic;
}
strong {
font-weight: bold;
}
/* Formulaires */
form, fieldset {
margin: 0;
padding: 0;
}
form
{
border: none;
}
/* Mise en forme simple pour les tableaux */
table {
margin: 0;
border: 1px solid gray; /* Pas de bordure = "none". */
border-collapse: collapse; /* Valeur par défaut: "separate". */
border-spacing: 0;
margin: auto;
}
table td, table th {
padding: 4px; /* Pas de retrait autour du texte = "0". */
border: 1px solid #ccc; /* Pas de bordure = "none". */
vertical-align: top; /* Valeur par défaut: "middle" */
text-align: left;
}
body
{
text-align: center;
}
label /* On affiche les labels sous forme de blocs et mise en page = formulaires alignés */
{
display: block;
}
th
{
background-color: rgba(255,10,255,0.2);
}
td
{
background-color: rgba(255,200,255,0.1);
}
.inline
{
display: inline;
}
.centre
{
text-align:center;
}

View File

@ -29,10 +29,24 @@ if (count($_GET) != 1) {
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Shorten me</title> <title>Shorten me</title>
<link rel="stylesheet" media="screen" type="text/css" href="design.css" /> <style type="text/css">
body {
text-align: center;
background-color: #333;
color: #DDD;
}
a:link, a:visited, a:hover, a:active {
color: yellow;
}
label {
display: block;
}
</style>
</head> </head>
<body> <body>
<h1>It's too long…</h1> <h1><a href="index.php">It's too long…</a></h1>
<form method="post" action="process.php"> <form method="post" action="process.php">
<p> <p>
<label for="url">URL: </label><input type="text" size="50" name="url" id="url" value="<?php echo $default_url; ?>"/> <label for="url">URL: </label><input type="text" size="50" name="url" id="url" value="<?php echo $default_url; ?>"/>
@ -42,7 +56,7 @@ if (count($_GET) != 1) {
</p> </p>
<p><input type="submit" value="Shorten !"/></p> <p><input type="submit" value="Shorten !"/></p>
<p>Add this link to your bookmarks to shorten links in one click ! <p>Add this link to your bookmarks to shorten links in one click !
<a href="javascript:javascript:(function(){var%20url%20=%20location.href;var%20title%20=%20document.title%20||%20url;window.open('<?php echo BASE_URL; ?>/?add&url='%20+%20encodeURIComponent(url),'_blank','menubar=no,height=390,width=600,toolbar=no,scrollbars=no,status=no,dialog=1');})();">Short link</a> <a href="javascript:javascript:(function(){var%20url%20=%20location.href;var%20title%20=%20document.title%20||%20url;window.open('<?php echo BASE_URL; ?>/?add&amp;url='%20+%20encodeURIComponent(url),'_blank','menubar=no,height=390,width=600,toolbar=no,scrollbars=no,status=no,dialog=1');})();">Short link</a>
</p> </p>
</form> </form>
</body> </body>

View File

@ -29,10 +29,20 @@ else {
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Shorten me !</title> <title>Shorten me !</title>
<link rel="stylesheet" media="screen" type="text/css" href="design.css" /> <style type="text/css">
body {
text-align: center;
background-color: #333;
color: #DDD;
}
a:link, a:visited, a:hover, a:active {
color: yellow;
}
</style>
</head> </head>
<body> <body>
<h1>It was too long !</h1> <h1><a href="index.php">It was too long !</a></h1>
<?php <?php
if (isset($_POST['short']) && $_POST['short'] != "") { if (isset($_POST['short']) && $_POST['short'] != "") {
$short = htmlspecialchars($_POST['short']); $short = htmlspecialchars($_POST['short']);