Skip to content

Commit

Permalink
Merge pull request #40 from dxn7335/Develop
Browse files Browse the repository at this point in the history
Commented Code and Cleaned App, index
  • Loading branch information
dxn7335 committed Nov 7, 2014
2 parents c8a75e9 + 1639610 commit 1e46915
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 16 deletions.
2 changes: 0 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@
<script type="text/javascript" src="js/router/TemplatedView.js"></script>
<script type="text/javascript" src="js/router/WorkPrevView.js"></script>
<script type="text/javascript" src="js/router/ApplicationRouter.js"></script>
<script type="text/javascript" src="js/router/routeConfig.js"></script>
<!--plugins-->
<script type="text/javascript" src="js/plugins/nprogress/nprogress.js"></script>
<script type="text/javascript" src="js/plugins/pagePiling/jquery.pagepiling.js"></script>
<script src='/js/plugins/scrollreveal/scrollReveal.min.js'></script>
<!--Main -->
<script type="text/javascript" src="js/app.js"></script>
</head>
Expand Down
34 changes: 27 additions & 7 deletions js/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
/* Main Portfolio App ---------------------------------------------------------------------------------*/
/////////////////////////////////////////////////////////////////////////
/*
* Portfolio Template Project
` By, Danny Nguyen
==============================
THe main script that initializes the portfolio application.
- Will startup main event listeners for general elements on DOM
- Start Backbone Router
*/
/////////////////////////////////////////////////////////////////////////

/* Main Portfolio App */
var portfolio_app = function(){

var current_work_index;
Expand Down Expand Up @@ -47,19 +61,25 @@ var portfolio_app = function(){
})


// Content on case-studies will fade in when scrolling towards it
//distance away from content used to detect when content should fade in
var dist = screen.height / 1.75;

//For the main case-container class
$(window).scroll(function() {
$('.case-study .case-container').each( function() {
console.log('looked');
if( $(window).scrollTop() > $(this).offset().top - 350 ) {

if( $(window).scrollTop() > $(this).offset().top - dist ) {
$(this).addClass('fadeInUp');
}
});
});

//For images in case-container
$(window).scroll(function() {
$('.case-study .case-container img').each( function() {
console.log('looked');
if( $(window).scrollTop() > $(this).offset().top - 350 ) {

if( $(window).scrollTop() > $(this).offset().top - dist) {
$(this).addClass('fadeInUp');
}
});
Expand Down Expand Up @@ -134,14 +154,14 @@ var portfolio_app = function(){
}; //End Portfolio App


//On Window Finish Loading
// On Window Finish Loading //
window.onload = function(){

//initialize portfolio
var myPortfolio = new portfolio_app();
myPortfolio.initialize();

//start router
var AppRouter = new ApplicationRouter($('#body-container'), routeConfig);
var AppRouter = new ApplicationRouter($('#body-container'));
Backbone.history.start();
}
13 changes: 13 additions & 0 deletions js/router/ApplicationRouter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*---------------------------------------------------------------*/
/*
* Portfolio Template Project
` By, Danny Nguyen
==============================
Application Router:
The Backbone router that tracks the url manipulation
and loads page content based on history change
*/
/*---------------------------------------------------------------*/


var ApplicationRouter = Backbone.Router.extend({

initialize: function(el, pRoutes) {
Expand Down
12 changes: 12 additions & 0 deletions js/router/Backbone.View.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/*----------------------------------------------------------------------*/
/*
* Portfolio Template Project
` By, Danny Nguyen
==============================
Backbone View:
The backbone view overrided and used to hold the page content
that gets loaded in. When loaded, will go thorugh a transition
*/
/*----------------------------------------------------------------------*/

// Override View.remove()'s default behavior
Backbone.View = Backbone.View.extend({

Expand Down
10 changes: 10 additions & 0 deletions js/router/ContentView.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*---------------------------------------------------------------*/
/*
* Portfolio Template Project
` By, Danny Nguyen
==============================
Content View:
General view loaded in, similar to Backbone View
*/
/*---------------------------------------------------------------*/
var ContentView = Backbone.View.extend({

/*
Expand Down
13 changes: 13 additions & 0 deletions js/router/TemplatedView.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*-------------------------------------------------------------------------*/
/*
* Portfolio Template Project
` By, Danny Nguyen
==============================
TemplatedView:
Holds a javascript template. (Used for work's gallery item)
When created, a data source holding information will
be used to fill the template before appending to DOM Element
*/
/*-------------------------------------------------------------------------*/

var TemplatedView = Backbone.View.extend({

/*
Expand Down
12 changes: 12 additions & 0 deletions js/router/WorkPrevView.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/*----------------------------------------------------------------------*/
/*
* Portfolio Template Project
` By, Danny Nguyen
==============================
WorkPrevView:
Acts like TemplateVIew, but loads in external template for
work preview through ajax before filling and appending
*/
/*----------------------------------------------------------------------*/

var WorkPrevView = Backbone.View.extend({
model: null,

Expand Down
7 changes: 0 additions & 7 deletions js/router/routeConfig.js

This file was deleted.

0 comments on commit 1e46915

Please sign in to comment.