Minor fixes

This commit is contained in:
Mattias Erming 2014-06-23 10:40:39 +02:00
parent 72ad03c6ea
commit ffabc7cfea
3 changed files with 60 additions and 43 deletions

View File

@ -49,8 +49,10 @@ button {
} }
.btn { .btn {
border: 2px solid #95a5a6; border: 2px solid #95a5a6;
border: 2px solid #84d1ff;
border-radius: 5px; border-radius: 5px;
color: #95a5a6; color: #95a5a6;
color: #84d1ff;
display: inline-block; display: inline-block;
font: bold 12px Lato, sans-serif; font: bold 12px Lato, sans-serif;
letter-spacing: 1px; letter-spacing: 1px;
@ -62,6 +64,7 @@ button {
} }
.btn:hover { .btn:hover {
background: #95a5a6; background: #95a5a6;
background: #84d1ff;
color: #fff; color: #fff;
} }
.btn:active { .btn:active {
@ -135,9 +138,13 @@ button {
} }
#sidebar .octicon { #sidebar .octicon {
float: left; float: left;
margin-top: 2px; margin-top: 1px;
margin-right: 8px; margin-right: 8px;
} }
#sidebar .octicon-plus {
margin-left: 1px;
margin-right: 11px;
}
#sidebar .lobby { #sidebar .lobby {
color: #84d1ff !important; color: #84d1ff !important;
font-size: 15px; font-size: 15px;
@ -203,6 +210,17 @@ button {
text-transform: uppercase; text-transform: uppercase;
word-spacing: 3px; word-spacing: 3px;
} }
#sidebar #logout,
#sidebar #settings-link {
display: none;
}
#sidebar.signed-in #login {
display: none;
}
#sidebar.signed-in #logout,
#sidebar.signed-in #settings-link {
display: block;
}
#main { #main {
bottom: 0; bottom: 0;
left: 220px; left: 220px;
@ -242,40 +260,48 @@ button {
font: 300 48px Lato, sans-serif; font: 300 48px Lato, sans-serif;
line-height: 1.5; line-height: 1.5;
} }
#windows h2 { #windows h2,
#windows h3 {
color: #7f8c8d; color: #7f8c8d;
font-size: 26px; font-size: 26px;
} }
#windows h3 { #windows h3 {
border-bottom: 1px solid #eee;
font-weight: 300;
margin-bottom: 10px;
padding-bottom: 7px;
}
#windows h4 {
color: #95a5a6; color: #95a5a6;
font-size: 18px; font-size: 18px;
font-weight: normal; font-weight: normal;
margin-bottom: 10px;
} }
#windows input[type=text] { #windows form {
margin: 0 0;
max-width: 250px;
}
#windows .input {
border: 2px solid #e9ecef; border: 2px solid #e9ecef;
border-radius: 4px; border-radius: 4px;
color: #95a5a6;
font-size: 24px; font-size: 24px;
margin-bottom: 16px;
outline: 0; outline: 0;
padding: 10px 14px; padding: 10px 14px;
transition: border-color .2s; transition: border-color .2s;
-webkit-appearance: none; -webkit-appearance: none;
width: 100%; width: 100%;
} }
#windows input[type=text]:hover, #windows .input:hover,
#windows input[type=text]:focus { #windows .input:focus {
border-color: #95a5a6; border-color: #bdc3c7;
} }
#windows .window { #windows .window {
padding: 12% 0; padding: 12% 0;
overflow: auto; overflow: auto;
} }
#settings {
}
#settings h2 {
border-bottom: 1px solid #eee;
margin-bottom: 10px;
}
#settings section { #settings section {
margin-top: 20px; margin-top: 20px;
} }
@ -310,15 +336,6 @@ button {
#settings #notification { #settings #notification {
color: #7f8c8d; color: #7f8c8d;
} }
#sign-in form {
margin: 0 0;
max-width: 250px;
}
#sign-in-input {
color: #95a5a6;
margin-bottom: 20px;
width: 100%;
}
#chat { #chat {
font: 13px "Consolas", monospace; font: 13px "Consolas", monospace;
line-height: 1.3em; line-height: 1.3em;

