Skip to content

Commit

Permalink
Merge pull request alvarotrigo#4003 from alvarotrigo/dev
Browse files Browse the repository at this point in the history
Merging dev branch 3.0.9
  • Loading branch information
alvarotrigo authored Jul 7, 2020
2 parents 650d52f + 06d30de commit 6115d84
Show file tree
Hide file tree
Showing 32 changed files with 1,344 additions and 96 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DS_Store
.idea
.ignore/
.vscode/*
bower_components/
node_modules/
**/node_modules/
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<p align="center">
<span>English</span> |
<a href="https://github.com/alvarotrigo/fullPage.js/tree/master/lang/spanish#fullpagejs">Español</a> |
<a href="https://github.com/alvarotrigo/fullPage.js/tree/master/lang/french#fullpagejs">Français</a> |
<a href="https://github.com/alvarotrigo/fullPage.js/tree/master/lang/russian#fullpagejs">Pусский</a> |
<a href="https://github.com/alvarotrigo/fullPage.js/tree/master/lang/chinese#fullpagejs">中文</a> |
<a href="https://github.com/alvarotrigo/fullPage.js/tree/master/lang/korean#fullpagejs">한국어</a>
Expand All @@ -16,14 +17,14 @@

---

![fullPage.js version](http://img.shields.io/badge/fullPage.js-v3.0.8-brightgreen.svg)
![fullPage.js version](http://img.shields.io/badge/fullPage.js-v3.0.9-brightgreen.svg)
[![License](https://img.shields.io/badge/License-GPL-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html)
[![PayPal Donate](https://img.shields.io/badge/donate-PayPal.me-ff69b4.svg)](https://www.paypal.me/alvarotrigo/9.95)
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/fullpage.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/fullpage.js)
&nbsp;&nbsp; **|**&nbsp;&nbsp; *7Kb gziped* &nbsp;&nbsp;**|**&nbsp;&nbsp; *Created by [@imac2](https://twitter.com/imac2)*

- [Demo online](http://alvarotrigo.com/fullPage/) | [Codepen](https://codepen.io/alvarotrigo/pen/NxyPPp)
- [Wordpress plugin for Gutenberg](https://alvarotrigo.com/fullPage/wordpress-plugin-gutenberg/)
- [Wordpress plugin for Gutenberg](https://alvarotrigo.com/fullPage/wordpress-plugin-gutenberg/) and [WordPress pluging fo Elementor](https://alvarotrigo.com/fullPage/wordpress-plugin-gutenberg/)
- [Wordpress theme](http://alvarotrigo.com/fullPage/utils/wordpress.html)
- [fullpage.js Extensions](http://alvarotrigo.com/fullPage/extensions/)
- [Frequently Answered Questions](https://github.com/alvarotrigo/fullPage.js/wiki/FAQ---Frequently-Answered-Questions)
Expand Down Expand Up @@ -424,7 +425,7 @@ It requires the file `vendors/easings.min.js` or [jQuery UI](http://jqueryui.com
- `fitToSectionDelay`: (default 1000). If `fitToSection` is set to true, this delays
the fitting by the configured milliseconds.

- `scrollBar`: (default `false`) Determines whether to use scrollbar for the site or not. In case of using scroll bar, the `autoScrolling` functionality will still work as expected. The user will also be free to scroll the site with the scroll bar and fullPage.js will fit the section in the screen when scrolling finishes.
- `scrollBar`: (default `false`) Determines whether to use scroll bar for the **vertical sections** on site or not. In case of using scroll bar, the `autoScrolling` functionality will still work as expected. The user will also be free to scroll the site with the scroll bar and fullPage.js will fit the section in the screen when scrolling finishes.

- `paddingTop`: (default `0`) Defines the top padding for each section with a numerical value and its measure (paddingTop: '10px', paddingTop: '10em'...) Useful in case of using a fixed header.

Expand All @@ -434,7 +435,7 @@ the fitting by the configured milliseconds.

- `normalScrollElements`: (default `null`) [Demo](https://codepen.io/alvarotrigo/pen/RmVazM) If you want to avoid the auto scroll when scrolling over some elements, this is the option you need to use. (useful for maps, scrolling divs etc.) It requires a string with the Javascript selectors for those elements. (For example: `normalScrollElements: '#element1, .element2'`). This option should not be applied to any section/slide element itself.

- `bigSectionsDestination`: (default `null`) Defines how to scroll to a section which size is bigger than the viewport. By default fullPage.js scrolls to the top if you come from a section above the destination one and to the bottom if you come from a section below the destination one. Possible values are `top`, `bottom`, `null`.
- `bigSectionsDestination`: (default `null`) [Demo](https://codepen.io/alvarotrigo/pen/vYLdMrx) Defines how to scroll to a section which height is bigger than the viewport and when not using `scrollOverflow:true`. (Read [how to create smaller or bigger sections](https://github.com/alvarotrigo/fullPage.js#creating-smaller-or-bigger-sections)). By default fullPage.js scrolls to the top if you come from a section above the destination one and to the bottom if you come from a section below the destination one. Possible values are `top`, `bottom`, `null`.

- `keyboardScrolling`: (default `true`) Defines if the content can be navigated using the keyboard.

Expand Down Expand Up @@ -963,7 +964,7 @@ To see the list of recent changes, see [Releases section](https://github.com/alv
Want to build fullpage.js distribution files? Please see [Build Tasks](https://github.com/alvarotrigo/fullPage.js/wiki/Build-tasks)

# Resources
- [Wordpress Plugin for Gutenberg](https://alvarotrigo.com/fullPage/wordpress-plugin-gutenberg/)
- Wordpress Plugin [for Gutenberg](https://alvarotrigo.com/fullPage/wordpress-plugin-gutenberg/) and [for Elementor](https://alvarotrigo.com/fullPage/wordpress-plugin-elementor/).
- [Wordpress theme](https://alvarotrigo.com/fullPage/utils/wordpress.html)
- [Official Vue.js wrapper component](https://github.com/alvarotrigo/vue-fullpage.js)
- [Official React.js wrapper component](https://github.com/alvarotrigo/react-fullpage)
Expand Down
9 changes: 5 additions & 4 deletions dist/fullpage.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* fullPage 3.0.8
* fullPage 3.0.9
* https://github.com/alvarotrigo/fullPage.js
*
* @license GPLv3 for open source use only
Expand Down Expand Up @@ -98,10 +98,11 @@ html.fp-enabled,
#fp-nav {
position: fixed;
z-index: 100;
margin-top: -32px;
top: 50%;
opacity: 1;
-webkit-transform: translate3d(0,0,0);
transform: translateY(-50%);
-ms-transform: translateY(-50%);
-webkit-transform: translate3d(0,-50%,0);
}
#fp-nav.fp-right {
right: 17px;
Expand Down Expand Up @@ -233,4 +234,4 @@ html.fp-enabled,
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
}
4 changes: 2 additions & 2 deletions dist/fullpage.extensions.min.js

Large diffs are not rendered by default.

61 changes: 48 additions & 13 deletions dist/fullpage.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* fullPage 3.0.8
* fullPage 3.0.9
* https://github.com/alvarotrigo/fullPage.js
*
* @license GPLv3 for open source use only
Expand Down Expand Up @@ -250,6 +250,7 @@
var g_initialAnchorsInDom = false;
var g_canFireMouseEnterNormalScroll = true;
var g_mediaLoadedId;
var g_transitionLapseId;
var extensions = [
'parallax',
'scrollOverflowReset',
Expand Down Expand Up @@ -690,6 +691,9 @@
//detecting any change on the URL to scroll to the given anchor link
//(a way to detect back history button as we play with the hashes on the URL)
window.addEventListener('hashchange', hashChangeHandler);

// on window focus
window.addEventListener('focus', focusHandler);

//when opening a new tab (ctrl + t), `control` won't be pressed when coming back.
window.addEventListener('blur', blurHandler);
Expand Down Expand Up @@ -849,7 +853,7 @@
if(!options.anchors.length){
var anchorsAttribute = '[data-anchor]';
var anchors = $(options.sectionSelector.split(',').join(anchorsAttribute + ',') + anchorsAttribute, container);
if(anchors.length){
if(anchors.length && anchors.length === $(SECTION_SEL).length){
g_initialAnchorsInDom = true;
anchors.forEach(function(item){
options.anchors.push(item.getAttribute('data-anchor').toString());
Expand Down Expand Up @@ -1092,10 +1096,7 @@
li += '</li>';
}
$('ul', nav)[0].innerHTML = li;

//centering it vertically
css($(SECTION_NAV_SEL), {'margin-top': '-' + ($(SECTION_NAV_SEL)[0].offsetHeight/2) + 'px'});


//activating the current active section

var bullet = $('li', $(SECTION_NAV_SEL)[0])[index($(SECTION_ACTIVE_SEL)[0], SECTION_SEL)];
Expand All @@ -1105,9 +1106,10 @@
/**
* Gets the name for screen readers for a section/slide navigation bullet.
*/
function getBulletLinkName(i, defaultName){
function getBulletLinkName(i, defaultName, item){
var anchor = defaultName === 'Section' ? options.anchors[i] : item.getAttribute('data-anchor');
return options.navigationTooltips[i]
|| options.anchors[i]
|| anchor
|| defaultName + ' ' + (i+1);
}

Expand Down Expand Up @@ -1186,6 +1188,10 @@
function scrollHandler(){
var currentSection;

if(isResizing){
return;
}

if(!options.autoScrolling || options.scrollBar){
var currentScroll = getScrollTop();
var scrollDirection = getScrollDirection(currentScroll);
Expand Down Expand Up @@ -1862,6 +1868,9 @@
* Performs the vertical movement (by CSS3 or by jQuery)
*/
function performMovement(v){
var isFastSpeed = options.scrollingSpeed < 700;
var transitionLapse = isFastSpeed ? 700 : options.scrollingSpeed;

// using CSS3 translate functionality
if (options.css3 && options.autoScrolling && !options.scrollBar) {

Expand All @@ -1876,7 +1885,10 @@
clearTimeout(afterSectionLoadsId);
afterSectionLoadsId = setTimeout(function () {
afterSectionLoads(v);
}, options.scrollingSpeed);

//disabling canScroll when using fastSpeed
canScroll = !isFastSpeed;
}, options.scrollingSpeed);
}else{
afterSectionLoads(v);
}
Expand All @@ -1900,10 +1912,22 @@
afterSectionLoads(v);
},30);
}else{

afterSectionLoads(v);

//disabling canScroll when using fastSpeed
canScroll = !isFastSpeed;
}
});
}

// enabling canScroll after the minimum transition laps
if(isFastSpeed){
clearTimeout(g_transitionLapseId);
g_transitionLapseId = setTimeout(function(){
canScroll = true;
}, transitionLapse);
}
}

/**
Expand Down Expand Up @@ -2080,7 +2104,9 @@
if(options.scrollOverflow){
clearTimeout(g_mediaLoadedId);
g_mediaLoadedId = setTimeout(function(){
scrollBarHandler.createScrollBar(section);
if(!hasClass($body, RESPONSIVE)){
scrollBarHandler.createScrollBar(section);
}
}, 200);
}
}
Expand Down Expand Up @@ -2367,6 +2393,11 @@
}
}
}

// changing isWindowFocused to true on focus event
function focusHandler(){
isWindowFocused = true;
}

//when opening a new tab (ctrl + t), `control` won't be pressed when coming back.
function blurHandler(){
Expand Down Expand Up @@ -2635,6 +2666,8 @@
* Resize event handler.
*/
function resizeHandler(){
isResizing = true;

clearTimeout(resizeId);

//in order to call the functions only when the resize is finished
Expand Down Expand Up @@ -2901,7 +2934,8 @@
addClass(nav, 'fp-' + options.slidesNavPosition);

for(var i=0; i< numSlides; i++){
appendTo(createElementFromHTML('<li><a href="#"><span class="fp-sr-only">'+ getBulletLinkName(i, 'Slide') +'</span><span></span></a></li>'), $('ul', nav)[0] );
var slide = $(SLIDE_SEL, section)[i];
appendTo(createElementFromHTML('<li><a href="#"><span class="fp-sr-only">'+ getBulletLinkName(i, 'Slide', slide) +'</span><span></span></a></li>'), $('ul', nav)[0] );
}

//centering it
Expand Down Expand Up @@ -3272,7 +3306,8 @@
scrollId,
scrollId2,
g_doubleCheckHeightId,
resizeHandlerId
resizeHandlerId,
g_transitionLapseId
].forEach(function(timeoutId){
clearTimeout(timeoutId);
});
Expand Down Expand Up @@ -3612,7 +3647,7 @@
}

/**
* Equivalent or jQuery function $().
* Equivalent of jQuery function $().
*/
function $(selector, context){
context = arguments.length > 1 ? context : document;
Expand Down
Loading

0 comments on commit 6115d84

Please sign in to comment.