Reworked the start page (brighter, added top bar, font on Windows sharper), fixed some padding bugs (firefox) and compressed the js

This commit is contained in:
Robin Buse 2011-08-16 23:25:42 +03:00
parent 5da30a40bf
commit 4aeb76cdac

View file

@ -6,16 +6,17 @@
body { body {
background: rgba(0,0,0,.05); background: rgba(0,0,0,.05);
color: #333; color: #333;
text-shadow: 0 1px 0 #fff;
font: 14px helvetica,sans-serif; font: 14px helvetica,sans-serif;
background: #ccc; background: #ccc;
background: -moz-radial-gradient(circle, #aaa, #eee) no-repeat center center fixed; background: -webkit-radial-gradient(circle,#aaa,#eee 60%) center fixed;
background: -webkit-radial-gradient(circle, #aaa, #eee) no-repeat center center fixed; background: -moz-radial-gradient(circle,#aaa,#eee 60%) center fixed;
background: -ms-radial-gradient(circle, #aaa, #eee) no-repeat center center fixed; background: -ms-radial-gradient(circle,#aaa,#eee 60%) center fixed;
background: -o-radial-gradient(circle, #aaa, #eee) no-repeat center center fixed; background: -o-radial-gradient(circle,#aaa,#eee 60%) center fixed;
overflow-x: hidden; overflow-x: hidden;
border-top: 8px solid rgba(51,51,51,.8)
} }
#container { #container {
text-shadow: 0 1px 1px #fff;
border-top: 1px solid #999; border-top: 1px solid #999;
margin-top: 160px; margin-top: 160px;
width: 100%; width: 100%;
@ -27,7 +28,7 @@
background: -ms-linear-gradient(#fff,#ccc); background: -ms-linear-gradient(#fff,#ccc);
background: -o-linear-gradient(#fff,#ccc); background: -o-linear-gradient(#fff,#ccc);
opacity: .9; opacity: .9;
box-shadow: 0px 1px 8px rgba(0, 0, 0, 0.3); box-shadow: 0px 1px 8px rgba(0,0,0,0.3)
} }
#button { #button {
margin: 0 auto; margin: 0 auto;
@ -44,7 +45,7 @@
background: -moz-linear-gradient(#5F5F5F,#565656 50%,#4C4C4C 51%,#373737); background: -moz-linear-gradient(#5F5F5F,#565656 50%,#4C4C4C 51%,#373737);
background: -ms-linear-gradient(#5F5F5F,#565656 50%,#4C4C4C 51%,#373737); background: -ms-linear-gradient(#5F5F5F,#565656 50%,#4C4C4C 51%,#373737);
background: -o-linear-gradient(#5F5F5F,#565656 50%,#4C4C4C 51%,#373737); background: -o-linear-gradient(#5F5F5F,#565656 50%,#4C4C4C 51%,#373737);
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.9); box-shadow: inset 0 1px 3px rgba(0,0,0,0.9)
} }
#button:hover { #button:hover {
cursor: pointer; cursor: pointer;
@ -52,73 +53,63 @@
background: -webkit-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747); background: -webkit-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747);
background: -moz-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747); background: -moz-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747);
background: -ms-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747); background: -ms-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747);
background: -o-linear-gradient(#707070, #666666 50%, #5B5B5B 51%, #474747); background: -o-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747)
} }
#button:active { #button:active {
box-shadow: inset 0 1px 12px rgba(0,0,0,0.9); box-shadow: inset 0 1px 12px rgba(0,0,0,0.9);
background: #444; background: #444
} }
#label { #label {
text-align: left; text-align: left;
margin: 0 auto; margin: 0 auto;
width: 300px; width: 300px
}
input {
vertical-align: middle;
font-weight: bold;
font-size: 15px
} }
input[type="text"] { input[type="text"] {
font-weight: bold; width: 243px;
font-size: 17px; padding: 10px 47px 10px 10px;
padding: 5px; background: #fff;
width: 245px; border: 1px solid #bbb;
outline: none; outline: none;
border-radius: 3px;
text-shadow: 0 0 1px #fff
} }
input[type="submit"] { input[type="submit"] {
height: 35px; width: 45px;
width: 40px; margin-left: -50px;
padding: 8px
} }
input[type="submit"]::-moz-focus-inner { border: 0 }
@-moz-document url-prefix() { input[type="submit"] { padding: 7px } }
</style> </style>
<link href="static/custom/index.css" rel="stylesheet"> <link href="static/custom/index.css" rel="stylesheet">
<script src="static/custom/index.js"></script> <script src="static/custom/index.js"></script>
<div id="container"> <div id="container">
<div id="button" onclick="go2Random()">New Pad</div> <div id="button" onclick="go2Random()">New Pad</div><br><div id="label">or create/open a Pad with the name</div>
<br>
<div id="label">or create/open a Pad with the name</div>
<form action="#" onsubmit="go2Name();return false;"> <form action="#" onsubmit="go2Name();return false;">
<input type="text" id="padname" autofocus> <input type="text" id="padname" autofocus>
<input type="submit" value="OK"> <input type="submit" value="OK">
</form> </form>
</div> </div>
<script> <script>
function go2Name() function go2Name() {
{ var a = document.getElementById("padname").value;
var padname = document.getElementById("padname").value; a.length > 0 ? window.location = "p/" + a : alert("Please enter a name")
if (padname.length > 0)
{
window.location = "p/" + padname;
} }
else function go2Random() {
{ window.location = "p/" + randomPadName()
alert("Please enter a name");
} }
function randomPadName() {
for (var a = "", b = 0; b < 10; b++) {
var c = Math.floor(Math.random() * 62);
a += "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".substring(c, c + 1)
} }
return a
function go2Random()
{
window.location = "p/" + randomPadName();
} }
typeof costumStart == "function" && costumStart();
function randomPadName()
{
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var string_length = 10;
var randomstring = '';
for (var i = 0; i < string_length; i++)
{
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum, rnum + 1);
}
return randomstring;
}
//start the costum js
if(typeof costumStart == "function") costumStart();
</script> </script>
</html> </html>