From 0fd99c3ba4fb486a2fe426bfde08df8ca43a10d3 Mon Sep 17 00:00:00 2001 From: Javi Jimenez Villar Date: Sat, 30 May 2015 16:19:37 +0200 Subject: [PATCH] UX from Session to Console --- dist/assets/img/avatar.jpg | Bin 0 -> 13304 bytes source/app.cjsx | 66 +++++++++++------- source/components/button.cjsx | 4 +- source/components/navigation.cjsx | 6 +- source/components/router.cjsx | 44 ++++++++++++ .../session.cjsx => forms/form.session.cjsx} | 21 +++--- source/modules/constants.coffee | 7 +- source/screens/console.cjsx | 39 +---------- source/styles/__constants.styl | 1 - source/styles/components/button.styl | 19 +++-- source/styles/components/form.styl | 15 ++++ source/styles/components/header.styl | 15 ++++ source/styles/components/input.styl | 38 ++++++++++ source/styles/components/list_item.styl | 6 +- source/styles/components/navigation.styl | 1 + 15 files changed, 192 insertions(+), 90 deletions(-) create mode 100644 dist/assets/img/avatar.jpg create mode 100644 source/components/router.cjsx rename source/{screens/session.cjsx => forms/form.session.cjsx} (62%) create mode 100644 source/styles/components/form.styl create mode 100644 source/styles/components/input.styl diff --git a/dist/assets/img/avatar.jpg b/dist/assets/img/avatar.jpg new file mode 100644 index 0000000000000000000000000000000000000000..08bfe41a056a6ddf33c5f9781f2c8ba6ee09ba67 GIT binary patch literal 13304 zcmdsdby%C*(r<7mUMTL`7I!EPEmow^;!YrF@dhUpD-?H!b{8!U4N?dW!QBGE11&Da zA#i){clJK}eCIyjKliVDC(o0acfHB1^{zE*&CGA!`}zA-0GWo0x(WaT0|TJ;`vbUN z1StRG>i>%Vq2&Kc!9V_d-vJ=U$Kb`_#lj#5V3K2Ckz?HV0GI$608Fg^tsL-AB6xs< zhmVVmfr<6|z6u!t0~-?)0}BfSivSyk7y!ToU|?b6;Nm?b$ERQ;pk#f-E+kAvP0OLE zWRO0`DI%)NrL1S@AtoVd^A7wzDFfOtJ@Z=+KSj||GabH84!MmBW9RuU+5 zmfYaqpN-N~o433vKrwA~N7nC0`Gjc30!gTs?h1n|8rc$g4vo-U;jo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a-router" -# -- Models -Session = require "./models/session" +# -- components +Button = require "./components/button" +Router = require "./components/router" +# -- forms +FormSession = require "./forms/form.session" # -- Screens -ScreenSession = require "./screens/session" ScreenConsole = require "./screens/console" +# -- Modules +C = require "./modules/constants" App = React.createClass - # -- States & Properties - getInitialState: -> - session : null - context : "campaigns" - # -- Lifecycle componentWillMount: -> SPArouter.listen - "/session/:id" : (id) => - @setState session: false, context: id - "/:context/:area/:element" : (context, area, element) => - @setState session: true, context: context + "/session/:context" : (context) => + @setState session: false, context: context "/:context/:area" : (context, area) => - @setState session: true, context: context - "/:context" : (context) => - @setState session: true, context: context + @setState session: true, context: context, area: area # -- Events onSessionSuccess: (data) -> - @setState session: true - SPArouter.path "console" + header_style = @refs.header.getDOMNode().classList + header_style.add "disabled" + header_style.remove "expanded" + setTimeout => + SPArouter.path "campaigns/list" + , C.ANIMATION.DURATION + setTimeout => + header_style.remove "disabled" + , (C.ANIMATION.DURATION * 2) + + onConsoleScroll: (value) -> @setState scrolling: value + + onLogout: -> SPArouter.path "session/login" # -- Render render: -> - - { - if @state.session - - else - - } + if @state.session + avatar = "http://soyjavi.com/assets/img/soyjavi.hat.jpg" + else + avatar = "./assets/img/avatar.jpg" + + +
+ + { + if @state.session + + else + + } +
+ { if @state.session }
React.render , document.body diff --git a/source/components/button.cjsx b/source/components/button.cjsx index 2e30ead4..f0cf8f54 100644 --- a/source/components/button.cjsx +++ b/source/components/button.cjsx @@ -15,10 +15,10 @@ module.exports = React.createClass # -- Events onClick: (event) -> event.preventDefault() - console.log ">" + @props.onClick.call @, event # -- Render render: -> - diff --git a/source/components/navigation.cjsx b/source/components/navigation.cjsx index 55e32b31..77f8a515 100644 --- a/source/components/navigation.cjsx +++ b/source/components/navigation.cjsx @@ -23,11 +23,7 @@ module.exports = React.createClass { for route, index in @props.routes method = if route.back is true then @onBack - console.log route.className - + {route.label} } diff --git a/source/components/router.cjsx b/source/components/router.cjsx new file mode 100644 index 00000000..ba68ff4e --- /dev/null +++ b/source/components/router.cjsx @@ -0,0 +1,44 @@ +### +@todo +### + +Button = require "./button" +Navigation = require "./navigation" +C = require "../modules/constants" + +module.exports = React.createClass + + # -- States & Properties + propTypes: + routes : React.PropTypes.array.required + + getDefaultProps: -> + routes : [ + label: "Campaigns", route: "/campaigns/list" + , + label: "Creatives", route: "/creatives/list" + , + label: "Users", route: "/users/list" + , + label: "Deals", route: "/deals/list" + , + label: "Analytics", route: "/analytics" + ] + + # -- Render + render: -> + for route in @props.routes + route.className = if route.label.toLowerCase() is @props.context then "active" else "" + for route in subroutes = C.SUBROUTES[@props.context.toUpperCase()] + route.className = if route.label.toLowerCase() is @props.area then "active" else "" +
+
+ +

Console

+ +
+ +
diff --git a/source/screens/session.cjsx b/source/forms/form.session.cjsx similarity index 62% rename from source/screens/session.cjsx rename to source/forms/form.session.cjsx index 923a4e01..2fb012ed 100644 --- a/source/screens/session.cjsx +++ b/source/forms/form.session.cjsx @@ -2,6 +2,9 @@ @todo ### +# -- components +Button = require "../components/button" + module.exports = React.createClass # -- States & Properties @@ -11,7 +14,7 @@ module.exports = React.createClass onSuccess : React.PropTypes.function getInitialState: -> - disabled: false + disabled : true # -- Events onKeyUp: (event) -> @@ -32,23 +35,19 @@ module.exports = React.createClass # -- Render render: -> - + # -- Private methods _getFormValues: -> diff --git a/source/modules/constants.coffee b/source/modules/constants.coffee index ca0dd136..d60780f4 100644 --- a/source/modules/constants.coffee +++ b/source/modules/constants.coffee @@ -12,10 +12,15 @@ module.exports = , label: "reports", route: "/campaigns/reports" ] - CREATIVES: [ label: "list", route: "/creatives/list" ] + USERS: [] + DEALS: [] + ANALYTICS: [] HEIGHT: LI : 80 + + ANIMATION: + DURATION : 450 diff --git a/source/screens/console.cjsx b/source/screens/console.cjsx index 5d95ce26..64d3ba1e 100644 --- a/source/screens/console.cjsx +++ b/source/screens/console.cjsx @@ -2,48 +2,13 @@ @todo ### -SPArouter = require "spa-router" -Header = require "../components/header" List = require "../components/list" ListItem = require "../components/list_item" -C = require "../modules/constants" module.exports = React.createClass - # -- States & Properties - propTypes: - routes : React.PropTypes.array - - getDefaultProps: -> - routes : [ - label: "Campaigns", route: "/campaigns" - , - label: "Creatives", route: "/creatives" - , - label: "Users", route: "/users" - , - label: "Deals", route: "/deals" - , - label: "Analytics", route: "/analytics" - ] - subroutes : [] - - getInitialState: -> - scrolling : false - - onScroll: (value) -> - @setState scrolling: value - render: -> - context = @props.context.toUpperCase() mock = (id: i, title: "Title #{i}" for i in [1..128]) - - for route in @props.routes - route.className = if route.label.toLowerCase() is @props.context then "active" else "" - -
-
- +
+
diff --git a/source/styles/__constants.styl b/source/styles/__constants.styl index 3ba1a43a..c1e1ddd4 100644 --- a/source/styles/__constants.styl +++ b/source/styles/__constants.styl @@ -26,7 +26,6 @@ OFFSET = (UNIT * 1.35) HEADER_HEIGHT = 33vh BUTTON_HEIGHT = (2.5 * SPACE) -BUTTON_HEIGHT = 14vw BUTTON_CIRCLE_HEIGHT = (2.75 * SPACE) BORDER_RADIUS = (SPACE / 2) H1_SHADOW = (SPACE / 6) (SPACE / 6) rgba(0,0,0,0.2) diff --git a/source/styles/components/button.styl b/source/styles/components/button.styl index 70bc7074..c9cc72f5 100644 --- a/source/styles/components/button.styl +++ b/source/styles/components/button.styl @@ -1,16 +1,20 @@ button, .button - height : BUTTON_HEIGHT - width : auto + font-size : FONT_SIZE_BIG font-weight : FONT_WEIGHT_BOLD line-height : BUTTON_HEIGHT text-align : center border : none overflow : hidden - transition-property opacity, box-shadow + transition-property opacity, background-color, box-shadow transition-duration ANIMATION_DURATION transition-timing-function ANIMATION_EASE + &:not(.circle) + height : BUTTON_HEIGHT + max-height : BUTTON_HEIGHT + width : auto + &.circle width : SIZE = BUTTON_CIRCLE_HEIGHT height : SIZE @@ -22,7 +26,8 @@ button, .button box-shadow BUTTON_SHADOW, inset 0 0 0 UNIT alpha(WHITE, 15%) // -- Colors - &.primary - background-color : PRIMARY - &.secondary - background-color : PRIMARY + &:not([disabled]) + &.primary + background-color : PRIMARY + &.secondary + background-color : PRIMARY diff --git a/source/styles/components/form.styl b/source/styles/components/form.styl new file mode 100644 index 00000000..9ff4bc13 --- /dev/null +++ b/source/styles/components/form.styl @@ -0,0 +1,15 @@ +form + padding : SPACE + // -- Classes + &.session + max-width : 25vw + > * + margin-bottom : (SPACE / 2) + + h1 + padding : 0 + input + font-size : FONT_SIZE_BIG !important + a + text-align : center + font-size : FONT_SIZE_TINY diff --git a/source/styles/components/header.styl b/source/styles/components/header.styl index 5049b30f..b78e9223 100644 --- a/source/styles/components/header.styl +++ b/source/styles/components/header.styl @@ -1,4 +1,5 @@ header + z-index : 2 position : fixed height : HEADER_HEIGHT width : 100vw @@ -16,6 +17,7 @@ header box-shadow 0 0 0 (SIZE / 10) alpha(WHITE, 15%) h1 padding : (UNIT / 2) 0 + text-transform : Capitalize transition all ANIMATION_DURATION ANIMATION_EASE nav &[data-role="text"] @@ -31,7 +33,20 @@ header > * margin-left : SPACE + // -- States + > * + transition all ANIMATION_DURATION ANIMATION_EASE + &.expanded + height : 100vh + &.disabled + delayChild index, 2 for index in (0..3) + + > * + opacity : 0 + transform translateY(-10vh) + // -- Effects + .scrolling & height : (HEADER_HEIGHT / 2) box-shadow : HEADER_SHADOW diff --git a/source/styles/components/input.styl b/source/styles/components/input.styl new file mode 100644 index 00000000..3a0aae45 --- /dev/null +++ b/source/styles/components/input.styl @@ -0,0 +1,38 @@ +input[type="email"], input[type="search"], input[type="text"], input[type="tel"], +input[type="url"], input[type="password"], textarea, select + width : 100% + padding : (SPACE / 2) + font-size : FONT_SIZE_NORMAL + border : none + border-bottom : solid (SPACE / 10) + box-shadow : none + box-sizing : border-box + transition all ANIMATION_DURATION ANIMATION_EASE + & :focus + outline : 0 + + -webkit-appearance : none + -moz-appearance : none + appearance : none + outline : none + -webkit-tap-highlight-color : rgba(255, 255, 255, 0) + -webkit-touch-callout : none + + // -- class ------------------------------------------------------------------ + &.transparent + font-size : FONT_SIZE_BIG + font-weight : FONT_WEIGHT_BOLD + background-color : transparent + color : WHITE + border-bottom-color : alpha(WHITE, 50%) + &:hover, &:focus, &:active + border-bottom-color : WHITE + &::-webkit-input-placeholder + color : alpha(WHITE, 50%) + + &.white + border-bottom-color : alpha(BACKGROUND, 25%) + opacity : 0.75 + &:hover, &:focus, &:active + border-bottom-color : THEME + opacity : 1 diff --git a/source/styles/components/list_item.styl b/source/styles/components/list_item.styl index 57eadefe..49e4ca77 100644 --- a/source/styles/components/list_item.styl +++ b/source/styles/components/list_item.styl @@ -1,6 +1,8 @@ li - padding : (SPACE / 2) 0 - height : 80px + margin-bottom : SPACE + padding : SPACE + background-color : white + box-shadow : HEADER_SHADOW img width : SIZE = (2.5 * SPACE) height : SIZE diff --git a/source/styles/components/navigation.styl b/source/styles/components/navigation.styl index ddc8dae7..d521e331 100644 --- a/source/styles/components/navigation.styl +++ b/source/styles/components/navigation.styl @@ -2,6 +2,7 @@ nav &[data-role="text"] font-size : FONT_SIZE_NORMAL > * + text-transform : Capitalize transition opacity ANIMATION_DURATION ANIMATION_EASE &:not(.active) font-weight : FONT_WEIGHT_THIN