Skip to content

Commit

Permalink
todolist starter
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinEberhardt committed Dec 16, 2015
1 parent 118a12e commit f634917
Show file tree
Hide file tree
Showing 9 changed files with 233 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/app/bootstrap.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {bootstrap} from 'angular2/platform/browser';
import Greeting from './greeting/greeting';
import ToDoList from './todolist/todolist';

bootstrap(Greeting);
bootstrap(ToDoList);
3 changes: 0 additions & 3 deletions src/app/greeting/greeting.css

This file was deleted.

3 changes: 0 additions & 3 deletions src/app/greeting/greeting.html

This file was deleted.

10 changes: 0 additions & 10 deletions src/app/greeting/greeting.ts

This file was deleted.

195 changes: 195 additions & 0 deletions src/app/todolist/todolist.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@

button {
margin: 0;
padding: 0;
border: 0;
background: none;
font-size: 100%;
vertical-align: baseline;
font-family: inherit;
font-weight: inherit;
color: inherit;
-webkit-appearance: none;
appearance: none;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
font-smoothing: antialiased;
}

.add {
cursor: pointer;
margin: 3px;
padding: 3px 7px;
border: 1px solid transparent;
border-radius: 3px;
}

.add:hover {
border-color: rgba(175, 47, 47, 0.1);
}

.hidden {
display: none;
}

.todoapp {
background: #fff;
margin: 130px 0 40px 0;
position: relative;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2),
0 25px 50px 0 rgba(0, 0, 0, 0.1);
}

.todoapp input::-webkit-input-placeholder {
font-style: italic;
font-weight: 300;
color: #e6e6e6;
}

.todoapp input::-moz-placeholder {
font-style: italic;
font-weight: 300;
color: #e6e6e6;
}

.todoapp input::input-placeholder {
font-style: italic;
font-weight: 300;
color: #e6e6e6;
}

.todoapp h1 {
position: absolute;
top: -155px;
width: 100%;
font-size: 100px;
font-weight: 100;
text-align: center;
color: rgba(175, 47, 47, 0.15);
-webkit-text-rendering: optimizeLegibility;
-moz-text-rendering: optimizeLegibility;
text-rendering: optimizeLegibility;
}

.new-todo,
.edit {
position: relative;
margin: 0;
width: 90%;
font-size: 24px;
font-family: inherit;
font-weight: inherit;
line-height: 1.4em;
border: 0;
outline: none;
color: inherit;
padding: 6px;
border: 1px solid #999;
box-shadow: inset 0 -1px 5px 0 rgba(0, 0, 0, 0.2);
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
font-smoothing: antialiased;
}

.new-todo {
padding: 16px 16px 16px 60px;
border: none;
background: rgba(0, 0, 0, 0.003);
box-shadow: inset 0 -2px 1px rgba(0,0,0,0.03);
}

.main {
position: relative;
z-index: 2;
border-top: 1px solid #e6e6e6;
}

.todo-list {
margin: 0;
padding: 0;
list-style: none;
}

.todo-list li {
position: relative;
font-size: 24px;
border-bottom: 1px solid #ededed;
}

.todo-list li:last-child {
border-bottom: none;
}

label {
white-space: pre;
word-break: break-word;
padding: 15px 60px 15px 15px;
margin-left: 45px;
display: block;
line-height: 1.2;
transition: color 0.4s;
}

// - todo list item styles

label.completed {
color: #d9d9d9;
text-decoration: line-through;
}

.destroy {
display: none;
position: absolute;
top: 0;
right: 10px;
bottom: 0;
width: 40px;
height: 40px;
margin: auto 0;
font-size: 30px;
color: #cc9a9a;
margin-bottom: 11px;
transition: color 0.2s ease-out;
border: 0;
background-color: transparent;
}

.destroy:hover {
color: #af5b5e;
}

.destroy:after {
content: '×';
}

.view:hover .destroy {
display: block;
}

.toggle {
text-align: center;
width: 40px;
/* auto, since non-WebKit browsers doesn't support input styling */
height: auto;
position: absolute;
top: 0;
bottom: 0;
margin: auto 0;
border: none; /* Mobile Safari */
-webkit-appearance: none;
appearance: none;
}

.toggle:after {
content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="-10 -18 100 135"><circle cx="50" cy="50" r="50" fill="none" stroke="#ededed" stroke-width="3"/></svg>');
}

.toggle:checked:after {
content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="-10 -18 100 135"><circle cx="50" cy="50" r="50" fill="none" stroke="#bddad5" stroke-width="3"/><path fill="#5dc2af" d="M72 25L42 71 27 56l-4 4 20 20 34-52z"/></svg>');
}

.toggle {
background: none;
height: 40px;
}
7 changes: 7 additions & 0 deletions src/app/todolist/todolist.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<section class="todoapp">
<header class="header">
<h1>todos</h1>
<input class="new-todo" placeholder="What needs to be done?" autofocus>
<button class="add">Add</button>
</header>
</section>
9 changes: 9 additions & 0 deletions src/app/todolist/todolist.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {Component} from 'angular2/core';

@Component({
selector: 'todo-list',
templateUrl: 'app/todolist/todolist.html',
styleUrls: ['app/todolist/todolist.css']
})
export default class ToDoList {
}
3 changes: 2 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
<head>
<meta charset="UTF-8">
<title>Angular2 seed</title>
<link rel="stylesheet" href="main.css"/>
</head>

<body>
<greeting>Loading...</greeting>
<todo-list>Loading...</todolist>
</body>

<script src="lib/angular2-polyfills.js"></script>
Expand Down
18 changes: 18 additions & 0 deletions src/main.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
html,
body {
margin: 0;
padding: 0;
}

body {
font: 14px 'Helvetica Neue', Helvetica, Arial, sans-serif;
line-height: 1.4em;
background: #f5f5f5;
color: #4d4d4d;
min-width: 230px;
max-width: 550px;
margin: 0 auto;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
font-smoothing: antialiased;
font-weight: 300;
}

button,
input[type="checkbox"] {
outline: none;
}

0 comments on commit f634917

Please sign in to comment.