diff --git a/package.json b/package.json index 4df79a7..3d53e5a 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ }, "dependencies": { "classnames": "^2.2.5", + "css-loader": "^0.28.11", "director": "^1.2.8", "express": "^4.15.3", "jsesc": "^2.5.1", @@ -59,6 +60,7 @@ "prop-types": "^15.5.10", "react": "^16.6.0", "react-dom": "^16.6.0", + "style-loader": "^0.18.2", "todomvc-app-css": "^2.1.0", "todomvc-common": "^1.0.3", "url-loader": "^0.5.9", diff --git a/src/base.css b/src/base.css new file mode 100644 index 0000000..da65968 --- /dev/null +++ b/src/base.css @@ -0,0 +1,141 @@ +hr { + margin: 20px 0; + border: 0; + border-top: 1px dashed #c5c5c5; + border-bottom: 1px dashed #f7f7f7; +} + +.learn a { + font-weight: normal; + text-decoration: none; + color: #b83f45; +} + +.learn a:hover { + text-decoration: underline; + color: #787e7e; +} + +.learn h3, +.learn h4, +.learn h5 { + margin: 10px 0; + font-weight: 500; + line-height: 1.2; + color: #000; +} + +.learn h3 { + font-size: 24px; +} + +.learn h4 { + font-size: 18px; +} + +.learn h5 { + margin-bottom: 0; + font-size: 14px; +} + +.learn ul { + padding: 0; + margin: 0 0 30px 25px; +} + +.learn li { + line-height: 20px; +} + +.learn p { + font-size: 15px; + font-weight: 300; + line-height: 1.3; + margin-top: 0; + margin-bottom: 0; +} + +#issue-count { + display: none; +} + +.quote { + border: none; + margin: 20px 0 60px 0; +} + +.quote p { + font-style: italic; +} + +.quote p:before { + content: '“'; + font-size: 50px; + opacity: .15; + position: absolute; + top: -20px; + left: 3px; +} + +.quote p:after { + content: '”'; + font-size: 50px; + opacity: .15; + position: absolute; + bottom: -42px; + right: 3px; +} + +.quote footer { + position: absolute; + bottom: -40px; + right: 0; +} + +.quote footer img { + border-radius: 3px; +} + +.quote footer a { + margin-left: 5px; + vertical-align: middle; +} + +.speech-bubble { + position: relative; + padding: 10px; + background: rgba(0, 0, 0, .04); + border-radius: 5px; +} + +.speech-bubble:after { + content: ''; + position: absolute; + top: 100%; + right: 30px; + border: 13px solid transparent; + border-top-color: rgba(0, 0, 0, .04); +} + +.learn-bar > .learn { + position: absolute; + width: 272px; + top: 8px; + left: -300px; + padding: 10px; + border-radius: 5px; + background-color: rgba(255, 255, 255, .6); + transition-property: left; + transition-duration: 500ms; +} + +@media (min-width: 899px) { + .learn-bar { + width: auto; + padding-left: 300px; + } + + .learn-bar > .learn { + left: 8px; + } +} diff --git a/src/client.js b/src/client.js index 5991905..a6c3110 100644 --- a/src/client.js +++ b/src/client.js @@ -5,6 +5,9 @@ import TodoApp from './components/todoApp.js'; import React from 'react'; import ReactDOM from 'react-dom'; +import './base.css'; +import './index.css'; + const initialState = window.initialState && JSON.parse(window.initialState) || {}; var todoStore = TodoStore.fromJS(initialState.todos || []); diff --git a/src/components/todoApp.js b/src/components/todoApp.js index 000ee80..a3767af 100644 --- a/src/components/todoApp.js +++ b/src/components/todoApp.js @@ -5,7 +5,6 @@ import {observer} from 'mobx-react'; import TodoEntry from './todoEntry'; import TodoOverview from './todoOverview'; import TodoFooter from './todoFooter'; -import { ALL_TODOS, ACTIVE_TODOS, COMPLETED_TODOS } from '../constants'; import DevTool from 'mobx-react-devtools'; @@ -29,13 +28,8 @@ export default class TodoApp extends React.Component { componentDidMount() { if (__CLIENT__) { var { Router } = require('director/build/director'); - var viewStore = this.props.viewStore; - var router = Router({ - '/': function() { viewStore.todoFilter = ALL_TODOS; }, - '/active': function() { viewStore.todoFilter = ACTIVE_TODOS; }, - '/completed': function() { viewStore.todoFilter = COMPLETED_TODOS; } - }); - router.init('/'); + var router = Router({}); + router.init('/'); } } } diff --git a/src/components/todoFooter.js b/src/components/todoFooter.js index 4c9c4c0..6e9e5f8 100644 --- a/src/components/todoFooter.js +++ b/src/components/todoFooter.js @@ -3,7 +3,6 @@ import PropTypes from 'prop-types'; import {observer} from 'mobx-react'; import {action} from 'mobx'; import {pluralize} from '../utils'; -import { ALL_TODOS, ACTIVE_TODOS, COMPLETED_TODOS } from '../constants'; @observer export default class TodoFooter extends React.Component { @@ -14,15 +13,15 @@ export default class TodoFooter extends React.Component { const activeTodoWord = pluralize(todoStore.activeTodoCount, 'item'); + const filters = this.props.todoStore.rangeOfTags; + return (