Added flash notification and header styling

This commit is contained in:
Luke Barratt 2014-05-04 00:01:36 +01:00
parent cfb406cf3e
commit a9139f6080
21 changed files with 176 additions and 30 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

View file

@ -26,4 +26,5 @@ $ ->
$wrapper.removeClass 'disabled' $wrapper.removeClass 'disabled'
$select.trigger 'DOMSubtreeModified' $select.trigger 'DOMSubtreeModified'
$('#notification').delay(3000).fadeOut()

View file

@ -62,4 +62,51 @@ div#errors {
} }
} }
} }
}
/*
Banner flash messages
*/
#notification {
position: absolute;
margin: 0 auto;
left: 50%;
top: 0;
.message {
background: image-url('layout/flash-notice-background.png');
position: relative;
width: 730px;
height: 60px;
left: -50%;
text-align: center;
font-family: $header-font-family;
font-size: 22px;
color: white;
line-height: 45px;
padding: 0 100px;
z-index: 2;
&:before {
background: image-url('layout/flash-notice-icon.png');
content: '';
display: block;
width: 30px;
height: 30px;
position: absolute;
top: 5px;
left: 60px;
}
&.warning,
&.error,
&.alert {
background: image-url('layout/flash-error-background.png');
&:before {
background: image-url('layout/flash-error-icon.png');
}
}
}
} }

View file

@ -298,6 +298,28 @@ form.square {
} }
} }
/*
Dark Forms
*/
form.dark {
input[type=text],
input[type=password] {
font-family: $header-font-family;
border-radius: 10px;
box-shadow: inset 3px 3px 5px 0px transparentize(black, 0.5);
border: 1px solid transparentize(#5a8da3, 0.5);
background: transparentize(black, 0.5);
color: white;
&:hover,
&:focus {
border: 1px solid transparentize(#5a8da3, 0.5);
}
}
}
form.search { form.search {
margin-bottom: 10px; margin-bottom: 10px;

View file

@ -44,7 +44,7 @@ body#tinymce {
#main { #main {
@include span-columns(9 of 12); @include span-columns(9 of 12);
padding: 20px 25px 20px 15px; padding: 20px 25px 20px 10px;
&.no-body { &.no-body {
box-shadow: none; box-shadow: none;

View file

@ -1,4 +1,4 @@
.footer { footer.footer {
$footer-link-color: #5a5a5a; $footer-link-color: #5a5a5a;
background: image-url('layout/footer-background.png'); background: image-url('layout/footer-background.png');

View file

@ -6,7 +6,7 @@ header .banner {
height: 125px; height: 125px;
#logo { #logo {
@include span-columns(9 of 12); @include span-columns(7 of 12);
min-height: 180px; min-height: 180px;
position: relative; position: relative;
@ -20,11 +20,20 @@ header .banner {
} }
#authentication { #authentication {
@include span-columns(3 of 12); @include span-columns(5 of 12);
padding: 30px 0; padding: 30px 0;
padding-top: 50px;
color: white; color: white;
line-height: 16px; line-height: 16px;
.fields {
input[type=text],
input[type=password] {
text-align: right;
margin-bottom: 3px;
}
}
.logged { .logged {
position: relative; position: relative;
} }
@ -84,6 +93,7 @@ header .banner {
text-align: center; text-align: center;
margin: 0 5px; margin: 0 5px;
} }
} }
.avatar { .avatar {
@ -104,5 +114,46 @@ header .banner {
height: 75px; height: 75px;
width: 75px; width: 75px;
} }
.buttons {
@include span-columns(12);
font-family: $header-font-family;
text-align: right;
text-transform: uppercase;
font-size: 12px;
.login,
.register {
@include span-columns(6);
}
.login input {
background: none;
border: 0;
font-family: $header-font-family;
color: #73d5f7;
font-size: 14px;
padding: 0;
text-transform: uppercase;
}
.register a {
float: right;
display: block;
clear: both;
}
}
}
&.authenticated {
#logo {
@include span-columns(9 of 12);
}
#authentication {
@include span-columns(3 of 12);
padding: 30px 0;
}
} }
} }

View file

