From 3544358446d7abfc97938635abb49ee6a64e5c4e Mon Sep 17 00:00:00 2001 From: Jeremiah Date: Tue, 28 Mar 2017 20:03:11 -0700 Subject: [PATCH 01/31] scaffolding done --- app/entry.js | 0 app/index.html | 12 ++++++++++++ 2 files changed, 12 insertions(+) create mode 100644 app/entry.js create mode 100644 app/index.html diff --git a/app/entry.js b/app/entry.js new file mode 100644 index 00000000..e69de29b diff --git a/app/index.html b/app/index.html new file mode 100644 index 00000000..ded73b28 --- /dev/null +++ b/app/index.html @@ -0,0 +1,12 @@ + + + + + + + + + + + + From 3ac1e4bb5602b893bbc90229de72fb039a5c662e Mon Sep 17 00:00:00 2001 From: Jeremiah Date: Tue, 28 Mar 2017 22:22:14 -0700 Subject: [PATCH 02/31] entry.js completed --- app/entry.js | 42 +++++++++++++++++++++++++++++++++++++ app/index.html | 2 +- app/service/auth-service.js | 0 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 app/service/auth-service.js diff --git a/app/entry.js b/app/entry.js index e69de29b..0820f262 100644 --- a/app/entry.js +++ b/app/entry.js @@ -0,0 +1,42 @@ +'use stirct'; + +require('./scss/lib/main.scss'); + +const path = require('path'); +const angular = require('angular'); +const camelcase = require('camelcase'); +const pascalcase = require('pascalcase'); +const uiRouter = require('angular-ui-router'); +const ngTouch = require('angular-touch'); +const ngAnimate = require('angular-animate'); + +const cfgram = angular.module('cfgram', [ngTouch, ngAnimate, uiRouter]); + +let context = require.context('./config/', true, /\.js$/); + +context.keys().forEach( key => { + cfgram.config(context(key)); +}); + +context = require.context('./view/', true, /\.js$/); +context.keys().forEach( key => { + let name = pascalcase(path.basename(key, '.js')); + let module = context(key); + cfgram.controller(name, module); +}); + +context = require.context('./service/', true, +/\.js$/); +context.keys().forEach( key => { + let name = camelcase(path.basename(key, '.js')); + + let module = context(key); + cfgram.service(name, module); +}); + +context = require.context('./component/', true, /\.js$/); +context.keys().forEach( key => { + let name = camelcase(path.basename(key, '.js')); + let module = context(key); + cfgram.component(name, module); +}); diff --git a/app/index.html b/app/index.html index ded73b28..9c8f91c7 100644 --- a/app/index.html +++ b/app/index.html @@ -6,7 +6,7 @@ - +
diff --git a/app/service/auth-service.js b/app/service/auth-service.js new file mode 100644 index 00000000..e69de29b From 666e0e0074b7ba9edcd54c527c7ddd8df15f0fb6 Mon Sep 17 00:00:00 2001 From: Jeremiah Date: Tue, 28 Mar 2017 22:47:30 -0700 Subject: [PATCH 03/31] view folder added --- app/service/auth-service.js | 77 +++++++++++++++++++++++++++++++++++++ app/view/home/_home.scss | 0 app/view/home/home.html | 0 app/view/home/home.js | 0 4 files changed, 77 insertions(+) create mode 100644 app/view/home/_home.scss create mode 100644 app/view/home/home.html create mode 100644 app/view/home/home.js diff --git a/app/service/auth-service.js b/app/service/auth-service.js index e69de29b..9ea749bc 100644 --- a/app/service/auth-service.js +++ b/app/service/auth-service.js @@ -0,0 +1,77 @@ +'use strict'; + +module.exports = ['$q', '$log', '$http', '$window', authService]; + +function authService($q, $log, $http, $window) { + $log.debug('authService'); + + let service = {}; + let token = null; + + function setToken(_token){ + $log.debug('authService.setToken'); + + if (! _token) { + return $q.reject(new Error('no token bro')); + } + + $window.localStorage.setItem('token', _token); + token = _token; + return $q.resolve(token); + } + + service.signup = function(user) { + $log.debug('authService.signup'); + + let url = `${__ARP_URL__}/api/signup`; + let config = { + headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + } + }; + + return $http.post(url, user, config) + .then( res => { + $log.log('success:', res.data); + return setToken(res.data); + }) + .catch( err => { + $log.error('failure:', err.message); + return $q.reject(err); + }); + + }; + + service.logout = function(){ + $log.debug('authService.logout'); + + $window.localStorage.removeItem('token'); + token = null; + return $q.resolve(); + }; + + service.login = function(user){ + $log.debug('authService.login'); + + let url = `${__API_URL__}/api/login`; + let base64 = $window.btoa(`${user.username}:${user.password}`); + let config = { + headers: { + Accept: 'application/json', + Authorization: `Basic ${base64}` + } + }; + return $http.get(url,config) + .then( res => { + $log.log('success', res.data); + return setToken(res.data); + }) + .catch( err => { + $log.error(err.message); + return $q.reject(err); + }); + }; + + return service; +} diff --git a/app/view/home/_home.scss b/app/view/home/_home.scss new file mode 100644 index 00000000..e69de29b diff --git a/app/view/home/home.html b/app/view/home/home.html new file mode 100644 index 00000000..e69de29b diff --git a/app/view/home/home.js b/app/view/home/home.js new file mode 100644 index 00000000..e69de29b From 30bbaf8b701bcf72e1640375681cf743174d195d Mon Sep 17 00:00:00 2001 From: Jeremiah Date: Tue, 28 Mar 2017 23:23:47 -0700 Subject: [PATCH 04/31] scss scaffolding --- app/{view/home/home.js => scss/lib/theme/_vars.scss} | 0 app/view/home/home.html | 3 +++ 2 files changed, 3 insertions(+) rename app/{view/home/home.js => scss/lib/theme/_vars.scss} (100%) diff --git a/app/view/home/home.js b/app/scss/lib/theme/_vars.scss similarity index 100% rename from app/view/home/home.js rename to app/scss/lib/theme/_vars.scss diff --git a/app/view/home/home.html b/app/view/home/home.html index e69de29b..ddaf170f 100644 --- a/app/view/home/home.html +++ b/app/view/home/home.html @@ -0,0 +1,3 @@ +
+

