Skip to content

Commit

Permalink
item drag details + todo done animation
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan You committed Oct 15, 2012
1 parent 0bfbf41 commit 5cb9fbc
Show file tree
Hide file tree
Showing 10 changed files with 423 additions and 57 deletions.
145 changes: 144 additions & 1 deletion css/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,144 @@
.drag{-webkit-transition:-webkit-transform 0s linear,opacity 0s linear!important}html,body{margin:0;padding:0;height:100%;font-family:Helvetica,Arial,sans-serif;font-size:19px;font-weight:bold;color:#fff}#fork-ribbon{display:none}#wrapper{position:absolute;width:100%;height:100%;top:0;left:0;background:#000;overflow:hidden}#list-view{z-index:1}.list{-webkit-transform:translate3d(0,0,0);-webkit-transition:opacity .3s cubic-bezier(0.64,0.16,0.39,0.83);position:absolute;width:100%;top:0;left:0;z-index:0}.list.fade{opacity:0}.item{text-shadow:0 1px 1px rgba(0,0,0,0.25);-webkit-transition:-webkit-transform .3s cubic-bezier(0.64,0.16,0.39,0.83),background-color .3s cubic-bezier(0.64,0.16,0.39,0.83),opacity .3s cubic-bezier(0.64,0.16,0.39,0.83);position:absolute;width:100%;top:0;left:0;height:64px}.item .inner{cursor:pointer;position:relative;-webkit-transform:translate3d(0,0,0);height:64px;line-height:64px;box-sizing:border-box;padding-left:12px;border-top:1px solid rgba(255,255,255,0.07);border-bottom:1px solid rgba(0,0,0,0.1)}.list-item{background-color:#0086f3}.list-item .count{position:absolute;width:64px;height:63px;right:0;top:-1px;background-color:rgba(255,255,255,0.15);text-align:center}.list-item.empty{color:rgba(255,255,255,0.5);text-shadow:0 1px 1px rgba(0,0,0,0.13)}body.desktop{background:url(../img/bg.png) center center no-repeat}body.desktop *{-webkit-user-select:none}body.desktop img{-webkit-user-drag:none}body.desktop #wrapper{width:320px;height:548px;top:50%;left:50%;margin-top:-259px;margin-left:-160px}body.desktop #fork-ribbon{display:inline}#log{position:absolute;bottom:5px;width:100%;left:0;text-align:center;font-size:14px}
.drag {
-webkit-transition: -webkit-transform 0s linear, opacity 0s linear !important;
}
html,
body {
margin: 0;
padding: 0;
height: 100%;
font-family: Helvetica, Arial, sans-serif;
font-size: 19px;
font-weight: bold;
color: #fff;
}
#fork-ribbon {
display: none;
}
#wrapper {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
background: #000;
overflow: hidden;
}
#list-view {
z-index: 1;
}
.list {
-webkit-transform: translate3d(0, 0, 0);
-webkit-transition: opacity 0.3s cubic-bezier(0.64, 0.16, 0.39, 0.83);
position: absolute;
width: 100%;
top: 0;
left: 0;
z-index: 0;
}
.list.fade {
opacity: 0;
}
.item {
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
-webkit-transition: -webkit-transform 0.3s cubic-bezier(0.64, 0.16, 0.39, 0.83), opacity 0.3s cubic-bezier(0.64, 0.16, 0.39, 0.83);
position: absolute;
z-index: 0;
width: 100%;
top: 0;
left: 0;
height: 64px;
}
.item .slider {
-webkit-transition: background-color 0.15s cubic-bezier(0.64, 0.16, 0.39, 0.83), color 0.15s cubic-bezier(0.64, 0.16, 0.39, 0.83);
cursor: pointer;
position: relative;
z-index: 1;
height: 64px;
}
.item .slider .inner {
-webkit-transform: translate3d(0, 0, 0);
box-sizing: border-box;
padding-left: 12px;
border-top: 1px solid rgba(255, 255, 255, 0.07);
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
height: 64px;
line-height: 64px;
}
.item .check,
.item .cross {
width: 64px;
height: 64px;
position: absolute;
z-index: 0;
top: 0;
opacity: 0;
}
.item .check {
left: 0;
}
.item .cross {
right: 0;
}
.list-item .count {
position: absolute;
width: 64px;
height: 63px;
right: 0;
top: -1px;
background-color: rgba(255, 255, 255, 0.15);
text-align: center;
}
.list-item.empty {
color: rgba(255, 255, 255, 0.5);
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.13);
}
.todo-item .line {
position: absolute;
height: 2px;
left: 10px;
top: 31px;
width: 0;
background-color: #fff;
-webkit-transition: width 0s linear, background-color 0.15s cubic-bezier(0.64, 0.16, 0.39, 0.83);
}
.todo-item.done {
z-index: 1;
color: #666;
}
.todo-item.done .slider {
background-color: #000 !important;
}
.todo-item.done .line {
background-color: #666;
}
.todo-item.green .slider {
background-color: #0A3 !important;
}
body.desktop {
background: url(../img/bg.png) center center no-repeat;
}
body.desktop * {
-webkit-user-select: none;
}
body.desktop img {
-webkit-user-drag: none;
}
body.desktop #wrapper {
width: 320px;
height: 548px;
top: 50%;
left: 50%;
margin-top: -259px;
margin-left: -160px;
}
body.desktop #fork-ribbon {
display: inline;
}
#log {
position: absolute;
bottom: 5px;
width: 100%;
left: 0;
text-align: center;
font-size: 14px;
}
73 changes: 64 additions & 9 deletions css/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,52 @@ html, body {
.item {
text-shadow: 0 1px 1px rgba(0,0,0,.25);
-webkit-transition: -webkit-transform .3s @ease,
background-color .3s @ease,
opacity .3s @ease;
position: absolute;
z-index: 0;
width: 100%;
top: 0;
left: 0;
height: @itemHeight;
.inner {

.slider {
-webkit-transition: background-color .15s @ease,
color .15s @ease;
cursor: pointer;
position: relative;
-webkit-transform: translate3d(0,0,0);
z-index: 1;
height: @itemHeight;
line-height: @itemHeight;
box-sizing: border-box;
padding-left: 12px;
border-top: 1px solid rgba(255,255,255,.07);
border-bottom: 1px solid rgba(0,0,0,.1);

.inner {
-webkit-transform: translate3d(0,0,0);
box-sizing: border-box;
padding-left: 12px;
border-top: 1px solid rgba(255,255,255,.07);
border-bottom: 1px solid rgba(0,0,0,.1);
height: @itemHeight;
line-height: @itemHeight;
}
}

.check, .cross {
width: 64px;
height: 64px;
position: absolute;
z-index: 0;
top: 0;
opacity: 0;
}

.check {
left: 0;
}

.cross {
right: 0;
}
}

.list-item {
background-color: #0086F3;

.count {
position: absolute;
Expand All @@ -89,6 +113,37 @@ html, body {
}
}

.todo-item {

.line {
position: absolute;
height: 2px;
left: 10px;
top: 31px;
width: 0;
background-color: #fff;
-webkit-transition: width 0s linear,
background-color .15s @ease;
}

&.done {
z-index: 1;
color: #666;
.slider {
background-color: #000 !important;
}
.line {
background-color: #666;
}
}

&.green {
.slider {
background-color: #0A3 !important;
}
}
}

// Desktop

body.desktop {
Expand Down
Binary file added img/check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/cross.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5cb9fbc

Please sign in to comment.