@ -25,12 +25,14 @@ ul.navigation {
list-style: none; list-style: none;
float: right; float: right;
max-width: $max-width; max-width: $max-width;
max-height: $navigation-height; max-height: 60px;
margin-top: 5px; margin-top: 5px;
> li { > li {
float: left; float: left;
border: none; border: none;
height: 60px;
position: relative;
a { a {
font-weight: 400; font-weight: 400;
@ -38,8 +40,19 @@ ul.navigation {
height: $navigation-height; height: $navigation-height;
line-height: $navigation-height; line-height: $navigation-height;
padding: 0 20px; padding: 0 20px;
color: #5f5f5f;
text-transform: uppercase; text-transform: uppercase;
color: #5f5f5f;
&:hover,
&.active {
color: #3dcfff;
}
}
> a {
width: 100%;
float: left;
position: relative;
border-top: 1px solid #54585b; border-top: 1px solid #54585b;
&:before, &:before,
@ -62,18 +75,11 @@ ul.navigation {
@include linear-gradient(#54585b, #15181a); @include linear-gradient(#54585b, #15181a);
right: -1px; right: -1px;
} }
}
> a {
width: 100%;
float: left;
position: relative;
border-top: 1px solid #266d98;
&:hover, &:hover,
&.active { &.active {
@include background-image(radial-gradient(50% -10%, ellipse cover, transparentize(#2abdfb, 0.6), transparent 60%)); @include background-image(radial-gradient(50% -10%, ellipse cover, transparentize(#2abdfb, 0.6), transparent 60%));
color: #3dcfff; border-top: 1px solid #266d98;
&:before, &:before,
&:after { &:after {
@ -87,13 +93,15 @@ ul.navigation {
position: relative; position: relative;
ul { ul {
background: image-url('layout/drop-menu-background.png') top center repeat-y;
width: 130px;
position: absolute; position: absolute;
box-shadow: $content-shadow; box-shadow: $content-shadow;
visibility: hidden; visibility: hidden;
pointer-events: none; pointer-events: none;
opacity: 0; opacity: 0;
z-index: 10; z-index: 10;
top: $navigation-height; top: 60px;
left: 0; left: 0;
min-width: 100%; min-width: 100%;
list-style: none; list-style: none;
@ -104,17 +112,20 @@ ul.navigation {
&:hover { &:hover {
ul { ul {
display: none; visibility: visible;
opacity: 1; opacity: 1;
pointer-events: auto; pointer-events: auto;
border-radius: $base-border-radius;
li { li {
a { a {
white-space: nowrap; white-space: nowrap;
display: block; display: block;
color: $navbar-text;
padding: 0 20px; padding: 0 20px;
line-height: 40px;
height: 40px;
font-size: 12px;
} }
&:hover a { &:hover a {

View file

@ -86,6 +86,14 @@
} }
.calendar { .calendar {
.widget-content-wrapper {
}
&:before {
display: none;
}
.entry { .entry {
margin-bottom: 20px; margin-bottom: 20px;
} }

View file

@ -109,12 +109,12 @@ div#match {
} }
.score-1 { .score-1 {
padding-left: $title-height/6; padding-left: 10px;
left: 0; left: 0;
} }
.score-2 { .score-2 {
padding-right: $title-height/6; padding-right: 10px;
right: 0; right: 0;
} }
} }

View file

@ -1,8 +1,8 @@
<header> <header>
<div class="banner"> <div class="banner <%= 'authenticated' if cuser %>">
<div class="wrapper"> <div class="wrapper">
<div id="logo"> <div id="logo">
<%= link_to image_tag("logo.png"), root_path %> <%= link_to image_tag('logo.png'), root_path %>
</div> </div>
<div id="authentication" class="<%= 'admin' if cuser && cuser.admin? %>"> <div id="authentication" class="<%= 'admin' if cuser && cuser.admin? %>">
<% if cuser %> <% if cuser %>

View file

@ -1,7 +1,9 @@
<% [:notice, :success, :error, :warning, :alert].each do |type| %> <% [:notice, :success, :error, :warning, :alert].each do |type| %>
<% if flash.key?(type) %> <% if flash.key?(type) %>
<div class="flash <%= type %>"> <div id="notification">
<%= flash[type] %> <div class="message <%= type %>">
<%= flash[type] %>
</div>
</div> </div>
<% end %> <% end %>
<% end %> <% end %>

View file

@ -12,12 +12,12 @@
</head> </head>
<body> <body>
<div id="container"> <div id="container">
<%= render partial: "messages" %>
<%= render partial: "header" %> <%= render partial: "header" %>
<%= render partial: "navigation" %> <%= render partial: "navigation" %>
<div class="wrapper"> <div class="wrapper">
<div id="content"> <div id="content">
<div id="main" class="<%= yield :main_class %>"> <div id="main" class="<%= yield :main_class %>">
<%= render partial: "messages" %>
<%= yield %> <%= yield %>
</div> </div>
<div id="sidebar"> <div id="sidebar">

View file

@ -1,11 +1,15 @@
<%= form_tag controller: "users", action: "login" do %> <%= form_tag({ controller: "users", action: "login" }, { class: 'dark' }) do %>
<div class="fields"> <div class="fields">
<%= text_field "login", "username", placeholder: "Username" %> <%= text_field "login", "username", placeholder: "Username" %>
<%= password_field "login", "password", placeholder: "Password" %> <%= password_field "login", "password", placeholder: "Password" %>
</div> </div>
<div class="controls"> <div class="buttons">
<%= submit_tag t('helpers.submit.user.login') %> <div class="login">
<%= link_to t('helpers.submit.user.create'), new_user_path %> <%= submit_tag t('helpers.submit.user.login') %>
<%= link_to t('sessions.form.forgot_password'), "/users/forgot/1", class: "password-reset" %> </div>
<div class="register">
<%= link_to t('helpers.submit.user.create'), new_user_path %>
<%= link_to t('sessions.form.forgot_password'), "/users/forgot/1", class: "password-reset" %>
</div>
</div> </div>
<% end %> <% end %>