View File

@ -33,7 +33,7 @@
<i class="octicon octicon-sign-in"></i> <i class="octicon octicon-sign-in"></i>
Sign in Sign in
</a> </a>
<a id="logout" href="" style="display: none;"> <a id="logout" href="">
<i class="octicon octicon-sign-out"></i> <i class="octicon octicon-sign-out"></i>
Sign out Sign out
</a> </a>
@ -52,7 +52,7 @@
<div class="wrap"> <div class="wrap">
<h1>Settings</h1> <h1>Settings</h1>
<section> <section>
<h2>Messages</h2> <h3>Messages</h3>
<div class="options"> <div class="options">
<label class="opt"> <label class="opt">
<input type="checkbox" name="join"> <input type="checkbox" name="join">
@ -77,7 +77,7 @@
</div> </div>
</section> </section>
<section> <section>
<h2>Sound</h2> <h3>Sound</h3>
<div class="options"> <div class="options">
<label class="opt wide"> <label class="opt wide">
<input type="checkbox" name="notification"> <input type="checkbox" name="notification">
@ -98,8 +98,8 @@
<h1>Shout</h1> <h1>Shout</h1>
<h2>You need to sign in to continue.</h2> <h2>You need to sign in to continue.</h2>
<form id="sign-in-form" method="post"> <form id="sign-in-form" method="post">
<h3>Password:</h3> <h4>Password:</h4>
<input id="sign-in-input" type="password" autofocus> <input id="sign-in-input" class="input" type="password" autofocus>
<button type="submit" class="btn"> <button type="submit" class="btn">
Sign in Sign in
</button> </button>

View File

@ -62,6 +62,7 @@ $(function() {
case "auth": case "auth":
$("#networks").add(chat).empty(); $("#networks").add(chat).empty();
$("#login").trigger("click"); $("#login").trigger("click");
$.cookie("current", null);
break; break;
case "debug": case "debug":
@ -115,8 +116,8 @@ $(function() {
.find(".chat") .find(".chat")
.sticky(); .sticky();
$("#login").hide(); sidebar.addClass("signed-in");
$("#logout").show().on("click", function(e) { $("#logout").on("click", function(e) {
e.stopPropagation(); e.stopPropagation();
}); });
@ -167,19 +168,18 @@ $(function() {
} }
} }
var settings = $("#settings");
var options = {
join: true,
nick: true,
part: true,
mode: true,
quit: true,
notification: true,
};
$.cookie.json = true; $.cookie.json = true;
$.cookie("settings", $.cookie("settings") || options); $.cookie("settings", $.cookie("settings") || options);
$.extend(options, $.cookie("settings"));
var settings = $("#settings");
var options = $.extend({
join: true,
mode: true,
nick: true,
notification: true,
part: true,
quit: true,
}, $.cookie("settings"));
for (var i in options) { for (var i in options) {
if (options[i]) { if (options[i]) {
@ -191,6 +191,8 @@ $(function() {
settings.find("input").each(function() { settings.find("input").each(function() {
var input = $(this); var input = $(this);
var name = input.attr("name"); var name = input.attr("name");
options[name] = input.prop("checked");
$.cookie("settings", options);
if ([ if ([
"join", "join",
"nick", "nick",
@ -198,10 +200,8 @@ $(function() {
"mode", "mode",
"quit", "quit",
].indexOf(name) !== -1) { ].indexOf(name) !== -1) {
chat.toggleClass("hide-" + name, !this.checked); chat.toggleClass("hide-" + name, !input.prop("checked"));
} }
options[name] = this.checked;
$.cookie("settings", options);
}); });
}).find("input") }).find("input")
.first() .first()