Navigation WIP

This commit is contained in:
carljbowman 2015-09-21 09:18:00 -04:00
parent df1c214a01
commit 9a67d3fb98
17 changed files with 220 additions and 86 deletions

View file

@ -14,7 +14,7 @@
clear: both; clear: both;
overflow: hidden; overflow: hidden;
background-color: #efefef; background-color: #efefef;
border-radius: 10px 10px 0 0; border-radius: 10px 10px 0 0;
border-top: 1px solid white; border-top: 1px solid white;
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;

View file

@ -0,0 +1,19 @@
var React = require('react');
var classNames = require('classnames');
require('./button.scss');
module.exports = React.createClass({
propTypes: {
},
render: function () {
var classes = classNames(
'button',
this.props.className
);
return (
<button {... this.props} className={classes} >{this.props.children}</button>
);
}
});

View file

@ -0,0 +1,27 @@
.button {
display: inline-block;
font-size: .8rem;
padding: .75em 1em;
margin: .5em 0;
background-color: #24a3ec;
color: white;
font-weight: bold;
border-radius: 5px;
box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.25);
cursor: pointer;
border: none;
&.white {
background-color: white;
border-top: 1px inset rgba(0, 0, 0, 0.1);
color: #24a3ec;
}
&:hover {
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.25);
}
&:active {
box-shadow: inset 0px 1px 2px rgba(0, 0, 0, 0.25);
}
}

View file

@ -0,0 +1,19 @@
var React = require('react');
var classNames = require('classnames');
require('./input.scss');
module.exports = React.createClass({
propTypes: {
},
render: function () {
var classes = classNames(
'input',
this.props.className
);
return (
<input {... this.props} className={classes} />
);
}
});

View file

@ -0,0 +1,28 @@
.input {
color:black;
border-radius: 5px;
border: 1px solid rgba(0, 0, 0, 0.1);
font-size: .8rem;
padding: .75em 1em;
margin: .5em 0;
background-color: #f7f7f7;
transition:all 1s ease;
&:focus {
background-color: #d3eaf8;
outline:none;
border: 1px solid rgba(0, 0, 0, 0.1);
transition:all 1s ease;
}
&.fail {
border: 1px solid #eab012;
background-color: #fff7df;
}
&.pass {
border: 1px solid #55db58;
background-color: #eafdea;
}
}

View file

@ -1,4 +1,6 @@
var React = require('react'); var React = require('react');
var Input = require('../forms/input.jsx');
var Button = require('../forms/button.jsx');
require('./login.scss'); require('./login.scss');
@ -15,11 +17,11 @@ module.exports = React.createClass({
<div className="login"> <div className="login">
<form onSubmit={this.handleSubmit}> <form onSubmit={this.handleSubmit}>
<label htmlFor="username">Username</label> <label htmlFor="username">Username</label>
<input type="text" name="username" maxLength="30" /> <Input type="text" name="username" maxLength="30" />
<label htmlFor="password">Password</label> <label htmlFor="password">Password</label>
<input type="password" name="password" /> <Input type="password" name="password" />
<button className="submit-button" type="submit">Sign in</button> <Button className="submit-button white" type="submit">Sign in</Button>
<a href="/accounts/password_reset/">Forgot password?</a> <a className="right" href="/accounts/password_reset/">Forgot password?</a>
</form> </form>
</div> </div>
); );

View file

@ -1,7 +1,20 @@
.login { .login {
padding: 14px 9px; padding: 10px;
label {
padding-top: 5px;
font-weight: bold;
}
.submit-button { .submit-button {
margin-right: 3px; margin-top: 5px;
}
a {
margin-top: 15px;
}
a:hover {
background-color: transparent !important;
} }
} }

View file

@ -1,3 +1,3 @@
$base-background-color: #0f8bc0; $base-background-color: #2aa3ef;
$active-background-color: rgb(1, 96, 135); $active-background-color: rgba(0, 0, 0, 0.1);
$border-color: rgb(20, 154, 203); $border-color: rgb(20, 154, 203);

View file