welcome home!

+
From 4fb8e0570e869bd49cb365f23f3e38d0b434d1c9 Mon Sep 17 00:00:00 2001 From: Jeremiah Date: Tue, 28 Mar 2017 23:39:27 -0700 Subject: [PATCH 05/31] karma installed with other dev dependencies --- .babelrc | 3 + .eslintrc | 21 ++++++ .gitignore | 94 ++++++++++++++++++++++++++ app/component/login/_login.scss | 0 app/component/login/login.html | 32 +++++++++ app/component/login/login.js | 22 ++++++ app/component/signup/_signup.scss | 0 app/component/signup/signup.html | 24 +++++++ app/component/signup/signup.js | 26 +++++++ app/config/router_config.js | 31 +++++++++ app/scss/lib/base/_base.scss | 0 app/scss/lib/base/_reset.scss | 0 app/scss/lib/layout/_content.scss | 0 app/scss/lib/layout/_footer.scss | 0 app/scss/lib/layout/_header.scss | 0 app/scss/lib/main.scss | 17 +++++ app/view/home/home-controller.js | 9 +++ app/view/landing/_landing.scss | 0 app/view/landing/landing-controller.js | 10 +++ app/view/landing/landing.html | 25 +++++++ gulpfile.js | 23 +++++++ karma.conf.js | 25 +++++++ package.json | 61 +++++++++++++++++ webpack.config.js | 44 ++++++++++++ 24 files changed, 467 insertions(+) create mode 100644 .babelrc create mode 100644 .eslintrc create mode 100644 .gitignore create mode 100644 app/component/login/_login.scss create mode 100644 app/component/login/login.html create mode 100644 app/component/login/login.js create mode 100644 app/component/signup/_signup.scss create mode 100644 app/component/signup/signup.html create mode 100644 app/component/signup/signup.js create mode 100644 app/config/router_config.js create mode 100644 app/scss/lib/base/_base.scss create mode 100644 app/scss/lib/base/_reset.scss create mode 100644 app/scss/lib/layout/_content.scss create mode 100644 app/scss/lib/layout/_footer.scss create mode 100644 app/scss/lib/layout/_header.scss create mode 100644 app/scss/lib/main.scss create mode 100644 app/view/home/home-controller.js create mode 100644 app/view/landing/_landing.scss create mode 100644 app/view/landing/landing-controller.js create mode 100644 app/view/landing/landing.html create mode 100644 gulpfile.js create mode 100644 karma.conf.js create mode 100644 package.json create mode 100644 webpack.config.js diff --git a/.babelrc b/.babelrc new file mode 100644 index 00000000..c13c5f62 --- /dev/null +++ b/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["es2015"] +} diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 00000000..b663d772 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,21 @@ +{ + "rules": { + "no-console": "off", + "indent": [ "error", 2 ], + "quotes": [ "error", "single" ], + "semi": ["error", "always"], + "linebreak-style": [ "error", "unix" ] + }, + "env": { + "es6": true, + "node": true, + "mocha": true, + "jasmine": true + }, + "ecmaFeatures": { + "modules": true, + "experimentalObjectRestSpread": true, + "impliedStrict": true + }, + "extends": "eslint:recommended" +} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..4df309fa --- /dev/null +++ b/.gitignore @@ -0,0 +1,94 @@ +# Created by https://www.gitignore.io/api/node,osx,windows,linux +### Linux ### +*~ +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* +# KDE directory preferences +.directory +# Linux trash folder which might appear on any partition or disk +.Trash-* +# .nfs files are created when an open file is removed but is still being accessed +.nfs* +### Node ### +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +# Runtime data +pids +*.pid +build/ +*.seed +*.pid.lock +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov +# Coverage directory used by tools like istanbul +coverage +# nyc test coverage +.nyc_output +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt +# Bower dependency directory (https://bower.io/) +bower_components +# node-waf configuration +.lock-wscript +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release +# Dependency directories +node_modules/ +jspm_packages/ +# Typescript v1 declaration files +typings/ +# Optional npm cache directory +.npm +# Optional eslint cache +.eslintcache +# Optional REPL history +.node_repl_history +# Output of 'npm pack' +*.tgz +# Yarn Integrity file +.yarn-integrity +# dotenv environment variables file +.env +### OSX ### +*.DS_Store +.AppleDouble +.LSOverride +# Icon must end with two \r +Icon +# Thumbnails +._* +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk +### Windows ### +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db +# Folder config file +Desktop.ini +# Recycle Bin used on file shares +$RECYCLE.BIN/ +# Windows Installer files +*.cab +*.msi +*.msm +*.msp +# Windows shortcuts +*.lnk +# End of https://www.gitignore.io/api/node,osx,windows,linux diff --git a/app/component/login/_login.scss b/app/component/login/_login.scss new file mode 100644 index 00000000..e69de29b diff --git a/app/component/login/login.html b/app/component/login/login.html new file mode 100644 index 00000000..3216c9b7 --- /dev/null +++ b/app/component/login/login.html @@ -0,0 +1,32 @@ + diff --git a/app/component/login/login.js b/app/component/login/login.js new file mode 100644 index 00000000..58ecb75f --- /dev/null +++ b/app/component/login/login.js @@ -0,0 +1,22 @@ +'use strict'; +require('./_login.scss'); + +module.exports = { + template: require('./login.html'), + controller: ['$log', '$location', 'authService', LoginController], + controllerAs: 'loginCtrl' +}; + +function LoginController($log, $location, authService){ + $log.debug('LoginController'); + + authService.getToken() + .then( () => { + $location.url('/home'); + }); + + this.login = function(){ + $log.debug('loginCtrl.login'); + + }; +} diff --git a/app/component/signup/_signup.scss b/app/component/signup/_signup.scss new file mode 100644 index 00000000..e69de29b diff --git a/app/component/signup/signup.html b/app/component/signup/signup.html new file mode 100644 index 00000000..ea9fe413 --- /dev/null +++ b/app/component/signup/signup.html @@ -0,0 +1,24 @@ + diff --git a/app/component/signup/signup.js b/app/component/signup/signup.js new file mode 100644 index 00000000..d2a64706 --- /dev/null +++ b/app/component/signup/signup.js @@ -0,0 +1,26 @@ +'use strict'; +require('./_Signup.scss'); + +module.exports = { + template: require('./signup.html'), + controller: ['$log', '$location', 'authService', SignupController], + controllerAs: 'signupCtrl' +}; + +function SignupController($log, $location, authService){ + $log.debug('SignupController'); + + authService.getToken() + .then( () => { + $location.url('/home'); + }); + + this.signup = function(user){ + $log.debug('signupCtrl.signup'); + + authService.getToken(user) + .then( () => { + $location.url('/home'); + }); + }; +} diff --git a/app/config/router_config.js b/app/config/router_config.js new file mode 100644 index 00000000..31d817b6 --- /dev/null +++ b/app/config/router_config.js @@ -0,0 +1,31 @@ +'use strict'; + +module.exports = ['$stateProvider', '$urlRouterProvider', routerConfig]; + +function routerConfig($stateProvider, $urlRouterProvider) { + $urlRouterProvider.when('', '/join#signup'); + $urlRouterProvider.when('/', '/join#signup'); + $urlRouterProvider.when('/signup', '/join#signup'); + $urlRouterProvider.when('/login', '/join#login'); + + let states = [ + { + name: 'home', + url: '/home', + template: require('../view/home/home.html'), + controller: 'HomeController', + controllerAs: 'homeCtrl' + }, + { + name: 'landing', + url: '/join', + template: require('../view/landing/landing.html'), + controller: 'LandingController', + controllerAs: 'landingCtrl' + } + ]; + + states.forEach( state => { + $stateProvider.state(state); + }); +} diff --git a/app/scss/lib/base/_base.scss b/app/scss/lib/base/_base.scss new file mode 100644 index 00000000..e69de29b diff --git a/app/scss/lib/base/_reset.scss b/app/scss/lib/base/_reset.scss new file mode 100644 index 00000000..e69de29b diff --git a/app/scss/lib/layout/_content.scss b/app/scss/lib/layout/_content.scss new file mode 100644 index 00000000..e69de29b diff --git a/app/scss/lib/layout/_footer.scss b/app/scss/lib/layout/_footer.scss new file mode 100644 index 00000000..e69de29b diff --git a/app/scss/lib/layout/_header.scss b/app/scss/lib/layout/_header.scss new file mode 100644 index 00000000..e69de29b diff --git a/app/scss/lib/main.scss b/app/scss/lib/main.scss new file mode 100644 index 00000000..0c8fa713 --- /dev/null +++ b/app/scss/lib/main.scss @@ -0,0 +1,17 @@ +body{ + background-color: maroon; +} + +/* BASE */ +@import "lib/base/reset"; +@import "lib/base/base"; + +/* LAYOUT */ +@import "lib/layout/content"; +@import "lib/layout/header"; + +/* COMPONENT */ +@import "../component/login/login"; +@import "../component/signup/signup"; +@import "../component/player-info/player-info"; +/* @import "lib/base/reset"; */ diff --git a/app/view/home/home-controller.js b/app/view/home/home-controller.js new file mode 100644 index 00000000..dd9d54bf --- /dev/null +++ b/app/view/home/home-controller.js @@ -0,0 +1,9 @@ +'use strict'; + +require('./_home.scss'); + +module.exports = ['$log', HomeController]; + +function HomeController($log) { + $log.debug('HomeController'); +} diff --git a/app/view/landing/_landing.scss b/app/view/landing/_landing.scss new file mode 100644 index 00000000..e69de29b diff --git a/app/view/landing/landing-controller.js b/app/view/landing/landing-controller.js new file mode 100644 index 00000000..ad4e3b7e --- /dev/null +++ b/app/view/landing/landing-controller.js @@ -0,0 +1,10 @@ +'use strict'; + +require('./_landing.scss'); + +module.exports = ['$log', '$location', '$rootScope', 'authService', LandingController]; + +function LandingController($log, $location, authService) { + let url = $location.url(); + this.showSignup = url === '/join#signup' || url === '/join'; +} diff --git a/app/view/landing/landing.html b/app/view/landing/landing.html new file mode 100644 index 00000000..c92448ac --- /dev/null +++ b/app/view/landing/landing.html @@ -0,0 +1,25 @@ +
+
+
+ +

already a member?

+ + sign in here. + +
+
+ +
+
+ +

want to sign up?

+ + sign up here. + +
+
+
diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 00000000..365d83da --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,23 @@ +'use strict'; + +const gulp = require('gulp'); +const eslint = require('gulp-eslint'); +const mocha = require ('gulp-mocha'); + +gulp.task('test', function(){ + gulp.src('./test/*-test.js', { read: false}) + .pipe(mocha({ reporter: 'spec'})); +}); + +gulp.task('lint', function() { + return gulp.src(['**/*.js', '!node_modules']) + .pipe(eslint()) + .pipe(eslint.format()) + .pipe(eslint.failAfterError()); +}); + +gulp.task('dev', function(){ + gulp.watch(['**/*.js', '!node_modules/**'], ['lint', 'test']); +}); + +gulp.task('default', ['dev']); \ No newline at end of file diff --git a/karma.conf.js b/karma.conf.js new file mode 100644 index 00000000..58de3786 --- /dev/null +++ b/karma.conf.js @@ -0,0 +1,25 @@ +const webpackConfig = require('./webpack.config.js'); + +module.exports = function(config) { + config.set({ + webpack: webpackConfig, + basePath: '', + frameworks: ['jasmine'], + files: [ + 'test/**/*-test.js', + ], + exclude: [ + ], + preprocessors: { + 'test/**/*-test.js': ['webpack'], + }, + reporters: ['mocha'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['PhantomJS'], + singleRun: false, + concurrency: Infinity, + }); +}; diff --git a/package.json b/package.json new file mode 100644 index 00000000..f74499c9 --- /dev/null +++ b/package.json @@ -0,0 +1,61 @@ +{ + "name": "25-angular_auth", + "version": "1.0.0", + "description": "![cf](https://i.imgur.com/7v5ASc8.png) Lab 25 - Client Side Auth ======", + "scripts": { + "build": "./node_modules/webpack/bin/webpack.js", + "watch": "./node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot", + "lint": "./node_modules/eslint/lib/eslint.js ." + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "angular": "^1.6.3", + "angular-animate": "^1.6.3", + "angular-route": "^1.6.3", + "angular-touch": "^1.6.3", + "angular-ui-router": "^0.4.2", + "babel-core": "^6.24.0", + "babel-loader": "^6.4.1", + "babel-preset-es2015": "^6.24.0", + "camelcase": "^4.0.0", + "clean-webpack-plugin": "^0.1.16", + "css-loader": "^0.27.3", + "dotenv": "^4.0.0", + "extract-text-webpack-plugin": "^2.1.0", + "file-loader": "^0.10.1", + "html-loader": "^0.4.5", + "html-webpack-plugin": "^2.28.0", + "node-sass": "^4.5.1", + "pascalcase": "^0.1.1", + "resolve-url-loader": "^2.0.2", + "sass-loader": "^6.0.3", + "style-loader": "^0.16.1", + "ui-router": "^1.0.0-alpha.3", + "url-loader": "^0.5.8", + "webpack": "^2.3.2" + }, + "devDependencies": { + "webpack-dev-server": "^2.4.2", + "angular-mocks": "^1.6.3", + "eslint": "^3.18.0", + "jasmine-core": "^2.5.2", + "karma": "^1.5.0", + "karma-jasmine": "^1.1.0", + "karma-mocha-reporter": "^2.2.3", + "karma-phantomjs-launcher": "^1.0.4", + "karma-webpack": "^2.0.3" +}, + "repository": { + "type": "git", + "url": "git+https://github.com/jtwalters25/25-angular_auth.git" + }, + "keywords": [], + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/jtwalters25/25-angular_auth/issues" + }, + "homepage": "https://github.com/jtwalters25/25-angular_auth#readme" +} diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 00000000..f0f9a59e --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,44 @@ +'use strict'; + +require('dotenv').load(); + +const webpack = require('webpack'); +const HTMLPlugin = require('html-webpack-plugin'); +const ExtractTextPlugin = require('extract-text-webpack-plugin'); + +module.exports = { + devtool: 'eval', + entry: `${__dirname}/app/entry.js`, + output: { + filename: 'bundle.js', + path: `${__dirname}/build` + }, + plugins: [ + new HTMLPlugin({ + template: `${__dirname}/app/index.html` + }), + new ExtractTextPlugin('bundle.css'), + // webpack constant env varible used for our app + new webpack.DefinePlugin({ + __API_URL__: JSON.stringify(process.env.API_URL) + }) + // API_URL is for our backend + ], + module: { + rules: [ + { + test: /\.js$/, + exclude: /node_modules/, + loader: 'babel-loader' + }, + { + test: /\.html$/, + loader: 'html-loader' + }, + { + test: /\.scss$/, + loader: ExtractTextPlugin.extract(['css-loader', 'sass-loader']) + } + ] + } +}; From f10f716b240fe121bdc5de15d8b1959eda87c8a3 Mon Sep 17 00:00:00 2001 From: Jeremiah Date: Tue, 28 Mar 2017 23:43:53 -0700 Subject: [PATCH 06/31] main.scss --- app/scss/lib/base/_reset.scss | 48 ++++++++++++++++++++++++++++++++ app/scss/lib/layout/_footer.scss | 3 ++ app/scss/lib/layout/_header.scss | 3 ++ app/scss/{lib => }/main.scss | 0 4 files changed, 54 insertions(+) rename app/scss/{lib => }/main.scss (100%) diff --git a/app/scss/lib/base/_reset.scss b/app/scss/lib/base/_reset.scss index e69de29b..ed11813c 100644 --- a/app/scss/lib/base/_reset.scss +++ b/app/scss/lib/base/_reset.scss @@ -0,0 +1,48 @@ +/* http://meyerweb.com/eric/tools/css/reset/ + v2.0 | 20110126 + License: none (public domain) +*/ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} diff --git a/app/scss/lib/layout/_footer.scss b/app/scss/lib/layout/_footer.scss index e69de29b..6f19c13a 100644 --- a/app/scss/lib/layout/_footer.scss +++ b/app/scss/lib/layout/_footer.scss @@ -0,0 +1,3 @@ +footer{ + +} diff --git a/app/scss/lib/layout/_header.scss b/app/scss/lib/layout/_header.scss index e69de29b..8ee8bc29 100644 --- a/app/scss/lib/layout/_header.scss +++ b/app/scss/lib/layout/_header.scss @@ -0,0 +1,3 @@ +header{ + +} diff --git a/app/scss/lib/main.scss b/app/scss/main.scss similarity index 100% rename from app/scss/lib/main.scss rename to app/scss/main.scss From 5c29d3ec5edf44613966150f3688bfaeb7105b1e Mon Sep 17 00:00:00 2001 From: Jeremiah Date: Tue, 28 Mar 2017 23:54:47 -0700 Subject: [PATCH 07/31] css work --- app/entry.js | 2 +- app/scss/lib/base/_base.scss | 17 +++++++++++++++++ app/scss/lib/theme/_vars.scss | 14 ++++++++++++++ app/scss/main.scss | 8 +++----- 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/app/entry.js b/app/entry.js index 0820f262..2617d508 100644 --- a/app/entry.js +++ b/app/entry.js @@ -1,6 +1,6 @@ 'use stirct'; -require('./scss/lib/main.scss'); +require('./scss/main.scss'); const path = require('path'); const angular = require('angular'); diff --git a/app/scss/lib/base/_base.scss b/app/scss/lib/base/_base.scss index e69de29b..a037547e 100644 --- a/app/scss/lib/base/_base.scss +++ b/app/scss/lib/base/_base.scss @@ -0,0 +1,17 @@ +@import '../theme/vars'; + +body{ + background-color: $primarycolor; + font-size: 2.5vw; + font-family: times; + color: $secondarycolor; +} + +a{ + text-decoration: none; + color: navy; + + &hover{ + color:white; + } +} diff --git a/app/scss/lib/theme/_vars.scss b/app/scss/lib/theme/_vars.scss index e69de29b..24bbefdd 100644 --- a/app/scss/lib/theme/_vars.scss +++ b/app/scss/lib/theme/_vars.scss @@ -0,0 +1,14 @@ +//:::: COLORS :::: +$primarycolor: rgb(107, 19, 23); +$secondarycolor: #ccc; +$black: #000; +$white: #fff; + +//:::: LAYOUT :::: +$gutter-std: 5%; +$gutter-sm: $gutter-std / 2; + + +//:::: ELEMENTS :::: +$border-radius: 3px; +$input-padding: 2%; diff --git a/app/scss/main.scss b/app/scss/main.scss index 0c8fa713..d12132e2 100644 --- a/app/scss/main.scss +++ b/app/scss/main.scss @@ -1,6 +1,3 @@ -body{ - background-color: maroon; -} /* BASE */ @import "lib/base/reset"; @@ -13,5 +10,6 @@ body{ /* COMPONENT */ @import "../component/login/login"; @import "../component/signup/signup"; -@import "../component/player-info/player-info"; -/* @import "lib/base/reset"; */ + +/* VIEW */ +@import "../view/landing/landing"; From 889483aeab43fed2ff210f8befb2e478bfef9bf1 Mon Sep 17 00:00:00 2001 From: Jeremiah Date: Wed, 29 Mar 2017 13:47:05 -0700 Subject: [PATCH 08/31] working on scss --- app/component/signup/_signup.scss | 13 +++++++++++++ app/index.html | 14 +++++++++++--- app/scss/lib/base/_base.scss | 13 ++++++++++++- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/app/component/signup/_signup.scss b/app/component/signup/_signup.scss index e69de29b..dd23ca32 100644 --- a/app/component/signup/_signup.scss +++ b/app/component/signup/_signup.scss @@ -0,0 +1,13 @@ +@import '../../scss/lib/theme/vars'; + +.signup{ + margin: $gutter-std; + height: 85%; + width: 80%; + border: solid 2px yellow; +} + +input-std{ + text-align: center; + width:60%; +} diff --git a/app/index.html b/app/index.html index 9c8f91c7..2d2c3842 100644 --- a/app/index.html +++ b/app/index.html @@ -3,10 +3,18 @@ - + CF-GRAM - +
+
+ +
+ +
+
-
diff --git a/app/scss/lib/base/_base.scss b/app/scss/lib/base/_base.scss index a037547e..ee018d7d 100644 --- a/app/scss/lib/base/_base.scss +++ b/app/scss/lib/base/_base.scss @@ -1,10 +1,11 @@ @import '../theme/vars'; body{ - background-color: $primarycolor; + background-color: $secondarycolor; font-size: 2.5vw; font-family: times; color: $secondarycolor; + display: relative; } a{ @@ -15,3 +16,13 @@ a{ color:white; } } + +.signup-form{ + margin: 15px; + height:400px; + width: 50%; +} +main{ + background-color: $primarycolor; + margin: $gutter-std; +} From f811cb4fb48b34680e73d8c0640a6863c36cadaf Mon Sep 17 00:00:00 2001 From: Jeremiah Date: Wed, 29 Mar 2017 15:17:49 -0700 Subject: [PATCH 09/31] scss wireframe --- app/component/signup/_signup.scss | 10 ++++- app/component/signup/signup.html | 1 + app/index.html | 2 +- app/scss/lib/base/_base.scss | 70 ++++++++++++++++++++++++++++++- app/scss/lib/layout/_content.scss | 6 +++ app/scss/lib/theme/_vars.scss | 4 +- app/view/landing/_landing.scss | 6 +++ 7 files changed, 94 insertions(+), 5 deletions(-) diff --git a/app/component/signup/_signup.scss b/app/component/signup/_signup.scss index dd23ca32..0523efbd 100644 --- a/app/component/signup/_signup.scss +++ b/app/component/signup/_signup.scss @@ -4,10 +4,18 @@ margin: $gutter-std; height: 85%; width: 80%; - border: solid 2px yellow; + + + h2{ + float: left; + font-size: 2vw; + margin-bottom: 0px; + margin-left:20px; + } } input-std{ text-align: center; width:60%; + height:10%; } diff --git a/app/component/signup/signup.html b/app/component/signup/signup.html index ea9fe413..7a0d1a9d 100644 --- a/app/component/signup/signup.html +++ b/app/component/signup/signup.html @@ -1,4 +1,5 @@ diff --git a/app/component/navbar/_navbar.scss b/app/component/navbar/_navbar.scss index 72a67d72..ed8fba94 100644 --- a/app/component/navbar/_navbar.scss +++ b/app/component/navbar/_navbar.scss @@ -1 +1,19 @@ -@import '../../../scss/lib/theme/vars'; +@import '../../scss/lib/theme/vars'; + +.navbar { + background-color: $secondarycolor; + color: $white; + height:90px; + img{ + height: 70px; + width: auto; + margin: 1%; + display: inline-block; + vertical-align: middle; + } + h1{ + display: inline-block; + font-size: 2vw; + vertical-align: middle; + } +} diff --git a/app/component/navbar/navbar.html b/app/component/navbar/navbar.html index 12fe3bc7..2ada27d8 100644 --- a/app/component/navbar/navbar.html +++ b/app/component/navbar/navbar.html @@ -1,6 +1,6 @@ diff --git a/app/component/gallery/edit-gallery/edit-gallery.js b/app/component/gallery/edit-gallery/edit-gallery.js index 8558e121..a0adfd8c 100644 --- a/app/component/gallery/edit-gallery/edit-gallery.js +++ b/app/component/gallery/edit-gallery/edit-gallery.js @@ -15,6 +15,7 @@ function EditGalleryController($log, galleryService){ $log.debug('EditGalleryController'); this.updateGallery = function(){ + $log.debug('EditGalleryController.updateGallery'); galleryService.updateGallery(this.gallery._id, this.gallery); }; } diff --git a/app/component/gallery/gallery-item/_gallery-item.scss b/app/component/gallery/gallery-item/_gallery-item.scss index 72a67d72..efbf9297 100644 --- a/app/component/gallery/gallery-item/_gallery-item.scss +++ b/app/component/gallery/gallery-item/_gallery-item.scss @@ -1 +1,15 @@ @import '../../../scss/lib/theme/vars'; + +.current-item{ + background-color:grey; + padding:20px; + margin-top:30px; + margin-bottom:30px; + border-radius: 10px 10px 10px; +} + +h3{ + font-size: 2vw; + color:rgb(34, 33, 33); + padding: 30px; +} diff --git a/app/component/gallery/gallery-item/gallery-item.html b/app/component/gallery/gallery-item/gallery-item.html index 76bf190a..b6a7f1d8 100644 --- a/app/component/gallery/gallery-item/gallery-item.html +++ b/app/component/gallery/gallery-item/gallery-item.html @@ -1,11 +1,11 @@ diff --git a/app/component/navbar/_navbar.scss b/app/component/navbar/_navbar.scss index ed8fba94..2c506f67 100644 --- a/app/component/navbar/_navbar.scss +++ b/app/component/navbar/_navbar.scss @@ -16,4 +16,8 @@ font-size: 2vw; vertical-align: middle; } + button{ + margin-top: -85px; + + } } diff --git a/app/scss/lib/base/_base.scss b/app/scss/lib/base/_base.scss index 2f180499..c22c1ddd 100644 --- a/app/scss/lib/base/_base.scss +++ b/app/scss/lib/base/_base.scss @@ -26,7 +26,7 @@ body{ border: 1px solid grey; margin: $gutter-std /2; margin-left: 2%; - font-size: 16px; + font-size: 25px; text-align: left; height: 60px; padding:5px; @@ -38,15 +38,34 @@ body{ padding: 0 $gutter-std*2.5; background-color: $secondarycolor; color: $white; - font-weight: 300; + font-size: x-large; + font-weight: lighter; + height:70px; float:right; - margin-right:-20px; + margin-right:0px; + border-radius: 10px 10px 10px } + .delete-btn-std{ + + width: unset; + padding: 0 $gutter-std*2.5; + background-color: $primarycolor / 2; + color: $black; + font-size: x-large; + font-weight: lighter; + height:70px; + float:right; + margin-right:0px; + border-radius: 10px 10px 10px + } + + footer{ background-color: grey; height:70px; width: 100%; + margin-top: 400px; // position: absolute; // bottom: 0px; } diff --git a/app/scss/lib/layout/_footer.scss b/app/scss/lib/layout/_footer.scss index 6f19c13a..c5311f9d 100644 --- a/app/scss/lib/layout/_footer.scss +++ b/app/scss/lib/layout/_footer.scss @@ -1,3 +1,3 @@ footer{ - + } diff --git a/app/service/auth-service.js b/app/service/auth-service.js index b5d23276..e0dbfa87 100644 --- a/app/service/auth-service.js +++ b/app/service/auth-service.js @@ -20,10 +20,21 @@ function authService($q, $log, $http, $window) { return $q.resolve(token); } + service.getToken = function() { + $log.debug('authService.getToken'); + if (token) { + return $q.resolve(token); + } + + token = $window.localStorage.getItem('token'); + if (token) return $q.resolve(token); + return $q.reject(new Error('token not found')); + }; + service.signup = function(user) { $log.debug('authService.signup'); - let url = `${__ARP_URL__}/api/signup`; + let url = `${__API_URL__}/api/signup`; let config = { headers: { 'Content-Type': 'application/json', diff --git a/app/service/gallery-service.js b/app/service/gallery-service.js index d7a67ef7..8043f6ea 100644 --- a/app/service/gallery-service.js +++ b/app/service/gallery-service.js @@ -89,8 +89,8 @@ function galleryService($q, $log, $http, authService) { }); }; - service.updateGalleries = function (galleryID, galleryData) { - $log.debug('galleryService.updateGalleries'); + service.updateGallery = function (galleryID, galleryData) { + $log.debug('galleryService.updateGallery'); return authService.getToken() .then( token => { @@ -129,7 +129,7 @@ function galleryService($q, $log, $http, authService) { let url = `${__API_URL__}/api/gallery/${galleryID}`; let config = { headers: { - Authorization: `Beare ${token}` + Authorization: `Bearer ${token}` } }; @@ -139,7 +139,7 @@ function galleryService($q, $log, $http, authService) { for (let i=0; i -

welcome home!

+ + +
    +

    Galleries

    + +
From 0d7196f53bf7716eb1529c99ac1a952a63ba4e22 Mon Sep 17 00:00:00 2001 From: Jeremiah Date: Fri, 31 Mar 2017 18:03:08 -0700 Subject: [PATCH 19/31] spacing with multiple galleries adjusted --- app/component/gallery/gallery-item/_gallery-item.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/component/gallery/gallery-item/_gallery-item.scss b/app/component/gallery/gallery-item/_gallery-item.scss index efbf9297..2eec2e1a 100644 --- a/app/component/gallery/gallery-item/_gallery-item.scss +++ b/app/component/gallery/gallery-item/_gallery-item.scss @@ -3,7 +3,7 @@ .current-item{ background-color:grey; padding:20px; - margin-top:30px; + margin-top:120px; margin-bottom:30px; border-radius: 10px 10px 10px; } From 362e41c000e58a11f0ac4c50aedec2da1d0cfad6 Mon Sep 17 00:00:00 2001 From: Jeremiah Date: Mon, 3 Apr 2017 09:49:46 -0700 Subject: [PATCH 20/31] login functionality fixed --- app/component/gallery/gallery-item/_gallery-item.scss | 6 ++++++ app/component/gallery/gallery-item/gallery-item.html | 6 +++--- app/component/landing/login/login.js | 5 ++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/component/gallery/gallery-item/_gallery-item.scss b/app/component/gallery/gallery-item/_gallery-item.scss index 2eec2e1a..9d63f0b0 100644 --- a/app/component/gallery/gallery-item/_gallery-item.scss +++ b/app/component/gallery/gallery-item/_gallery-item.scss @@ -6,6 +6,12 @@ margin-top:120px; margin-bottom:30px; border-radius: 10px 10px 10px; + + .item-label{ + font-size: 2vw; + color:rgb(57, 56, 56); + + } } h3{ diff --git a/app/component/gallery/gallery-item/gallery-item.html b/app/component/gallery/gallery-item/gallery-item.html index b6a7f1d8..06bec505 100644 --- a/app/component/gallery/gallery-item/gallery-item.html +++ b/app/component/gallery/gallery-item/gallery-item.html @@ -1,11 +1,11 @@