Skip to content
This repository has been archived by the owner on Oct 3, 2020. It is now read-only.

Commit

Permalink
More work on website
Browse files Browse the repository at this point in the history
+ Added scrollMagic for Parallax and animations based on scrolling
+ Added TweenMax plugin for blazing fast animations
  • Loading branch information
Sabri committed Dec 17, 2014
1 parent 9dcf70c commit 0fa4064
Show file tree
Hide file tree
Showing 318 changed files with 86,452 additions and 2,784 deletions.
3 changes: 1 addition & 2 deletions .gruntc.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ module.exports = function(grunt) {
}
});

grunt.registerTask('build', [
grunt.registerTask('default', [
'clean:oldDist',
'copy:developmentToProduction',
'clean:newDist',
Expand All @@ -114,5 +114,4 @@ module.exports = function(grunt) {
'usemin',
'clean:tempDir',
]);
grunt.registerTask('default', ['build']);
};
1 change: 0 additions & 1 deletion src/assets/css/main.css

This file was deleted.

File renamed without changes.
36 changes: 36 additions & 0 deletions src/assets/css/tox-homepage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
body {

}

header.toxHeader {
height:500px;
width:100%;

background-color:#000;
}
header.toxHeader section {
height:100%;
width:100%;

background-image:url(../images/Background.png);

background-repeat:no-repeat;
background-position: center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
header.toxHeader section.active {
opacity:.6;
}
header.toxHeader footer {

}

aside.toxObject {
height:1000px;
width:100%;

background:#fff;
}
Binary file added src/assets/images/Background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
112 changes: 108 additions & 4 deletions src/assets/js/tox.bootstrap.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,113 @@
(function(window) {
Tox = {};
/*
* _____ ___ __ __
* |_ _|/ _ \\ \/ /
* | | | (_) |> <
* |_| \___//_/\_\
*
* Copyright (C) 2013-2015 The Tox Foundation <https://tox.im/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/

(function() {

var Tox = {
s: Foundation.utils.S, // Main selector
e: function(e) { return e(); }, // Execute a function
g: function(g) { return Foundation.utils.random_str(g); }, // Random string generator
d: {
scrollInstance: new ScrollMagic()
}
};

// Run the Bootstrap
Tox.Bootstrap = function() {
console.log('heyhey');
Tox.Bootstrap = function()
{
// Inject Scenes
this.e(this.scenesMap.Header);

Tox.resize.addEvent(function(height, width) {
Tox.s('body header.toxHeader').css({height: height});
});

// Watch Resize Events
Tox.resize.watchEvents();

return true;
};

Tox.scenesMap = {

Header: function() {
// Make timeline: https://github.com/janpaepke/ScrollMagic/blob/master/examples/advanced/svg_drawing.html#L80

var gBdyHeight = function() {
return Tox.resize.stats.h;
};

var tween = TweenMax.to('body header.toxHeader section', 1, {className: '+=active'});

return new ScrollScene({duration: gBdyHeight}) // Duration can be a function (return resize event)
//.setPin('body header.toxHeader section')
.setTween(tween)
.addTo(Tox.d.scrollInstance);
}
};

// Resize listener
Tox.resize = {

memory: [],
stats: {
h: Tox.s('body').outerHeight(),
w: Tox.s('body').outerWidth()
},
addEvent: function(execCallback) {

// Push the callback to memory
this.memory.push(execCallback);

// Execute callbacks for the first time
execCallback(Tox.resize.stats.h, Tox.resize.stats.w);

return this.memory.length;
},
removeEvent: function(id) {
this.memory[id] = false;
},

watchEvents: function() {

var execCallbacks = function(h, w) {
for(var i = 0, len = Tox.resize.memory.length; i < len; i++) {
Tox.resize.memory[i](h, w);
}
};

// Fire events
Tox.s(window).on('resize', Foundation.utils.throttle(function(e) {

// Get Height / Width
Tox.resize.stats = {
h: Tox.s('body').outerHeight(),
w: Tox.s('body').outerWidth()
};

// Execute callbacks
execCallbacks(Tox.resize.stats.h, Tox.resize.stats.w);
}, 10));
}
};

return Tox.Bootstrap();
Expand Down
49 changes: 49 additions & 0 deletions src/assets/vendor/ScrollMagic/.bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "ScrollMagic",
"version": "1.3.0",
"description": "The jQuery plugin for magical scroll interactions.",
"homepage": "http://janpaepke.github.io/ScrollMagic/",
"authors": [
{
"name": "Jan Paepke",
"homepage": "http://www.janpaepke.de"
}
],
"main": [
"js/jquery.scrollmagic.js"
],
"keywords": [
"scroll",
"scrolling",
"animation",
"sticky",
"pin",
"fixed",
"scrollbar",
"scrub",
"sync",
"position",
"progress",
"parallax",
"events",
"classes"
],
"dependencies": {
"jquery": "~1.11",
"gsap": "~1.14"
},
"license": [
"MIT",
"GPL-3.0+"
],
"_release": "1.3.0",
"_resolution": {
"type": "version",
"tag": "v1.3.0",
"commit": "a5ff6d395595f60a16c3e7f3d3b1288204362388"
},
"_source": "git://github.com/janpaepke/ScrollMagic.git",
"_target": "~1.3.0",
"_originalSource": "janpaepke/ScrollMagic",
"_direct": true
}
2 changes: 2 additions & 0 deletions src/assets/vendor/ScrollMagic/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
npm-debug.log
1 change: 1 addition & 0 deletions src/assets/vendor/ScrollMagic/.nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

12 changes: 12 additions & 0 deletions src/assets/vendor/ScrollMagic/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: node_js
node_js:
- "0.10"
script: ./node_modules/karma/bin/karma start ./dev/tests/karma.conf.js --single-run
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
before_script:
- "node dev/build"
notifications:
email: false
86 changes: 86 additions & 0 deletions src/assets/vendor/ScrollMagic/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
CHANGELOG
=========

## 1.3.0 (2014-11-13)

#### changes (potentially breaking):
- changed AMD loader behavior to export only one object -> `{Controller: ScrollMagic, Scene: ScrollScene}`

#### bugfixes:
- added Error message for missing dependencies
- fixed bubbling of pseudo-resize event of div containers
- reference bug with AMD loading

## 1.2.0 (2014-10-14)

#### features
- AMD loader support (See issue [160](https://github.com/janpaepke/ScrollMagic/issues/160))
- added warning for tweens being overwritten (See issue [145](https://github.com/janpaepke/ScrollMagic/issues/145))

#### changes (non-breaking):
- better code for mobile clicks (See issue [169](https://github.com/janpaepke/ScrollMagic/issues/169))
- updated [draw example](http://janpaepke.github.io/ScrollMagic/examples/advanced/svg_drawing.html) to camel case to support Firefox
- updated [parralax sections example](http://janpaepke.github.io/ScrollMagic/examples/advanced/parallax_sections.html) to moving divs instead of background position
- added new references
- added favicon

#### bugfixes:
- scroll momentum increased in Firefox over fixed elements (See issue [164](https://github.com/janpaepke/ScrollMagic/issues/164))
- parallax example was juggy in Firefox and Safari -> removed reliance of TweenMax ticker in favor of requestAnimationFrame (See issue [167](https://github.com/janpaepke/ScrollMagic/issues/167))
- bugfix for pinned elements jittering if inside a container, because of the delayed position update in refreshInterval


## 1.1.0 (2014-09-04)

#### changes (potentially breaking):
- **zero duration scene events & states**
The event logic for zero duration scenes has been changed: From now on a zero duration scene will trigger `enter`, `start`, `progress` (in this order) when scrolling forward past the trigger point and `progress`, `start`, `leave` when scrolling in reverse.
This means there will never be an `end` event triggered, which reflects the behaviour more accurately.
Furthemore this affects the scene's possible states, which can now only be `"BEFORE"` and `"DURING"` for zero duration scenes.
To learn more, read [this issue](https://github.com/janpaepke/ScrollMagic/issues/141#issuecomment-53549776) or [this documentation](http://janpaepke.github.io/ScrollMagic/docs/ScrollScene.html#progress).
- **removed method `startPosition()`**
Method was marked deprecated since v1.0.7 and has now been replaced by `triggerPosition()`.
The terms "_offset_" and "_position_" were used too randomly.
To avoid confision, from now on "_offset_" will be used in connection with the scroll offset of the container, while "_position_" refers to the top / left values within the DOM.
- **`change` event only fires when change actually happened**
If a setter is used with the current value or the internal validator fails and defaults to the same value an option is already set to, no `change` event will be fired anymore.

#### changes (non-breaking)
- **scenes are sorted in controller**
Scenes attached to the same controller are now updated in the order of their start position.
This way DOM modifcations (e.g. tweens) that influence each other are sure to be called in the right order.
To learn more, read [this issue](https://github.com/janpaepke/ScrollMagic/issues/141).
- **marked `triggerOffset` as deprecated, replaced by `triggerPosition`**
Renaming to avoid confusion. Read above for clarification.
- **new controller option `refreshInterval`**
To update values that otherwise wouldn't fire an event a `refreshInterval` option was added to poll for changes.
These changes involve resizing of a div scroll container or movement of a scene's trigger element position.
- **no more logging in minified version**
All debug logging functionality was removed when using the minified version to save on filesize.

#### features:
- new controller method: [scrollTo](http://janpaepke.github.io/ScrollMagic/docs/ScrollMagic.html#scrollTo)
- new controller method: [scrollPos](http://janpaepke.github.io/ScrollMagic/docs/ScrollMagic.html#scrollPos)
- new scene method: [refresh](http://janpaepke.github.io/ScrollMagic/docs/ScrollScene.html#refresh)
- new scene method: [setClassToggle](http://janpaepke.github.io/ScrollMagic/docs/ScrollScene.html#setClassToggle), [removeClassToggle](http://janpaepke.github.io/ScrollMagic/docs/ScrollScene.html#removeClassToggle) respectively
- new scene event: [shift](http://janpaepke.github.io/ScrollMagic/docs/ScrollScene.html#event:shift) fires when scene position changes
- new scene event: [destroy](http://janpaepke.github.io/ScrollMagic/docs/ScrollScene.html#event:destroy) fires when scene is destroyed
- extended scene option [duration](http://janpaepke.github.io/ScrollMagic/docs/ScrollScene.html#duration) to support dynamic updates in responsive layouts
- docs: grouped methods for more clear arrangement
- docs: various additions and clarifications

#### bugfixes:
- removing and resetting pins during pin phase didn't work properly
- using mousewheel to scroll over pinned elements in container (See issues [34](https://github.com/janpaepke/ScrollMagic/issues/34), [50](https://github.com/janpaepke/ScrollMagic/issues/50), [82](https://github.com/janpaepke/ScrollMagic/issues/82), [139](https://github.com/janpaepke/ScrollMagic/issues/139), [140](https://github.com/janpaepke/ScrollMagic/issues/140))
- pin width collapsed, if no width was defined (See issues [63](https://github.com/janpaepke/ScrollMagic/issues/63), [94](https://github.com/janpaepke/ScrollMagic/issues/94))
- positioned pins didn't work in IE 9
- padding of pinned elements was added to relative width
- event namespace issues
- docs: fixed highlight & deeplink issues

#### examples:
- basic: [CSS Class Toggles](http://janpaepke.github.io/ScrollMagic/examples/basic/class_toggles.html)
- advanced: [SVG Line Drawing](http://janpaepke.github.io/ScrollMagic/examples/advanced/svg_drawing.html)
- advanced: [Parallax Sections](http://janpaepke.github.io/ScrollMagic/examples/advanced/parallax_sections.html)
- expert: [Image Sequences](http://janpaepke.github.io/ScrollMagic/examples/expert/image_sequence.html)
- expert: [Bezier Path Animations](http://janpaepke.github.io/ScrollMagic/examples/expert/bezier_path_animation.html)
Loading

0 comments on commit 0fa4064

Please sign in to comment.