@ -3,15 +3,16 @@
.dropdown { .dropdown {
position: absolute; position: absolute;
right: 0; right: 0;
min-width: 160px; min-width: 240px;
max-width: 220px; max-width: 260px;
background-color: $base-background-color; background-color: $base-background-color;
overflow: hidden; overflow: visible;
border-radius: 0px 0px 4px 4px; border-radius: 0 0 5px 5px;
box-shadow: inset 0 1px 1px rgba(100,100,100,.25),0 1px 1px rgba(0,0,0,.25); padding: 10px;
color: white; color: white;
font-weight: normal; font-weight: normal;
font-size: 0.8125rem; font-size: 0.8125rem;
border: 1px solid $active-background-color;
display: none; display: none;
&.open { &.open {
@ -20,12 +21,13 @@
a { a {
color: white; color: white;
background-color: transparent;
} }
input { input {
// 100% minus border and padding // 100% minus border and padding
width: calc(100% - 2px - 8px); width: calc(100% - 30px);
margin-bottom: 9px; margin-bottom: 12px;
} }
label { label {
@ -47,28 +49,33 @@
padding: 0 10px; padding: 0 10px;
&:hover { &:hover {
background-color: $active-background-color; background-color: $active-background-color;
text-decoration: none; text-decoration: none;
} }
} }
} }
&.with-arrow { &.with-arrow {
$arrow-border-width: 11px; $arrow-border-width: 14px;
overflow: visible;
margin-top: $arrow-border-width; margin-top: $arrow-border-width;
border-radius: 4px; border-radius: 5px;
overflow: visible;
&:before { &:before {
position: absolute; position: absolute;
display: block; display: block;
right: 10%; top: -$arrow-border-width/2;
top: -$arrow-border-width; right: 10%;
left: auto;
border-color: transparent; height: $arrow-border-width;
border-bottom-color: $base-background-color; width: $arrow-border-width;
border-style: solid; content: '';
border-width: 0 $arrow-border-width $arrow-border-width $arrow-border-width; transform: rotate(45deg);
content: " ";
background-color: $base-background-color;
border-top: 1px solid $active-background-color;
border-left: 1px solid $active-background-color;
border-radius: 5px;
} }
} }
} }

View file

