diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..5d12634 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/Gruntfile.js b/Gruntfile.js index 4f0e1bb..a4f0f9a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,67 +1,67 @@ module.exports = function(grunt) { - require("matchdep").filterAll("grunt-*").forEach(grunt.loadNpmTasks); - var webpack = require("webpack"); - var webpackConfig = require("./webpack.config.js"); + require("matchdep").filterAll("grunt-*").forEach(grunt.loadNpmTasks); + var webpack = require("webpack"); + var webpackConfig = require("./webpack.config.js"); - grunt.initConfig({ - "webpack-dev-server": { - options: { - webpack: webpackConfig, - publicPath: "", - contentBase: './dev' - }, - start: { - keepAlive: true, - webpack: { - devtool: "sourcemap", - debug: true - } - } - }, - watch: { - sass: { - files: ['src/css/**/*.scss'], - tasks: ['sass:dev'], - options: { - spawn: false - } - } - }, - sass: { - dev: { - options: { - outputStyle: 'expanded', - sourceComments: 'map' - }, - files: { 'dev/main.css': 'src/css/main.scss' } - } - }, - exec: { - docpad: { - cmd: "docpad generate -e production" - }, - clear_dist: { - cmd: "rm -rf ./dist/" - } - }, - execute: { - // TODO :: currently this dumps metadata.json into the module's dist - // we need to pass options into generate-meta.js to define - // our own outputDir - modernizr: { - src: ['./node_modules/modernizr/lib/generate-meta.js'], - } - }, - 'gh-pages': { - options: { - base: 'dist' - }, - src: ['**'] - } - }); + grunt.initConfig({ + "webpack-dev-server": { + options: { + webpack: webpackConfig, + publicPath: "", + contentBase: './dev' + }, + start: { + keepAlive: true, + webpack: { + devtool: "sourcemap", + debug: true + } + } + }, + watch: { + sass: { + files: ['src/css/**/*.scss'], + tasks: ['sass:dev'], + options: { + spawn: false + } + } + }, + sass: { + dev: { + options: { + outputStyle: 'expanded', + sourceComments: 'map' + }, + files: { 'dev/main.css': 'src/css/main.scss' } + } + }, + exec: { + docpad: { + cmd: "docpad generate -e production" + }, + clear_dist: { + cmd: "rm -rf ./dist/" + } + }, + execute: { + // TODO :: currently this dumps metadata.json into the module's dist + // we need to pass options into generate-meta.js to define + // our own outputDir + modernizr: { + src: ['./node_modules/modernizr/lib/generate-meta.js'], + } + }, + 'gh-pages': { + options: { + base: 'dist' + }, + src: ['**'] + } + }); - grunt.registerTask("default", ["webpack-dev-server:start"]); - grunt.registerTask("dist", ["exec:clear_dist", "exec:docpad"]) + grunt.registerTask("default", ["webpack-dev-server:start"]); + grunt.registerTask("dist", ["exec:clear_dist", "exec:docpad"]) }; diff --git a/docpad.coffee b/docpad.coffee index 2a15d94..d37c797 100644 --- a/docpad.coffee +++ b/docpad.coffee @@ -4,24 +4,24 @@ webpack = require('webpack') webpackConfig.plugins.push(new webpack.optimize.UglifyJsPlugin()) docpadConfig = { - srcPath: 'src/html' - environments: - development: - outPath: 'dev' - ignoreCustomPatterns: /build.js|build.css.scss/ - production: - outPath: 'dist' - plugins: - webpack: webpackConfig - nodesass: - outputStyle: 'compressed' - collections: - pages: -> - @getCollection("html").findAllLive({isPage:true}).on "add", (model) -> - model.setMetaDefaults({layout:"default"}) - posts: -> - @getCollection("html").findAllLive({relativeOutDirPath: 'posts'}).on "add", (model) -> - model.setMetaDefaults({layout:"default"}) + srcPath: 'src/html' + environments: + development: + outPath: 'dev' + ignoreCustomPatterns: /build.js|build.css.scss/ + production: + outPath: 'dist' + plugins: + webpack: webpackConfig + nodesass: + outputStyle: 'compressed' + collections: + pages: -> + @getCollection("html").findAllLive({isPage:true}).on "add", (model) -> + model.setMetaDefaults({layout:"default"}) + posts: -> + @getCollection("html").findAllLive({relativeOutDirPath: 'posts'}).on "add", (model) -> + model.setMetaDefaults({layout:"default"}) } -module.exports = docpadConfig \ No newline at end of file +module.exports = docpadConfig diff --git a/src/api.json b/src/api.json index e30ec0e..f558f87 100644 --- a/src/api.json +++ b/src/api.json @@ -1,26 +1,26 @@ [ - { - "name": "Modernizr.addTest" - }, - { - "name": "Modernizr.prefixed()" - }, - { - "name": "Modernizr.testStyles()" - }, - { - "name": "Modernizr.testProp()" - }, - { - "name": "Modernizr.testAllProps()" - }, - { - "name": "Modernizr.hasEvent()" - }, - { - "name": "Modernizr._prefixes" - }, - { - "name": "Modernizr._domPrefixes" - } -] \ No newline at end of file + { + "name": "Modernizr.addTest" + }, + { + "name": "Modernizr.prefixed()" + }, + { + "name": "Modernizr.testStyles()" + }, + { + "name": "Modernizr.testProp()" + }, + { + "name": "Modernizr.testAllProps()" + }, + { + "name": "Modernizr.hasEvent()" + }, + { + "name": "Modernizr._prefixes" + }, + { + "name": "Modernizr._domPrefixes" + } +] diff --git a/src/css/_old/_color.scss b/src/css/_old/_color.scss index 3dd11a4..9eab619 100644 --- a/src/css/_old/_color.scss +++ b/src/css/_old/_color.scss @@ -1,38 +1,38 @@ // TODO - browser support for non-RGBa, i.e. create stacks of pseudo-translucent colors .c_light { - background: #f7f7f7; - color: #272727; - a { color: inherit; } + background: #f7f7f7; + color: #272727; + a { color: inherit; } } .c_stark { - background: #FFF; + background: #FFF; } .c_base { - background: #272727; - color: rgba(255,255,255,0.5); - a { - color: rgba(255,255,255,1); - } + background: #272727; + color: rgba(255,255,255,0.5); + a { + color: rgba(255,255,255,1); + } } .c_linkbox { - background: #fff; + background: #fff; } a.c_primary, .c_primary { - background: #db4886; - color: #f7f7f7; + background: #db4886; + color: #f7f7f7; } .c_box { - background: #eee; + background: #eee; } .c_action, a.c_action { - color: #db4886; -} \ No newline at end of file + color: #db4886; +} diff --git a/src/css/_old/_general.scss b/src/css/_old/_general.scss index 162a5b9..4a7b57a 100644 --- a/src/css/_old/_general.scss +++ b/src/css/_old/_general.scss @@ -1,19 +1,19 @@ *, input { - box-sizing: border-box; + box-sizing: border-box; } a { - text-decoration: none; + text-decoration: none; } ul { - margin: 0; - padding-left: 0; - list-style: none; + margin: 0; + padding-left: 0; + list-style: none; } dd { - margin-left: 0; + margin-left: 0; } /** @@ -41,4 +41,4 @@ dd { */ .cf { *zoom: 1; -} \ No newline at end of file +} diff --git a/src/css/_old/_layout.scss b/src/css/_old/_layout.scss index b1a890d..ff29caa 100644 --- a/src/css/_old/_layout.scss +++ b/src/css/_old/_layout.scss @@ -1,360 +1,360 @@ html, body { - overflow: hidden; - height: 100%; + overflow: hidden; + height: 100%; } .app { - width: 112rem; - margin: 0 auto; + width: 112rem; + margin: 0 auto; } .header { - @extend .cf; - padding-top: 4rem; - // margin-left: -80px; -} - - .header__logo, - .header__search, - .header__util { - // @extend .stacked; - // padding-left: 80px; - } - - .header__logo { - width: 8rem; - float: left; - - } - - .header__search { - width: 8rem * 6; - float: left; - } - - .header__util { - float: right; - // width: 80px * 5; - } + @extend .cf; + padding-top: 4rem; + // margin-left: -80px; +} + + .header__logo, + .header__search, + .header__util { + // @extend .stacked; + // padding-left: 80px; + } + + .header__logo { + width: 8rem; + float: left; + + } + + .header__search { + width: 8rem * 6; + float: left; + } + + .header__util { + float: right; + // width: 80px * 5; + } .stacked { - display: inline-block; - vertical-align: top; + display: inline-block; + vertical-align: top; } // NOTE - ensure there is no whitespace in-between columns // TODO - take care of this by removing whitespace on build .row { - margin-left: -8rem; + margin-left: -8rem; } .row__column { - @extend .stacked; - margin-left: 8rem; + @extend .stacked; + margin-left: 8rem; } .logo-nav { - height: 12rem; - line-height: 12rem; - text-indent: -9999px; - display: block; - margin-top: -4rem; - padding-top: 4rem; - background: #db4886 !important; + height: 12rem; + line-height: 12rem; + text-indent: -9999px; + display: block; + margin-top: -4rem; + padding-top: 4rem; + background: #db4886 !important; } .search { - position: relative; - border: none; - line-height: 8rem; - padding: 0 1.5em; - color: #272727; - background: #fff; - border: 1px solid #ddd; -} - - .search__label { - // padding-left: 1em; - } - - .search__input { - background: none; - border: 0; - outline: 0; - width: 100%; - line-height: 20px; - } + position: relative; + border: none; + line-height: 8rem; + padding: 0 1.5em; + color: #272727; + background: #fff; + border: 1px solid #ddd; +} + + .search__label { + // padding-left: 1em; + } + + .search__input { + background: none; + border: 0; + outline: 0; + width: 100%; + line-height: 20px; + } @-webkit-keyframes blink { - 0% { - opacity: 0; - } - 75% { - opacity: 1; - } - 100% { - opacity: 1; - } + 0% { + opacity: 0; + } + 75% { + opacity: 1; + } + 100% { + opacity: 1; + } } .util { - margin-left: -1px; - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; -} - .util__item { - @extend .stacked; - border-left: 1px solid #ddd; - &+.util__item { - border-left-color: #eee; - } - } + margin-left: -1px; + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; +} + .util__item { + @extend .stacked; + border-left: 1px solid #ddd; + &+.util__item { + border-left-color: #eee; + } + } .build-state-btn { - height: 8rem; - width: 8rem; - text-align: center; -} - .build-state-btn__char { - padding-top: 1.6rem; - display: block; - } - .build-state-btn__suffix { - padding-top: 0.4rem; - display: block; - } + height: 8rem; + width: 8rem; + text-align: center; +} + .build-state-btn__char { + padding-top: 1.6rem; + display: block; + } + .build-state-btn__suffix { + padding-top: 0.4rem; + display: block; + } .build-state-label { - line-height: 8rem; + line-height: 8rem; } .hit { - color: inherit; - display: block; + color: inherit; + display: block; } .main { - padding-top: 4rem; -} - .main__sidebar { - width: 8rem; - } - .main__results { - width: 8rem * 6; - // min-height: 1px; - // position: relative; - } - .main__detail { - width: 8rem * 5; - // min-height: 1px; - // position: relative; - } + padding-top: 4rem; +} + .main__sidebar { + width: 8rem; + } + .main__results { + width: 8rem * 6; + // min-height: 1px; + // position: relative; + } + .main__detail { + width: 8rem * 5; + // min-height: 1px; + // position: relative; + } .main__detail .detail { - // position: absolute; - // top: -10rem; - // bottom: -4rem; - + // position: absolute; + // top: -10rem; + // bottom: -4rem; + } .results-state-label { - padding-top: 3.3rem; - line-height: 1.5; - font-size: 1.1rem; + padding-top: 3.3rem; + line-height: 1.5; + font-size: 1.1rem; } .results { - position: absolute; - top: 16rem; - bottom: 0; - width: 48rem; - overflow-y: auto; + position: absolute; + top: 16rem; + bottom: 0; + width: 48rem; + overflow-y: auto; } .result { - padding: 0 2rem; - position: relative; - cursor: pointer; - line-height: 8rem; - -webkit-user-select: none; - &+.result { - border-top: 1px solid #ddd; - } + padding: 0 2rem; + position: relative; + cursor: pointer; + line-height: 8rem; + -webkit-user-select: none; + &+.result { + border-top: 1px solid #ddd; + } } .result.is-focused { - position: relative; // For .add-action - background: #eee; - border-left: 1px solid #ddd; - border-right: 1px solid #ddd; - &:before { - content: ''; - position: absolute; - top: 0; right: 0; bottom: 0; left: 0; - // border: 1px solid #db4886; // TODO - Move color - } + position: relative; // For .add-action + background: #eee; + border-left: 1px solid #ddd; + border-right: 1px solid #ddd; + &:before { + content: ''; + position: absolute; + top: 0; right: 0; bottom: 0; left: 0; + // border: 1px solid #db4886; // TODO - Move color + } } .result__name { - display: inline-block; - line-height: 8rem; - width: 80%; - // opacity: 0.5; - &:hover { - // text-decoration: underline; - opacity: 0.8; - } + display: inline-block; + line-height: 8rem; + width: 80%; + // opacity: 0.5; + &:hover { + // text-decoration: underline; + opacity: 0.8; + } } .result__add-action { - width: 20%; - position: absolute; - top: 0; - bottom: 0; right: 0; - padding-right: 2rem; - padding-left: 2rem; - font-weight: 600; - display: none; - opacity: 0.2; - // text-align: right; - &:before, - &:after { - content: ''; - background: #db4886; - position: absolute; - top: 0; bottom: 0; left: 0; - margin-top: auto; - margin-bottom: auto; - } - &:before { - width: 4px; - height: 20px; - } - &:after { - height: 4px; - width: 20px; - left: -8px; - } - &:hover { - // text-decoration: underline; - } + width: 20%; + position: absolute; + top: 0; + bottom: 0; right: 0; + padding-right: 2rem; + padding-left: 2rem; + font-weight: 600; + display: none; + opacity: 0.2; + // text-align: right; + &:before, + &:after { + content: ''; + background: #db4886; + position: absolute; + top: 0; bottom: 0; left: 0; + margin-top: auto; + margin-bottom: auto; + } + &:before { + width: 4px; + height: 20px; + } + &:after { + height: 4px; + width: 20px; + left: -8px; + } + &:hover { + // text-decoration: underline; + } } .result.is-added .result__add-action:before { - display: none; + display: none; } .result:hover .result__add-action, .result.is-focused .result__add-action { - display: block; + display: block; } .result.is-focused .result__name, .result.is-focused .result__add-action, .result .result__add-action:hover { - opacity: 1; + opacity: 1; } .result.is-added { - color: #89B100; + color: #89B100; } .results-actions { - padding-top: 4rem; - li+li { - padding-top: 1rem; - } + padding-top: 4rem; + li+li { + padding-top: 1rem; + } } .detail { - padding: 4rem; - position: relative; - h1 { - font-size: 2.4rem; - line-height: 1.2; - font-weight: 300; - margin-bottom: 0.5rem; - padding-top: 2rem; - } - h1+p { - margin-top: 0; - } - .desc { - padding-top: 1rem; - font-size: 1.2rem; - line-height: 2; - } - h2 { - font-size: 1.8rem; - line-height: 1.2; - font-weight: 300; - margin: 0; - padding-top: 2.5rem; - } - p { - line-height: 3rem; - } - dt { - float: left; - clear: both; - padding-top: 1rem; - } - dd { - float: right; - padding-top: 1rem; - } -} - .detail__close { - position: absolute; - right: 4rem; - top: 4rem; - font-size: 1.1rem; - line-height: 3.4rem; - - &:hover { - opacity: 0.8; - } - } + padding: 4rem; + position: relative; + h1 { + font-size: 2.4rem; + line-height: 1.2; + font-weight: 300; + margin-bottom: 0.5rem; + padding-top: 2rem; + } + h1+p { + margin-top: 0; + } + .desc { + padding-top: 1rem; + font-size: 1.2rem; + line-height: 2; + } + h2 { + font-size: 1.8rem; + line-height: 1.2; + font-weight: 300; + margin: 0; + padding-top: 2.5rem; + } + p { + line-height: 3rem; + } + dt { + float: left; + clear: both; + padding-top: 1rem; + } + dd { + float: right; + padding-top: 1rem; + } +} + .detail__close { + position: absolute; + right: 4rem; + top: 4rem; + font-size: 1.1rem; + line-height: 3.4rem; + + &:hover { + opacity: 0.8; + } + } .tags { - margin-left: -1px; - li { - @extend .stacked; - line-height: 1.1rem; - margin-left: 1px; - a { - display: inline-block; - padding: 0.7em; - } - } + margin-left: -1px; + li { + @extend .stacked; + line-height: 1.1rem; + margin-left: 1px; + a { + display: inline-block; + padding: 0.7em; + } + } } .detail--intro { - padding: 0; + padding: 0; } .detail--intro p { - line-height: 1.6; - padding-top: 2em; + line-height: 1.6; + padding-top: 2em; } .logo { - display: block; - height: 100%; - position: relative; - img { - position: absolute; - top: 0; right: 0; bottom: 0; left: 0; - margin: auto; - display: block; - width: 3rem; - height: 3rem * 0.44; - } + display: block; + height: 100%; + position: relative; + img { + position: absolute; + top: 0; right: 0; bottom: 0; left: 0; + margin: auto; + display: block; + width: 3rem; + height: 3rem * 0.44; + } } .current-filter { - text-transform: capitalize; -} \ No newline at end of file + text-transform: capitalize; +} diff --git a/src/css/_old/_site.scss b/src/css/_old/_site.scss index 5f4cdb8..7ce066b 100644 --- a/src/css/_old/_site.scss +++ b/src/css/_old/_site.scss @@ -1,40 +1,40 @@ html, body { - height: 100%; - overflow: visible; + height: 100%; + overflow: visible; } .container { - display: table; - height: 100%; - width: 100%; + display: table; + height: 100%; + width: 100%; } .block { - display: table-row; - height: 1px; + display: table-row; + height: 1px; } .push { - height: auto; + height: auto; } .build-state-btn { - position: relative; + position: relative; } .build-state-btn span { - position: absolute; - left: 0; right: 0; - top: 50%; - -webkit-transform: translateY(-50%); + position: absolute; + left: 0; right: 0; + top: 50%; + -webkit-transform: translateY(-50%); } .intro { - padding: 6rem 0; - h1 { - font-size: 5rem; - font-weight: 100; - letter-spacing: -0.06em; - } - p { max-width: 600px; } + padding: 6rem 0; + h1 { + font-size: 5rem; + font-weight: 100; + letter-spacing: -0.06em; + } + p { max-width: 600px; } } h1 a { - border-bottom: 1px solid; + border-bottom: 1px solid; } diff --git a/src/css/_old/_typography.scss b/src/css/_old/_typography.scss index b4c28a2..919ce1c 100644 --- a/src/css/_old/_typography.scss +++ b/src/css/_old/_typography.scss @@ -6,49 +6,49 @@ */ html { - font-size: 62.5%; - // -webkit-font-smoothing: antialiased; + font-size: 62.5%; + // -webkit-font-smoothing: antialiased; } body { - font-family: 'Open Sans', serif; - font-weight: 300; - font-size: 1.4rem; - letter-spacing: 0.05em; + font-family: 'Open Sans', serif; + font-weight: 300; + font-size: 1.4rem; + letter-spacing: 0.05em; } strong { - font-weight: 600; + font-weight: 600; } p, ul, ol { - /*font-size: 1.4rem;*/ + /*font-size: 1.4rem;*/ } .t_search-label { - font-size: 1.8rem; - line-height: 6rem; - font-style: italic; - font-weight: 300; - letter-spacing: 0.075em; + font-size: 1.8rem; + line-height: 6rem; + font-style: italic; + font-weight: 300; + letter-spacing: 0.075em; } .t_subtitle { - font-size: 1.8rem; - font-weight: 600; + font-size: 1.8rem; + font-weight: 600; } .t_action { - text-transform: uppercase; + text-transform: uppercase; } .t_action--primary { - font-weight: 600; -} + font-weight: 600; +} .t_label { - font-size: 1.1rem; + font-size: 1.1rem; } dt { - -} \ No newline at end of file + +} diff --git a/src/css/color.scss b/src/css/color.scss index f5e88ce..61ad232 100644 --- a/src/css/color.scss +++ b/src/css/color.scss @@ -1,67 +1,67 @@ a { - color: inherit; + color: inherit; } .c-base { - background: #ececec; - color: #444; - border-color: #ddd; - * { - border-color: #ddd; - } + background: #ececec; + color: #444; + border-color: #ddd; + * { + border-color: #ddd; + } } .c-reverse { - background: #32292c; - color: #f0f0f0; + background: #32292c; + color: #f0f0f0; } .c-reverseBorder { - border-color: #444 !important; + border-color: #444 !important; } .c-reverseContrast { - background: #1e1619; - color: #fff; + background: #1e1619; + color: #fff; } .c-contrast { - background: #fff; - color: #444; - border-color: #ddd; + background: #fff; + color: #444; + border-color: #ddd; } .c-selectable { - background: rgba(#fff, 0.6); - color: rgba(#444, 0.35); + background: rgba(#fff, 0.6); + color: rgba(#444, 0.35); } .c-filter { - background: #f8fafc; - color: #4a7fab; + background: #f8fafc; + color: #4a7fab; } .c-aux { - color: #aaa8a9; + color: #aaa8a9; } .c-action { - color: #e279a2; - .Icon { - background: #e279a2; - } + color: #e279a2; + .Icon { + background: #e279a2; + } } .c-btn { - background: #db4886; - color: #fff; + background: #db4886; + color: #fff; } .c-menuBar { - background: #444; + background: #444; } .c-added { - background: #85d900; - color: #fff; -} \ No newline at end of file + background: #85d900; + color: #fff; +} diff --git a/src/css/components/_action.scss b/src/css/components/_action.scss index 7d88863..85e0b62 100644 --- a/src/css/components/_action.scss +++ b/src/css/components/_action.scss @@ -1,15 +1,15 @@ .Action { - .Action-label, - .Action-icon { - display: inline-block; - vertical-align: middle; - } - .Action-icon { - padding-left: 1em; // If icon is on right, ensure it has padding for the label - &:first-child { - // Switch the padding round if the icon is on left - padding-right: 1em; - padding-left: 0; - } - } -} \ No newline at end of file + .Action-label, + .Action-icon { + display: inline-block; + vertical-align: middle; + } + .Action-icon { + padding-left: 1em; // If icon is on right, ensure it has padding for the label + &:first-child { + // Switch the padding round if the icon is on left + padding-right: 1em; + padding-left: 0; + } + } +} diff --git a/src/css/components/_bar.scss b/src/css/components/_bar.scss index 334f707..827f8ff 100644 --- a/src/css/components/_bar.scss +++ b/src/css/components/_bar.scss @@ -1,8 +1,8 @@ .Bar { - display: table; - width: 100%; - .Bar-item { - display: table-cell; - vertical-align: middle; - } -} \ No newline at end of file + display: table; + width: 100%; + .Bar-item { + display: table-cell; + vertical-align: middle; + } +} diff --git a/src/css/components/_box-set.scss b/src/css/components/_box-set.scss index 3365f60..617bf0c 100644 --- a/src/css/components/_box-set.scss +++ b/src/css/components/_box-set.scss @@ -4,7 +4,7 @@ */ .BoxSet { - &>.BoxSet-item~.BoxSet-item { - margin-top: 1px; - } -} \ No newline at end of file + &>.BoxSet-item~.BoxSet-item { + margin-top: 1px; + } +} diff --git a/src/css/components/_box.scss b/src/css/components/_box.scss index 95db88a..74c3860 100644 --- a/src/css/components/_box.scss +++ b/src/css/components/_box.scss @@ -3,16 +3,16 @@ */ .Box { - @include rem(padding, 3); - &.is-selected { - @extend .c-contrast; - } + @include rem(padding, 3); + &.is-selected { + @extend .c-contrast; + } } /** * Less padding. useful for labels, etc. */ .Box--minor { - @include rem(padding-top, 2); - @include rem(padding-bottom, 2); -} \ No newline at end of file + @include rem(padding-top, 2); + @include rem(padding-bottom, 2); +} diff --git a/src/css/components/_container.scss b/src/css/components/_container.scss index 9bbfe61..f5382e9 100644 --- a/src/css/components/_container.scss +++ b/src/css/components/_container.scss @@ -1,3 +1,3 @@ .Container { - @include rem(margin, 0, 4); -} \ No newline at end of file + @include rem(margin, 0, 4); +} diff --git a/src/css/components/_fruit-machine.scss b/src/css/components/_fruit-machine.scss index 95caf18..63fee0a 100644 --- a/src/css/components/_fruit-machine.scss +++ b/src/css/components/_fruit-machine.scss @@ -1,29 +1,29 @@ .FruitMachine { - overflow: hidden; - .FruitMachine-item { - overflow: hidden; // Why? - } - .FruitMachine-transport { - @include transform(translate3d(0, 0, 0)); - -webkit-transition: -webkit-transform 0.6s cubic-bezier(1.000, 0.000, 0.000, 1.000); - } - .ChooseDetects-link { - // TODO :: move to the right place - // text-transform: uppercase; - // font-size: 2rem; - // font-weight: 600; - padding: 0 3rem; - -webkit-transition: background-color 0.3s 0.2s ease; - display: block; - } - &.is-moved { - .FruitMachine-transport { - @include transform(translate3d(0, -100%, 0)); - } - .ChooseDetects-link { - // TODO ????? - background-color: transparent; - color: #eee; - } - } -} \ No newline at end of file + overflow: hidden; + .FruitMachine-item { + overflow: hidden; // Why? + } + .FruitMachine-transport { + @include transform(translate3d(0, 0, 0)); + -webkit-transition: -webkit-transform 0.6s cubic-bezier(1.000, 0.000, 0.000, 1.000); + } + .ChooseDetects-link { + // TODO :: move to the right place + // text-transform: uppercase; + // font-size: 2rem; + // font-weight: 600; + padding: 0 3rem; + -webkit-transition: background-color 0.3s 0.2s ease; + display: block; + } + &.is-moved { + .FruitMachine-transport { + @include transform(translate3d(0, -100%, 0)); + } + .ChooseDetects-link { + // TODO ????? + background-color: transparent; + color: #eee; + } + } +} diff --git a/src/css/components/_grid.scss b/src/css/components/_grid.scss index 50fd18e..9c6a67f 100644 --- a/src/css/components/_grid.scss +++ b/src/css/components/_grid.scss @@ -4,21 +4,21 @@ */ .Grid--withGutter { - @include rem(margin, 0, -2); - & > .Grid-cell { - @include rem(padding, 0, 2); - } + @include rem(margin, 0, -2); + & > .Grid-cell { + @include rem(padding, 0, 2); + } } .Grid--withDividers { - margin: 0 0 0 -1px; // NOTE :: compensates boxel model on the parent element (unidirectional, unlike Grid--withGutter) - &>.Grid-cell { - border-left-width: 1px; - &:first-child { - border-left-width: 0; - padding-left: 1px; // NOTE :: Keeps content-box same width, replacing border for padding - } - } + margin: 0 0 0 -1px; // NOTE :: compensates boxel model on the parent element (unidirectional, unlike Grid--withGutter) + &>.Grid-cell { + border-left-width: 1px; + &:first-child { + border-left-width: 0; + padding-left: 1px; // NOTE :: Keeps content-box same width, replacing border for padding + } + } } // TODO :: something to handle grid 'lips' diff --git a/src/css/components/_icon.scss b/src/css/components/_icon.scss index c7723a6..3d9ac7d 100644 --- a/src/css/components/_icon.scss +++ b/src/css/components/_icon.scss @@ -1,25 +1,25 @@ .Icon { - display: inline-block; - vertical-align: text-top; - @include rem(width, 1.6); - @include rem(height, 1.6); - background-size: 100% auto; + display: inline-block; + vertical-align: text-top; + @include rem(width, 1.6); + @include rem(height, 1.6); + background-size: 100% auto; } .Icon--menu { - @include rem(width, 4); - @include rem(height, 4); + @include rem(width, 4); + @include rem(height, 4); } .Icon--build { - @include rem(width, 2); - @include rem(height, 2); - @include rem(line-height, 1.5); - @include rem(border-width, 0.3); - border-radius: 999px; - .IconRing--build-inner { - border-radius: 999px; - @include rem(width, 0.8); - @include rem(height, 0.8); - } -} \ No newline at end of file + @include rem(width, 2); + @include rem(height, 2); + @include rem(line-height, 1.5); + @include rem(border-width, 0.3); + border-radius: 999px; + .IconRing--build-inner { + border-radius: 999px; + @include rem(width, 0.8); + @include rem(height, 0.8); + } +} diff --git a/src/css/components/_main-header.scss b/src/css/components/_main-header.scss index 8887340..3b201c1 100644 --- a/src/css/components/_main-header.scss +++ b/src/css/components/_main-header.scss @@ -1,38 +1,38 @@ .MainHeader { - height: 120px; - .MainHeader-mid { - display: table; - width: 100%; - height: 100%; - table-layout: fixed; - overflow: hidden; - } - .MainHeader-logo { - width: 320px; - display: table-cell; - vertical-align: middle; - // padding-left: 4rem; - } - .MainHeader-body { - width: auto; - display: table-cell; - vertical-align: top; - } - .MainHeader-row { - -webkit-transition: height 0.2s ease; - height: 100%; - &+.MainHeader-row { - height: 0; - } - } - &.is-browser-open { - .MainHeader-row { - height: 50% !important; - } - } + height: 120px; + .MainHeader-mid { + display: table; + width: 100%; + height: 100%; + table-layout: fixed; + overflow: hidden; + } + .MainHeader-logo { + width: 320px; + display: table-cell; + vertical-align: middle; + // padding-left: 4rem; + } + .MainHeader-body { + width: auto; + display: table-cell; + vertical-align: top; + } + .MainHeader-row { + -webkit-transition: height 0.2s ease; + height: 100%; + &+.MainHeader-row { + height: 0; + } + } + &.is-browser-open { + .MainHeader-row { + height: 50% !important; + } + } } .MainHeader-countList { - border-left-width: 1px; - @include rem(padding, 0, 3); + border-left-width: 1px; + @include rem(padding, 0, 3); } diff --git a/src/css/components/_main-nav.scss b/src/css/components/_main-nav.scss index e16db40..d78500e 100644 --- a/src/css/components/_main-nav.scss +++ b/src/css/components/_main-nav.scss @@ -1,142 +1,142 @@ .MainNav { - display: table; - table-layout: fixed; - width: 100%; - .MainNav-item { - display: table-cell; - vertical-align: middle; - width: auto; - font-size: 1.6em; - text-transform: uppercase; - border-left: 1px solid rgba(#ccc, 1); - } + display: table; + table-layout: fixed; + width: 100%; + .MainNav-item { + display: table-cell; + vertical-align: middle; + width: auto; + font-size: 1.6em; + text-transform: uppercase; + border-left: 1px solid rgba(#ccc, 1); + } } .NavItem { - display: table; - width: 100%; - height: 100%; - -webkit-transition: background-color 0.1s ease; - background: #fff; - .NavItem-inner { - display: table-cell; - vertical-align: middle; - text-align: center; - width: 100%; - } - &:hover, - &.is-current { - background: #f0f0f0; - } + display: table; + width: 100%; + height: 100%; + -webkit-transition: background-color 0.1s ease; + background: #fff; + .NavItem-inner { + display: table-cell; + vertical-align: middle; + text-align: center; + width: 100%; + } + &:hover, + &.is-current { + background: #f0f0f0; + } } .BrowserHeader { - display: table; - width: 100%; - height: 100%; - table-layout: fixed; - .BrowserHeader-input { - display: block; - box-sizing: border-box; - height: 100%; - font-size: 1.8rem; - padding: 0 1.5rem; - background: #272727; - color: #fff; - width: 100%; - border: 0; - &:focus { - outline: 0; - } - } - .BrowserHeader-col { - display: table-cell; - vertical-align: middle; - width: auto; - height: 100%; - } + display: table; + width: 100%; + height: 100%; + table-layout: fixed; + .BrowserHeader-input { + display: block; + box-sizing: border-box; + height: 100%; + font-size: 1.8rem; + padding: 0 1.5rem; + background: #272727; + color: #fff; + width: 100%; + border: 0; + &:focus { + outline: 0; + } + } + .BrowserHeader-col { + display: table-cell; + vertical-align: middle; + width: auto; + height: 100%; + } } // .MainNav { -// white-space: nowrap; -// position: relative; -// z-index: 1; -// margin-right: -40px; -// .MainNav-mid { -// position: absolute; -// left: 0; -// top: 0; -// right: 0; -// overflow: hidden; -// } -// .MainNav-inner { -// display: inline-block; -// vertical-align: top; -// position: relative; -// -webkit-transition: -webkit-transform 0.6s 0.6s cubic-bezier(1.000, 0.000, 0.000, 1.000);; -// -webkit-transform: translate3d(0, 0, 0); -// } -// .MainNav-list { -// left: 0; -// background: #fff; -// position: absolute; -// top: 0; -// } -// .MainNav-icon { -// position: relative; -// z-index: 1; -// } +// white-space: nowrap; +// position: relative; +// z-index: 1; +// margin-right: -40px; +// .MainNav-mid { +// position: absolute; +// left: 0; +// top: 0; +// right: 0; +// overflow: hidden; +// } +// .MainNav-inner { +// display: inline-block; +// vertical-align: top; +// position: relative; +// -webkit-transition: -webkit-transform 0.6s 0.6s cubic-bezier(1.000, 0.000, 0.000, 1.000);; +// -webkit-transform: translate3d(0, 0, 0); +// } +// .MainNav-list { +// left: 0; +// background: #fff; +// position: absolute; +// top: 0; +// } +// .MainNav-icon { +// position: relative; +// z-index: 1; +// } // } // .NavList { -// .NavList-item { -// width: 25%; -// position: relative; -// display: inline-block; -// vertical-align: top; -// } +// .NavList-item { +// width: 25%; +// position: relative; +// display: inline-block; +// vertical-align: top; +// } -// .NavList-link { -// @include rem(line-height, 13rem); -// -webkit-transform: translate3d(0, -13rem, 0); -// -webkit-transition: -webkit-transform 0.6s 0s cubic-bezier(1.000, 0.000, 0.000, 1.000), background-color 0.2s ease, border-color 1s ease; -// .MainNav.is-active & { -// -webkit-transform: translate3d(0, 0, 0); -// } -// .u-vc { -// width: 100%; -// } -// &:hover { -// background: #f7f7f7; -// .NavList-underline { -// border-bottom-width: 1px; -// } -// } -// } -// .NavList-item+.NavList-item .NavList-link { - -// // TODO :: move to to color.scss -// .MainNav.is-active & { -// border-left-width: 1px; -// } -// } -// .NavList-item>.NavList-link { -webkit-transition-delay: 0.4s, 0; .MainNav.is-active & { -webkit-transition-delay: 0.8s, 0; } } -// .NavList-item:nth-child(2)>.NavList-link { -webkit-transition-delay: 0.3s, 0; .MainNav.is-active & { -webkit-transition-delay: 0.9s, 0; } } -// .NavList-item:nth-child(3)>.NavList-link { -webkit-transition-delay: 0.2s, 0; .MainNav.is-active & { -webkit-transition-delay: 1s, 0; } } -// .NavList-item:nth-child(4)>.NavList-link { -webkit-transition-delay: 0.1s, 0; .MainNav.is-active & { -webkit-transition-delay: 1.1s, 0; } } - +// .NavList-link { +// @include rem(line-height, 13rem); +// -webkit-transform: translate3d(0, -13rem, 0); +// -webkit-transition: -webkit-transform 0.6s 0s cubic-bezier(1.000, 0.000, 0.000, 1.000), background-color 0.2s ease, border-color 1s ease; +// .MainNav.is-active & { +// -webkit-transform: translate3d(0, 0, 0); +// } +// .u-vc { +// width: 100%; +// } +// &:hover { +// background: #f7f7f7; +// .NavList-underline { +// border-bottom-width: 1px; +// } +// } +// } +// .NavList-item+.NavList-item .NavList-link { + +// // TODO :: move to to color.scss +// .MainNav.is-active & { +// border-left-width: 1px; +// } +// } +// .NavList-item>.NavList-link { -webkit-transition-delay: 0.4s, 0; .MainNav.is-active & { -webkit-transition-delay: 0.8s, 0; } } +// .NavList-item:nth-child(2)>.NavList-link { -webkit-transition-delay: 0.3s, 0; .MainNav.is-active & { -webkit-transition-delay: 0.9s, 0; } } +// .NavList-item:nth-child(3)>.NavList-link { -webkit-transition-delay: 0.2s, 0; .MainNav.is-active & { -webkit-transition-delay: 1s, 0; } } +// .NavList-item:nth-child(4)>.NavList-link { -webkit-transition-delay: 0.1s, 0; .MainNav.is-active & { -webkit-transition-delay: 1.1s, 0; } } + -// // .NavList-link:hover .NavList-underline { -// // // TODO :: move to color.scss -// // border-bottom-color: #999; - -// // } +// // .NavList-link:hover .NavList-underline { +// // // TODO :: move to color.scss +// // border-bottom-color: #999; + +// // } // } // .MainNav { -// &.is-animation-disabled { -// &, * { -// -webkit-transition: none; -// } -// } +// &.is-animation-disabled { +// &, * { +// -webkit-transition: none; +// } +// } // } diff --git a/src/css/components/_menu-icon.scss b/src/css/components/_menu-icon.scss index 4ab085d..5238c9a 100644 --- a/src/css/components/_menu-icon.scss +++ b/src/css/components/_menu-icon.scss @@ -1,27 +1,27 @@ .MenuIcon { - width: 40px; - height: 18px; + width: 40px; + height: 18px; } .MenuIcon-bar { - height: 2px; - width: 100%; - position: relative; - -webkit-transform: translate3d(0, 0, 0); - -webkit-transition: -webkit-transform 0.2s ease-out; - &+.MenuIcon-bar { - margin-top: 6px; - } + height: 2px; + width: 100%; + position: relative; + -webkit-transform: translate3d(0, 0, 0); + -webkit-transition: -webkit-transform 0.2s ease-out; + &+.MenuIcon-bar { + margin-top: 6px; + } } .MainNav.is-active { - .MenuIcon-bar { - &:first-child { - -webkit-transform: translate3d(0, 8px, 0); - } - &:last-child { - -webkit-transform: translate3d(0, -8px, 0); - } - } + .MenuIcon-bar { + &:first-child { + -webkit-transform: translate3d(0, 8px, 0); + } + &:last-child { + -webkit-transform: translate3d(0, -8px, 0); + } + } } diff --git a/src/css/components/_overlay.scss b/src/css/components/_overlay.scss index 07d01f8..94d09b2 100644 --- a/src/css/components/_overlay.scss +++ b/src/css/components/_overlay.scss @@ -1,27 +1,27 @@ .Overlay { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - background: rgba(#32292c, 0.8); - color: #f0f0f0; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + background: rgba(#32292c, 0.8); + color: #f0f0f0; } - .Overlay-inner { - overflow-y: auto; - height: 100%; - } + .Overlay-inner { + overflow-y: auto; + height: 100%; + } - .Overlay-content { - width: 600px; - margin-left: auto; - margin-right: auto; - display: table; - height: 100%; - } + .Overlay-content { + width: 600px; + margin-left: auto; + margin-right: auto; + display: table; + height: 100%; + } - .Overlay-contentInner { - display: table-cell; - vertical-align: middle; - } \ No newline at end of file + .Overlay-contentInner { + display: table-cell; + vertical-align: middle; + } diff --git a/src/css/components/_ring.scss b/src/css/components/_ring.scss index cf09d3b..ab5e846 100644 --- a/src/css/components/_ring.scss +++ b/src/css/components/_ring.scss @@ -5,63 +5,63 @@ $easeInOutExpo: cubic-bezier(1.000, 0.000, 0.000, 1.000); .Ring { - border-width: 0.2em; - border-radius: 999px; - display: inline-block; - width: 2em; - height: 2em; - font-size: 1em; - overflow: hidden; - line-height: 1.6em; - text-align: center; + border-width: 0.2em; + border-radius: 999px; + display: inline-block; + width: 2em; + height: 2em; + font-size: 1em; + overflow: hidden; + line-height: 1.6em; + text-align: center; } .Ring-inner { - height: 100%; - line-height: 1.6em; - -webkit-transform: translate3d(0,0,0); - -webkit-transition: -webkit-transform 0.4s $easeInOutExpo; + height: 100%; + line-height: 1.6em; + -webkit-transform: translate3d(0,0,0); + -webkit-transition: -webkit-transform 0.4s $easeInOutExpo; } .Ring.is-moved { - .Ring-inner { - -webkit-transform: translate3d(0,-1.6em,0); - } + .Ring-inner { + -webkit-transform: translate3d(0,-1.6em,0); + } } .Ring--small { - font-size: 1.4em; - cursor: pointer; - border-color: rgba(#db4886, 0.3) !important; - img { - width: 1em; - height: 1em; - } - &:hover { - border-color: rgba(#db4886, 1) !important; - } - .Ring-inner { + font-size: 1.4em; + cursor: pointer; + border-color: rgba(#db4886, 0.3) !important; + img { + width: 1em; + height: 1em; + } + &:hover { + border-color: rgba(#db4886, 1) !important; + } + .Ring-inner { - } - &.is-moved .Ring-inner { - -webkit-transform: translate3d(0,-1.7em,0); - } + } + &.is-moved .Ring-inner { + -webkit-transform: translate3d(0,-1.7em,0); + } } .Ring--close { - border-color: rgba(#444, 0.3) !important; - &:hover { - border-color: #444 !important; - } + border-color: rgba(#444, 0.3) !important; + &:hover { + border-color: #444 !important; + } } .Ring--selection { - -webkit-transition: border-color 0.4s ease; - cursor: pointer; - &:hover { - border-color: rgba(#fff, 0.5) !important; - } - &.is-active { - border-color: rgba(#fff, 1) !important; - } -} \ No newline at end of file + -webkit-transition: border-color 0.4s ease; + cursor: pointer; + &:hover { + border-color: rgba(#fff, 0.5) !important; + } + &.is-active { + border-color: rgba(#fff, 1) !important; + } +} diff --git a/src/css/components/_search-bar.scss b/src/css/components/_search-bar.scss index 6f97d3b..998c021 100644 --- a/src/css/components/_search-bar.scss +++ b/src/css/components/_search-bar.scss @@ -1,12 +1,12 @@ .SearchBar { - background: transparent; - @include rem(line-height, 7); - @include rem(height, 7); - @include rem(padding, 0, 3); - width: 100%; // TODO :: is this needed + background: transparent; + @include rem(line-height, 7); + @include rem(height, 7); + @include rem(padding, 0, 3); + width: 100%; // TODO :: is this needed } input.SearchBar { - border: 0; // Remove default input border - outline: 0; // Prevent outline on focus + border: 0; // Remove default input border + outline: 0; // Prevent outline on focus } diff --git a/src/css/layout.scss b/src/css/layout.scss index 655883b..de55f68 100644 --- a/src/css/layout.scss +++ b/src/css/layout.scss @@ -1,8 +1,8 @@ * { - box-sizing: border-box; - border: 0px solid; // NOTE :: Define borders using 'border-width' in components, and keep border-color in color.scss + box-sizing: border-box; + border: 0px solid; // NOTE :: Define borders using 'border-width' in components, and keep border-color in color.scss } html, body, #app-container, .App { - height: 100%; -} \ No newline at end of file + height: 100%; +} diff --git a/src/css/main.scss b/src/css/main.scss index 9f0b436..e3c8041 100644 --- a/src/css/main.scss +++ b/src/css/main.scss @@ -29,196 +29,196 @@ $easeInOutExpo: cubic-bezier(1.000, 0.000, 0.000, 1.000); .OpenSide { - .OpenSide-item { - -webkit-transition: width 0.6s 0s $easeInOutExpo; - .FruitMachine--forOpenSide.is-moved & { - -webkit-transition-delay: 0.6s; - } - } + .OpenSide-item { + -webkit-transition: width 0.6s 0s $easeInOutExpo; + .FruitMachine--forOpenSide.is-moved & { + -webkit-transition-delay: 0.6s; + } + } } .FruitMachine--forOpenSide { - .FruitMachine-transport { - -webkit-transition-delay: 0.6s; - } - &.is-moved { - .FruitMachine-transport { - -webkit-transition-delay: 0s; - } - } + .FruitMachine-transport { + -webkit-transition-delay: 0.6s; + } + &.is-moved { + .FruitMachine-transport { + -webkit-transition-delay: 0s; + } + } } .TypeList { - .TypeList-item+.TypeList-item { - padding-top: 0.6em; - } - .TypeList-item>a { - display: block; - &:hover { - opacity: 0.5; - } - } - .TypeList-count { - float: right; - } + .TypeList-item+.TypeList-item { + padding-top: 0.6em; + } + .TypeList-item>a { + display: block; + &:hover { + opacity: 0.5; + } + } + .TypeList-count { + float: right; + } } .Btn { - @include rem(line-height, 13); + @include rem(line-height, 13); } .App-main { - @include rem(padding-top, 4); + @include rem(padding-top, 4); } .NoItemsMessage { - @include rem(padding, 0, 6); + @include rem(padding, 0, 6); } .Result { - -webkit-transition: outline-width 0.2s ease; - outline: 0 solid #fff; - cursor: pointer; - color: #999; - &:hover { - color: #444; - } - &.is-selected { - position: relative; - z-index: 1; - outline-width: 10px; - } + -webkit-transition: outline-width 0.2s ease; + outline: 0 solid #fff; + cursor: pointer; + color: #999; + &:hover { + color: #444; + } + &.is-selected { + position: relative; + z-index: 1; + outline-width: 10px; + } } .Result-icon { - position: absolute; - right: 2em; - top: 0; - bottom: 0; - width: 3em; - height: 3em; - line-height: (3em - 0.4em); - margin: auto; - -webkit-transition: background 0.4s ease, border-color 0.4s ease; - .Result.is-selected &, - &:hover { - border-color: #444; - .Ring-inner>img { - opacity: 1; - } - } - .Result.is-added & { - border-color: #85d900; - -webkit-transition-delay: 0.2s, 0.2s; - .Ring-inner>img { - opacity: 1; - } - } - .Ring-inner { - line-height: (3em - 0.4em); - img { - width: 1.5em; - height: 1.5em; - opacity: 0.5; - } - } - &.is-moved { - .Ring-inner { - -webkit-transform: translate3d(0, 0 - (3em - 0.4em),0); - } - } + position: absolute; + right: 2em; + top: 0; + bottom: 0; + width: 3em; + height: 3em; + line-height: (3em - 0.4em); + margin: auto; + -webkit-transition: background 0.4s ease, border-color 0.4s ease; + .Result.is-selected &, + &:hover { + border-color: #444; + .Ring-inner>img { + opacity: 1; + } + } + .Result.is-added & { + border-color: #85d900; + -webkit-transition-delay: 0.2s, 0.2s; + .Ring-inner>img { + opacity: 1; + } + } + .Ring-inner { + line-height: (3em - 0.4em); + img { + width: 1.5em; + height: 1.5em; + opacity: 0.5; + } + } + &.is-moved { + .Ring-inner { + -webkit-transform: translate3d(0, 0 - (3em - 0.4em),0); + } + } } .CombinationMark { - text-align: center; - display: block; // For - .CombinationMark-logo { - display: inline-block; - width: 4em; - } - .CombinationMark-text { - color: #db4886; // TODO :: color - padding-left: 0.5em; - font-size: 2.2em; - } + text-align: center; + display: block; // For + .CombinationMark-logo { + display: inline-block; + width: 4em; + } + .CombinationMark-text { + color: #db4886; // TODO :: color + padding-left: 0.5em; + font-size: 2.2em; + } } .HomePage { - li+li { - padding-top: 1.6rem; - } + li+li { + padding-top: 1.6rem; + } } .HomePage-hero { - @include rem(padding, 5, 0); + @include rem(padding, 5, 0); } .HomePage-heading { - font-size: 10rem; letter-spacing: -0.03em; line-height: 1.1 + font-size: 10rem; letter-spacing: -0.03em; line-height: 1.1 } .HomePage-content { - max-width: 70rem; padding-top: 2em + max-width: 70rem; padding-top: 2em } .HomePage-subHeading { - line-height: 1.5; + line-height: 1.5; } .HomePage-cta { - background-color: #db4886; color: #fff; padding: 0.8em 1em; - -webkit-transition: opacity 0.3s ease; - &:hover { - opacity: 0.5; - } + background-color: #db4886; color: #fff; padding: 0.8em 1em; + -webkit-transition: opacity 0.3s ease; + &:hover { + opacity: 0.5; + } } .HomePage-secondaryCta { - margin-left: 1em; - padding: 0.8em 1em; - &>span { - border-bottom: 1px solid #ccc; - } + margin-left: 1em; + padding: 0.8em 1em; + &>span { + border-bottom: 1px solid #ccc; + } } .pageswitch-enter, .pageswitch-leave { - position: absolute; - top: 17rem; right: 4rem; bottom: 0; left: 4rem; - .ResultList { - top: 0 !important; - } + position: absolute; + top: 17rem; right: 4rem; bottom: 0; left: 4rem; + .ResultList { + top: 0 !important; + } } .MainNav-icon, .Btn { - cursor: pointer; + cursor: pointer; } .ResultsList { - -webkit-transition: all 0.2s ease; - position: absolute; - top: 17rem; - bottom: 0; - width: 51.12%; - overflow-y: auto; - margin-left: -4rem; - margin-right: -4rem; - padding-left: 4rem; - padding-right: 4rem; - margin-top: -4rem; - padding-top: 4rem; + -webkit-transition: all 0.2s ease; + position: absolute; + top: 17rem; + bottom: 0; + width: 51.12%; + overflow-y: auto; + margin-left: -4rem; + margin-right: -4rem; + padding-left: 4rem; + padding-right: 4rem; + margin-top: -4rem; + padding-top: 4rem; } .pageswitch-enter { opacity: 0.01; - -webkit-transform: translate3d(0,100px,0); + -webkit-transform: translate3d(0,100px,0); transition: opacity 0.6s 0.2s $easeInOutExpo, -webkit-transform 0.6s 0.2s $easeInOutExpo; } .pageswitch-leave { - opacity: 1; - -webkit-transform: translate3d(0,0,0); - transition: opacity 0.6s $easeInOutExpo, -webkit-transform 0.6s $easeInOutExpo; + opacity: 1; + -webkit-transform: translate3d(0,0,0); + transition: opacity 0.6s $easeInOutExpo, -webkit-transform 0.6s $easeInOutExpo; } .pageswitch-enter.pageswitch-enter-active { @@ -227,6 +227,6 @@ $easeInOutExpo: cubic-bezier(1.000, 0.000, 0.000, 1.000); } .pageswitch-leave.pageswitch-leave-active { - opacity: 0.01; - -webkit-transform: translate3d(0,100px,0); + opacity: 0.01; + -webkit-transform: translate3d(0,100px,0); } diff --git a/src/css/mixins/rem.scss b/src/css/mixins/rem.scss index 20133ec..ea49d53 100644 --- a/src/css/mixins/rem.scss +++ b/src/css/mixins/rem.scss @@ -4,32 +4,32 @@ @function strip-unit($num) { - @return $num / ($num * 0 + 1); + @return $num / ($num * 0 + 1); } @mixin rem($property, $values...) { - $max: length($values); - $pxValues: ''; - $remValues: ''; - - @for $i from 1 through $max { - $value: strip-unit(nth($values, $i)); - $pxValues: #{$pxValues + $value*10}px; - - @if $i < $max { - $pxValues: #{$pxValues + " "}; - } - } - - @for $i from 1 through $max { - $value: strip-unit(nth($values, $i)); - $remValues: #{$remValues + $value}rem; - - @if $i < $max { - $remValues: #{$remValues + " "}; - } - } - - #{$property}: $pxValues; - #{$property}: $remValues; -} \ No newline at end of file + $max: length($values); + $pxValues: ''; + $remValues: ''; + + @for $i from 1 through $max { + $value: strip-unit(nth($values, $i)); + $pxValues: #{$pxValues + $value*10}px; + + @if $i < $max { + $pxValues: #{$pxValues + " "}; + } + } + + @for $i from 1 through $max { + $value: strip-unit(nth($values, $i)); + $remValues: #{$remValues + $value}rem; + + @if $i < $max { + $remValues: #{$remValues + " "}; + } + } + + #{$property}: $pxValues; + #{$property}: $remValues; +} diff --git a/src/css/type.scss b/src/css/type.scss index 5151844..fe49ea8 100644 --- a/src/css/type.scss +++ b/src/css/type.scss @@ -1,66 +1,66 @@ html { - font-size: 62.5%; - -webkit-font-smoothing: antialiased; + font-size: 62.5%; + -webkit-font-smoothing: antialiased; } input { - -webkit-font-smoothing: antialiased; + -webkit-font-smoothing: antialiased; } body { - font-family: 'Source Sans Pro', sans-serif; + font-family: 'Source Sans Pro', sans-serif; } strong { - font-weight: 600; + font-weight: 600; } a { - text-decoration: none; + text-decoration: none; } .t-heading { - @include rem(font-size, 2.8); + @include rem(font-size, 2.8); } .t-label { - @include rem(font-size, 1.8); + @include rem(font-size, 1.8); } .t-body { - @include rem(font-size, 1.6); + @include rem(font-size, 1.6); } .t-action, .t-primaryAction { - text-transform: uppercase; - letter-spacing: 0.05em; + text-transform: uppercase; + letter-spacing: 0.05em; } // .t-action { -// @include rem(font-size, 1.2); -// -webkit-font-smoothing: subpixel-antialiased; +// @include rem(font-size, 1.2); +// -webkit-font-smoothing: subpixel-antialiased; // } .t-primaryAction { - @include rem(font-size, 2); + @include rem(font-size, 2); } .t-digits { - font-family: sans-serif; + font-family: sans-serif; } .t-instruction { - font-style: italic; - letter-spacing: 0.05em; + font-style: italic; + letter-spacing: 0.05em; } .t-content { - overflow: hidden; - p { - @extend .t-body; - color: #666; - padding-top: 1em; - line-height: 1.5; - } -} \ No newline at end of file + overflow: hidden; + p { + @extend .t-body; + color: #666; + padding-top: 1em; + line-height: 1.5; + } +} diff --git a/src/css/utilities/_alignment.scss b/src/css/utilities/_alignment.scss index 13851a4..b0cf88a 100644 --- a/src/css/utilities/_alignment.scss +++ b/src/css/utilities/_alignment.scss @@ -1,16 +1,16 @@ .u-fullHeight { - height: 100%; + height: 100%; } .u-vcContainer { - display: table; - width: 100%; - height: 100%; + display: table; + width: 100%; + height: 100%; } .u-vc { - display: table-cell; - vertical-align: middle; + display: table-cell; + vertical-align: middle; } /** @@ -19,19 +19,19 @@ */ .u-removeWhitespace { - font-size: 0; - // Reset for immediately for every child element - &>* { - font-size: 1rem; - } + font-size: 0; + // Reset for immediately for every child element + &>* { + font-size: 1rem; + } } .u-contain { - position: relative; + position: relative; } .u-stretch { - position: absolute; - top: 0; right: 0; bottom: 0; left: 0; - margin: auto; -} \ No newline at end of file + position: absolute; + top: 0; right: 0; bottom: 0; left: 0; + margin: auto; +} diff --git a/src/css/utilities/_animate.scss b/src/css/utilities/_animate.scss index fe3b677..2ebb1f1 100644 --- a/src/css/utilities/_animate.scss +++ b/src/css/utilities/_animate.scss @@ -2,9 +2,9 @@ $easeInOutExpo: cubic-bezier(1.000, 0.000, 0.000, 1.000); $rhythm: 0.6s; .u-animateWidth { - -webkit-transition: width $rhythm $easeInOutExpo; + -webkit-transition: width $rhythm $easeInOutExpo; } .u-delay1 { - -webkit-transition-delay: $rhythm; -} \ No newline at end of file + -webkit-transition-delay: $rhythm; +} diff --git a/src/css/utilities/_misc.scss b/src/css/utilities/_misc.scss index 738a8c0..2d429d3 100644 --- a/src/css/utilities/_misc.scss +++ b/src/css/utilities/_misc.scss @@ -1,31 +1,31 @@ .u-mask { - overflow: hidden; + overflow: hidden; } .u-hit { - color: inherit; - display: block; - text-decoration: none; + color: inherit; + display: block; + text-decoration: none; } .u-hideText { - text-indent: 100%; - white-space: nowrap; - overflow: hidden; + text-indent: 100%; + white-space: nowrap; + overflow: hidden; } .u-gutterLipLeft { - @include rem(margin-left, -4); + @include rem(margin-left, -4); } .u-gutterLipRight { - @include rem(margin-right, -4); + @include rem(margin-right, -4); } .u-gutterPadLeft { - @include rem(padding-left, 4); + @include rem(padding-left, 4); } .u-gutterPadRight { - @include rem(padding-right, 4); -} \ No newline at end of file + @include rem(padding-right, 4); +} diff --git a/src/css/utilities/_size.scss b/src/css/utilities/_size.scss index 1a30cff..cead4c4 100644 --- a/src/css/utilities/_size.scss +++ b/src/css/utilities/_size.scss @@ -4,13 +4,13 @@ */ .u-size4of14 { - width: 28.57% !important; + width: 28.57% !important; } .u-size10of14 { - width: 71.42% !important; + width: 71.42% !important; } .u-size0 { - width: 0 !important; -} \ No newline at end of file + width: 0 !important; +} diff --git a/src/extras.json b/src/extras.json index 1d8c9e0..adb1b6e 100644 --- a/src/extras.json +++ b/src/extras.json @@ -1,20 +1,20 @@ [ - { - "name": "html5shiv", - "default": true - }, - { - "name": "html5shiv w/ printshiv" - }, - { - "name": "Modernizr.load (YepNope.js)", - "default": true - }, - { - "name": "Media Queries" - }, - { - "name": "Add CSS Classes", - "default": true - } -] \ No newline at end of file + { + "name": "html5shiv", + "default": true + }, + { + "name": "html5shiv w/ printshiv" + }, + { + "name": "Modernizr.load (YepNope.js)", + "default": true + }, + { + "name": "Media Queries" + }, + { + "name": "Add CSS Classes", + "default": true + } +] diff --git a/src/html/documents/build.css.scss b/src/html/documents/build.css.scss index f57bce0..62890ba 100644 --- a/src/html/documents/build.css.scss +++ b/src/html/documents/build.css.scss @@ -1 +1 @@ -@import "../../css/main.scss"; \ No newline at end of file +@import "../../css/main.scss"; diff --git a/src/html/documents/build.js b/src/html/documents/build.js index f2b3347..4fa5e96 100644 --- a/src/html/documents/build.js +++ b/src/html/documents/build.js @@ -1,4 +1,4 @@ --- webpack: true --- -require('../src/js/main.js'); \ No newline at end of file +require('../src/js/main.js'); diff --git a/src/html/documents/index.html.eco b/src/html/documents/index.html.eco index c6cd082..acef917 100644 --- a/src/html/documents/index.html.eco +++ b/src/html/documents/index.html.eco @@ -4,5 +4,5 @@ isPage: true ---
- <%- @react("../js/components/App.jsx") if 'production' in @getEnvironments() %> -
\ No newline at end of file + <%- @react("../js/components/App.jsx") if 'production' in @getEnvironments() %> + diff --git a/src/html/documents/news.html.eco b/src/html/documents/news.html.eco index 9439a92..4cdb5cd 100644 --- a/src/html/documents/news.html.eco +++ b/src/html/documents/news.html.eco @@ -11,4 +11,4 @@ isPage: true
<% end %> - \ No newline at end of file + diff --git a/src/html/documents/posts/new-something.html.eco b/src/html/documents/posts/new-something.html.eco index a581d94..cb0450a 100644 --- a/src/html/documents/posts/new-something.html.eco +++ b/src/html/documents/posts/new-something.html.eco @@ -3,4 +3,4 @@ title: 'Test Post' layout: "default" --- -

Aenean lacinia bibendum nulla sed consectetur. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Etiam porta sem malesuada magna mollis euismod.

\ No newline at end of file +

Aenean lacinia bibendum nulla sed consectetur. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Etiam porta sem malesuada magna mollis euismod.

diff --git a/src/html/layouts/default.html.eco b/src/html/layouts/default.html.eco index 23202db..6f01651 100644 --- a/src/html/layouts/default.html.eco +++ b/src/html/layouts/default.html.eco @@ -1,21 +1,21 @@ - - <%= @document.title %> - <% if 'production' in @getEnvironments(): %> - <%- @getBlock('styles').add([@asset('/build.css')]).toHTML() %> - <% else: %> - <%- @getBlock('styles').add(['/main.css']).toHTML() %> - <% end %> - + + <%= @document.title %> + <% if 'production' in @getEnvironments(): %> + <%- @getBlock('styles').add([@asset('/build.css')]).toHTML() %> + <% else: %> + <%- @getBlock('styles').add(['/main.css']).toHTML() %> + <% end %> + - <%- @content %> - <% if 'production' in @getEnvironments(): %> - <%- @getBlock("scripts").add([@asset('/build.js')]).toHTML() %> - <% else: %> - <%- @getBlock('scripts').add(['/main.js']).toHTML() %> - <% end %> + <%- @content %> + <% if 'production' in @getEnvironments(): %> + <%- @getBlock("scripts").add([@asset('/build.js')]).toHTML() %> + <% else: %> + <%- @getBlock('scripts').add(['/main.js']).toHTML() %> + <% end %> - \ No newline at end of file + diff --git a/src/js/actions/MetadataActions.js b/src/js/actions/MetadataActions.js index aa661dc..c22b3d4 100644 --- a/src/js/actions/MetadataActions.js +++ b/src/js/actions/MetadataActions.js @@ -1,11 +1,11 @@ var AppDispatcher = require('../dispatcher/AppDispatcher'); var MetadataActions = { - fetch: function() { - AppDispatcher.handleViewAction({ - actionType: 'METADATA_FETCH' - }); - } + fetch: function() { + AppDispatcher.handleViewAction({ + actionType: 'METADATA_FETCH' + }); + } }; -module.exports = MetadataActions; \ No newline at end of file +module.exports = MetadataActions; diff --git a/src/js/actions/ResultActions.js b/src/js/actions/ResultActions.js index 7baefb2..d5e1836 100644 --- a/src/js/actions/ResultActions.js +++ b/src/js/actions/ResultActions.js @@ -1,50 +1,50 @@ var AppDispatcher = require('../dispatcher/AppDispatcher'); var ResultActions = { - search: function(text) { - AppDispatcher.handleViewAction({ - actionType: 'RESULT_SEARCH', - text: text - }); - }, - focus: function(cid) { - AppDispatcher.handleViewAction({ - actionType: 'RESULT_FOCUS', - cid: cid - }); - }, - blur: function() { - AppDispatcher.handleViewAction({ - actionType: 'RESULT_BLUR' - }); - }, - up: function() { - AppDispatcher.handleViewAction({ - actionType: 'RESULT_UP' - }); - }, - down: function() { - AppDispatcher.handleViewAction({ - actionType: 'RESULT_DOWN' - }); - }, - filterByTag: function(cid) { - AppDispatcher.handleViewAction({ - actionType: 'RESULT_FILTER_BY_TAG', - cid: cid - }); - }, - filterByType: function(type, typeName) { - AppDispatcher.handleViewAction({ - actionType: 'RESULT_FILTER_BY_TYPE', - type: type - }); - }, - showSelectionOnly: function() { - AppDispatcher.handleViewAction({ - actionType: 'RESULT_SHOW_SELECTION_ONLY' - }); - } + search: function(text) { + AppDispatcher.handleViewAction({ + actionType: 'RESULT_SEARCH', + text: text + }); + }, + focus: function(cid) { + AppDispatcher.handleViewAction({ + actionType: 'RESULT_FOCUS', + cid: cid + }); + }, + blur: function() { + AppDispatcher.handleViewAction({ + actionType: 'RESULT_BLUR' + }); + }, + up: function() { + AppDispatcher.handleViewAction({ + actionType: 'RESULT_UP' + }); + }, + down: function() { + AppDispatcher.handleViewAction({ + actionType: 'RESULT_DOWN' + }); + }, + filterByTag: function(cid) { + AppDispatcher.handleViewAction({ + actionType: 'RESULT_FILTER_BY_TAG', + cid: cid + }); + }, + filterByType: function(type, typeName) { + AppDispatcher.handleViewAction({ + actionType: 'RESULT_FILTER_BY_TYPE', + type: type + }); + }, + showSelectionOnly: function() { + AppDispatcher.handleViewAction({ + actionType: 'RESULT_SHOW_SELECTION_ONLY' + }); + } }; -module.exports = ResultActions; \ No newline at end of file +module.exports = ResultActions; diff --git a/src/js/actions/SelectionActions.js b/src/js/actions/SelectionActions.js index 1082aa1..e03bb20 100644 --- a/src/js/actions/SelectionActions.js +++ b/src/js/actions/SelectionActions.js @@ -1,34 +1,34 @@ var AppDispatcher = require('../dispatcher/AppDispatcher'); var SelectionActions = { - add: function(data) { - if(data instanceof Array) { - AppDispatcher.handleViewAction({ - actionType: 'SELECTION_ADD_ALL', - data: data - }); - } - else { - AppDispatcher.handleViewAction({ - actionType: 'SELECTION_ADD', - data: data - }); - } - }, - remove: function() { - if(arguments[0] instanceof Array) { - AppDispatcher.handleViewAction({ - actionType: 'SELECTION_REMOVE_ALL', - data: arguments[0] - }); - } - else { - AppDispatcher.handleViewAction({ - actionType: 'SELECTION_REMOVE', - cid: arguments[0] - }); - } - } + add: function(data) { + if(data instanceof Array) { + AppDispatcher.handleViewAction({ + actionType: 'SELECTION_ADD_ALL', + data: data + }); + } + else { + AppDispatcher.handleViewAction({ + actionType: 'SELECTION_ADD', + data: data + }); + } + }, + remove: function() { + if(arguments[0] instanceof Array) { + AppDispatcher.handleViewAction({ + actionType: 'SELECTION_REMOVE_ALL', + data: arguments[0] + }); + } + else { + AppDispatcher.handleViewAction({ + actionType: 'SELECTION_REMOVE', + cid: arguments[0] + }); + } + } }; -module.exports = SelectionActions; \ No newline at end of file +module.exports = SelectionActions; diff --git a/src/js/components/App.jsx b/src/js/components/App.jsx index 99d321d..6250ed9 100644 --- a/src/js/components/App.jsx +++ b/src/js/components/App.jsx @@ -21,172 +21,172 @@ var MainNav = require('jsx-loader!./MainNav.jsx'); var BuildOptionsOverlay = require('jsx-loader!./BuildOptionsOverlay.jsx'); var App = React.createClass({ - mixins: [WithFlux], - stores: [MetadataStore, ResultsStore, SelectionStore], - storeStates: { - 'ResultsStore': { - results: ResultsStore.getResults, - currentIndex: ResultsStore.getCurrentIndex, - isFiltered: ResultsStore.isFiltered, - searchValue: ResultsStore.getSearchValue, - currentTag: ResultsStore.getCurrentTag, - currentType: ResultsStore.getCurrentType, - selectionOnly: ResultsStore.getSelectionOnly - }, - 'SelectionStore': { - selection: SelectionStore.getSelection, - detectCount: SelectionStore.getDetectCount, - extraCount: SelectionStore.getExtraCount, - apiCount: SelectionStore.getAPICount - } - }, - - getInitialState: function() { - return { - page: 'index', - buildOverlayOpen: false - }; - }, - - componentWillMount: function() { - MetadataActions.fetch(); - }, - - render: function() { - var selectionCount = _.size(this.state.selection) || 0; - var currentResult = this.state.results && !isNaN(this.state.currentIndex) && this.state.results[this.state.currentIndex]; - - var activeRoute = this.props.activeRouteHandler({ - results: this.state.results, - currentResult: currentResult, - selectionOnly: this.state.selectionOnly, - currentTag: this.state.getCurrentTag, - currentType: this.state.getCurrentType, - selection: this.state.selection, - onPageMount: this._handlePageMount - }); - - return ( -
-
- } - selectionCount={selectionCount} - detectCount={this.state.detectCount} - extraCount={this.state.extraCount} - apiCount={this.state.apiCount} - selectionOnly={this.state.selectionOnly} - onBuildBtnClick={this._onMainHeaderBuildBtnClick} - activeRouteName={activeRoute.props.name} - /> -
-
-
- - - {activeRoute} - - -
-
- {this.state.buildOverlayOpen && - - } -
- ); - - /* - return ( -
-
- } /> -
- {this.state.results && -
- - {this.state.currentTag && -
- {this.state.currentTag.name} -
- } - - {this.state.currentType && -
- {this._getResultNameByType(this.state.currentType)} -
- } - - {(this.state.isFiltered && -
- {this.state.results.length} {this._getResultNameByType(this.state.currentType)} -
- ) || -
- Showing all {this.state.results.length} {this._getResultNameByType(this.state.currentType)} -
- } - - -
- } -
- -
-
- {(currentResult && - - ) || -
-

Welcome to
Modernizr's detect library.

-

You can browser detects to find out about browser features, and also add detects to a build, ready to use on your project.

-

[Add more instructions here]

-
- } -
-
-
- ); - */ - }, - - // _onCurrentFilterClick: function() { - // ResultActions.blur(); - // }, - - _onCTAClick: function() { - var _this = this; - setTimeout(function(){ - _this.setState({ - page: 'detects' - }); - }, 600); - - }, - - _onMainHeaderBuildBtnClick: function() { - this.setState({ - buildOverlayOpen: true - }); - }, - - _onBuildOptionsOverlayClick: function() { - this.setState({ - buildOverlayOpen: false - }); - }, - - _handlePageMount: function() { - - } + mixins: [WithFlux], + stores: [MetadataStore, ResultsStore, SelectionStore], + storeStates: { + 'ResultsStore': { + results: ResultsStore.getResults, + currentIndex: ResultsStore.getCurrentIndex, + isFiltered: ResultsStore.isFiltered, + searchValue: ResultsStore.getSearchValue, + currentTag: ResultsStore.getCurrentTag, + currentType: ResultsStore.getCurrentType, + selectionOnly: ResultsStore.getSelectionOnly + }, + 'SelectionStore': { + selection: SelectionStore.getSelection, + detectCount: SelectionStore.getDetectCount, + extraCount: SelectionStore.getExtraCount, + apiCount: SelectionStore.getAPICount + } + }, + + getInitialState: function() { + return { + page: 'index', + buildOverlayOpen: false + }; + }, + + componentWillMount: function() { + MetadataActions.fetch(); + }, + + render: function() { + var selectionCount = _.size(this.state.selection) || 0; + var currentResult = this.state.results && !isNaN(this.state.currentIndex) && this.state.results[this.state.currentIndex]; + + var activeRoute = this.props.activeRouteHandler({ + results: this.state.results, + currentResult: currentResult, + selectionOnly: this.state.selectionOnly, + currentTag: this.state.getCurrentTag, + currentType: this.state.getCurrentType, + selection: this.state.selection, + onPageMount: this._handlePageMount + }); + + return ( +
+
+ } + selectionCount={selectionCount} + detectCount={this.state.detectCount} + extraCount={this.state.extraCount} + apiCount={this.state.apiCount} + selectionOnly={this.state.selectionOnly} + onBuildBtnClick={this._onMainHeaderBuildBtnClick} + activeRouteName={activeRoute.props.name} + /> +
+
+
+ + + {activeRoute} + + +
+
+ {this.state.buildOverlayOpen && + + } +
+ ); + + /* + return ( +
+
+ } /> +
+ {this.state.results && +
+ + {this.state.currentTag && +
+ {this.state.currentTag.name} +
+ } + + {this.state.currentType && +
+ {this._getResultNameByType(this.state.currentType)} +
+ } + + {(this.state.isFiltered && +
+ {this.state.results.length} {this._getResultNameByType(this.state.currentType)} +
+ ) || +
+ Showing all {this.state.results.length} {this._getResultNameByType(this.state.currentType)} +
+ } + + +
+ } +
+ +
+
+ {(currentResult && + + ) || +
+

Welcome to
Modernizr's detect library.

+

You can browser detects to find out about browser features, and also add detects to a build, ready to use on your project.

+

[Add more instructions here]

+
+ } +
+
+
+ ); + */ + }, + + // _onCurrentFilterClick: function() { + // ResultActions.blur(); + // }, + + _onCTAClick: function() { + var _this = this; + setTimeout(function(){ + _this.setState({ + page: 'detects' + }); + }, 600); + + }, + + _onMainHeaderBuildBtnClick: function() { + this.setState({ + buildOverlayOpen: true + }); + }, + + _onBuildOptionsOverlayClick: function() { + this.setState({ + buildOverlayOpen: false + }); + }, + + _handlePageMount: function() { + + } }); module.exports = App; diff --git a/src/js/components/BuildOptionsOverlay.jsx b/src/js/components/BuildOptionsOverlay.jsx index edc238f..3a70752 100644 --- a/src/js/components/BuildOptionsOverlay.jsx +++ b/src/js/components/BuildOptionsOverlay.jsx @@ -7,50 +7,50 @@ var LayeredComponentMixin = require('../mixins/LayeredComponentMixin'); var BuildOptionsOverlay = React.createClass({ - mixins: [ - LayeredComponentMixin - ], + mixins: [ + LayeredComponentMixin + ], - renderLayer: function() { - return ( -
-
-
-
-
-
-
-
Unminfied
- -
-
-
-
-
Minified
- -
-
-
-
-
Grunt configuration
- -
-
-
-
-
-
-
- ); - }, + renderLayer: function() { + return ( +
+
+
+
+
+
+
+
Unminfied
+ +
+
+
+
+
Minified
+ +
+
+
+
+
Grunt configuration
+ +
+
+
+
+
+
+
+ ); + }, - _onContentClick: function(event) { - event.stopPropagation(); - }, + _onContentClick: function(event) { + event.stopPropagation(); + }, - render: function() { - return (); - } + render: function() { + return (); + } }); -module.exports = BuildOptionsOverlay; \ No newline at end of file +module.exports = BuildOptionsOverlay; diff --git a/src/js/components/Detail.jsx b/src/js/components/Detail.jsx index 95c6458..1025445 100644 --- a/src/js/components/Detail.jsx +++ b/src/js/components/Detail.jsx @@ -6,87 +6,87 @@ var React = require('react'); var ResultActions = require('../actions/ResultActions'); var Detail = React.createClass({ - propTypes: { - detect: React.PropTypes.object.isRequired - }, + propTypes: { + detect: React.PropTypes.object.isRequired + }, - closePanel: function(event) { + closePanel: function(event) { - }, - render: function() { - var root = React.DOM['div']; - var authors = this.props.detect.authors && this.props.detect.authors.join(', '); - var notes = this.props.detect.notes; - var doc = this.props.detect.doc; - return ( - -
-
-
{this.props.detect.name}
-
-
- {doc && -
-
-
Description
-
-
-
- } - {notes && notes.length && -
-
-
More detail
-
    - {this.props.detect.notes.map(function(result, i) { - return ( -
  • {result.name}
  • - ); - }.bind(this))} -
-
-
- } - {authors && -
-
-
Authors
-
-

{authors}

-
-
-
- } - - ); + }, + render: function() { + var root = React.DOM['div']; + var authors = this.props.detect.authors && this.props.detect.authors.join(', '); + var notes = this.props.detect.notes; + var doc = this.props.detect.doc; + return ( + +
+
+
{this.props.detect.name}
+
+
+ {doc && +
+
+
Description
+
+
+
+ } + {notes && notes.length && +
+
+
More detail
+
    + {this.props.detect.notes.map(function(result, i) { + return ( +
  • {result.name}
  • + ); + }.bind(this))} +
+
+
+ } + {authors && +
+
+
Authors
+
+

{authors}

+
+
+
+ } + + ); - // var authors = this.props.detect.authors && this.props.detect.authors.join(', '); - // return ( - //
- // CLOSE - // - //

{this.props.detect.name}

- // {authors && - //

by {authors}

- // } - // {this.props.detect.doc && - //
- // } - //

Usage

- //
- //
CSS
- //
{'.css-transitions .foo { }'}
- //
JS
- //
{'if(Modernizr.csstransitions)'}
- //
- //
- // ); - } + // var authors = this.props.detect.authors && this.props.detect.authors.join(', '); + // return ( + //
+ // CLOSE + // + //

{this.props.detect.name}

+ // {authors && + //

by {authors}

+ // } + // {this.props.detect.doc && + //
+ // } + //

Usage

+ //
+ //
CSS
+ //
{'.css-transitions .foo { }'}
+ //
JS
+ //
{'if(Modernizr.csstransitions)'}
+ //
+ //
+ // ); + } }); diff --git a/src/js/components/DetectsPage.jsx b/src/js/components/DetectsPage.jsx index e3d48c0..dab5c75 100644 --- a/src/js/components/DetectsPage.jsx +++ b/src/js/components/DetectsPage.jsx @@ -11,78 +11,78 @@ var FilterLabel = require('jsx-loader!./FilterLabel.jsx'); var DetectsPage = React.createClass({ - render: function() { - var root = React.DOM['div']; - return ( - -
-
-
-
-
- {this.props.selectionOnly && -
- -
- } - {this.props.currentTag && -
- -
- } - {this.props.currentType && -
- -
- } -
-
-
-
- {this.props.results.length} results -
-
- -
-
-
-
-
-
-
- {this.props.results ? - - : null} -
-
-
-
- {this.props.currentResult ? - - : null} -
-
-
- ); - }, + render: function() { + var root = React.DOM['div']; + return ( + +
+
+
+
+
+ {this.props.selectionOnly && +
+ +
+ } + {this.props.currentTag && +
+ +
+ } + {this.props.currentType && +
+ +
+ } +
+
+
+
+ {this.props.results.length} results +
+
+ +
+
+
+
+
+
+
+ {this.props.results ? + + : null} +
+
+
+
+ {this.props.currentResult ? + + : null} +
+
+
+ ); + }, - _getResultNameByType: function(type) { - switch(type) { - case 'detect': - return 'detects'; - break; - case 'extra': - return 'extras'; - break; - case 'api': - return 'API methods' - break; - default: - return 'results'; - break; - } - } + _getResultNameByType: function(type) { + switch(type) { + case 'detect': + return 'detects'; + break; + case 'extra': + return 'extras'; + break; + case 'api': + return 'API methods' + break; + default: + return 'results'; + break; + } + } }); -module.exports = DetectsPage; \ No newline at end of file +module.exports = DetectsPage; diff --git a/src/js/components/FilterLabel.jsx b/src/js/components/FilterLabel.jsx index 19d7e97..1578e73 100644 --- a/src/js/components/FilterLabel.jsx +++ b/src/js/components/FilterLabel.jsx @@ -8,29 +8,29 @@ var closeIcon = require('url?limit=0&mimetype=image/svg+xml!../../img/close.svg' var FilterLabel = React.createClass({ - render: function() { - return ( -
-
-
- {this.props.tag.name} -
-
-
-
- Close -
-
-
-
-
- ); - }, + render: function() { + return ( +
+
+
+ {this.props.tag.name} +
+
+
+
+ Close +
+
+
+
+
+ ); + }, - _onClick: function() { - ResultActions.blur(); - } + _onClick: function() { + ResultActions.blur(); + } }); -module.exports = FilterLabel; \ No newline at end of file +module.exports = FilterLabel; diff --git a/src/js/components/HomePage.jsx b/src/js/components/HomePage.jsx index 01c636a..8c721cb 100644 --- a/src/js/components/HomePage.jsx +++ b/src/js/components/HomePage.jsx @@ -8,105 +8,105 @@ var Link = Router.Link; var HomePage = React.createClass({ - render: function() { - return ( -
-
-
-
- Respond to your user’s
browser features.
-
-
-
Modernizr tells you what HTML, CSS and JavaScript features the user’s browser has to offer.
-

- Add your detects - - Download a development copy - -

-
-
+ render: function() { + return ( +
+
+
+
+ Respond to your user’s
browser features.
+
+
+
Modernizr tells you what HTML, CSS and JavaScript features the user’s browser has to offer.
+

+ Add your detects + + Download a development copy + +

+
+
-
-
-
-
What is Modernizr?
-

It’s a collection of superfast tests – or “detects” as we like to call them – which run as your web page loads, then you can use the results to tailor the experience to the user.

-
Why do I need it?
-

All web developers come up against differences between browsers and devices. That’s largely due to different feature sets: the latest versions of the popular browsers can do some awesome things which older browsers can’t – but we still have to support the older ones.

-

Modernizr makes it easy to deliver tiered experiences: make use of the latest and greatest features in browsers which support them, without leaving less fortunate users high and dry.

-
-
-
-
- -
-
-
-
-
Latest news
-
-
- -
-
-
-
-
-
-
-
-
Talk to us
-
-
- -
-
-
-
-
-
-
+
+
+
+
What is Modernizr?
+

It’s a collection of superfast tests – or “detects” as we like to call them – which run as your web page loads, then you can use the results to tailor the experience to the user.

+
Why do I need it?
+

All web developers come up against differences between browsers and devices. That’s largely due to different feature sets: the latest versions of the popular browsers can do some awesome things which older browsers can’t – but we still have to support the older ones.

+

Modernizr makes it easy to deliver tiered experiences: make use of the latest and greatest features in browsers which support them, without leaving less fortunate users high and dry.

+
+
+
+
+ +
+
+
+
+
Latest news
+
+
+ +
+
+
+
+
+
+
+
+
Talk to us
+
+
+ +
+
+
+
+
+
+
-
-
- ); - } +
+
+ ); + } }); module.exports = HomePage; diff --git a/src/js/components/MainHeader.jsx b/src/js/components/MainHeader.jsx index 5321856..0223a2b 100644 --- a/src/js/components/MainHeader.jsx +++ b/src/js/components/MainHeader.jsx @@ -11,169 +11,169 @@ var ResultActions = require('../actions/ResultActions'); var Link = Router.Link; var MainHeader = React.createClass({ - render: function() { + render: function() { - var browserOpen = this.props.activeRouteName === 'detects'; + var browserOpen = this.props.activeRouteName === 'detects'; - return ( -
-
-
- - - Modernizr - -
-
-
-
- - Browse features - -
- - - -
-
-
- {this.props.search} -
-
-
- Build -
-
-
-
-
+ return ( +
+
+
+ + + Modernizr + +
+
+
+
+ + Browse features + +
+ + + +
+
+
+ {this.props.search} +
+
+
+ Build +
+
+
+
+
- {/* -
-
-
-
-
-
-
-
- - - Modernizr - -
-
-
-
-
-
-
-
-
-
-
- {this.props.search} -
-
-
-
-
-
- -
-
-
-
-
-
-
No items have been added to your build yet.
-
-
-
-
-
-
-
-
-
-
- {this.props.selectionCount} -
-
- {this.props.selectionCount} -
-
-
-
-
-
-
- Build -
-
-
-
-
-
-
-
-
-
- */} -
- ); - }, + {/* +
+
+
+
+
+
+
+
+ + + Modernizr + +
+
+
+
+
+
+
+
+
+
+
+ {this.props.search} +
+
+
+
+
+
+ +
+
+
+
+
+
+
No items have been added to your build yet.
+
+
+
+
+
+
+
+
+
+
+ {this.props.selectionCount} +
+
+ {this.props.selectionCount} +
+
+
+
+
+
+
+ Build +
+
+
+
+
+
+
+
+
+
+ */} +
+ ); + }, - _onSelectionCountClick: function() { - ResultActions.showSelectionOnly(); - }, + _onSelectionCountClick: function() { + ResultActions.showSelectionOnly(); + }, - _onTypeClick: function(props) { - ResultActions.filterByType(props.type); - }, + _onTypeClick: function(props) { + ResultActions.filterByType(props.type); + }, - _onBuildBtnClick: function(event) { - this.props.onBuildBtnClick(event); - } + _onBuildBtnClick: function(event) { + this.props.onBuildBtnClick(event); + } }); -module.exports = MainHeader; \ No newline at end of file +module.exports = MainHeader; diff --git a/src/js/components/MainNav.jsx b/src/js/components/MainNav.jsx index 2862c3f..1f1c867 100644 --- a/src/js/components/MainNav.jsx +++ b/src/js/components/MainNav.jsx @@ -7,84 +7,84 @@ var cx = require('react/lib/cx'); var NavSlider = require('../nav-slider'); var MainNav = React.createClass({ - getInitialState: function() { - return { - active: false - }; - }, + getInitialState: function() { + return { + active: false + }; + }, - componentDidMount: function() { - this.navSlider = new NavSlider(); - this._checkSlider(); - this.started = false; - }, + componentDidMount: function() { + this.navSlider = new NavSlider(); + this._checkSlider(); + this.started = false; + }, - render: function() { - return ( -
-
-
-
    - {this.props.items.map(function(item) { - return ( -
  • - -
    - {item} -
    -
    -
  • - ); - })} -
-
-
-
-
-
- Start -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ); - }, + render: function() { + return ( +
+
+
+
    + {this.props.items.map(function(item) { + return ( +
  • + +
    + {item} +
    +
    +
  • + ); + })} +
+
+
+
+
+
+ Start +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ); + }, - _onStartClick: function() { - if(this.started) return; - $(this.refs.startBtn.getDOMNode()).addClass('is-moved'); - this.navSlider.toggle(); - $('.SearchBar').focus(); - this.started = true; - this.props.onStartClick(); - }, + _onStartClick: function() { + if(this.started) return; + $(this.refs.startBtn.getDOMNode()).addClass('is-moved'); + this.navSlider.toggle(); + $('.SearchBar').focus(); + this.started = true; + this.props.onStartClick(); + }, - _toggle: function() { - this.setState({ - active: !this.state.active - }); - }, + _toggle: function() { + this.setState({ + active: !this.state.active + }); + }, - _checkSlider: function() { - if(this.props.page === 'index') { - this.navSlider.toggle({ - first: true - }); - } - } + _checkSlider: function() { + if(this.props.page === 'index') { + this.navSlider.toggle({ + first: true + }); + } + } }); -module.exports = MainNav; \ No newline at end of file +module.exports = MainNav; diff --git a/src/js/components/Result.jsx b/src/js/components/Result.jsx index 2ab9a19..73cabf5 100644 --- a/src/js/components/Result.jsx +++ b/src/js/components/Result.jsx @@ -13,62 +13,62 @@ var addIcon = require('file!../../img/add.svg'); var acceptIcon = require('file!../../img/accept.svg'); var Result = React.createClass({ - propTypes: { - result: React.PropTypes.object.isRequired, - added: React.PropTypes.object, - current: React.PropTypes.bool - }, + propTypes: { + result: React.PropTypes.object.isRequired, + added: React.PropTypes.object, + current: React.PropTypes.bool + }, - getDefaultProps: function() { - return { - current: false - }; - }, + getDefaultProps: function() { + return { + current: false + }; + }, - getInitialState: function() { - return { - isMouseOver: false - }; - }, - render: function() { - var root = React.DOM['div']; - return ( - -
-
- Add -
-
- Remove -
-
-
{this.props.result.name}
-
- ); - }, + getInitialState: function() { + return { + isMouseOver: false + }; + }, + render: function() { + var root = React.DOM['div']; + return ( + +
+
+ Add +
+
+ Remove +
+
+
{this.props.result.name}
+
+ ); + }, - _onClick: function(event) { - event.preventDefault(); - if(this.props.current) { - this._toggle(); - } else { - ResultActions.focus(this.props.result.cid); - } - }, + _onClick: function(event) { + event.preventDefault(); + if(this.props.current) { + this._toggle(); + } else { + ResultActions.focus(this.props.result.cid); + } + }, - _onToggleBtnClick: function(event) { - event.stopPropagation(); - this._toggle(); - }, + _onToggleBtnClick: function(event) { + event.stopPropagation(); + this._toggle(); + }, - _toggle: function() { - if(this.props.added) { - SelectionActions.remove(this.props.result.cid); - } - else { - SelectionActions.add(this.props.result); - } - } + _toggle: function() { + if(this.props.added) { + SelectionActions.remove(this.props.result.cid); + } + else { + SelectionActions.add(this.props.result); + } + } }); module.exports = Result; diff --git a/src/js/components/ResultList.jsx b/src/js/components/ResultList.jsx index 940c0e4..120d3be 100644 --- a/src/js/components/ResultList.jsx +++ b/src/js/components/ResultList.jsx @@ -9,104 +9,104 @@ var ResultActions = require('../actions/ResultActions'); var SelectionActions = require('../actions/SelectionActions'); var ResultList = React.createClass({ - componentDidMount: function() { - $(window).on('keydown', this._onKeyDown); - $(document).on('keydown', function(e) { - if(e.which === 38 || e.which === 40) { - e.preventDefault(); - } - }); - }, + componentDidMount: function() { + $(window).on('keydown', this._onKeyDown); + $(document).on('keydown', function(e) { + if(e.which === 38 || e.which === 40) { + e.preventDefault(); + } + }); + }, - componentDidUpdate: function(prevProps, prevState) { - if(this.refs.firstResult) { - this._updateScrollPosition(); - } - }, + componentDidUpdate: function(prevProps, prevState) { + if(this.refs.firstResult) { + this._updateScrollPosition(); + } + }, - render: function() { - var root = React.DOM['div']; - return ( - - {this.props.results.map(function(result, i) { - var current = this.props.currentResult && this.props.currentResult.cid === result.cid; - var ref = i === 0 ? 'firstResult' : null - if(result.type === 'tag') { - return ( -
- -
- ); - } - else { - var added = this.props.selection && this.props.selection[result.cid]; - return ( -
- -
- ); - } - }.bind(this))} -
- ); - }, + render: function() { + var root = React.DOM['div']; + return ( + + {this.props.results.map(function(result, i) { + var current = this.props.currentResult && this.props.currentResult.cid === result.cid; + var ref = i === 0 ? 'firstResult' : null + if(result.type === 'tag') { + return ( +
+ +
+ ); + } + else { + var added = this.props.selection && this.props.selection[result.cid]; + return ( +
+ +
+ ); + } + }.bind(this))} +
+ ); + }, - _onKeyDown: function(e) { - switch(e.which) { - case 38: // Up - ResultActions.up(); - break; - case 40: // Down - ResultActions.down(); - break; - case 13: // Enter - if(this.props.currentResult && this.props.currentResult.type !== 'tag') { - var added = this.props.selection && this.props.selection[this.props.currentResult.cid]; - if(added) { - SelectionActions.remove(this.props.currentResult.cid); - } - else { - SelectionActions.add(this.props.currentResult); - } - } - else if(this.props.currentResult && this.props.currentResult.type === 'tag') { - ResultActions.filterByTag(this.props.currentResult.cid); - } - else { - ResultActions.down(); - } - break; - case 27: // Esc - ResultActions.blur(); - break; - } - }, + _onKeyDown: function(e) { + switch(e.which) { + case 38: // Up + ResultActions.up(); + break; + case 40: // Down + ResultActions.down(); + break; + case 13: // Enter + if(this.props.currentResult && this.props.currentResult.type !== 'tag') { + var added = this.props.selection && this.props.selection[this.props.currentResult.cid]; + if(added) { + SelectionActions.remove(this.props.currentResult.cid); + } + else { + SelectionActions.add(this.props.currentResult); + } + } + else if(this.props.currentResult && this.props.currentResult.type === 'tag') { + ResultActions.filterByTag(this.props.currentResult.cid); + } + else { + ResultActions.down(); + } + break; + case 27: // Esc + ResultActions.blur(); + break; + } + }, - _updateScrollPosition: function() { - var scrollTop = $(this.getDOMNode()).scrollTop(); - var resultHeight = $(this.refs.firstResult.getDOMNode()).outerHeight(); + _updateScrollPosition: function() { + var scrollTop = $(this.getDOMNode()).scrollTop(); + var resultHeight = $(this.refs.firstResult.getDOMNode()).outerHeight(); - var index = this.props.currentIndex || 0; - var offset = index * (resultHeight + 1) - 1; - var resultListHeight = $(this.getDOMNode()).height(); - var bottomOffset = resultHeight / 2; + var index = this.props.currentIndex || 0; + var offset = index * (resultHeight + 1) - 1; + var resultListHeight = $(this.getDOMNode()).height(); + var bottomOffset = resultHeight / 2; - if((offset + resultHeight) > (scrollTop + resultListHeight)) { - scrollTop = (offset + resultHeight) - resultListHeight; - $(this.getDOMNode()).animate({ - scrollTop: scrollTop + bottomOffset - }, { - duration: 200 - }); - } - else if(offset < scrollTop) { - $(this.getDOMNode()).animate({ - scrollTop: offset - }, { - duration: 200 - }); - } - } + if((offset + resultHeight) > (scrollTop + resultListHeight)) { + scrollTop = (offset + resultHeight) - resultListHeight; + $(this.getDOMNode()).animate({ + scrollTop: scrollTop + bottomOffset + }, { + duration: 200 + }); + } + else if(offset < scrollTop) { + $(this.getDOMNode()).animate({ + scrollTop: offset + }, { + duration: 200 + }); + } + } }); -module.exports = ResultList; \ No newline at end of file +module.exports = ResultList; diff --git a/src/js/components/Search.jsx b/src/js/components/Search.jsx index 638aa17..60a0f94 100644 --- a/src/js/components/Search.jsx +++ b/src/js/components/Search.jsx @@ -7,23 +7,23 @@ var ResultActions = require('../actions/ResultActions'); var Search = React.createClass({ - componentWillReceiveProps: function(nextProps) { - // Ensure the search box is focused whenever the search value is removed, - // ready for searching again. - if(nextProps.searchValue === '' && nextProps.searchValue !== this.props.searchValue) { - this.refs.input.getDOMNode().focus(); - } - }, + componentWillReceiveProps: function(nextProps) { + // Ensure the search box is focused whenever the search value is removed, + // ready for searching again. + if(nextProps.searchValue === '' && nextProps.searchValue !== this.props.searchValue) { + this.refs.input.getDOMNode().focus(); + } + }, - render: function() { - return ( - - ); - }, + render: function() { + return ( + + ); + }, - _onInputChange: function(event) { - ResultActions.search(event.target.value); - }, + _onInputChange: function(event) { + ResultActions.search(event.target.value); + }, }); -module.exports = Search; \ No newline at end of file +module.exports = Search; diff --git a/src/js/components/TagResult.jsx b/src/js/components/TagResult.jsx index 26cf51f..af2234d 100644 --- a/src/js/components/TagResult.jsx +++ b/src/js/components/TagResult.jsx @@ -7,25 +7,25 @@ var ResultActions = require('../actions/ResultActions'); var cx = require('react/lib/cx'); var Result = React.createClass({ - propTypes: { - result: React.PropTypes.object.isRequired, - current: React.PropTypes.bool - }, + propTypes: { + result: React.PropTypes.object.isRequired, + current: React.PropTypes.bool + }, - render: function() { - var root = React.DOM['div']; - return ( - -
-
{this.props.result.name}
-
- ); - }, + render: function() { + var root = React.DOM['div']; + return ( + +
+
{this.props.result.name}
+
+ ); + }, - _onClick: function(event) { - event.preventDefault(); - ResultActions.filterByTag(this.props.result.cid); - } + _onClick: function(event) { + event.preventDefault(); + ResultActions.filterByTag(this.props.result.cid); + } }); module.exports = Result; diff --git a/src/js/components/ToggleAll.jsx b/src/js/components/ToggleAll.jsx index cc6f010..fa05960 100644 --- a/src/js/components/ToggleAll.jsx +++ b/src/js/components/ToggleAll.jsx @@ -10,37 +10,37 @@ var cx = require('react/lib/cx'); var ToggleAll = React.createClass({ - render: function() { - return ( - - ); - }, - - _onRemoveAllClick: function() { - SelectionActions.remove(this.props.results); - }, - - - _onAddAllClick: function() { - SelectionActions.add(this.props.results); - } + render: function() { + return ( + + ); + }, + + _onRemoveAllClick: function() { + SelectionActions.remove(this.props.results); + }, + + + _onAddAllClick: function() { + SelectionActions.add(this.props.results); + } }); -module.exports = ToggleAll; \ No newline at end of file +module.exports = ToggleAll; diff --git a/src/js/components/TypeFilter.jsx b/src/js/components/TypeFilter.jsx index 44cd0c3..657ff97 100644 --- a/src/js/components/TypeFilter.jsx +++ b/src/js/components/TypeFilter.jsx @@ -6,19 +6,19 @@ var React = require('react'); var ResultActions = require('../actions/ResultActions'); var TypeFilter = React.createClass({ - render: function() { - return ( - - {this.props.count} - {this.props.name} - - ); - }, + render: function() { + return ( + + {this.props.count} + {this.props.name} + + ); + }, - _onClick: function(event) { - event.preventDefault(); - ResultActions.filterByType(this.props.type); - } + _onClick: function(event) { + event.preventDefault(); + ResultActions.filterByType(this.props.type); + } }); module.exports = TypeFilter; diff --git a/src/js/main.js b/src/js/main.js index bcfcec3..a771cf9 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -8,10 +8,10 @@ var HomePage = require('jsx-loader!./components/HomePage.jsx'); var DetectsPage = require('jsx-loader!./components/DetectsPage.jsx'); var app = Routes(null, - Route({handler: App}, - Route({name: 'index', path: '/', handler: HomePage}), - Route({name: 'detects', path: '/detects', handler: DetectsPage}) - ) + Route({handler: App}, + Route({name: 'index', path: '/', handler: HomePage}), + Route({name: 'detects', path: '/detects', handler: DetectsPage}) + ) ); -React.renderComponent(app, document.getElementById('app-container')); \ No newline at end of file +React.renderComponent(app, document.getElementById('app-container')); diff --git a/src/js/mixins/LayeredComponentMixin.js b/src/js/mixins/LayeredComponentMixin.js index bc2cb7e..9c55a58 100644 --- a/src/js/mixins/LayeredComponentMixin.js +++ b/src/js/mixins/LayeredComponentMixin.js @@ -55,4 +55,4 @@ var LayeredComponentMixin = { } }; -module.exports = LayeredComponentMixin; \ No newline at end of file +module.exports = LayeredComponentMixin; diff --git a/src/js/mixins/WithFlux.js b/src/js/mixins/WithFlux.js index db4a8cb..f668ab0 100644 --- a/src/js/mixins/WithFlux.js +++ b/src/js/mixins/WithFlux.js @@ -1,49 +1,49 @@ var WithFlux = { - getInitialState: function() { - console.log(this.getState()); - return this.getState(); - }, - getStoreByName: function(name) { - for(var i = 0; i < this.stores.length; i++) { - if(this.stores[i].name === name) { - return this.stores[i]; - } - } - }, - getState: function(name) { - var states = {} - for(var storeName in this.storeStates) { - if(!name || storeName === name) { - for(var varName in this.storeStates[storeName]) { - states[varName] = this.storeStates[storeName][varName].call(this); - } - } - } - return states; - }, - componentWillMount: function() { - this.storeListeners = {}; - var _this = this; - for(var storeName in this.storeStates) { - (function(name) { - var store = _this.getStoreByName(name); - var onStoreChange = function() { - _this.setState(_this.getState(name)); - }; - store.on('change', onStoreChange); - _this.storeListeners[name] = onStoreChange; - })(storeName); - } - }, - componentWillUnmount: function() { - var _this = this; - for(var storeName in this.stores) { - (function(name) { - var store = _this.getStoreByName(name); - store.removeListener('change', _this.storeListeners[name]); - })(storeName); - } - } + getInitialState: function() { + console.log(this.getState()); + return this.getState(); + }, + getStoreByName: function(name) { + for(var i = 0; i < this.stores.length; i++) { + if(this.stores[i].name === name) { + return this.stores[i]; + } + } + }, + getState: function(name) { + var states = {} + for(var storeName in this.storeStates) { + if(!name || storeName === name) { + for(var varName in this.storeStates[storeName]) { + states[varName] = this.storeStates[storeName][varName].call(this); + } + } + } + return states; + }, + componentWillMount: function() { + this.storeListeners = {}; + var _this = this; + for(var storeName in this.storeStates) { + (function(name) { + var store = _this.getStoreByName(name); + var onStoreChange = function() { + _this.setState(_this.getState(name)); + }; + store.on('change', onStoreChange); + _this.storeListeners[name] = onStoreChange; + })(storeName); + } + }, + componentWillUnmount: function() { + var _this = this; + for(var storeName in this.stores) { + (function(name) { + var store = _this.getStoreByName(name); + store.removeListener('change', _this.storeListeners[name]); + })(storeName); + } + } }; -module.exports = WithFlux; \ No newline at end of file +module.exports = WithFlux; diff --git a/src/js/nav-slider.js b/src/js/nav-slider.js index e9bec78..f6c1468 100644 --- a/src/js/nav-slider.js +++ b/src/js/nav-slider.js @@ -1,68 +1,68 @@ var NavSlider = function() { - this.isNavActive = false; - this.isMoving = false; - this.offset = 0; - this.init(); + this.isNavActive = false; + this.isMoving = false; + this.offset = 0; + this.init(); }; NavSlider.prototype = { - init: function() { - var _this = this; - $('.js-main-nav__inner').width($('.js-main-nav').width()); - this.offset = $(window).width() - $('.js-main-nav__inner').width() - $('.js-main-nav__inner').offset().left; - $(document).on('click', '.js-main-nav__menu-icon', function() { - _this.toggle(); - }); - }, - toggle: function(opts) { - if(this.isMoving) return; + init: function() { + var _this = this; + $('.js-main-nav__inner').width($('.js-main-nav').width()); + this.offset = $(window).width() - $('.js-main-nav__inner').width() - $('.js-main-nav__inner').offset().left; + $(document).on('click', '.js-main-nav__menu-icon', function() { + _this.toggle(); + }); + }, + toggle: function(opts) { + if(this.isMoving) return; - var _this = this; - var first = opts && opts.first; + var _this = this; + var first = opts && opts.first; - var $container = $('.js-main-nav'); - var $contentContainer = $('.js-nav-list'); - var $inner = $container.find('.js-main-nav__mid'); - var $menuNav = $('.js-main-nav__inner'); + var $container = $('.js-main-nav'); + var $contentContainer = $('.js-nav-list'); + var $inner = $container.find('.js-main-nav__mid'); + var $menuNav = $('.js-main-nav__inner'); - this.isNavActive = !this.isNavActive; - if(first) { - $container.addClass('is-animation-disabled'); - } + this.isNavActive = !this.isNavActive; + if(first) { + $container.addClass('is-animation-disabled'); + } - $container.toggleClass('is-active', this.isNavActive); - - this.isMoving = true; + $container.toggleClass('is-active', this.isNavActive); + + this.isMoving = true; - if(this.isNavActive) { - $menuNav.css('transform', 'translate3d(' + (this.offset) + 'px, 0px, 0px)'); - $inner.css({ - marginRight: -9999 - }); - $contentContainer.css({ - marginLeft: 0 - this.offset, - marginRight: $menuNav.width() - }); - setTimeout(function() { - $container.removeClass('is-animation-disabled'); - _this.isMoving = false; - }, 20); - } - else { - $menuNav.css('transform', ''); - setTimeout(function() { - $contentContainer.css({ - marginLeft: '', - marginRight: '' - }); - $inner.css({ - marginRight: '' - }); - $container.removeClass('is-animation-disabled'); - _this.isMoving = false; - }, 1100); - } - } + if(this.isNavActive) { + $menuNav.css('transform', 'translate3d(' + (this.offset) + 'px, 0px, 0px)'); + $inner.css({ + marginRight: -9999 + }); + $contentContainer.css({ + marginLeft: 0 - this.offset, + marginRight: $menuNav.width() + }); + setTimeout(function() { + $container.removeClass('is-animation-disabled'); + _this.isMoving = false; + }, 20); + } + else { + $menuNav.css('transform', ''); + setTimeout(function() { + $contentContainer.css({ + marginLeft: '', + marginRight: '' + }); + $inner.css({ + marginRight: '' + }); + $container.removeClass('is-animation-disabled'); + _this.isMoving = false; + }, 1100); + } + } }; -module.exports = NavSlider; \ No newline at end of file +module.exports = NavSlider; diff --git a/src/js/stores/Metadata.js b/src/js/stores/Metadata.js index 0f2d89a..b543c64 100644 --- a/src/js/stores/Metadata.js +++ b/src/js/stores/Metadata.js @@ -7,85 +7,85 @@ var ExtrasData = require('../../extras.json'); var APIData = require('../../api.json'); var _detects = [], - _tags = [], - _data = [], - _extras = [], - _api = []; + _tags = [], + _data = [], + _extras = [], + _api = []; function fetch() { - _tags = _.unique(_.flatten(_.pluck(DetectsData, 'tags'))) - _tags = _tags.map(function(tag) { - return { - cid: _.uniqueId('tag_'), - type: 'tag', - name: tag - } - }); + _tags = _.unique(_.flatten(_.pluck(DetectsData, 'tags'))) + _tags = _tags.map(function(tag) { + return { + cid: _.uniqueId('tag_'), + type: 'tag', + name: tag + } + }); - _detects = DetectsData.map(function(detect) { - return _.extend(detect, { - cid: _.uniqueId('detect_'), - type: 'detect', - tags: detect.tags.map(function(tagName) { - return _.find(_tags, function(tagObj) { - return tagObj.name === tagName; - }); - }) - }); - }); + _detects = DetectsData.map(function(detect) { + return _.extend(detect, { + cid: _.uniqueId('detect_'), + type: 'detect', + tags: detect.tags.map(function(tagName) { + return _.find(_tags, function(tagObj) { + return tagObj.name === tagName; + }); + }) + }); + }); - _extras = ExtrasData.map(function(extra) { - return _.extend(extra, { - cid: _.uniqueId('extra_'), - type: 'extra' - }); - }); + _extras = ExtrasData.map(function(extra) { + return _.extend(extra, { + cid: _.uniqueId('extra_'), + type: 'extra' + }); + }); - _api = APIData.map(function(api) { - return _.extend(api, { - cid: _.uniqueId('api'), - type: 'api' - }); - }); + _api = APIData.map(function(api) { + return _.extend(api, { + cid: _.uniqueId('api'), + type: 'api' + }); + }); - _data = _.union(_detects, _tags, _extras, _api); + _data = _.union(_detects, _tags, _extras, _api); - MetadataStore.emit('change'); + MetadataStore.emit('change'); } var MetadataStore = merge(EventEmitter.prototype, { - getAll: function() { - return _data; - }, - getDetects: function() { - return _detects; - }, - getTags: function() { - return _tags; - }, - getAPI: function() { - return _api; - }, - getExtras: function() { - return _extras; - } + getAll: function() { + return _data; + }, + getDetects: function() { + return _detects; + }, + getTags: function() { + return _tags; + }, + getAPI: function() { + return _api; + }, + getExtras: function() { + return _extras; + } }); MetadataStore.name = 'MetadataStore'; AppDispatcher.register(function(payload) { - var action = payload.action; - switch(action.actionType) { - case 'METADATA_FETCH': - fetch(); - return true; // Async - break; - default: - return true; - break; - } - MetadataStore.emit('change'); + var action = payload.action; + switch(action.actionType) { + case 'METADATA_FETCH': + fetch(); + return true; // Async + break; + default: + return true; + break; + } + MetadataStore.emit('change'); }); -module.exports = MetadataStore; \ No newline at end of file +module.exports = MetadataStore; diff --git a/src/js/stores/Results.js b/src/js/stores/Results.js index 2570c25..057c7ad 100644 --- a/src/js/stores/Results.js +++ b/src/js/stores/Results.js @@ -6,205 +6,205 @@ var Fuse = require('../../../bower_components/fuse/src/fuse'); var SelectionStore = require('./Selection'); var _fuse, - _value = null, - _results = [], - _currentIndex = null, - _currentTag = null, - _currentType = null, - _selectionOnly = false; + _value = null, + _results = [], + _currentIndex = null, + _currentTag = null, + _currentType = null, + _selectionOnly = false; MetadataStore.on('change', function() { - prepare(); - if(!_results.length) { - _results = MetadataStore.getAll(); - ResultsStore.emit('change'); - } + prepare(); + if(!_results.length) { + _results = MetadataStore.getAll(); + ResultsStore.emit('change'); + } }); function prepare() { - var data = MetadataStore.getAll(); - _fuse = new Fuse(data, { - keys: ['name', 'property'], - threshold: 0.8 - }); + var data = MetadataStore.getAll(); + _fuse = new Fuse(data, { + keys: ['name', 'property'], + threshold: 0.8 + }); } function search(value) { - // TODO :: filter by any currentType or currentTag - - _value = value; - if(_value) { - _results = _fuse.search(_getFuseValue(_value)); - _results = _prioritiseMatchingTag(_results); - _currentIndex = 0; - } - else { - _results = MetadataStore.getAll(); - _currentIndex = null; - } + // TODO :: filter by any currentType or currentTag + + _value = value; + if(_value) { + _results = _fuse.search(_getFuseValue(_value)); + _results = _prioritiseMatchingTag(_results); + _currentIndex = 0; + } + else { + _results = MetadataStore.getAll(); + _currentIndex = null; + } } function _prioritiseMatchingTag(results) { - var tagMatch = _.find(results, function(result) { - return (result.type === 'tag' && result.name === _value); - }); + var tagMatch = _.find(results, function(result) { + return (result.type === 'tag' && result.name === _value); + }); - if(tagMatch) { - var restOfResults = _.without(results, tagMatch); + if(tagMatch) { + var restOfResults = _.without(results, tagMatch); - return [tagMatch].concat(restOfResults); - } + return [tagMatch].concat(restOfResults); + } - return results; + return results; } function focus(cid) { - var data = _results || MetadataStore.getAll(); - for(var i in data) { - if(data[i].cid === cid) { - _currentIndex = parseInt(i, null); - break; - } - } + var data = _results || MetadataStore.getAll(); + for(var i in data) { + if(data[i].cid === cid) { + _currentIndex = parseInt(i, null); + break; + } + } } function blur() { - _currentIndex = null; - _value = null; - _currentTag = null; - _currentType = null; - _results = MetadataStore.getAll(); - _selectionOnly = false; + _currentIndex = null; + _value = null; + _currentTag = null; + _currentType = null; + _results = MetadataStore.getAll(); + _selectionOnly = false; } function move(delta) { - if(isNaN(_currentIndex)) { - _currentIndex = _results[0]; - } - else { - var maxIndex = _results.length - 1; - _currentIndex = _currentIndex + delta; - if(_currentIndex < 0) _currentIndex = 0; - else if(_currentIndex > maxIndex) _currentIndex = maxIndex; - } + if(isNaN(_currentIndex)) { + _currentIndex = _results[0]; + } + else { + var maxIndex = _results.length - 1; + _currentIndex = _currentIndex + delta; + if(_currentIndex < 0) _currentIndex = 0; + else if(_currentIndex > maxIndex) _currentIndex = maxIndex; + } } function filterByTag(cid) { - var data = MetadataStore.getAll(); - var tags = MetadataStore.getTags(); - _currentType = null; - _selectionOnly = false; - - _currentTag = _.find(tags, function(tag) { - return tag.cid === cid; - }); - - _results = data.filter(function(obj) { - if(obj.tags instanceof Array) { - var match = _.find(obj.tags, function(tag) { - return tag.cid === cid; - }); - if(match) { - return true; - } - } - return false; - }); - - _value = null; + var data = MetadataStore.getAll(); + var tags = MetadataStore.getTags(); + _currentType = null; + _selectionOnly = false; + + _currentTag = _.find(tags, function(tag) { + return tag.cid === cid; + }); + + _results = data.filter(function(obj) { + if(obj.tags instanceof Array) { + var match = _.find(obj.tags, function(tag) { + return tag.cid === cid; + }); + if(match) { + return true; + } + } + return false; + }); + + _value = null; } function filterByType(type) { - var data = MetadataStore.getAll(); - _currentTag = null; - _selectionOnly = false; - _currentType = type; - - _results = data.filter(function(obj) { - return obj.type === type; - }); + var data = MetadataStore.getAll(); + _currentTag = null; + _selectionOnly = false; + _currentType = type; + + _results = data.filter(function(obj) { + return obj.type === type; + }); } function showSelectionOnly() { - if(!_selectionOnly) { - _selectionOnly = true; - _currentType = null; - _currentTag = null; - _results = _.map(SelectionStore.getSelection(), function(obj) { - return obj - }); - } else { - blur(); - } + if(!_selectionOnly) { + _selectionOnly = true; + _currentType = null; + _currentTag = null; + _results = _.map(SelectionStore.getSelection(), function(obj) { + return obj + }); + } else { + blur(); + } } function _getFuseValue(value) { - // Modification for better results through Fuse - // var valueForFuse = value.replace(/\s+/g, ''); - // valueForFuse = valueForFuse.split('').join(' '); - return value; + // Modification for better results through Fuse + // var valueForFuse = value.replace(/\s+/g, ''); + // valueForFuse = valueForFuse.split('').join(' '); + return value; } var ResultsStore = merge(EventEmitter.prototype, { - getResults: function() { - return _results; - }, - isFiltered: function() { - return !!_value; - }, - getCurrentIndex: function() { - return _currentIndex; - }, - getSearchValue: function() { - return _value || ''; - }, - getCurrentTag: function() { - return _currentTag; - }, - getCurrentType: function() { - return _currentType; - }, - getSelectionOnly: function() { - return _selectionOnly; - } + getResults: function() { + return _results; + }, + isFiltered: function() { + return !!_value; + }, + getCurrentIndex: function() { + return _currentIndex; + }, + getSearchValue: function() { + return _value || ''; + }, + getCurrentTag: function() { + return _currentTag; + }, + getCurrentType: function() { + return _currentType; + }, + getSelectionOnly: function() { + return _selectionOnly; + } }); ResultsStore.name = 'ResultsStore'; AppDispatcher.register(function(payload) { - var action = payload.action; - switch(action.actionType) { - case 'RESULT_SEARCH': - search(action.text); - break; - case 'RESULT_FOCUS': - focus(action.cid); - break; - case 'RESULT_BLUR': - blur(); - break; - case 'RESULT_UP': - move(-1); - break; - case 'RESULT_DOWN': - move(1); - break; - case 'RESULT_FILTER_BY_TAG': - filterByTag(action.cid); - break; - case 'RESULT_FILTER_BY_TYPE': - filterByType(action.type); - break; - case 'RESULT_SHOW_SELECTION_ONLY': - showSelectionOnly(); - break; - default: - return true; - break; - } - - ResultsStore.emit('change'); + var action = payload.action; + switch(action.actionType) { + case 'RESULT_SEARCH': + search(action.text); + break; + case 'RESULT_FOCUS': + focus(action.cid); + break; + case 'RESULT_BLUR': + blur(); + break; + case 'RESULT_UP': + move(-1); + break; + case 'RESULT_DOWN': + move(1); + break; + case 'RESULT_FILTER_BY_TAG': + filterByTag(action.cid); + break; + case 'RESULT_FILTER_BY_TYPE': + filterByType(action.type); + break; + case 'RESULT_SHOW_SELECTION_ONLY': + showSelectionOnly(); + break; + default: + return true; + break; + } + + ResultsStore.emit('change'); }); -module.exports = ResultsStore; \ No newline at end of file +module.exports = ResultsStore; diff --git a/src/js/stores/Selection.js b/src/js/stores/Selection.js index 84cde5e..5344249 100644 --- a/src/js/stores/Selection.js +++ b/src/js/stores/Selection.js @@ -7,71 +7,71 @@ var MetadataStore = require('./Metadata'); var _selection = {}; function add(data) { - _selection[data.cid] = data; + _selection[data.cid] = data; } function addAll(data) { - _.forEach(data, function(obj) { - add(obj); - }.bind(this)); + _.forEach(data, function(obj) { + add(obj); + }.bind(this)); } function remove(cid) { - delete _selection[cid]; - if(_.size(_selection) === 0) { - - } + delete _selection[cid]; + if(_.size(_selection) === 0) { + + } } function removeAll(data) { - _.forEach(data, function(obj) { - remove(obj.cid); - }.bind(this)); + _.forEach(data, function(obj) { + remove(obj.cid); + }.bind(this)); } var SelectionStore = merge(EventEmitter.prototype, { - getSelection: function() { - return _selection; - }, - getDetectCount: function() { - return _.filter(_selection, function(obj) { - return obj.type === 'detect'; - }).length; - }, - getExtraCount: function() { - return _.filter(_selection, function(obj) { - return obj.type === 'extra'; - }).length; - }, - getAPICount: function() { - return _.filter(_selection, function(obj) { - return obj.type === 'api'; - }).length; - } + getSelection: function() { + return _selection; + }, + getDetectCount: function() { + return _.filter(_selection, function(obj) { + return obj.type === 'detect'; + }).length; + }, + getExtraCount: function() { + return _.filter(_selection, function(obj) { + return obj.type === 'extra'; + }).length; + }, + getAPICount: function() { + return _.filter(_selection, function(obj) { + return obj.type === 'api'; + }).length; + } }); SelectionStore.name = 'SelectionStore'; AppDispatcher.register(function(payload) { - var action = payload.action; - switch(action.actionType) { - case 'SELECTION_ADD': - add(action.data); - break; - case 'SELECTION_REMOVE': - remove(action.cid); - break; - case 'SELECTION_ADD_ALL': - addAll(action.data); - break; - case 'SELECTION_REMOVE_ALL': - removeAll(action.data); - break; - default: - return true; - break; - } - SelectionStore.emit('change'); + var action = payload.action; + switch(action.actionType) { + case 'SELECTION_ADD': + add(action.data); + break; + case 'SELECTION_REMOVE': + remove(action.cid); + break; + case 'SELECTION_ADD_ALL': + addAll(action.data); + break; + case 'SELECTION_REMOVE_ALL': + removeAll(action.data); + break; + default: + return true; + break; + } + SelectionStore.emit('change'); }); -module.exports = SelectionStore; \ No newline at end of file +module.exports = SelectionStore;