├── .DS_Store ├── LICENSE ├── README.md ├── includes ├── .DS_Store ├── css │ └── global.css ├── images │ ├── p1.jpg │ ├── p2.jpg │ ├── p3.jpg │ ├── p4.jpg │ ├── p5.jpg │ └── p6.jpg └── js │ ├── responsive_3dfoldscroll.js │ └── responsive_3dfoldscroll.min.js └── index.php /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickavignone/responsive_3dfoldscroll/f54268ec003d2216caec702ed96330b96cc4c452/.DS_Store -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 nickavignone 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | responsive_3dfoldscroll 2 | ======================= 3 | [See it in action](http://nickavi.com/responsive_3dfoldscroll/) 4 | 5 | Example: 6 | `````javascript 7 | $( document ).ready(function() { 8 | var fold = $.fn.responsive_3dfoldscroll({ 9 | animationLength : 1500 10 | }); 11 | }); 12 | ````` 13 | -------------------------------------------------------------------------------- /includes/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickavignone/responsive_3dfoldscroll/f54268ec003d2216caec702ed96330b96cc4c452/includes/.DS_Store -------------------------------------------------------------------------------- /includes/css/global.css: -------------------------------------------------------------------------------- 1 | /* Global */ 2 | 3 | * { 4 | text-rendering: optimizeLegibility; 5 | } 6 | 7 | body, html { 8 | width: 100%; 9 | background: lightblue; 10 | font-family: "Open-Sans", Helvetica, Arial, sans-serif; 11 | color: #84888c; 12 | font-size: 14px; 13 | margin:0px; 14 | } 15 | 16 | .clearfix::after { 17 | content: "."; 18 | display: block; 19 | height: 0; 20 | clear: both; 21 | visibility: hidden; 22 | font-size:0; 23 | } 24 | 25 | img{ 26 | width:100%; 27 | height:auto; 28 | } 29 | 30 | #container{ 31 | z-index: 2; 32 | width:100%; 33 | position:fixed; 34 | top:0px; 35 | left:0px; 36 | } 37 | #page{ 38 | position: relative; 39 | } 40 | /* ********************************************************************** */ 41 | /* Folds */ 42 | /* ********************************************************************** */ 43 | .topHalf, 44 | .bottomHalf { 45 | position: relative; 46 | display: block; 47 | z-index: 2; 48 | width:100%; 49 | transition:none; 50 | overflow: hidden; 51 | } 52 | 53 | .topHalf{ 54 | z-index: 3 !important; 55 | -webkit-transform-origin:top; 56 | transition: -webkit-transform 500ms cubic-bezier(0.000, 0.450, 1.000, 0.950), background-color 500ms ease-in; 57 | position: absolute; 58 | top:0px; 59 | transition:none; 60 | } 61 | .bottomHalf{ 62 | transition: -webkit-transform 500ms cubic-bezier(0.000, 0.450, 1.000, 0.950), background-color 500ms ease-in; 63 | -webkit-transform-origin:bottom; 64 | position: absolute; 65 | bottom:0px; 66 | 67 | transition:none; 68 | } 69 | .bottomHalf img{ 70 | top:-100%; 71 | position: absolute; 72 | } 73 | .foldWrapper { 74 | position:relative; 75 | vertical-align: top; 76 | padding: 0px; 77 | width: 100%; height: auto; 78 | background: rgba(0,0,0,0.1); 79 | z-index: 1; 80 | display: block; 81 | overflow:hidden; 82 | -webkit-transform-style: preserve-3d; 83 | -webkit-perspective: 1000px; 84 | transition:none; 85 | } 86 | #footer-top{ 87 | position: fixed; 88 | width:100%; 89 | height:400px; 90 | top:0px; 91 | left:0px; 92 | display: table; 93 | background:#373737; 94 | display:none; 95 | z-index:3; 96 | } 97 | #footer-bottom{ 98 | position: absolute; 99 | width:100%; 100 | height:400px; 101 | bottom:0px; 102 | left:0px; 103 | display: table; 104 | background:#373737; 105 | } 106 | .footer-inner{ 107 | display: table-cell; 108 | vertical-align: middle; 109 | text-align: center; 110 | font-size:70px; 111 | color:white; 112 | } 113 | -------------------------------------------------------------------------------- /includes/images/p1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickavignone/responsive_3dfoldscroll/f54268ec003d2216caec702ed96330b96cc4c452/includes/images/p1.jpg -------------------------------------------------------------------------------- /includes/images/p2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickavignone/responsive_3dfoldscroll/f54268ec003d2216caec702ed96330b96cc4c452/includes/images/p2.jpg -------------------------------------------------------------------------------- /includes/images/p3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickavignone/responsive_3dfoldscroll/f54268ec003d2216caec702ed96330b96cc4c452/includes/images/p3.jpg -------------------------------------------------------------------------------- /includes/images/p4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickavignone/responsive_3dfoldscroll/f54268ec003d2216caec702ed96330b96cc4c452/includes/images/p4.jpg -------------------------------------------------------------------------------- /includes/images/p5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickavignone/responsive_3dfoldscroll/f54268ec003d2216caec702ed96330b96cc4c452/includes/images/p5.jpg -------------------------------------------------------------------------------- /includes/images/p6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickavignone/responsive_3dfoldscroll/f54268ec003d2216caec702ed96330b96cc4c452/includes/images/p6.jpg -------------------------------------------------------------------------------- /includes/js/responsive_3dfoldscroll.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | $.fn.responsive_3dfoldscroll = function(options) { 3 | options = $.extend({ 4 | 'animationLength': 1500, 5 | 'foldHolder': 'foldWrapper' 6 | }, options); 7 | 8 | var foldingElements = $("."+options.foldHolder); 9 | var folds = []; 10 | init(); 11 | function fold (element, i, hh){ 12 | this.element = element; 13 | this.i = i; 14 | this.hh = hh; 15 | 16 | 17 | } 18 | function init(){ 19 | var foldhtml = ""; 20 | $.each(foldingElements, function(i, element){ 21 | var hh = $(element).find("img").height(); 22 | foldhtml += "
"; 30 | folds[i] = new fold(element, i, hh); 31 | 32 | }); 33 | $("#container").html(foldhtml); 34 | $("#page").height((folds.length+0.5)*(options.animationLength)); 35 | $("#footer-top").height(Math.floor($(window).height()*.4)); 36 | $("#footer-bottom").height(Math.ceil($(window).height()*.6)); 37 | } 38 | 39 | var resizeId; 40 | 41 | //when resizing the site, we adjust the heights of the sections 42 | $(window).resize(function() { 43 | doneResizing(); 44 | }); 45 | function doneResizing() { 46 | var sTop = $(window).scrollTop(); 47 | var numtimes = 0; 48 | var carpos = 0; 49 | $("#footer-top").height(Math.floor($(window).height()*.4)); 50 | $("#footer-bottom").height(Math.ceil($(window).height()*.6)); 51 | for (var j=0;j