ui: more ui / focus / animation states

This commit is contained in:
Jack Pearkes 2014-04-30 12:15:54 -04:00
parent 676d582171
commit 8b2dc6dc4f
6 changed files with 32 additions and 5 deletions

View File

@ -106,14 +106,14 @@
<div class="panel-body"> <div class="panel-body">
<form class="form"> <form class="form">
<div class="form-group"> <div {{ bind-attr class=":form-group newKey.keyValid:valid" }}>
<div class="input-group"> <div class="input-group">
<span class="input-group-addon">{{topModel.parentKey}}</span> <span class="input-group-addon">{{topModel.parentKey}}</span>
{{ input value=newKey.key class="form-control" required=true }} {{ input value=newKey.key class="form-control" required=true }}
</div> </div>
</div> </div>
<div class="form-group"> <div {{ bind-attr class=":form-group newKey.valueValid:valid" }}>
{{ textarea value=newKey.value class="form-control"}} {{ textarea value=newKey.value class="form-control"}}
</div> </div>

View File

@ -86,6 +86,9 @@ App.Key = Ember.Object.extend(Ember.Validations.Mixin, {
value: { presence: true } value: { presence: true }
}, },
keyValid: Ember.computed.empty('errors.key'),
valueValid: Ember.computed.empty('errors.value'),
isFolder: function() { isFolder: function() {
return (this.get('key').slice(-1) == "/") return (this.get('key').slice(-1) == "/")
}.property('key'), }.property('key'),

19
ui/styles/_forms.scss Normal file
View File

@ -0,0 +1,19 @@
.form-group {
.form-control {
@include transition(border-color .2s ease-in-out);
@include transition(box-shadow .2s ease-in-out);
@include transition(border-color .2s ease-in-out);
}
&.valid {
.form-control {
border-color: $green-faded;
box-shadow: 0 0 5px $green-faded;
}
}
.input-group-addon {
background-color: $gray-background;
}
}

View File

@ -5,6 +5,7 @@
border-radius: 0px; border-radius: 0px;
margin-bottom: 15px; margin-bottom: 15px;
margin-top: 15px; margin-top: 15px;
@include transition(background-color .3s ease-in-out);
.list-group-item-heading, .list-inline { .list-group-item-heading, .list-inline {
margin: 10px 15px 10px 15px; margin: 10px 15px 10px 15px;
@ -42,9 +43,11 @@
} }
&.active { &.active {
@include transition(border-color .1s linear);
border-color: $purple; border-color: $purple;
.list-bar { .list-bar {
@include transition(background-color .1s linear);
background-color: $purple; background-color: $purple;
} }
} }

View File

@ -1,6 +1,7 @@
.panel { .panel {
border-width: 2px; border-width: 2px;
border-color: $gray-background; border-color: $gray-background;
@include transition(background-color .3s ease-in-out);
.panel-heading { .panel-heading {
background-color: transparent; background-color: transparent;
@ -41,7 +42,7 @@
.panel-bar { .panel-bar {
width: 100%; width: 100%;
height: 20px; height: 20px;
@include transition(background-color .3s ease-in-out); @include transition(background-color .1s linear);
} }
&.panel-link { &.panel-link {
@ -62,7 +63,7 @@
border-color: $purple; border-color: $purple;
} }
@include transition(background-color .3s ease-in-out); @include transition(background-color .1s linear);
border-color: $purple; border-color: $purple;

View File

@ -5,6 +5,7 @@
@import "nav"; @import "nav";
@import "buttons"; @import "buttons";
@import "lists"; @import "lists";
@import "forms";
@media (min-width: 768px) { // + 18 @media (min-width: 768px) { // + 18
.container { .container {
@ -84,7 +85,7 @@ a {
} }
.bg-gray { .bg-gray {
background-color: $gray; background-color: $gray-light;
} }
.bg-light-gray { .bg-light-gray {