@ -1,7 +1,9 @@
var React = require('react'); var React = require('react');
var classNames = require('classnames'); var classNames = require('classnames');
var Login = require('../login/login.jsx');
var Dropdown = require('./dropdown.jsx'); var Dropdown = require('./dropdown.jsx');
var Input = require('../forms/input.jsx');
var Login = require('../login/login.jsx');
require('./navigation.scss'); require('./navigation.scss');
@ -54,17 +56,17 @@ module.exports = React.createClass({
<li className="search"> <li className="search">
<form action="/search/google_results" method="get"> <form action="/search/google_results" method="get">
<input type="submit" value="" /> <Input type="submit" value="" />
<input type="text" placeholder="Search" name="q" /> <Input type="text" placeholder="Search" name="q" />
<input type="hidden" name="date" value="anytime" /> <Input type="hidden" name="date" value="anytime" />
<input type="hidden" name="sort_by" value="datetime_shared" /> <Input type="hidden" name="sort_by" value="datetime_shared" />
</form> </form>
</li> </li>
{this.state.loggedIn ? [ {this.state.loggedIn ? [
<li className="link right messages"><a href="/messages/" title="Messages">Messages</a></li>, <li className="link right messages"><a href="/messages/" title="Messages">Messages</a></li>,
<li className="link right mystuff"><a href="/mystuff/" title="My Stuff">My Stuff</a></li>, <li className="link right mystuff"><a href="/mystuff/" title="My Stuff">My Stuff</a></li>,
<li className="link right account-nav"> <li className="link right account-nav">
<a href="#" onClick={this.handleClickAccountNav}> <a className="userInfo" href="#" onClick={this.handleClickAccountNav}>
<img src={this.state.loggedInUser.thumbnail} /> <img src={this.state.loggedInUser.thumbnail} />
{this.state.loggedInUser.username} {this.state.loggedInUser.username}
</a> </a>

View file

@ -10,7 +10,7 @@
background-color: $base-background-color; background-color: $base-background-color;
/* NOTE: Height should match offset settings in main.scss file */ /* NOTE: Height should match offset settings in main.scss file */
height: 35px; height: 50px;
.inner > ul { .inner > ul {
display: flex; display: flex;
@ -18,7 +18,7 @@
flex-wrap: nowrap; flex-wrap: nowrap;
justify-content: flex-start; justify-content: flex-start;
height: 35px; height: 50px;
margin: 0; margin: 0;
padding: 0; padding: 0;
list-style: none; list-style: none;
@ -28,25 +28,27 @@
align-self: flex-start; align-self: flex-start;
float: left; float: left;
height: 100%; height: 100%;
border-left: 1px solid $border-color;
position: relative; position: relative;
} }
.logo { .logo {
border-left: none; margin-right: 10px;
a { a {
display: block; display: block;
width: 80px; width: 81px;
height: 35px; height: 50px;
margin: 4px 6px 0 0; margin: 0px 6px 0 0;
border: none; border: none;
background-image: url('/images/logo_sm.png'); background-image: url('/images/logo_sm.png');
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center center;
background-size: 95%;
transition: .15s ease all;
&:hover { &:hover {
background-image: url('/images/logo_sm_highlight.png'); background-size: 100%;
transition: .15s ease all;
} }
} }
} }
@ -54,13 +56,14 @@
.link { .link {
> a { > a {
display: block; display: block;
height: 28px; height: 33px;
padding: 7px 15px 0 15px; padding: 17px 15px 0px 15px;
color: white; color: white;
text-decoration: none; text-decoration: none;
font-size: 0.95rem; font-size: 0.85rem;
white-space: nowrap; white-space: nowrap;
font-weight: bold;
} }
> a:hover { > a:hover {
@ -71,9 +74,11 @@
.search { .search {
flex-grow: 3; flex-grow: 3;
border-right: none; border-right: none;
color: white;
margin:0px 20px;
form { form {
margin: 6px 0 0 15px; margin: 0;
} }
input { input {
@ -81,26 +86,42 @@
height: 14px; height: 14px;
outline: none; outline: none;
border: none; border: none;
background-color: $active-background-color;
margin-top:5px;
} }
input[type=submit] { input[type=submit] {
position: absolute; position: absolute;
width: 30px; width: 40px;
height: 22px; height: 40px;
background-color: transparent;
background-color: white;
background-image: url('/images/nav-search-glass.png'); background-image: url('/images/nav-search-glass.png');
background-size: 14px 14px;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center center; background-position: center center;
border-right: 1px solid #efefef;
border-radius: 10px 0 0 10px;
} }
input[type=text] { input[type=text] {
width: calc(100% - 50px); width: calc(100% - 50px);
padding-left: 36px; height: 40px;
border-radius: 10px; padding: 0;
color: white;
padding-left: 40px;
padding-right:10px;
font-size: 0.85em; font-size: 0.85em;
transition: .15s ease background-color;
&::placeholder {
color:rgba(255, 255, 255, 0.75);
}
&:focus {
background-color: rgba(0, 0, 0, 0.2);
transition: .15s ease background-color;
}
} }
.ie9 input[type=text] { .ie9 input[type=text] {
@ -112,17 +133,12 @@
align-self: flex-end; align-self: flex-end;
float: right; float: right;
margin-left: auto; margin-left: auto;
font-weight: bold;
&:last-child { a:hover {
border-right: 1px solid rgb(20, 154, 203); background-color: $active-background-color;
} }
} }
.join > a:hover {
background-color: #f79231;
}
.messages, .mystuff { .messages, .mystuff {
> a { > a {
background-repeat: no-repeat; background-repeat: no-repeat;
@ -154,15 +170,21 @@
} }
.account-nav { .account-nav {
.userInfo {
padding-top: 11px;
padding-bottom: 6px;
}
> a { > a {
font-weight: normal; font-weight: normal;
font-size: 0.8125rem; font-size: 0.8125rem;
img { img {
width: 24px; width: 30px;
height: 24px; height: 30px;
margin-right: 5px; margin-right: 10px;
vertical-align: middle; vertical-align: middle;
border-radius: 3px;
} }
&:after { &:after {

View file

@ -51,24 +51,10 @@ a:hover {
padding: 10px 0; padding: 10px 0;
/* NOTE: Margin should match height in navigation.scss */ /* NOTE: Margin should match height in navigation.scss */
margin-top: 35px; margin-top: 50px;
}
/* Forms */
input {
height: 18px;
line-height: 18px;
display: inline-block;
padding: 4px;
margin-bottom: 9px;
font-size: 13px;
color: #555;
border: 1px solid #ccc;
border-radius: 3px;
box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
transition: border linear .2s,box-shadow linear .2s;
} }
/*
button { button {
cursor: pointer; cursor: pointer;
line-height: 30px; line-height: 30px;
@ -88,3 +74,5 @@ button {
button:hover { button:hover {
background-image: linear-gradient(#e6e6e6,#e6e6e6); background-image: linear-gradient(#e6e6e6,#e6e6e6);
} }
*/

View file

@ -1,7 +1,10 @@
var React = require('react'); var React = require('react');
var Box = require('../../components/box/box.jsx'); var Box = require('../../components/box/box.jsx');
var Button = require('../../components/forms/button.jsx');
var Carousel = require('../../components/carousel/carousel.jsx'); var Carousel = require('../../components/carousel/carousel.jsx');
var Input = require('../../components/forms/input.jsx');
require('./components.scss'); require('./components.scss');
@ -9,6 +12,10 @@ var View = React.createClass({
render: function () { render: function () {
return ( return (
<div className="inner"> <div className="inner">
<h1>Button</h1>
<Button>I love button</Button>
<h1>Form</h1>
<Input type="text" name="test" maxLength="30" />
<h1>Box Component</h1> <h1>Box Component</h1>
<Box <Box
title="Some Title" title="Some Title"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB