diff --git a/README.md b/README.md index 53517ca..3f26055 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,45 @@ -# studyCompanion -An app to help you track your study time. +Project #1 – Group 2 +Trilogy – Full Stack Development Program + +University of Miami Cohort 2017 + +Team Members +Ashley Calixte (@Ashleycalx) + +Calvin Mendoza (@calvinmen1988) + +Ejike Onwe (@reyhenry38) + +Mariela Pascual (@mariela2) + +Study Buddy +Project Description: +Study Buddy is an interactive tool that allows the user to actively track study time and increase overall productively. The application will utilize an API intended to increase users’ motivation, by generating motivational quotes randomly. In each instance where the user stops the timer for the day, the session will be stored in a database.This will allow the user to actively track progress throughout the week using an integrated chart within the application. In addition to this, the user will have the ability to use their current location for traffic updates and directions to their intended facility or program location. + +Key Elements & Features: +Productivity/ Focus + +Motivation + +Time Management + +Tracking work hours per day/week using insightful charts + +Traffic update from current location to class + +Motivation +How to effectively track study time on a weekly bases, and increase student productively and focus. Inspired by weekly cohort survey (time spent on studying, assigments and such). + +Tech/framework used +HTML, CSS, JavaScript, JQuery + +New Technology used +Chart.js + +API Reference +Google Maps (Current traffic updates, and direction) + +Motivational Quotes (Generates quotes) + +Copyright +Ashley Calixte(@Ashleycalx), Calvin Mendoza(@calvinmen1988), Ejike Onwe(@reyhenry38), Mariela Pascual (@mariela) © 2017 All Rights Reserved. diff --git a/assets/css/style.css b/assets/css/style.css new file mode 100755 index 0000000..07df7ea --- /dev/null +++ b/assets/css/style.css @@ -0,0 +1,164 @@ +/*----------------------- +----- Basic Styles ----- +-------------------------*/ +body{ + font-family: Raleway, Arial, sans-serif; + font-size:16px; + font-weight:300; + color:#6d6d6d; + overflow-x:hidden; +} + +#sectionHeaders{ + margin-top: 80px; + font-size: 40px; + font-weight:300; +} +/*----------------------- +---- Header Styles ---- +-------------------------*/ +#home{ + width: 100%; + height: 650px; + background:url('../img/header-bg.jpg') no-repeat; + background-repeat: no-repeat; + background-position: center; + background-size: cover; + color:white; + border-bottom: 8px solid #dbb98f; +} +#headerText{ + + margin-top: 15%; + font-size:70px; + font-weight:500; +} +#quoteText{ + margin-top: 5%; +} +#quote-div{ + margin-top: 20%; + } + +#quote{ + font-size: 30px; + font-style: oblique; +} +#quoteButton{ + margin-top: 3%; + background-color: #dbb98f; + padding: 10px; + border: none; +} +#quoteText{ + font-size:26px; + font-weight:300; + +} + +/*Quotes Style Starts here*/ + +.quote { + padding: 1em 1.5em 0; + font-size: 2em; + font-weight: bold; + font-family: cursive; +} + +.author { + font-size: 1.5em; + font-style: italic; +} + + +/*Quotes Styles Ends here*/ + + +/*----------------------- +---- Timer Styles ---- +-------------------------*/ +#timerSection{ + background-color: #fff; + /*box-shadow: 0 0 50px rgba(0,0,0,0.5);*/ + width: 100%; + height: 800px; +} + +#timer{ + margin-top: 80px; + font-size: 80px; + +} + +#buttonsContainer{ + margin: 100px 50px 0 50px; +} +#start{ + height: 100px; + width: 100px; +} +#start:hover { + opacity: .5; +} + +#pause{ + height: 100px; + width: 100px; +} +#pause:hover { + opacity: .5; +} + +#stop{ + height: 100px; + width: 100px; +} +#stop:hover { + opacity: .5; +} + +#textBtn{ + margin: 40px 80px; +} + +/*----------------------- +---- Chart Styles ---- +-------------------------*/ +#chartSection{ + width: 100%; + height: 750px; + background-color: #fff; + +} +#chartContainer{ + padding:50px; + width: 800px; + height:500px; +} + +/*----------------------- +---- Traffic Styles ---- +-------------------------*/ +#trafficSection{ + width: 100%; + height: 600px; + border-top: 8px solid #dbb98f; + border-bottom: 8px solid #dbb98f; + background-repeat: no-repeat; + background-position: center; + background-size: cover; +} + +/*----------------------- +---- Footer Styles ---- +-------------------------*/ + +.footer{ + width: 100%; + height: 100px; + background-color: #334958; +} + +#footer{ + margin-top: 35px; +} diff --git a/assets/img/header-bg.jpg b/assets/img/header-bg.jpg new file mode 100755 index 0000000..4c11cdd Binary files /dev/null and b/assets/img/header-bg.jpg differ diff --git a/assets/img/pause.png b/assets/img/pause.png new file mode 100755 index 0000000..23ba2c8 Binary files /dev/null and b/assets/img/pause.png differ diff --git a/assets/img/play.png b/assets/img/play.png new file mode 100755 index 0000000..f3d9bdd Binary files /dev/null and b/assets/img/play.png differ diff --git a/assets/img/stop.png b/assets/img/stop.png new file mode 100755 index 0000000..39e6fb1 Binary files /dev/null and b/assets/img/stop.png differ diff --git a/assets/img/traffic.jpg b/assets/img/traffic.jpg new file mode 100755 index 0000000..55c3a8b Binary files /dev/null and b/assets/img/traffic.jpg differ diff --git a/assets/js/require.js b/assets/js/require.js new file mode 100755 index 0000000..a3ca583 --- /dev/null +++ b/assets/js/require.js @@ -0,0 +1,5 @@ +/** vim: et:ts=4:sw=4:sts=4 + * @license RequireJS 2.3.5 Copyright jQuery Foundation and other contributors. + * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE + */ +var requirejs,require,define;!function(global,setTimeout){function commentReplace(e,t){return t||""}function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){if(e){var i;for(i=0;i-1&&(!e[i]||!t(e[i],i,e));i-=1);}}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var i;for(i in e)if(hasProp(e,i)&&t(e[i],i))break}function mixin(e,t,i,r){return t&&eachProp(t,function(t,n){!i&&hasProp(e,n)||(!r||"object"!=typeof t||!t||isArray(t)||isFunction(t)||t instanceof RegExp?e[n]=t:(e[n]||(e[n]={}),mixin(e[n],t,i,r)))}),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),function(e){t=t[e]}),t}function makeError(e,t,i,r){var n=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return n.requireType=e,n.requireModules=r,i&&(n.originalError=i),n}function newContext(e){function t(e){var t,i;for(t=0;t0&&(e.splice(t-1,2),t-=2)}}function i(e,i,r){var n,o,a,s,u,c,d,p,f,l,h=i&&i.split("/"),m=y.map,g=m&&m["*"];if(e&&(c=(e=e.split("/")).length-1,y.nodeIdCompat&&jsSuffixRegExp.test(e[c])&&(e[c]=e[c].replace(jsSuffixRegExp,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),t(e),e=e.join("/")),r&&m&&(h||g)){e:for(a=(o=e.split("/")).length;a>0;a-=1){if(u=o.slice(0,a).join("/"),h)for(s=h.length;s>0;s-=1)if((n=getOwn(m,h.slice(0,s).join("/")))&&(n=getOwn(n,u))){d=n,p=a;break e}!f&&g&&getOwn(g,u)&&(f=getOwn(g,u),l=a)}!d&&f&&(d=f,p=l),d&&(o.splice(0,p,d),e=o.join("/"))}return getOwn(y.pkgs,e)||e}function r(e){isBrowser&&each(scripts(),function(t){if(t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===q.contextName)return t.parentNode.removeChild(t),!0})}function n(e){var t=getOwn(y.paths,e);if(t&&isArray(t)&&t.length>1)return t.shift(),q.require.undef(e),q.makeRequire(null,{skipMap:!0})([e]),!0}function o(e){var t,i=e?e.indexOf("!"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function a(e,t,r,n){var a,s,u,c,d=null,p=t?t.name:null,f=e,l=!0,h="";return e||(l=!1,e="_@r"+(T+=1)),c=o(e),d=c[0],e=c[1],d&&(d=i(d,p,n),s=getOwn(j,d)),e&&(d?h=r?e:s&&s.normalize?s.normalize(e,function(e){return i(e,p,n)}):-1===e.indexOf("!")?i(e,p,n):e:(d=(c=o(h=i(e,p,n)))[0],h=c[1],r=!0,a=q.nameToUrl(h))),u=!d||s||r?"":"_unnormalized"+(A+=1),{prefix:d,name:h,parentMap:t,unnormalized:!!u,url:a,originalName:f,isDefine:l,id:(d?d+"!"+h:h)+u}}function s(e){var t=e.id,i=getOwn(S,t);return i||(i=S[t]=new q.Module(e)),i}function u(e,t,i){var r=e.id,n=getOwn(S,r);!hasProp(j,r)||n&&!n.defineEmitComplete?(n=s(e)).error&&"error"===t?i(n.error):n.on(t,i):"defined"===t&&i(j[r])}function c(e,t){var i=e.requireModules,r=!1;t?t(e):(each(i,function(t){var i=getOwn(S,t);i&&(i.error=e,i.events.error&&(r=!0,i.emit("error",e)))}),r||req.onError(e))}function d(){globalDefQueue.length&&(each(globalDefQueue,function(e){var t=e[0];"string"==typeof t&&(q.defQueueMap[t]=!0),O.push(e)}),globalDefQueue=[])}function p(e){delete S[e],delete k[e]}function f(e,t,i){var r=e.map.id;e.error?e.emit("error",e.error):(t[r]=!0,each(e.depMaps,function(r,n){var o=r.id,a=getOwn(S,o);!a||e.depMatched[n]||i[o]||(getOwn(t,o)?(e.defineDep(n,j[o]),e.check()):f(a,t,i))}),i[r]=!0)}function l(){var e,t,i=1e3*y.waitSeconds,o=i&&q.startTime+i<(new Date).getTime(),a=[],s=[],u=!1,d=!0;if(!x){if(x=!0,eachProp(k,function(e){var i=e.map,c=i.id;if(e.enabled&&(i.isDefine||s.push(e),!e.error))if(!e.inited&&o)n(c)?(t=!0,u=!0):(a.push(c),r(c));else if(!e.inited&&e.fetched&&i.isDefine&&(u=!0,!i.prefix))return d=!1}),o&&a.length)return e=makeError("timeout","Load timeout for modules: "+a,null,a),e.contextName=q.contextName,c(e);d&&each(s,function(e){f(e,{},{})}),o&&!t||!u||!isBrowser&&!isWebWorker||w||(w=setTimeout(function(){w=0,l()},50)),x=!1}}function h(e){hasProp(j,e[0])||s(a(e[0],null,!0)).init(e[1],e[2])}function m(e,t,i,r){e.detachEvent&&!isOpera?r&&e.detachEvent(r,t):e.removeEventListener(i,t,!1)}function g(e){var t=e.currentTarget||e.srcElement;return m(t,q.onScriptLoad,"load","onreadystatechange"),m(t,q.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}function v(){var e;for(d();O.length;){if(null===(e=O.shift())[0])return c(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));h(e)}q.defQueueMap={}}var x,b,q,E,w,y={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},S={},k={},M={},O=[],j={},P={},R={},T=1,A=1;return E={require:function(e){return e.require?e.require:e.require=q.makeRequire(e.map)},exports:function(e){if(e.usingExports=!0,e.map.isDefine)return e.exports?j[e.map.id]=e.exports:e.exports=j[e.map.id]={}},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(y.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}},b=function(e){this.events=getOwn(M,e.id)||{},this.map=e,this.shim=getOwn(y.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},b.prototype={init:function(e,t,i,r){r=r||{},this.inited||(this.factory=t,i?this.on("error",i):this.events.error&&(i=bind(this,function(e){this.emit("error",e)})),this.depMaps=e&&e.slice(0),this.errback=i,this.inited=!0,this.ignore=r.ignore,r.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(!this.fetched){this.fetched=!0,q.startTime=(new Date).getTime();var e=this.map;if(!this.shim)return e.prefix?this.callPlugin():this.load();q.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()}))}},load:function(){var e=this.map.url;P[e]||(P[e]=!0,q.load(this.map.id,e))},check:function(){if(this.enabled&&!this.enabling){var e,t,i=this.map.id,r=this.depExports,n=this.exports,o=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(o)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{n=q.execCb(i,o,r,n)}catch(t){e=t}else n=q.execCb(i,o,r,n);if(this.map.isDefine&&void 0===n&&((t=this.module)?n=t.exports:this.usingExports&&(n=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",c(this.error=e)}else n=o;if(this.exports=n,this.map.isDefine&&!this.ignore&&(j[i]=n,req.onResourceLoad)){var a=[];each(this.depMaps,function(e){a.push(e.normalizedMap||e)}),req.onResourceLoad(q,this.map,a)}p(i),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else hasProp(q.defQueueMap,i)||this.fetch()}},callPlugin:function(){var e=this.map,t=e.id,r=a(e.prefix);this.depMaps.push(r),u(r,"defined",bind(this,function(r){var n,o,d,f=getOwn(R,this.map.id),l=this.map.name,h=this.map.parentMap?this.map.parentMap.name:null,m=q.makeRequire(e.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(r.normalize&&(l=r.normalize(l,function(e){return i(e,h,!0)})||""),o=a(e.prefix+"!"+l,this.map.parentMap,!0),u(o,"defined",bind(this,function(e){this.map.normalizedMap=o,this.init([],function(){return e},null,{enabled:!0,ignore:!0})})),void((d=getOwn(S,o.id))&&(this.depMaps.push(o),this.events.error&&d.on("error",bind(this,function(e){this.emit("error",e)})),d.enable()))):f?(this.map.url=q.nameToUrl(f),void this.load()):((n=bind(this,function(e){this.init([],function(){return e},null,{enabled:!0})})).error=bind(this,function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(S,function(e){0===e.map.id.indexOf(t+"_unnormalized")&&p(e.map.id)}),c(e)}),n.fromText=bind(this,function(i,r){var o=e.name,u=a(o),d=useInteractive;r&&(i=r),d&&(useInteractive=!1),s(u),hasProp(y.config,t)&&(y.config[o]=y.config[t]);try{req.exec(i)}catch(e){return c(makeError("fromtexteval","fromText eval for "+t+" failed: "+e,e,[t]))}d&&(useInteractive=!0),this.depMaps.push(u),q.completeLoad(o),m([o],n)}),void r.load(e.name,m,n,y))})),q.enable(r,this),this.pluginMaps[r.id]=r},enable:function(){k[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,t){var i,r,n;if("string"==typeof e){if(e=a(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,n=getOwn(E,e.id))return void(this.depExports[t]=n(this));this.depCount+=1,u(e,"defined",bind(this,function(e){this.undefed||(this.defineDep(t,e),this.check())})),this.errback?u(e,"error",bind(this,this.errback)):this.events.error&&u(e,"error",bind(this,function(e){this.emit("error",e)}))}i=e.id,r=S[i],hasProp(E,i)||!r||r.enabled||q.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var t=getOwn(S,e.id);t&&!t.enabled&&q.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,t){var i=this.events[e];i||(i=this.events[e]=[]),i.push(t)},emit:function(e,t){each(this.events[e],function(e){e(t)}),"error"===e&&delete this.events[e]}},q={config:y,contextName:e,registry:S,defined:j,urlFetched:P,defQueue:O,defQueueMap:{},Module:b,makeModuleMap:a,nextTick:req.nextTick,onError:c,configure:function(e){if(e.baseUrl&&"/"!==e.baseUrl.charAt(e.baseUrl.length-1)&&(e.baseUrl+="/"),"string"==typeof e.urlArgs){var t=e.urlArgs;e.urlArgs=function(e,i){return(-1===i.indexOf("?")?"?":"&")+t}}var i=y.shim,r={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,function(e,t){r[t]?(y[t]||(y[t]={}),mixin(y[t],e,!0,!0)):y[t]=e}),e.bundles&&eachProp(e.bundles,function(e,t){each(e,function(e){e!==t&&(R[e]=t)})}),e.shim&&(eachProp(e.shim,function(e,t){isArray(e)&&(e={deps:e}),!e.exports&&!e.init||e.exportsFn||(e.exportsFn=q.makeShimExports(e)),i[t]=e}),y.shim=i),e.packages&&each(e.packages,function(e){var t;t=(e="string"==typeof e?{name:e}:e).name,e.location&&(y.paths[t]=e.location),y.pkgs[t]=e.name+"/"+(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}),eachProp(S,function(e,t){e.inited||e.map.unnormalized||(e.map=a(t,null,!0))}),(e.deps||e.callback)&&q.require(e.deps||[],e.callback)},makeShimExports:function(e){return function(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}},makeRequire:function(t,n){function o(i,r,u){var d,p,f;return n.enableBuildCallback&&r&&isFunction(r)&&(r.__requireJsBuild=!0),"string"==typeof i?isFunction(r)?c(makeError("requireargs","Invalid require call"),u):t&&hasProp(E,i)?E[i](S[t.id]):req.get?req.get(q,i,t,o):(p=a(i,t,!1,!0),d=p.id,hasProp(j,d)?j[d]:c(makeError("notloaded",'Module name "'+d+'" has not been loaded yet for context: '+e+(t?"":". Use require([])")))):(v(),q.nextTick(function(){v(),(f=s(a(null,t))).skipMap=n.skipMap,f.init(i,r,u,{enabled:!0}),l()}),o)}return n=n||{},mixin(o,{isBrowser:isBrowser,toUrl:function(e){var r,n=e.lastIndexOf("."),o=e.split("/")[0],a="."===o||".."===o;return-1!==n&&(!a||n>1)&&(r=e.substring(n,e.length),e=e.substring(0,n)),q.nameToUrl(i(e,t&&t.id,!0),r,!0)},defined:function(e){return hasProp(j,a(e,t,!1,!0).id)},specified:function(e){return e=a(e,t,!1,!0).id,hasProp(j,e)||hasProp(S,e)}}),t||(o.undef=function(e){d();var i=a(e,t,!0),n=getOwn(S,e);n.undefed=!0,r(e),delete j[e],delete P[i.url],delete M[e],eachReverse(O,function(t,i){t[0]===e&&O.splice(i,1)}),delete q.defQueueMap[e],n&&(n.events.defined&&(M[e]=n.events),p(e))}),o},enable:function(e){getOwn(S,e.id)&&s(e).enable()},completeLoad:function(e){var t,i,r,o=getOwn(y.shim,e)||{},a=o.exports;for(d();O.length;){if(null===(i=O.shift())[0]){if(i[0]=e,t)break;t=!0}else i[0]===e&&(t=!0);h(i)}if(q.defQueueMap={},r=getOwn(S,e),!t&&!hasProp(j,e)&&r&&!r.inited){if(!(!y.enforceDefine||a&&getGlobal(a)))return n(e)?void 0:c(makeError("nodefine","No define call for "+e,null,[e]));h([e,o.deps||[],o.exportsFn])}l()},nameToUrl:function(e,t,i){var r,n,o,a,s,u,c,d=getOwn(y.pkgs,e);if(d&&(e=d),c=getOwn(R,e))return q.nameToUrl(c,t,i);if(req.jsExtRegExp.test(e))s=e+(t||"");else{for(r=y.paths,o=(n=e.split("/")).length;o>0;o-=1)if(a=n.slice(0,o).join("/"),u=getOwn(r,a)){isArray(u)&&(u=u[0]),n.splice(0,o,u);break}s=n.join("/"),s=("/"===(s+=t||(/^data\:|^blob\:|\?/.test(s)||i?"":".js")).charAt(0)||s.match(/^[\w\+\.\-]+:/)?"":y.baseUrl)+s}return y.urlArgs&&!/^blob\:/.test(s)?s+y.urlArgs(e,s):s},load:function(e,t){req.load(q,e,t)},execCb:function(e,t,i,r){return t.apply(r,i)},onScriptLoad:function(e){if("load"===e.type||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=g(e);q.completeLoad(t.id)}},onScriptError:function(e){var t=g(e);if(!n(t.id)){var i=[];return eachProp(S,function(e,r){0!==r.indexOf("_@r")&&each(e.depMaps,function(e){if(e.id===t.id)return i.push(r),!0})}),c(makeError("scripterror",'Script error for "'+t.id+(i.length?'", needed by: '+i.join(", "):'"'),e,[t.id]))}}},q.require=q.makeRequire(),q}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState?interactiveScript:(eachReverse(scripts(),function(e){if("interactive"===e.readyState)return interactiveScript=e}),interactiveScript)}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.5",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if(void 0===define){if(void 0!==requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}void 0===require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(e,t,i,r){var n,o,a=defContextName;return isArray(e)||"string"==typeof e||(o=e,isArray(t)?(e=t,t=i,i=r):e=[]),o&&o.context&&(a=o.context),(n=getOwn(contexts,a))||(n=contexts[a]=req.s.newContext(a)),o&&n.configure(o),n.require(e,t,i)},req.config=function(e){return req(e)},req.nextTick=void 0!==setTimeout?function(e){setTimeout(e,4)}:function(e){e()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(e){req[e]=function(){var t=contexts[defContextName];return t.require[e].apply(t,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],(baseElement=document.getElementsByTagName("base")[0])&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(e,t,i){var r=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return r.type=e.scriptType||"text/javascript",r.charset="utf-8",r.async=!0,r},req.load=function(e,t,i){var r,n=e&&e.config||{};if(isBrowser)return(r=req.createNode(n,t,i)).setAttribute("data-requirecontext",e.contextName),r.setAttribute("data-requiremodule",t),!r.attachEvent||r.attachEvent.toString&&r.attachEvent.toString().indexOf("[native code")<0||isOpera?(r.addEventListener("load",e.onScriptLoad,!1),r.addEventListener("error",e.onScriptError,!1)):(useInteractive=!0,r.attachEvent("onreadystatechange",e.onScriptLoad)),r.src=i,n.onNodeCreated&&n.onNodeCreated(r,n,t,i),currentlyAddingScript=r,baseElement?head.insertBefore(r,baseElement):head.appendChild(r),currentlyAddingScript=null,r;if(isWebWorker)try{setTimeout(function(){},0),importScripts(i),e.completeLoad(t)}catch(r){e.onError(makeError("importscripts","importScripts failed for "+t+" at "+i,r,[t]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(e){if(head||(head=e.parentNode),dataMain=e.getAttribute("data-main"))return mainScript=dataMain,cfg.baseUrl||-1!==mainScript.indexOf("!")||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0}),define=function(e,t,i){var r,n;"string"!=typeof e&&(i=t,t=e,e=null),isArray(t)||(i=t,t=null),!t&&isFunction(i)&&(t=[],i.length&&(i.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,function(e,i){t.push(i)}),t=(1===i.length?["require"]:["require","exports","module"]).concat(t))),useInteractive&&(r=currentlyAddingScript||getInteractiveScript())&&(e||(e=r.getAttribute("data-requiremodule")),n=contexts[r.getAttribute("data-requirecontext")]),n?(n.defQueue.push([e,t,i]),n.defQueueMap[e]=!0):globalDefQueue.push([e,t,i])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}}(this,"undefined"==typeof setTimeout?void 0:setTimeout); \ No newline at end of file diff --git a/assets/js/script.js b/assets/js/script.js new file mode 100755 index 0000000..e999ebc --- /dev/null +++ b/assets/js/script.js @@ -0,0 +1,273 @@ +// Initialize Firebase + var config = { + apiKey: "AIzaSyDAQEQ-Kv0IOWzZRPFOdp2tuG14h6rEirE", + authDomain: "studybuddy-dfa34.firebaseapp.com", + databaseURL: "https://studybuddy-dfa34.firebaseio.com", + projectId: "studybuddy-dfa34", + storageBucket: "", + messagingSenderId: "585854569143" + }; + firebase.initializeApp(config); + + var database = firebase.database(); + +//Require +require.config({ + + paths: { + //"jquery": "https://code.jquery.com/jquery-2.2.4.min", + "moment": "https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.14.1/moment", + "chartjs": "https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.6/Chart.bundle" + }, + shim: { + // jquery: { + // exports: "$" + // } + } +}); + +//TIMER +var time = document.getElementById('timer'); +var start = document.getElementById('start'); +var pause = document.getElementById('pause'); +var stop = document.getElementById('stop'); +var seconds = 0; +var minutes = 0; +var hours = 0; +var t; +// addedTime is a decimal / float so that we could see the fractional changes +var addedSeconds = 0, addedMinutes = 0, addedHours = 0, addedTime = 0.01, newTime = 0; + + +function add() +{ + seconds++; + if (seconds >= 60) + { + seconds = 0; + minutes++; + if (minutes >= 60) + { + minutes = 0; + hours++; + } + } + + time.innerHTML = (hours ? (hours > 9 ? hours : "0" + hours) : "00") + ":" + (minutes ? (minutes > 9 ? minutes : "0" + minutes) : "00") + + ":" + (seconds > 9 ? seconds : "0" + seconds); + + timer(); +} + +function timer() +{ + t = setTimeout(add, 1000); +} + + +$("#start").on("click", function(event) { + event.preventDefault(); + $("#start").empty().append("Start"); + clearTimeout(t); + timer(); + console.log("Start"); + }); + +$("#pause").on("click", function(){ + clearTimeout(t); + $("#start").empty().append("Start"); +}); + +$("#stop").on("click", function() { + + console.log("seconds: " + seconds + " minutes: " + minutes + " hours: " + hours); + //send the values to go get added + sum(hours, minutes, seconds); + //console.log("stop"); + $("#start").empty().append("Start"); + clearInterval(t); + time.textContent = "00:00:00"; + seconds = 0; + minutes = 0; + hours = 0; + + + }); +//END OF TIMER + +// this function gets called everytime we stop the timerSection +// basically, take the time we had when we stopped the timer +// then add them all up... we want the answer to be in mins so hrs/secs get converted into minutes +function sum(hrs, mins, secs){ + newTime = (hrs * 60) + mins + (secs / 60); + console.log("This is the amount of time studied this session in mins: " + newTime); + //send the sum to the db + saveToDb(newTime); +} + +//changed it so that we only save one value in the database, the sum +function saveToDb(time) { + var saveTime = { + time: time + }; +//everytime you stop the timer send the value of added time to the database so that we could retrieve it later + database.ref("/allTime").push(saveTime); +} + +var weeks = []; + + + +//END OF TIMER + +// CHART + +//changed the chart to be minutes so that we could see the changes during the demo +require(['moment', 'chartjs'], function(moment, Chart) { + + const CHART = document.getElementById("myChart"); + + Chart.defaults.scale.ticks.beginAtZero = true; + + let barChart = new Chart(CHART,{ + + type: 'bar', + data: { + labels: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32], + datasets: [{ + label: 'Minutes Per Week', + backgroundColor: '#b2c7c8', + data: [11, 15, 20, 3, 9, 4, 7, 15, 10, 0] + + }] + } + + }); + + +//retrieve the saved times from the database + database.ref("/allTime").on("child_added", function(snapshot){ +//add every saved value you find in the database and add them to the addedtime variable + addedTime += snapshot.val().time; +//send the sum, to the chart + addData(barChart, 10, addedTime); + console.log("This is the value of addedTime when we send it to chart: " + addedTime); + + }); + +// this takes whatever you want to send to the chart and then updates the chart +// in this case we want the sum of all the time in the database "addedTime" +// got this idea from http://www.chartjs.org/docs/latest/developers/updates.html +// got the splice syntax from https://devdocs.io/javascript/global_objects/array/splice + + function addData(chart, week, newData) { +//we are picking one specific week in the chart, and replacing it with newData + chart.data.datasets[0].data.splice(9, 1, newData); + chart.update(); +} + +//END OF CHART + + +// Random Quotes Starts Here + +quote(); + +function quote() { + $.ajax({ + url: "https://api.forismatic.com/api/1.0/", + jsonp: "jsonp", + dataType: "jsonp", + data: { + method: "getQuote", + lang: "en", + format: "jsonp" + }, + success: function(response) { + $('#quote').html(response.quoteText); + $('#author').html(response.quoteAuthor); + } + }); +} + +$("#quoteButton").on("click", function() { + quote(); +}); + +// Random quotes Ends Here + + +// Google map api init. Location default is UM Bootcamp location - Allen Hall + +function initMap () { + var umBootcamp = { lat: 25.7230, lng: -80.2763 }; + var map = new google.maps.Map(document.getElementById('trafficSection'), { + zoom: 14, + center: umBootcamp, + }); + + //traffic layer functionality. + var trafficLayer = new google.maps.TrafficLayer(); + trafficLayer.setMap(map); + + if (navigator.geolocation) { + navigator.geolocation.getCurrentPosition(function (position) { + const user_location = { + lat: position.coords.latitude, + lng: position.coords.longitude + }; + + // Center map with user location + map.setCenter(user_location); + + // Add a marker for your user location + var userLocation = new google.maps.Marker({ + position: { + lat: user_location.lat, + lng: user_location.lng + }, + map: map, + title: "You are here" + }); + + var directionsService = new google.maps.DirectionsService(); + var directionsDisplay = new google.maps.DirectionsRenderer(); + + var directionRequest = { + origin: user_location, + destination: umBootcamp, + travelMode: 'DRIVING' + }; + + directionsService.route( + directionRequest, + function(response, status) { + if (status === 'OK') { + // everything is ok + directionsDisplay.setDirections(response); + + } else { + // something went wrong + window.alert('Directions request failed due to ' + status); + } + } + ); + + + directionsDisplay.setMap(map); + + console.log(directionsDisplay); + + }, function () { + console.log('Error in the geolocation service.'); + }); + } else { + console.log('Browser does not support geolocation.'); + } + + } + + initMap(); + +}); +// END OF MAP diff --git a/chart.html b/chart.html new file mode 100755 index 0000000..b24fc86 --- /dev/null +++ b/chart.html @@ -0,0 +1,50 @@ + + + + Chart + + + + + + + + \ No newline at end of file diff --git a/index.html b/index.html new file mode 100755 index 0000000..aa1ea81 --- /dev/null +++ b/index.html @@ -0,0 +1,160 @@ + + + + + + + Study Buddy + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +

Study Buddy

+

Quotes to Fuel Your Mind:

+ + +
+

+

+
+
+ +
+ + +
+ +
+ +
+ +
+ +

Let's get to work!

+ +

+ +
+ +
+ +
+ +
+

Press this button when you are ready to start studiyng. Also after taking a break.

+ + +
+ +
+ +
+ +
+

Press this button to take a break. You should do it at least every hour

+ + +
+ +
+ +
+ +
+

Press this button when you're done for the day. The minimum recommended is 20 hours per week

+ + +
+ +
+ +
+ + +
+ + +
+ +
+ +

Weekly Chart

+
+
+ +
+ +
+ +
+ + +
+ + + +
+ + +
+ +
+ + + +
+ +
+ + + + + + + + + + + +