diff --git a/.bowerrc b/.bowerrc
new file mode 100644
index 0000000..396bad5
--- /dev/null
+++ b/.bowerrc
@@ -0,0 +1,3 @@
+{
+ "directory": "sample/vendor"
+}
diff --git a/.codeclimate.yml b/.codeclimate.yml
new file mode 100644
index 0000000..53ab0ac
--- /dev/null
+++ b/.codeclimate.yml
@@ -0,0 +1,5 @@
+languages:
+ JavaScript: true
+exclude_paths:
+- "sample/material-avatar.js"
+- "material-avatar.min.js"
diff --git a/.jshintrc b/.jshintrc
deleted file mode 100644
index 39b1b33..0000000
--- a/.jshintrc
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "node": true,
- "esnext": true,
- "bitwise": true,
- "eqeqeq": true,
- "eqnull": true,
- "immed": true,
- "indent": 2,
- "latedef": "nofunc",
- "newcap": true,
- "nonew": true,
- "noarg": true,
- "regexp": true,
- "undef": true,
- "unused": false,
- "trailing": true,
- "sub": true,
- "maxlen": 100,
- "globals" : {
- /* HTML5 */
- "localStorage": false,
- "window": false,
- "document": false,
- /* jQuery+Angular */
- "$": false
- }
-}
diff --git a/Gruntfile.coffee b/Gruntfile.coffee
deleted file mode 100644
index 4002831..0000000
--- a/Gruntfile.coffee
+++ /dev/null
@@ -1,72 +0,0 @@
-module.exports = (grunt)->
-
- ############################################################
- # Project configuration
- ############################################################
-
- grunt.initConfig
-
- coffee:
- build:
- options:
- bare: false
- sourceMap: true
- files:
- 'dist/jquery.logosDistort.js': 'src/jquery.logosDistort.coffee'
-
- compass:
- build:
- options:
- sourcemap: true
- sassDir: 'demo/assets/_scss'
- cssDir: 'demo/assets/css'
- environment: 'development'
- outputStyle: 'expanded'
-
- uglify:
- build:
- options:
- mangle: true
- sourceMap: true
- compress:
- drop_console: true
- files:
- 'dist/jquery.logosDistort.min.js': 'src/jquery.logosDistort.js'
-
- cssmin:
- build:
- options:
- sourceMap: true
- advanced: false
- compatibility: true
- processImport: false
- shorthandCompacting: false
- files: [
- expand: true
- cwd: 'demo/assets/css'
- src: ['*.css', '!*.min.css', '!style.css']
- dest: 'dist/css'
- ext: '.min.css'
- ]
-
- ##############################################################
- # Dependencies
- ###############################################################
-
- grunt.loadNpmTasks('grunt-contrib-coffee')
- grunt.loadNpmTasks('grunt-contrib-compass')
- grunt.loadNpmTasks('grunt-contrib-cssmin')
- grunt.loadNpmTasks('grunt-contrib-uglify')
-
- ############################################################
- # Alias tasks
- ############################################################
-
- grunt.registerTask('build', [
- #'coffee:build' # tmp
- 'compass:build' # tmp
- 'uglify:build' # public
- 'cssmin:build' # public
- ])
-
-
diff --git a/Gruntfile.js b/Gruntfile.js
deleted file mode 100644
index afa82b3..0000000
--- a/Gruntfile.js
+++ /dev/null
@@ -1,71 +0,0 @@
-// Generated by CoffeeScript 1.9.1
-(function() {
- module.exports = function(grunt) {
- grunt.initConfig({
- coffee: {
- build: {
- options: {
- bare: false,
- sourceMap: true
- },
- files: {
- 'dist/jquery.logosDistort.js': 'src/jquery.logosDistort.coffee'
- }
- }
- },
- compass: {
- build: {
- options: {
- sourcemap: true,
- sassDir: 'demo/assets/_scss',
- cssDir: 'demo/assets/css',
- environment: 'development',
- outputStyle: 'expanded'
- }
- }
- },
- uglify: {
- build: {
- options: {
- mangle: true,
- sourceMap: true,
- compress: {
- drop_console: true
- }
- },
- files: {
- 'dist/jquery.logosDistort.min.js': 'src/jquery.logosDistort.js'
- }
- }
- },
- cssmin: {
- build: {
- options: {
- sourceMap: true,
- advanced: false,
- compatibility: true,
- processImport: false,
- shorthandCompacting: false
- },
- files: [
- {
- expand: true,
- cwd: 'demo/assets/css',
- src: ['*.css', '!*.min.css', '!style.css'],
- dest: 'dist/css',
- ext: '.min.css'
- }
- ]
- }
- }
- });
- grunt.loadNpmTasks('grunt-contrib-coffee');
- grunt.loadNpmTasks('grunt-contrib-compass');
- grunt.loadNpmTasks('grunt-contrib-cssmin');
- grunt.loadNpmTasks('grunt-contrib-uglify');
- return grunt.registerTask('build', ['compass:build', 'uglify:build', 'cssmin:build']);
- };
-
-}).call(this);
-
-//# sourceMappingURL=Gruntfile.js.map
diff --git a/Gruntfile.js.map b/Gruntfile.js.map
deleted file mode 100644
index e2f4efd..0000000
--- a/Gruntfile.js.map
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "version": 3,
- "file": "Gruntfile.js",
- "sourceRoot": "",
- "sources": [
- "Gruntfile.coffee"
- ],
- "names": [],
- "mappings": ";AAAA;AAAA,EAAA,MAAM,CAAC,OAAP,GAAiB,SAAC,KAAD,GAAA;AAMf,IAAA,KAAK,CAAC,UAAN,CAEE;AAAA,MAAA,MAAA,EACE;AAAA,QAAA,KAAA,EACE;AAAA,UAAA,OAAA,EACE;AAAA,YAAA,IAAA,EAAM,KAAN;AAAA,YACA,SAAA,EAAW,IADX;WADF;AAAA,UAGA,KAAA,EACE;AAAA,YAAA,6BAAA,EAA+B,gCAA/B;WAJF;SADF;OADF;AAAA,MAQA,OAAA,EACE;AAAA,QAAA,KAAA,EACE;AAAA,UAAA,OAAA,EACE;AAAA,YAAA,SAAA,EAAW,IAAX;AAAA,YACA,OAAA,EAAS,mBADT;AAAA,YAEA,MAAA,EAAQ,iBAFR;AAAA,YAGA,WAAA,EAAa,aAHb;AAAA,YAIA,WAAA,EAAa,UAJb;WADF;SADF;OATF;AAAA,MAiBA,MAAA,EACE;AAAA,QAAA,KAAA,EACE;AAAA,UAAA,OAAA,EACE;AAAA,YAAA,MAAA,EAAQ,IAAR;AAAA,YACA,SAAA,EAAW,IADX;AAAA,YAEA,QAAA,EACE;AAAA,cAAA,YAAA,EAAc,IAAd;aAHF;WADF;AAAA,UAKA,KAAA,EACE;AAAA,YAAA,iCAAA,EAAmC,4BAAnC;WANF;SADF;OAlBF;AAAA,MA2BA,MAAA,EACE;AAAA,QAAA,KAAA,EACE;AAAA,UAAA,OAAA,EACE;AAAA,YAAA,SAAA,EAAW,IAAX;AAAA,YACA,QAAA,EAAU,KADV;AAAA,YAEA,aAAA,EAAe,IAFf;AAAA,YAGA,aAAA,EAAe,KAHf;AAAA,YAIA,mBAAA,EAAqB,KAJrB;WADF;AAAA,UAMA,KAAA,EAAO;YACL;AAAA,cAAA,MAAA,EAAQ,IAAR;AAAA,cACA,GAAA,EAAK,iBADL;AAAA,cAEA,GAAA,EAAK,CAAC,OAAD,EAAU,YAAV,EAAwB,YAAxB,CAFL;AAAA,cAGA,IAAA,EAAM,UAHN;AAAA,cAIA,GAAA,EAAK,UAJL;aADK;WANP;SADF;OA5BF;KAFF,CAAA,CAAA;AAAA,IAiDA,KAAK,CAAC,YAAN,CAAmB,sBAAnB,CAjDA,CAAA;AAAA,IAkDA,KAAK,CAAC,YAAN,CAAmB,uBAAnB,CAlDA,CAAA;AAAA,IAmDA,KAAK,CAAC,YAAN,CAAmB,sBAAnB,CAnDA,CAAA;AAAA,IAoDA,KAAK,CAAC,YAAN,CAAmB,sBAAnB,CApDA,CAAA;WA0DA,KAAK,CAAC,YAAN,CAAmB,OAAnB,EAA4B,CAE1B,eAF0B,EAG1B,cAH0B,EAI1B,cAJ0B,CAA5B,EAhEe;EAAA,CAAjB,CAAA;AAAA"
-}
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..5244b45
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Mathew Kleppin
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
index 6bb75b2..c8af4b3 100644
--- a/README.md
+++ b/README.md
@@ -3,17 +3,24 @@
### Create a unique parallax environment to show off your work.
#### Inspired by http://hellomonday.com/
-![Demo 1](demo/demo1.gif)
+
I've always been a big fan of using subtitle 3d effects to give depth to UI and images. Ever since laying my eyes on the [26000 Vodka] (http://26000.resn.co.nz/flash.html) website many years ago, I've wanted to create something that can emulate that same kind of depth, without using cumbersome flash to do it. (Also, I didn't know flash, so there's that)
This plugin allows you to (currently) do full-page 3d perspective transforms base on mouse position. There are a lot of options you can tweak to your liking, and I'm looking to develop the application of this effect further.
-Check out the demo's to see whats possible
+[Check out the demo's to see whats possible](http://hellsan631.github.io/LogosDistort/)
-[^Demo 1] (http://mathew-kleppin.com/dev/logosdistort/demo/demo1.html) - [Demo 2] (http://mathew-kleppin.com/dev/logosdistort/demo/demo2.html) - [^Demo 3] (http://mathew-kleppin.com/dev/logosdistort/demo/demo3.html)
+### New In v0.3
-^Demo's Work Optimally in Chrome
+1. JQuery no longer a requirement.
+2. Multiple element on screen now supported. [see demo5.html](http://hellsan631.github.io/LogosDistort/demo5.html)
+3. Added new mouse movement listeners. [see demo5.html](http://hellsan631.github.io/LogosDistort/demo5.html)
+4. _New Option:_ __perspectiveMulti__
+5. _New Option:_ __depthOverride__
+6. Fixed a few bugs, performance should be more consistant now.
+
+__Note: When 1.0 hits, the file name will drop the jQuery prefix__
## Usage
@@ -23,7 +30,7 @@ bower install logos-distort
```
Or by downloading the repo and using the files there
-1. Include jQuery:
+1. Include jQuery (optional):
```html
@@ -51,12 +58,18 @@ Or by downloading the repo and using the files there
4. Call the plugin:
```javascript
- $("#demo1").logosDistort();
+ $("#demo1").logosDistort(options);
+
+ //or non jquery way
+
+ var distortion = new logosDistort(document.getElementById('demo1'), options);
```
> You can customize a number of options and send them in when starting the plugin. See "Options" for more info.
-![Demo 3](demo/demo3.gif)
+
+
+
## Options
@@ -78,51 +91,70 @@ Or by downloading the repo and using the files there
A multipler for the time it takes for the parallax effect to center on the mouse cursor. Higher
means more time, lower means the animation is faster.
-5. __outerBuffer:__ 1.10 _(number)_
+5. __mouseMode:__ "container" _(string)_
+ Changes how mouse movement triggers the parallax effect. This has 3 settings, _"container"_,
+ _"window"_, and _"magnetic"_. The default (container) binds it so that the parallaxing only
+ changes when the mouse is inside of the container, like wise window means that the mouse updates
+ will be bound to the window. __Magnetic__, however, allows tracking of the mouse on X and Y planes.
+ The effect will update when the mouse is on the same x or y plane as the base element.
+
+6. __outerBuffer:__ 1.10 _(number)_
A size multiplier for the backgrounds, so that the 3d parallax effect doesn't clip to show a
static background. If you see move your mouse to the corner of the window, and you see a white
background clip on the opposite corner, this value should be higher. That, or your elementDepth
is set too high.
-6. __elementDepth:__ 140 _(number)_
+7. __elementDepth:__ 140 _(number)_
The difference of depth between each element in px. A higher depth means a better parallax effect,
but also means a higher chance that the further elements will clip. More elements means more
overall scene depth, meaning that if you have more then 4-5 elements in a scene, consider leaving
this setting at its default value, or making it lower.
-7. __directions:__ [ 1, 1, 1, 1, -1, -1, 1, 1 ] _(array of numbers)_
+8. __depthOverride:__ false _(boolean)_
+ If there are a lot of elements in the scene, logosDistort will halve the depth for each element,
+ to maintain good performance (default setting of false). However, you can turn this off manually if
+ you don't have any performance concerns by setting this to ```true```;
+
+9. __perspectiveMulti:__ 1.0 _(number)_
+ Changes the perspective of the 3d parent container. This changes the focal point where the scene
+ will rotate around. A higher multiplier means a smaller rotation, but things will seem far away.
+ A lower multiplier (below 1.0) means the scene will be closer and will rotate more, which might
+ expose the background.
+
+10. __directions:__ [ 1, 1, 1, 1, -1, -1, 1, 1 ] _(array of numbers)_
Weights for the directions of the parallax effect based on mouse movement. Default is set so that
the "center" of the effect moves opposite to the mouse in all directions. Changes in this can break
- the effect. See the Demo3 for an example on how to set these directions.
+ the effect. See the Demo3 for an example on how to set these directions
-8: __weights:__ [ 0.0000310, 0.0001800, 0.0000164, 0.0000019, 0.0001200 ] _(array of numbers)_
+11. __weights:__ [ 0.0000310, 0.0001800, 0.0000164, 0.0000019, 0.0001200 ] _(array of numbers)_
Effect weights for how much the effect will move in a given direction based on mouse movement.
Here is each number and what they do (about).
-
-
- [
- "distance from center",
- "y plane neg to left, pos to right -> rotational",
- "distance from center axis point X and Y",
- "1 minus distance from center axis point",
- "relative distance from center x plane, top neg, bot pos"
- ]
-
-
-9: __container:__ window _(variable)_
- The container for which the effect will be bound. Changing this option may cause unintended
- side-effects, as I havn't debugged this functionality. But your welcome to try it and submit a PR :)
-
-10: __cssClasses:__ _(object)_
+ ```js
+ [
+ "distance from center",
+ "y plane neg to left, pos to right -> rotational",
+ "distance from center axis point X and Y",
+ "1 minus distance from center axis point",
+ "relative distance from center x plane, top neg, bot pos"
+ ]
+ ```
+
+12. __container:__ window _(variable)_
+ The container for which the effect will be bound. This can either be an element, or set to ```'self'```,
+ where the base element will be used as the container. See ```demo5.html``` for an example.
+
+13. __cssClasses:__ _(object)_
Overrides for the class names incase you want to use a similar class name for a specific element.
-
-
- {
- smartContainer: "ld-smart-container",
- overlapContainer: "ld-overlap-container",
- parent3d: "ld-3d-parent",
- transformTarget: "ld-transform-target",
- active: "ld-transform-active",
- object3d: "ld-3d-object"
- }
-
+
+ ```js
+ {
+ smartContainer: "ld-smart-container",
+ overlapContainer: "ld-overlap-container",
+ parent3d: "ld-3d-parent",
+ transformTarget: "ld-transform-target",
+ active: "ld-transform-active",
+ object3d: "ld-3d-object"
+ }
+ ```
+
+### Yay
diff --git a/bower.json b/bower.json
index 2d0fd6c..a88ea05 100644
--- a/bower.json
+++ b/bower.json
@@ -1,11 +1,11 @@
{
"name": "LogosDistort",
- "version": "0.2.1",
+ "version": "0.3.0",
"homepage": "https://github.com/hellsan631/LogosDistort",
"authors": [
"Mathew Kleppin "
],
- "description": "A simple jQuery plugin that uses matrix3d to perform perspective distortions.",
+ "description": "A simple Javascript plugin that uses matrix3d to perform perspective distortions.",
"main": "src/jquery.logosDistort.js",
"ignore": [
".jshintrc",
@@ -15,9 +15,7 @@
"node_modules",
"bower_components"
],
- "dependencies": {
- "jQuery": "~2.1.3"
- },
+ "dependencies": {},
"keywords": [
"jquery",
"matrix3d",
diff --git a/demo/assets/_scss/_default.scss b/demo/assets/_scss/_default.scss
deleted file mode 100644
index ac7bb68..0000000
--- a/demo/assets/_scss/_default.scss
+++ /dev/null
@@ -1,123 +0,0 @@
-/* default.scss */
-HTML{
- margin:0;
- padding:0;
-}
-
-BODY {
- font-family: 'Open Sans', sans-serif;
- font-weight:400;
- font-size: 100%;
- line-height: 1.2em;
- color: #313131;
- margin:0;
- padding:0;
-
- @include respondTo(retina) { font-size: 125%; }
- @include respondTo(desktop) { font-size: 105%; }
- @include respondTo(smallScreen) { font-size: 95%; }
- @include respondTo(laptop) { font-size: 85%; }
- @include respondTo(tablet) { font-size: 75%; }
- @include respondTo(smartphone) { font-size: 65%; }
-}
-
-DIV {
- margin:0;
- padding:0;
-}
-
-A {
- color: inherit;
-}
-
-* {
- -webkit-font-smoothing: antialiased;
- -webkit-backface-visibility: hidden;
- box-sizing: border-box;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- margin: 0;
- padding: 0;
- -webkit-user-drag: none;
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
- -webkit-overflow-scrolling: touch;
- /* -webkit-transform: translateZ(0); */
- -webkit-touch-callout: none;
-}
-
-h1,h2,h3,h4,h5,h6{
- font-family: 'Open Sans', sans-serif;
- //text-transform:uppercase;
- font-weight:300;
- padding:0;
- margin:0;
- display: block;
- line-height:1em;
- @include text-shadow(#000 0px 2px 10px);
-}
-
-@include header(body h1, 3.2em, #fff, 1px);
-@include header(body h2, 2.8em, #fff, 1px);
-@include header(body h3, 2.4em, #fff, 0px);
-@include header(body h4, 2.0em, #fff, 0px);
-@include header(body h5, 1.6em, #fff, 0px);
-@include header(body h6, 1.2em, #fff, 0px);
-
-p {
- max-width:80em;
-}
-
-.float-right{
- float:right;
-}
-
-.float-left{
- float:left;
-}
-
-.aligncenter{
- text-align: center;
-}
-
-.alignright{
- text-align: right;
-}
-
-.alignleft{
- text-align: left;
-}
-
-input[type="text"], input[type="password"]{
- padding:10px 15px;
- font-family: 'Roboto', sans-serif;
- font-size: 15px;
- line-height: 15px;
- font-weight:400;
- border: 1px solid #ACACAC;
- border-radius: 3px;
-}
-
-label{
- font-family: 'Roboto', sans-serif;
- font-size: 15px;
- line-height: 26px;
- font-weight:400;
- vertical-align: top;
-}
-
-select{
- padding:8px 15px;
- border: 2px solid #222;
- border-radius: 3px;
-}
-
-select, option{
- font-family: 'Roboto', sans-serif;
- font-size: 15px;
- line-height: 15px;
- font-weight:400;
-}
-
-option{
- padding:5px 10px;
-}
\ No newline at end of file
diff --git a/demo/assets/_scss/_fonts.scss b/demo/assets/_scss/_fonts.scss
deleted file mode 100644
index 8c98a1c..0000000
--- a/demo/assets/_scss/_fonts.scss
+++ /dev/null
@@ -1,2 +0,0 @@
-/* _fonts.scss */
-@import url(http://fonts.googleapis.com/css?family=Open+Sans:300,400,500,600,700);
\ No newline at end of file
diff --git a/demo/assets/_scss/_functions.scss b/demo/assets/_scss/_functions.scss
deleted file mode 100644
index 53532cd..0000000
--- a/demo/assets/_scss/_functions.scss
+++ /dev/null
@@ -1,226 +0,0 @@
-/* _functions.scss */
-@import "compass";
-@import "compass/support";
-
-@mixin header($element, $size, $color, $letter-spacing, $margin-before-after: 0.5em){
- #{$element} {
- -webkit-margin-before: #{$margin-before-after};
- -webkit-margin-after: #{$margin-before-after};
- -webkit-margin-start: 0px;
- -webkit-margin-end: 0px;
- font-size: #{$size};
- color: #{$color};
- letter-spacing: #{$letter-spacing};
- }
-}
-
-@mixin materialBounce($element: all, $duration: 600ms){
- @include transition($element $duration cubic-bezier(0.620, -0.005, 0.260, 0.995));
-}
-
-@mixin linear-gradient($from, $to, $direction: top){
- @include filter-gradient($from, $to, vertical); // IE6-9
- @include linear-gradient($direction, $from 0%, $to 100%);
-}
-
-@mixin calc($property, $expression) {
- #{$property}: -webkit-calc(#{$expression});
- #{$property}: -moz-calc(#{$expression});
- #{$property}: -o-calc(#{$expression});
- #{$property}: calc(#{$expression});
- #{$property}: expression(#{$expression});
-}
-
-// keyframes mixin
-@mixin keyframes($name) {
- @-webkit-keyframes #{$name} {
- @content;
- }
- @-moz-keyframes #{$name} {
- @content;
- }
- @-ms-keyframes #{$name} {
- @content;
- }
- @keyframes #{$name} {
- @content;
- }
-}
-
-/*
-## Triangle
-* @include triangle within a pseudo element and add positioning properties (ie. top, left)
-* $direction: up, down, left, right
-*/
-@mixin triangle($direction, $size: 8px, $color: #222){
- content: '';
- display: block;
- position: absolute;
- height: 0; width: 0;
- @if ($direction == 'up'){
- border-bottom: $size solid $color;
- border-left: $size solid transparent;
- border-right: $size solid transparent;
- }
- @else if ($direction == 'down'){
- border-top: $size solid $color;
- border-left: $size solid transparent;
- border-right: $size solid transparent;
- }
- @else if ($direction == 'left'){
- border-top: $size solid transparent;
- border-bottom: $size solid transparent;
- border-right: $size solid $color;
- }
- @else if ($direction == 'right'){
- border-top: $size solid transparent;
- border-bottom: $size solid transparent;
- border-left: $size solid $color;
- }
-}
-
-
-/*
-* Currency
-*/
-%currency {
- position: relative;
- &:before {
- content: '$';
- position: relative;
- left: 0;
- }
-}
-
-.USD %currency:before { content: '$'; }
-.EUR %currency:before { content: '\20AC'; } // must escape the html entities for each currency symbol
-.ILS %currency:before { content: '\20AA'; }
-.GBP %currency:before { content: '\00A3'; }
-
-/*
-* Clearfix
-*/
-%clearfix {
- *zoom: 1;
- &:after {
- content: '';
- display: table;
- line-height: 0;
- clear: both;
- }
-}
-
-.clearfix{
- @extend %clearfix;
-}
-
-/*
-* Respond To
-* Copied from UtilityBelt- https://github.com/dmtintner/UtilityBelt
-*
-* Example:
-* @include respondTo(smartphone){ display: none; }
-*
-*/
-
-$largeScreen: 1940px;
-$desktop: 1680px;
-$laptop: 1280px;
-$tabletLandscape: 1024px;
-$tabletPortrait: 767px;
-
-@mixin respondTo($media) {
- @if $media == retina {
- @media (min-width: $largeScreen) { @content; }
- }
- @else if $media == desktop {
- @media (min-width: $desktop) and (max-width: $largeScreen) { @content; }
- }
- @else if $media == smallScreen {
- @media (min-width: $laptop) and (max-width: $desktop) { @content; }
- }
- @else if $media == laptop {
- @media (max-width: $laptop) { @content; }
- }
- @else if $media == tablet {
- @media (min-width: $tabletPortrait) and (max-width: $tabletLandscape) { @content; }
- }
- @else if $media == smartphone {
- @media (max-width: $tabletPortrait) { @content; }
- }
-
-}
-
-/*
-* Ghost Vertical Align
-*/
-@mixin ghostVerticalAlign($pseudoEl: before){
- &:#{$pseudoEl} {
- content: '';
- display: inline-block;
- vertical-align: middle;
- height: 100%; width: .1px;
- }
-}
-
-%vertical-align {
- @include ghostVerticalAlign();
-}
-
-/*
-* Truncate Text
-*/
-@mixin truncateText($overflow: ellipsis){
- overflow: hidden;
- white-space: nowrap;
- text-overflow: $overflow; // values are: clip, ellipsis, or a string
-}
-
-/*
-* Animation
-*/
-@mixin animation($name, $duration: 1000ms, $iterations: infinite, $timing-function: ease, $delay: 0ms) {
- // There is a FF bug that requires all time values to have units, even 0 !!!!!!
- -webkit-animation: $name $duration $iterations $timing-function $delay;
- -moz-animation: $name $duration $iterations $timing-function $delay;
- -o-animation: $name $duration $iterations $timing-function $delay;
- animation: $name $duration $iterations $timing-function $delay;
-}
-
-
-/*
-* Alerted
-*/
-@include keyframes(alertMe) {
- from {
- border-width: 3px;
- border-color: gold;
- }
- to {
- border-width: 0;
- border-color: rgba(gold, .1);
- }
-}
-
-@mixin alerted() {
- &:before {
- content: '';
- position: absolute;
- top: 6px; right: 6px;
- height: 8px; width: 8px;
- border-radius: 10px;
- background-color: gold;
- }
- &:after {
- content: '';
- position: absolute;
- top: 0; right: 0;
- height: 20px; width: 20px;
- border-radius: 20px;
- background-color: transparent;
- border: solid gold;
- border-width: 2px; // animates
- box-sizing: border-box;
- @include animation($name: alertMe);
- }
-}
diff --git a/demo/assets/_scss/normalize/_ie.scss b/demo/assets/_scss/normalize/_ie.scss
deleted file mode 100644
index 5cd5b6c..0000000
--- a/demo/assets/_scss/normalize/_ie.scss
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Welcome to Compass. Use this file to write IE specific override styles.
- * Import this file using the following HTML or equivalent:
- * */
diff --git a/demo/assets/_scss/normalize/_print.scss b/demo/assets/_scss/normalize/_print.scss
deleted file mode 100644
index b0e9e45..0000000
--- a/demo/assets/_scss/normalize/_print.scss
+++ /dev/null
@@ -1,3 +0,0 @@
-/* Welcome to Compass. Use this file to define print styles.
- * Import this file using the following HTML or equivalent:
- * */
diff --git a/demo/assets/_scss/normalize/_screen.scss b/demo/assets/_scss/normalize/_screen.scss
deleted file mode 100644
index 81de847..0000000
--- a/demo/assets/_scss/normalize/_screen.scss
+++ /dev/null
@@ -1,6 +0,0 @@
-/* Welcome to Compass.
- * In this file you should write your main styles. (or centralize your imports)
- * Import this file using the following HTML or equivalent:
- * */
-
-@import "compass/reset";
diff --git a/demo/assets/_scss/perspectiveRules.scss b/demo/assets/_scss/perspectiveRules.scss
deleted file mode 100644
index e61af26..0000000
--- a/demo/assets/_scss/perspectiveRules.scss
+++ /dev/null
@@ -1,39 +0,0 @@
-.ld-smart-container{
- position: absolute;
- z-index: 2;
- width: 100%;
- height: 100%;
- overflow:hidden;
-
- .ld-3d-parent{
- width: 100%;
- height: 100%;
- pointer-events: none;
- transform-style: preserve-3d;
- perspective: 9000px;
- opacity: 1;
- }
-
- .ld-transform-target{
- position: relative;
- -webkit-transform-style: flat;
- -webkit-backface-visibility: hidden;
- -webkit-transform: translate3d(0px, 0px, 0px);
- width: 100%;
- height: 100%;
- pointer-events: none;
- transform-style: preserve-3d;
- }
-
- .ld-3d-object{
- position: absolute;
- pointer-events: none;
- -webkit-transform-style: flat;
- -webkit-backface-visibility: hidden;
- -webkit-transform: translate3d(0px, 0px, 0px);
- transform-style: preserve-3d;
- -webkit-perspective: 1000;
- backface-visibility: hidden;
- perspective: 1000;
- }
-}
\ No newline at end of file
diff --git a/demo/assets/_scss/style.scss b/demo/assets/_scss/style.scss
deleted file mode 100644
index 54b1dc1..0000000
--- a/demo/assets/_scss/style.scss
+++ /dev/null
@@ -1,55 +0,0 @@
-@import "functions";
-@import "default";
-@import "fonts";
-
-body{
- max-width:100%;
- overflow:hidden;
-}
-
-#particle-target{
- position: absolute;
- overflow:hidden;
-}
-
-#demo-menu{
- position: absolute;
- right:-400px;
- top:2em;
- width:auto;
- padding:2em;
- background:rgba(#fff,0.8);
- height:auto;
- display: inline-block;
- z-index:20;
-}
-
-#min-max-tag{
- position: absolute;
- right:0;
- top:2em;
- width:auto;
- padding:0.4em;
- font-size: 200%;
- line-height: 1em;
- background:rgba(#fff,0.4);
- color: rgba(#222,0.6);
- height:auto;
- display: inline-block;
- z-index:20;
- border-top-left-radius:0.5em;
- border-top-right-radius:0em;
- border-bottom-right-radius:0em;
- border-bottom-left-radius:0.5em;
- cursor:pointer;
-
- @include transition(all 200ms cubic-bezier(0.620, -0.005, 0.260, 0.995));
-
- @include box-shadow(rgba(#000, 0.75) -0.2em 0em 2em);
-
- &:hover{
- background:rgba(#fff,0.8);
- color: rgba(#222,0.8);
- }
-}
-
diff --git a/demo/assets/css/perspectiveRules.css b/demo/assets/css/perspectiveRules.css
index 2000297..fab5755 100644
--- a/demo/assets/css/perspectiveRules.css
+++ b/demo/assets/css/perspectiveRules.css
@@ -1,4 +1,4 @@
-/* line 1, ../_scss/perspectiveRules.scss */
+
.ld-smart-container {
position: absolute;
z-index: 2;
@@ -6,7 +6,7 @@
height: 100%;
overflow: hidden;
}
-/* line 8, ../_scss/perspectiveRules.scss */
+
.ld-smart-container .ld-3d-parent {
width: 100%;
height: 100%;
@@ -14,8 +14,9 @@
transform-style: preserve-3d;
perspective: 9000px;
opacity: 1;
+ position: relative;
}
-/* line 17, ../_scss/perspectiveRules.scss */
+
.ld-smart-container .ld-transform-target {
position: relative;
-webkit-transform-style: flat;
@@ -26,7 +27,7 @@
pointer-events: none;
transform-style: preserve-3d;
}
-/* line 28, ../_scss/perspectiveRules.scss */
+
.ld-smart-container .ld-3d-object {
position: absolute;
pointer-events: none;
@@ -38,5 +39,3 @@
backface-visibility: hidden;
perspective: 1000;
}
-
-/*# sourceMappingURL=perspectiveRules.css.map */
diff --git a/demo/assets/css/perspectiveRules.css.map b/demo/assets/css/perspectiveRules.css.map
deleted file mode 100644
index d6a0827..0000000
--- a/demo/assets/css/perspectiveRules.css.map
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-"version": 3,
-"mappings": ";AAAA,mBAAmB;EACjB,QAAQ,EAAE,QAAQ;EAClB,OAAO,EAAE,CAAC;EACV,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,QAAQ,EAAC,MAAM;;;AAEf,iCAAa;EACX,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,cAAc,EAAE,IAAI;EACpB,eAAe,EAAE,WAAW;EAC5B,WAAW,EAAE,MAAM;EACnB,OAAO,EAAE,CAAC;;;AAGZ,wCAAoB;EAClB,QAAQ,EAAE,QAAQ;EAClB,uBAAuB,EAAE,IAAI;EAC7B,2BAA2B,EAAE,MAAM;EACnC,iBAAiB,EAAE,0BAA0B;EAC7C,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,cAAc,EAAE,IAAI;EACpB,eAAe,EAAE,WAAW;;;AAG9B,iCAAa;EACX,QAAQ,EAAE,QAAQ;EAClB,cAAc,EAAE,IAAI;EACpB,uBAAuB,EAAE,IAAI;EAC7B,2BAA2B,EAAE,MAAM;EACnC,iBAAiB,EAAE,0BAA0B;EAC7C,eAAe,EAAE,WAAW;EAC5B,mBAAmB,EAAE,IAAI;EACzB,mBAAmB,EAAE,MAAM;EAC3B,WAAW,EAAE,IAAI",
-"sources": ["../_scss/perspectiveRules.scss"],
-"names": [],
-"file": "perspectiveRules.css"
-}
\ No newline at end of file
diff --git a/demo/assets/css/style.css b/demo/assets/css/style.css
index 760757e..3f23573 100644
--- a/demo/assets/css/style.css
+++ b/demo/assets/css/style.css
@@ -343,23 +343,34 @@ body {
/* line 15, ../_scss/style.scss */
#demo-menu {
position: absolute;
- right: -400px;
top: 2em;
- width: auto;
+ width: 350px;
padding: 2em;
background: rgba(255, 255, 255, 0.8);
height: auto;
display: inline-block;
z-index: 20;
+ -webkit-transition: all 200ms cubic-bezier(0.62, -0.005, 0.26, 0.995);
+ -moz-transition: all 200ms cubic-bezier(0.62, -0.005, 0.26, 0.995);
+ -o-transition: all 200ms cubic-bezier(0.62, -0.005, 0.26, 0.995);
+ transition: all 200ms cubic-bezier(0.62, -0.005, 0.26, 0.995);
+}
+
+#demo-menu.closed{
+ right: -350px;
+}
+
+#demo-menu.open{
+ right: 0px;
}
/* line 27, ../_scss/style.scss */
#min-max-tag {
position: absolute;
- right: 0;
- top: 2em;
- width: auto;
- padding: 0.4em;
+ left: -40px;
+ top: 10px;
+ width: 40px;
+ padding: 10px;
font-size: 200%;
line-height: 1em;
background: rgba(255, 255, 255, 0.4);
diff --git a/demo/assets/js/jquery.logosDistort.min.js b/demo/assets/js/jquery.logosDistort.min.js
deleted file mode 100644
index 350b442..0000000
--- a/demo/assets/js/jquery.logosDistort.min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-(function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};!function(b,c,d){var e,f,g;return g="logosDistort",f={enable:!0,effectWeight:1,enableSmoothing:!0,smoothingMultiplier:1,activeOnlyInside:!1,outerBuffer:1.1,elementDepth:140,directions:[1,1,1,1,-1,-1,1,1],weights:[31e-6,18e-5,164e-7,19e-7,12e-5],container:c,cssClasses:{smartContainer:"ld-smart-container",overlapContainer:"ld-overlap-container",parent3d:"ld-3d-parent",transformTarget:"ld-transform-target",active:"ld-transform-active",object3d:"ld-3d-object"},onInit:function(){},onDestroy:function(){}},e=function(){function e(c,d){this.element=c,this.applyTransform=a(this.applyTransform,this),this.settings=b.extend({},f,d),this._defaults=f,this._name=g,this.container=b(this.settings.container),this.$el=b(this.element),this.winW=this.container.innerWidth(),this.winH=this.container.innerHeight(),this.center=this.getCenterOfContainer(),this.outerCon=null,this.outerConParent=null,this.transformTarget=null,this.objects3d=null,this.mouseX=this.mouseY=0,this.effectX=this.effectY=0,this.has3dSupport=this.has3d(),this.paused=!1,this.raf=null,this.init()}return e.prototype.init=function(){var a;return this.createEnvironment(),this.settings.onInit(),a=this,b(d).on("mousemove",function(b){return a.mouseX=b.pageX,a.mouseY=b.pageY,!a.settings.enableSmoothing&&a.has3dSupport?a.draw():void 0}),b(c).on("resize",function(){return a.resizeHandler()}),this.has3dSupport?this.draw():void 0},e.prototype.createEnvironment=function(){var a,c,d,e,f;for(this.objects3d=this.$el.children(),this.$el.html(""),f=this.objects3d,d=0,e=f.length;e>d;d++)a=f[d],b(a).addClass(""+this.settings.cssClasses.object3d);return this.outerConParent=b(""),this.outerCon=b(""),c=b(""),this.transformTarget=b(""),this.$el.append(this.outerConParent.append(this.outerCon.append(c.append(this.transformTarget.append(this.objects3d))))),this.calculateOuterContainer(),this.calculate3dObjects()},e.prototype.setImageDefaults=function(a){var c;return c=this,a.is("img")?a.one("load",function(){return c.calculatePerspective(a)}).each(function(){return this.complete?b(this).load():void 0}):c.calculatePerspective(a)},e.prototype.calculateOuterContainer=function(){var a,b;return b=this.outerConParent.innerWidth()*this.settings.outerBuffer,a=this.outerConParent.innerHeight()*this.settings.outerBuffer,this.outerCon.css({width:b.toFixed(2),height:a.toFixed(2),left:-((b-this.winW)/2).toFixed(2),top:-((a-this.winH)/2).toFixed(2)})},e.prototype.calculate3dObjects=function(){var a,c,d,e,f;for(e=this.objects3d,f=[],c=0,d=e.length;d>c;c++)a=e[c],f.push(this.setImageDefaults(b(a)));return f},e.prototype.calculatePerspective=function(a){var c,d,e,f,g,h,i,j,k,l;return a=b(a),f=a.index()+1,this.objects3d.length>4&&(f-=this.objects3d.length/2),g=f*this.settings.elementDepth,d=this.getAspectRatio(),e=this.getAspectRatio(a),c=isNaN(e[0])||a.is("div")?d:e,i=(this.outerConParent.innerHeight()*this.settings.outerBuffer).toFixed(2),l=(i*c[0]).toFixed(2),l
-
-
- Logos Perspective Distortion Demo 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/demo/demo2.html b/demo/demo2.html
index e86e2ba..99468ac 100644
--- a/demo/demo2.html
+++ b/demo/demo2.html
@@ -8,18 +8,18 @@
-
+
-
-
-
-
+
+
+
+
-