From d34579130c7f45d1b5da4d5d26dcf4a0f1f490f4 Mon Sep 17 00:00:00 2001 From: Simon C Date: Tue, 15 Mar 2022 00:50:28 +0100 Subject: [PATCH] feat: design --- assets/js/main.js | 20 +- assets/node_modules/fullpage.js/LICENSE | 674 +++ assets/node_modules/fullpage.js/README.md | 1057 ++++ .../fullpage.js/dist/fullpage.css | 237 + .../dist/fullpage.extensions.min.js | 8 + .../node_modules/fullpage.js/dist/fullpage.js | 4242 +++++++++++++++++ .../fullpage.js/dist/fullpage.min.css | 11 + .../fullpage.js/dist/fullpage.min.css.map | 1 + .../fullpage.js/dist/fullpage.min.js | 12 + .../fullpage.js/dist/fullpage.min.js.map | 1 + assets/node_modules/fullpage.js/package.json | 55 + .../fullpage.js/vendors/.DS_Store | Bin 0 -> 6148 bytes .../fullpage.js/vendors/easings.js | 169 + .../fullpage.js/vendors/easings.min.js | 2 + .../fullpage.js/vendors/easings.min.js.map | 1 + .../fullpage.js/vendors/scrolloverflow.js | 2608 ++++++++++ .../fullpage.js/vendors/scrolloverflow.min.js | 15 + .../vendors/scrolloverflow.min.js.map | 1 + assets/styles/main.sass | 46 + config/_default/config.yml | 14 +- content/.drone.yml | 167 - content/racine.md | 161 + content/{_index.md => tronc.md} | 54 +- layouts/{index.html => _default/single.html} | 12 +- layouts/home.html | 41 + layouts/partials/scores.html | 17 +- 26 files changed, 9417 insertions(+), 209 deletions(-) create mode 100644 assets/node_modules/fullpage.js/LICENSE create mode 100644 assets/node_modules/fullpage.js/README.md create mode 100644 assets/node_modules/fullpage.js/dist/fullpage.css create mode 100755 assets/node_modules/fullpage.js/dist/fullpage.extensions.min.js create mode 100644 assets/node_modules/fullpage.js/dist/fullpage.js create mode 100644 assets/node_modules/fullpage.js/dist/fullpage.min.css create mode 100644 assets/node_modules/fullpage.js/dist/fullpage.min.css.map create mode 100644 assets/node_modules/fullpage.js/dist/fullpage.min.js create mode 100644 assets/node_modules/fullpage.js/dist/fullpage.min.js.map create mode 100644 assets/node_modules/fullpage.js/package.json create mode 100644 assets/node_modules/fullpage.js/vendors/.DS_Store create mode 100644 assets/node_modules/fullpage.js/vendors/easings.js create mode 100644 assets/node_modules/fullpage.js/vendors/easings.min.js create mode 100644 assets/node_modules/fullpage.js/vendors/easings.min.js.map create mode 100755 assets/node_modules/fullpage.js/vendors/scrolloverflow.js create mode 100755 assets/node_modules/fullpage.js/vendors/scrolloverflow.min.js create mode 100644 assets/node_modules/fullpage.js/vendors/scrolloverflow.min.js.map delete mode 100644 content/.drone.yml create mode 100644 content/racine.md rename content/{_index.md => tronc.md} (82%) rename layouts/{index.html => _default/single.html} (86%) create mode 100644 layouts/home.html diff --git a/assets/js/main.js b/assets/js/main.js index bd44980..001e5de 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -1,3 +1,22 @@ +import fullpage from "node_modules/fullpage.js/dist/fullpage.js" + +// import { createApp } from 'node_modules/vue/dist/vue.esm-browser.js' +// import App from './App.vue' +// createApp(App).mount('#app') + +new fullpage('#fullpage', { + //options here + autoScrolling:true, + navigationPosition: 'left', + navigation: true, + paddingTop: '1rem', + paddingBottom: '1rem', + fitToSection: false, + fitToSectionDelay: 10000, + scrollingSpeed: 1000, + slidesNavigation: true +}); + if ('serviceWorker' in navigator) { // Use the window load event to keep the page load performant window.addEventListener('load', () => { @@ -37,7 +56,6 @@ async function main () { return score >= item.dataset.min && (item.dataset.max == "" || score <= item.dataset.max) }).map(item => { item.classList.add('active') - console.log(item.getElementsByClassName('score_' + form.dataset.id)) Array.from(item.getElementsByClassName('score_' + form.dataset.id)).map(item => item.innerHTML = score) }) } diff --git a/assets/node_modules/fullpage.js/LICENSE b/assets/node_modules/fullpage.js/LICENSE new file mode 100644 index 0000000..871ce8e --- /dev/null +++ b/assets/node_modules/fullpage.js/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 3 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 . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/assets/node_modules/fullpage.js/README.md b/assets/node_modules/fullpage.js/README.md new file mode 100644 index 0000000..cc6fedf --- /dev/null +++ b/assets/node_modules/fullpage.js/README.md @@ -0,0 +1,1057 @@ +# fullPage.js +![preview](https://raw.github.com/alvarotrigo/fullPage.js/master/examples/imgs/intro.png) +![compatibility](https://raw.github.com/alvarotrigo/fullPage.js/master/examples/imgs/compatible.gif?v=2) + +

+ English | + Español | + Français | + Pусский | + 中文 | + 한국어 +

+ +

+ Available for Vue, React and Angular. +

+ +--- + +![fullPage.js version](http://img.shields.io/badge/fullPage.js-v3.1.2-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) +   **|**   *7Kb gziped*   **|**   *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/) and [WordPress plugin for Elementor](https://alvarotrigo.com/fullPage/wordpress-plugin-elementor/) +- [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) + +--- + +A simple and easy to use library that creates fullscreen scrolling websites (also known as single page websites or onepage sites) and adds landscape sliders inside the sections of the site. + +- [Introduction](https://github.com/alvarotrigo/fullPage.js#introduction) +- [Compatibility](https://github.com/alvarotrigo/fullPage.js#compatibility) +- [License](https://github.com/alvarotrigo/fullPage.js#license) +- [Usage](https://github.com/alvarotrigo/fullPage.js#usage) + - [Creating links to sections or slides](https://github.com/alvarotrigo/fullPage.js#creating-links-to-sections-or-slides) + - [Creating smaller or bigger sections](https://github.com/alvarotrigo/fullPage.js#creating-smaller-or-bigger-sections) + - [State classes added by fullpage.js](https://github.com/alvarotrigo/fullPage.js#state-classes-added-by-fullpagejs) + - [Lazy loading](https://github.com/alvarotrigo/fullPage.js#lazy-loading) + - [Auto play/pause embedded media](https://github.com/alvarotrigo/fullPage.js#auto-playpause-embedded-media) + - [Use extensions](https://github.com/alvarotrigo/fullPage.js#use-extensions) +- [Options](https://github.com/alvarotrigo/fullPage.js#options) +- [Methods](https://github.com/alvarotrigo/fullPage.js#methods) +- [Callbacks](https://github.com/alvarotrigo/fullPage.js#callbacks) +- [Reporting issues](https://github.com/alvarotrigo/fullPage.js#reporting-issues) +- [Contributing to fullpage.js](https://github.com/alvarotrigo/fullPage.js#contributing-to-fullpagejs) +- [Changelog](https://github.com/alvarotrigo/fullPage.js#changelog) +- [Build tasks](https://github.com/alvarotrigo/fullPage.js#build-tasks) +- [Resources](https://github.com/alvarotrigo/fullPage.js#resources) +- [Who is using fullpage.js](https://github.com/alvarotrigo/fullPage.js#who-is-using-fullpagejs) +- [Donations](https://github.com/alvarotrigo/fullPage.js#donations) +- [Sponsors](https://github.com/alvarotrigo/fullPage.js#sponsors) + +## Introduction +Suggestion are more than welcome, not only for feature requests but also for coding style improvements. +Let's make this a great library to make people's lives easier! + +## Compatibility +fullPage.js is fully functional on all modern browsers, as well as some old ones such as Internet Explorer 9, Opera 12, etc. +It works with browsers with CSS3 support and with the ones which don't have it, making it ideal for old browsers compatibility. +It also provides touch support for mobile phones, tablets and touch screen computers. + +Special thanks to [Browserstack](http://www.browserstack.com/) for supporting fullpage.js. + +## License + +### Commercial license +If you want to use fullPage to develop non open sourced sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary. Which means, you won't have to change your whole application source code to an open source license. [[Purchase a Fullpage Commercial License]](https://alvarotrigo.com/fullPage/pricing/) + +### Open source license +If you are creating an open source application under a license compatible with the [GNU GPL license v3](https://www.gnu.org/licenses/gpl-3.0.html), you may use fullPage under the terms of the GPLv3. + +**The credit comments in the JavaScript and CSS files should be kept intact** (even after combination or minification) + +[Read more about fullPage's license](https://alvarotrigo.com/fullPage/pricing/). + +## Usage +As you can see in the example files, you will need to include: + - The JavaScript file `fullpage.js` (or its minified version `fullpage.min.js`) + - The css file `fullpage.css` + + **Optionally**, when using `css3:false`, you can add the [easings file](https://github.com/alvarotrigo/fullPage.js/tree/master/vendors/easings.min.js) in case you want to use other easing effects apart from the one included in the library (`easeInOutCubic`). + +### Install using bower or npm +**Optionally**, you can install fullPage.js with bower or npm if you prefer: + +Terminal: +```shell +// With bower +bower install fullpage.js + +// With npm +npm install fullpage.js +``` + +### Including files: +```html + + + + + + + + + + +``` + +Using Webpack, Browserify or Require.js? Check how to use fullPage.js with module loaders. + +### Optional use of CDN +If you prefer to use a CDN to load the needed files, fullPage.js is in CDNJS: +https://cdnjs.com/libraries/fullPage.js + +### Required HTML structure +Start your HTML document with the compulsory [HTML DOCTYPE declaration](http://www.corelangs.com/html/introduction/doctype.html) on the 1st line of your HTML code. You might have troubles with sections heights otherwise. The examples provided use HTML 5 doctype ``. + +Each section will be defined with an element containing the `section` class. +The active section by default will be the first section, which is taken as the home page. + +Sections should be placed inside a wrapper (`
` in this case). The wrapper can not be the `body` element. +```html +
+
Some section
+
Some section
+
Some section
+
Some section
+
+``` +If you want to define a different starting point rather than the first section or the first slide of a section, just add the class `active` to the section and slide you want to load first. +```html +
Some section
+``` + +In order to create a landscape slider within a section, each slide will be defined by default with an element containing the `slide` class: +```html +
+
Slide 1
+
Slide 2
+
Slide 3
+
Slide 4
+
+```` +You can see a fully working example of the HTML structure in the [`simple.html` file](https://github.com/alvarotrigo/fullPage.js/blob/master/examples/simple.html). + +### Initialization + +#### Initialization with Vanilla Javascript +All you need to do is call fullPage.js before the closing `` tag. + +```javascript +new fullpage('#fullpage', { + //options here + autoScrolling:true, + scrollHorizontally: true +}); + +//methods +fullpage_api.setAllowScrolling(false); +``` + +#### Initialization with jQuery +You can use fullpage.js as a jQuery plugin if you want to! + +```javascript +$(document).ready(function() { + $('#fullpage').fullpage({ + //options here + autoScrolling:true, + scrollHorizontally: true + }); + + //methods + $.fn.fullpage.setAllowScrolling(false); +}); +``` + +Functions and methods can still be called in the jQuery way, as [in fullPage.js v2.X](https://github.com/alvarotrigo/fullPage.js/tree/2.9.7). + +#### Vanilla JS example with all options +A more complex initialization with all options set could look like this: +```javascript + +var myFullpage = new fullpage('#fullpage', { + //Navigation + menu: '#menu', + lockAnchors: false, + anchors:['firstPage', 'secondPage'], + navigation: false, + navigationPosition: 'right', + navigationTooltips: ['firstSlide', 'secondSlide'], + showActiveTooltip: false, + slidesNavigation: false, + slidesNavPosition: 'bottom', + + //Scrolling + css3: true, + scrollingSpeed: 700, + autoScrolling: true, + fitToSection: true, + fitToSectionDelay: 1000, + scrollBar: false, + easing: 'easeInOutCubic', + easingcss3: 'ease', + loopBottom: false, + loopTop: false, + loopHorizontal: true, + continuousVertical: false, + continuousHorizontal: false, + scrollHorizontally: false, + interlockedSlides: false, + dragAndMove: false, + offsetSections: false, + resetSliders: false, + fadingEffect: false, + normalScrollElements: '#element1, .element2', + scrollOverflow: false, + scrollOverflowReset: false, + scrollOverflowOptions: null, + touchSensitivity: 15, + bigSectionsDestination: null, + + //Accessibility + keyboardScrolling: true, + animateAnchor: true, + recordHistory: true, + + //Design + controlArrows: true, + verticalCentered: true, + sectionsColor : ['#ccc', '#fff'], + paddingTop: '3em', + paddingBottom: '10px', + fixedElements: '#header, .footer', + responsiveWidth: 0, + responsiveHeight: 0, + responsiveSlides: false, + parallax: false, + parallaxOptions: {type: 'reveal', percentage: 62, property: 'translate'}, + dropEffect: false, + dropEffectOptions: { speed: 2300, color: '#F82F4D', zIndex: 9999}, + waterEffect: false, + waterEffectOptions: { animateContent: true, animateOnMouseMove: true}, + cards: false, + cardsOptions: {perspective: 100, fadeContent: true, fadeBackground: true}, + + //Custom selectors + sectionSelector: '.section', + slideSelector: '.slide', + + lazyLoading: true, + + //events + onLeave: function(origin, destination, direction){}, + afterLoad: function(origin, destination, direction){}, + afterRender: function(){}, + afterResize: function(width, height){}, + afterReBuild: function(){}, + afterResponsive: function(isResponsive){}, + afterSlideLoad: function(section, origin, destination, direction){}, + onSlideLeave: function(section, origin, destination, direction){} +}); +``` + +### Creating links to sections or slides +If you are using fullPage.js with anchor links for the sections (using the `anchors` option or the attribute `data-anchor` in each section), then you will be able to use anchor links also to navigate directly to a certain slide inside a section. + +This would be an example of a link with an anchor: http://alvarotrigo.com/fullPage/#secondPage/2 (which is the URL you will see once you access to that section/slide manually) +Notice the last part of the URL ends in `#secondPage/2`. + +Having the following initialization: + +```javascript +new fullpage('#fullpage', { + anchors:['firstPage', 'secondPage', 'thirdPage'] +}); +``` + +The anchor at the end of the URL `#secondPage/2` defines the section and slide of destination respectively. In the previous URL, the section of destination will be the one defined with the anchor `secondPage` and the slide will be the 2nd slide, as we are using the index `2` for it. (the fist slide of a section has index 0, as technically it is a section). + +We could have used a custom anchor for the slide instead of its index if we would have used the attribute `data-anchor` on the HTML markup like so: + +```html +
+
Slide 1
+
Slide 2
+
Slide 3
+
Slide 4
+
+``` +In this last case, the URL we would use would be `#secondPage/slide3`, which is the equivalent to our previous `#secondPage/2`. + +Note that section anchors can also be defined in the same way, by using the `data-anchor` attribute, if no `anchors` array is provided. + +**Be careful!** `data-anchor` tags can not have the same value as any ID element on the site (or NAME element for IE). + +### Creating smaller or bigger sections +[Demo](http://codepen.io/alvarotrigo/pen/BKjRYm) fullPage.js provides a way to remove the full height restriction from its sections and slides. It is possible to create sections which height is smaller or bigger than the viewport. This is ideal for footers. +It is important to realise that it doesn't make sense to have all of your sections using this feature. If there is more than one section in the initial load of the site, fullPage.js won't scroll at all to see the next one as it will be already in the viewport. + +To create smaller sections just use the class `fp-auto-height` in the section you want to apply it. It will then take the height defined by your section/slide content. + +```html +
Whole viewport
+
Auto height
+``` + +#### Responsive auto height sections +[Demo](https://codepen.io/alvarotrigo/pen/MzByMa) A responsive auto height can be applied by using the class `fp-auto-height-responsive`. This way sections will be fullscreen until the responsive mode gets fired. Then they'll take the size required by their content, which could be bigger or smaller than the viewport. + +### State classes added by fullpage.js +Fullpage.js adds multiple classes in different elements to keep a record of the status of the site: + +- `active` is added the current visible section and slide. +- `active` is added to the current menu element (if using the `menu` option). +- A class of the form `fp-viewing-SECTION-SLIDE` is added to the `body` element of the site. (eg: [`fp-viewing-secondPage-0`](http://alvarotrigo.com/fullPage/#secondPage)) The `SECTION` and `SLIDE` parts will be the anchors (or indexes if no anchor is provided) of the current section and slide. +- `fp-responsive` is added to the `body` element when the entering in the responsive mode +- `fp-enabled` is added to the `html` element when fullpage.js is enabled. (and removed when destroyed). +- `fp-destroyed` is added to the fullpage.js container when fullPage.js is destroyed. + +### Lazy Loading +[Demo](http://codepen.io/alvarotrigo/pen/eNLBXo) fullPage.js provides a way to lazy load images, videos and audio elements so they won't slow down the loading of your site or unnecessarily waste data transfer. +When using lazy loading, all these elements will only get loaded when entering in the viewport. +To enable lazy loading all you need to do is change your `src` attribute to `data-src` as shown below: + +```html + + + ``` + +If you already use another lazy load solution which uses `data-src` as well, you can disable the fullPage.js lazy loading by setting the option `lazyLoading: false`. + +### Auto play/pause embedded media + +[Demo](https://codepen.io/alvarotrigo/pen/pXEaaK) **Note**: the autoplay feature might not work on some mobile devices depending on the OS and browser (i.e. [Safari on iOS](https://webkit.org/blog/6784/new-video-policies-for-ios/) version < 10.0). + +#### Play on section/slide load: +Using the attribute `autoplay` for videos or audio, or the param `autoplay=1` for youtube iframes will result in the media element playing on page load. +In order to play it on section/slide load use instead the attribute `data-autoplay`. For example: + +```html + +``` + +#### Pause on leave +Embedded HTML5 `
'),Gn('
')],Yn(yn(cn,l)[0],a),"#fff"!==E.controlArrowColor&&(Tn(yn(wn,l),{"border-color":"transparent transparent transparent "+E.controlArrowColor}),Tn(yn(Sn,l),{"border-color":"transparent "+E.controlArrowColor+" transparent transparent"})),E.loopHorizontal||Bn(yn(Sn,l))),E.slidesNavigation&&function(e,t){jn(Gn('
    '),e);var n=yn(pn,e)[0];Nn(n,"fp-"+E.slidesNavPosition);for(var o=0;o'+ye(o,"Slide",r)+""),yn("ul",n)[0])}Tn(n,{"margin-left":"-"+n.innerWidth/2+"px"}),Nn(yn("a",yn("li",n)[0]),Xt)}(e,n)),t.forEach(function(e){Tn(e,{width:r+"%"}),E.verticalCentered&&pt(e)});var c=yn(an,e)[0];null!=c&&(0!==In(yn(Qt),qt)||0===In(yn(Qt),qt)&&0!==In(c))?At(c,"internal"):Nn(t[0],Xt)}function ye(e,t,n){var o="Section"===t?E.anchors[e]:n.getAttribute("data-anchor");return E.navigationTooltips[e]||o||t+" "+(e+1)}function Ee(){var e,t,n=yn(Qt)[0];Nn(n,_t),Ye(n),We(),Ue(n),E.scrollOverflow&&E.scrollOverflowHandler.afterLoad(),e=Qe(),t=mt(e.section),e.section&&t&&(void 0===t||In(t)!==In(f))||!_n(E.afterLoad)||Ne("afterLoad",{activeSection:n,element:n,direction:null,anchorLink:n.getAttribute("data-anchor"),sectionIndex:In(n,qt)}),_n(E.afterRender)&&Ne("afterRender")}function Le(){var e,t,n,o,r,i;if(!T&&(!E.autoScrolling||E.scrollBar)){var l=Un(),a=(i=U<(r=l)?"down":"up",Q=U=r,i),s=0,c=l+xn()/2,u=L.offsetHeight-xn()===l,f=yn(qt);if(u)s=f.length-1;else if(l)for(var d=0;d=Un()+xn())&&(Ln(yn(Qt)[0],_t)||(Nn(yn(Qt)[0],_t),zn(Xn(yn(Qt)[0]),_t))),!Ln(e=f[s],Xt)){F=!0;var v,p,h=yn(Qt)[0],g=In(h,qt)+1,m=vt(e),S=e.getAttribute("data-anchor"),w=In(e,qt)+1,b=yn(an,e)[0],y={activeSection:h,sectionIndex:w-1,anchorLink:S,element:e,leavingSection:g,direction:m};b&&(p=b.getAttribute("data-anchor"),v=In(b)),k&&(Nn(e,Xt),zn(Xn(e),Xt),_n(E.onLeave)&&Ne("onLeave",y),_n(E.afterLoad)&&Ne("afterLoad",y),Ke(h),Ye(e),Ue(e),dt(S,w-1),E.anchors.length&&(x=S),bt(v,p,S)),clearTimeout(O),O=setTimeout(function(){F=!1},100)}E.fitToSection&&(clearTimeout(M),M=setTimeout(function(){E.fitToSection&&yn(Qt)[0].offsetHeight<=A&&xe()},E.fitToSectionDelay))}}function xe(){k&&(T=!0,Re(yn(Qt)[0]),T=!1)}function Ae(e){if(p.m[e]){var t="down"===e?se:ae;if(E.scrollOverflow){var n=E.scrollOverflowHandler.scrollable(yn(Qt)[0]),o="down"===e?"bottom":"top";if(null!=n){if(!E.scrollOverflowHandler.isScrolled(o,n))return!0;t()}else t()}else t()}}function Te(e){E.autoScrolling&&Oe(e)&&p.m.up&&Kn(e)}function ke(e){var t=Wn(e.target,qt)||yn(Qt)[0];if(Oe(e)){E.autoScrolling&&Kn(e);var n=xt(e);_=n.y,$=n.x,yn(cn,t).length&&Math.abs(K-$)>Math.abs(X-_)?!a&&Math.abs(K-$)>An()/100*E.touchSensitivity&&($zt.innerHeight/100*E.touchSensitivity&&(_G&&p.m.down&&se()),G=e.pageY)}function it(e,t,n){var o,r,i=Wn(e,qt),l={slides:e,destiny:t,direction:n,destinyPos:{left:t.offsetLeft},slideIndex:In(t),section:i,sectionIndex:In(i,qt),anchorLink:i.getAttribute("data-anchor"),slidesNav:yn(pn,i)[0],slideAnchor:Et(t),prevSlide:yn(an,i)[0],prevSlideIndex:In(yn(an,i)[0]),localIsResizing:T};l.xMovement=(o=l.prevSlideIndex,r=l.slideIndex,o==r?"none":r20*Math.max(J,t)/100&&(ve(!0),J=t)}}else we();T=!1}function ct(){var e=E.responsive||E.responsiveWidth,t=E.responsiveHeight,n=e&&zt.innerWidth -1;\r\n\r\n // cache common elements\r\n var $htmlBody = $('html, body');\r\n var $html = $('html')[0];\r\n var $body = $('body')[0];\r\n\r\n //only once my friend!\r\n if(hasClass($html, ENABLED)){ displayWarnings(); return; }\r\n\r\n var FP = {};\r\n\r\n // Creating some defaults, extending them with any options that were provided\r\n options = deepExtend({\r\n //navigation\r\n menu: false,\r\n anchors:[],\r\n lockAnchors: false,\r\n navigation: false,\r\n navigationPosition: 'right',\r\n navigationTooltips: [],\r\n showActiveTooltip: false,\r\n slidesNavigation: false,\r\n slidesNavPosition: 'bottom',\r\n scrollBar: false,\r\n hybrid: false,\r\n\r\n //scrolling\r\n css3: true,\r\n scrollingSpeed: 700,\r\n autoScrolling: true,\r\n fitToSection: true,\r\n fitToSectionDelay: 1000,\r\n easing: 'easeInOutCubic',\r\n easingcss3: 'ease',\r\n loopBottom: false,\r\n loopTop: false,\r\n loopHorizontal: true,\r\n continuousVertical: false,\r\n continuousHorizontal: false,\r\n scrollHorizontally: false,\r\n interlockedSlides: false,\r\n dragAndMove: false,\r\n offsetSections: false,\r\n resetSliders: false,\r\n fadingEffect: false,\r\n normalScrollElements: null,\r\n scrollOverflow: false,\r\n scrollOverflowReset: false,\r\n scrollOverflowHandler: window.fp_scrolloverflow ? window.fp_scrolloverflow.iscrollHandler : null,\r\n scrollOverflowOptions: null,\r\n touchSensitivity: 5,\r\n touchWrapper: typeof containerSelector === 'string' ? $(containerSelector)[0] : containerSelector,\r\n bigSectionsDestination: null,\r\n\r\n //Accessibility\r\n keyboardScrolling: true,\r\n animateAnchor: true,\r\n recordHistory: true,\r\n\r\n //design\r\n controlArrows: true,\r\n controlArrowColor: '#fff',\r\n verticalCentered: true,\r\n sectionsColor : [],\r\n paddingTop: 0,\r\n paddingBottom: 0,\r\n fixedElements: null,\r\n responsive: 0, //backwards compabitility with responsiveWiddth\r\n responsiveWidth: 0,\r\n responsiveHeight: 0,\r\n responsiveSlides: false,\r\n parallax: false,\r\n parallaxOptions: {\r\n type: 'reveal',\r\n percentage: 62,\r\n property: 'translate'\r\n },\r\n cards: false,\r\n cardsOptions: {\r\n perspective: 100,\r\n fadeContent: true,\r\n fadeBackground: true\r\n },\r\n\r\n //Custom selectors\r\n sectionSelector: SECTION_DEFAULT_SEL,\r\n slideSelector: SLIDE_DEFAULT_SEL,\r\n\r\n //events\r\n v2compatible: false,\r\n afterLoad: null,\r\n onLeave: null,\r\n afterRender: null,\r\n afterResize: null,\r\n afterReBuild: null,\r\n afterSlideLoad: null,\r\n onSlideLeave: null,\r\n afterResponsive: null,\r\n\r\n lazyLoading: true\r\n }, options);\r\n\r\n //flag to avoid very fast sliding for landscape sliders\r\n var slideMoving = false;\r\n\r\n var isTouchDevice = navigator.userAgent.match(/(iPhone|iPod|iPad|Android|playbook|silk|BlackBerry|BB10|Windows Phone|Tizen|Bada|webOS|IEMobile|Opera Mini)/);\r\n var isTouch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0) || (navigator.maxTouchPoints));\r\n var container = typeof containerSelector === 'string' ? $(containerSelector)[0] : containerSelector;\r\n var windowsHeight = getWindowHeight();\r\n var windowsWidth = getWindowWidth();\r\n var isResizing = false;\r\n var isWindowFocused = true;\r\n var lastScrolledDestiny;\r\n var lastScrolledSlide;\r\n var canScroll = true;\r\n var scrollings = [];\r\n var controlPressed;\r\n var startingSection;\r\n var isScrollAllowed = {};\r\n isScrollAllowed.m = { 'up':true, 'down':true, 'left':true, 'right':true };\r\n isScrollAllowed.k = deepExtend({}, isScrollAllowed.m);\r\n var MSPointer = getMSPointer();\r\n var events = {\r\n touchmove: 'ontouchmove' in window ? 'touchmove' : MSPointer.move,\r\n touchstart: 'ontouchstart' in window ? 'touchstart' : MSPointer.down\r\n };\r\n var scrollBarHandler;\r\n\r\n // taken from https://github.com/udacity/ud891/blob/gh-pages/lesson2-focus/07-modals-and-keyboard-traps/solution/modal.js\r\n var focusableElementsString = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex=\"0\"], [contenteditable]';\r\n\r\n //cheks for passive event support\r\n var g_supportsPassive = false;\r\n try {\r\n var opts = Object.defineProperty({}, 'passive', {\r\n get: function() {\r\n g_supportsPassive = true;\r\n }\r\n });\r\n window.addEventListener(\"testPassive\", null, opts);\r\n window.removeEventListener(\"testPassive\", null, opts);\r\n } catch (e) {}\r\n\r\n //timeouts\r\n var resizeId;\r\n var resizeHandlerId;\r\n var afterSectionLoadsId;\r\n var afterSlideLoadsId;\r\n var scrollId;\r\n var scrollId2;\r\n var keydownId;\r\n var g_doubleCheckHeightId;\r\n var originals = deepExtend({}, options); //deep copy\r\n var activeAnimation;\r\n var g_initialAnchorsInDom = false;\r\n var g_canFireMouseEnterNormalScroll = true;\r\n var g_mediaLoadedId;\r\n var g_transitionLapseId;\r\n var extensions = [\r\n 'parallax',\r\n 'scrollOverflowReset',\r\n 'dragAndMove',\r\n 'offsetSections',\r\n 'fadingEffect',\r\n 'responsiveSlides',\r\n 'continuousHorizontal',\r\n 'interlockedSlides',\r\n 'scrollHorizontally',\r\n 'resetSliders',\r\n 'cards',\r\n 'dropEffect',\r\n 'waterEffect'\r\n ];\r\n\r\n displayWarnings();\r\n\r\n //easeInOutCubic animation included in the plugin\r\n window.fp_easings = deepExtend(window.fp_easings, {\r\n easeInOutCubic: function (t, b, c, d) {\r\n if ((t/=d/2) < 1) return c/2*t*t*t + b;return c/2*((t-=2)*t*t + 2) + b;\r\n }\r\n });\r\n\r\n /**\r\n * Sets the autoScroll option.\r\n * It changes the scroll bar visibility and the history of the site as a result.\r\n */\r\n function setAutoScrolling(value, type){\r\n //removing the transformation\r\n if(!value){\r\n silentScroll(0);\r\n }\r\n\r\n setVariableState('autoScrolling', value, type);\r\n\r\n var element = $(SECTION_ACTIVE_SEL)[0];\r\n\r\n if(options.autoScrolling && !options.scrollBar){\r\n css($htmlBody, {\r\n 'overflow': 'hidden',\r\n 'height': '100%'\r\n });\r\n\r\n setRecordHistory(originals.recordHistory, 'internal');\r\n\r\n //for IE touch devices\r\n css(container, {\r\n '-ms-touch-action': 'none',\r\n 'touch-action': 'none'\r\n });\r\n\r\n if(element != null){\r\n //moving the container up\r\n silentScroll(element.offsetTop);\r\n }\r\n }else{\r\n css($htmlBody, {\r\n 'overflow' : 'visible',\r\n 'height' : 'initial'\r\n });\r\n\r\n var recordHistory = !options.autoScrolling ? false : originals.recordHistory;\r\n setRecordHistory(recordHistory, 'internal');\r\n\r\n //for IE touch devices\r\n css(container, {\r\n '-ms-touch-action': '',\r\n 'touch-action': ''\r\n });\r\n\r\n //scrolling the page to the section with no animation\r\n if (element != null) {\r\n var scrollSettings = getScrollSettings(element.offsetTop);\r\n scrollSettings.element.scrollTo(0, scrollSettings.options);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Defines wheter to record the history for each hash change in the URL.\r\n */\r\n function setRecordHistory(value, type){\r\n setVariableState('recordHistory', value, type);\r\n }\r\n\r\n /**\r\n * Defines the scrolling speed\r\n */\r\n function setScrollingSpeed(value, type){\r\n setVariableState('scrollingSpeed', value, type);\r\n }\r\n\r\n /**\r\n * Sets fitToSection\r\n */\r\n function setFitToSection(value, type){\r\n setVariableState('fitToSection', value, type);\r\n }\r\n\r\n /**\r\n * Sets lockAnchors\r\n */\r\n function setLockAnchors(value){\r\n options.lockAnchors = value;\r\n }\r\n\r\n /**\r\n * Adds or remove the possibility of scrolling through sections by using the mouse wheel or the trackpad.\r\n */\r\n function setMouseWheelScrolling(value){\r\n if(value){\r\n addMouseWheelHandler();\r\n addMiddleWheelHandler();\r\n }else{\r\n removeMouseWheelHandler();\r\n removeMiddleWheelHandler();\r\n }\r\n }\r\n\r\n /**\r\n * Adds or remove the possibility of scrolling through sections by using the mouse wheel/trackpad or touch gestures.\r\n * Optionally a second parameter can be used to specify the direction for which the action will be applied.\r\n *\r\n * @param directions string containing the direction or directions separated by comma.\r\n */\r\n function setAllowScrolling(value, directions){\r\n if(typeof directions !== 'undefined'){\r\n directions = directions.replace(/ /g,'').split(',');\r\n\r\n directions.forEach(function (direction){\r\n setIsScrollAllowed(value, direction, 'm');\r\n });\r\n }\r\n else{\r\n setIsScrollAllowed(value, 'all', 'm');\r\n }\r\n }\r\n\r\n /**\r\n * Adds or remove the mouse wheel hijacking\r\n */\r\n function setMouseHijack(value){\r\n if(value){\r\n setMouseWheelScrolling(true);\r\n addTouchHandler();\r\n }else{\r\n setMouseWheelScrolling(false);\r\n removeTouchHandler();\r\n }\r\n }\r\n\r\n /**\r\n * Adds or remove the possibility of scrolling through sections by using the keyboard arrow keys\r\n */\r\n function setKeyboardScrolling(value, directions){\r\n if(typeof directions !== 'undefined'){\r\n directions = directions.replace(/ /g,'').split(',');\r\n\r\n directions.forEach(function(direction){\r\n setIsScrollAllowed(value, direction, 'k');\r\n });\r\n }else{\r\n setIsScrollAllowed(value, 'all', 'k');\r\n options.keyboardScrolling = value;\r\n }\r\n }\r\n\r\n /**\r\n * Moves the page up one section.\r\n */\r\n function moveSectionUp(){\r\n var prev = prevUntil($(SECTION_ACTIVE_SEL)[0], SECTION_SEL);\r\n\r\n //looping to the bottom if there's no more sections above\r\n if (!prev && (options.loopTop || options.continuousVertical)) {\r\n prev = last($(SECTION_SEL));\r\n }\r\n\r\n if (prev != null) {\r\n scrollPage(prev, null, true);\r\n }\r\n }\r\n\r\n /**\r\n * Moves the page down one section.\r\n */\r\n function moveSectionDown(){\r\n var next = nextUntil($(SECTION_ACTIVE_SEL)[0], SECTION_SEL);\r\n\r\n //looping to the top if there's no more sections below\r\n if(!next &&\r\n (options.loopBottom || options.continuousVertical)){\r\n next = $(SECTION_SEL)[0];\r\n }\r\n\r\n if(next != null){\r\n scrollPage(next, null, false);\r\n }\r\n }\r\n\r\n /**\r\n * Moves the page to the given section and slide with no animation.\r\n * Anchors or index positions can be used as params.\r\n */\r\n function silentMoveTo(sectionAnchor, slideAnchor){\r\n setScrollingSpeed (0, 'internal');\r\n moveTo(sectionAnchor, slideAnchor);\r\n setScrollingSpeed (originals.scrollingSpeed, 'internal');\r\n }\r\n\r\n /**\r\n * Moves the page to the given section and slide.\r\n * Anchors or index positions can be used as params.\r\n */\r\n function moveTo(sectionAnchor, slideAnchor){\r\n var destiny = getSectionByAnchor(sectionAnchor);\r\n\r\n if (typeof slideAnchor !== 'undefined'){\r\n scrollPageAndSlide(sectionAnchor, slideAnchor);\r\n }else if(destiny != null){\r\n scrollPage(destiny);\r\n }\r\n }\r\n\r\n /**\r\n * Slides right the slider of the active section.\r\n * Optional `section` param.\r\n */\r\n function moveSlideRight(section){\r\n moveSlide('right', section);\r\n }\r\n\r\n /**\r\n * Slides left the slider of the active section.\r\n * Optional `section` param.\r\n */\r\n function moveSlideLeft(section){\r\n moveSlide('left', section);\r\n }\r\n\r\n /**\r\n * When resizing is finished, we adjust the slides sizes and positions\r\n */\r\n function reBuild(resizing){\r\n if(hasClass(container, DESTROYED)){ return; } //nothing to do if the plugin was destroyed\r\n\r\n isResizing = true;\r\n\r\n //updating global vars\r\n windowsHeight = getWindowHeight();\r\n windowsWidth = getWindowWidth();\r\n\r\n var sections = $(SECTION_SEL);\r\n for (var i = 0; i < sections.length; ++i) {\r\n var section = sections[i];\r\n var slidesWrap = $(SLIDES_WRAPPER_SEL, section)[0];\r\n var slides = $(SLIDE_SEL, section);\r\n\r\n //adjusting the height of the table-cell for IE and Firefox\r\n if(options.verticalCentered){\r\n css($(TABLE_CELL_SEL, section), {'height': getTableHeight(section) + 'px'});\r\n }\r\n\r\n css(section, {'height': windowsHeight + 'px'});\r\n\r\n //adjusting the position fo the FULL WIDTH slides...\r\n if (slides.length > 1) {\r\n landscapeScroll(slidesWrap, $(SLIDE_ACTIVE_SEL, slidesWrap)[0]);\r\n }\r\n }\r\n\r\n if(options.scrollOverflow){\r\n scrollBarHandler.createScrollBarForAll();\r\n }\r\n\r\n var activeSection = $(SECTION_ACTIVE_SEL)[0];\r\n var sectionIndex = index(activeSection, SECTION_SEL);\r\n\r\n //isn't it the first section?\r\n if(sectionIndex){\r\n //adjusting the position for the current section\r\n silentMoveTo(sectionIndex + 1);\r\n }\r\n\r\n isResizing = false;\r\n\r\n if(isFunction( options.afterResize ) && resizing){\r\n options.afterResize.call(container, window.innerWidth, window.innerHeight);\r\n }\r\n if(isFunction( options.afterReBuild ) && !resizing){\r\n options.afterReBuild.call(container);\r\n }\r\n }\r\n\r\n /**\r\n * Determines whether fullpage.js is in responsive mode or not.\r\n */\r\n function isResponsiveMode(){\r\n return hasClass($body, RESPONSIVE);\r\n }\r\n\r\n /**\r\n * Turns fullPage.js to normal scrolling mode when the viewport `width` or `height`\r\n * are smaller than the set limit values.\r\n */\r\n function setResponsive(active){\r\n var isResponsive = isResponsiveMode();\r\n\r\n if(active){\r\n if(!isResponsive){\r\n setAutoScrolling(false, 'internal');\r\n setFitToSection(false, 'internal');\r\n hide($(SECTION_NAV_SEL));\r\n addClass($body, RESPONSIVE);\r\n if(isFunction( options.afterResponsive )){\r\n options.afterResponsive.call( container, active);\r\n }\r\n\r\n //when on page load, we will remove scrolloverflow if necessary\r\n if(options.scrollOverflow){\r\n scrollBarHandler.createScrollBarForAll();\r\n }\r\n }\r\n }\r\n else if(isResponsive){\r\n setAutoScrolling(originals.autoScrolling, 'internal');\r\n setFitToSection(originals.autoScrolling, 'internal');\r\n show($(SECTION_NAV_SEL));\r\n removeClass($body, RESPONSIVE);\r\n if(isFunction( options.afterResponsive )){\r\n options.afterResponsive.call( container, active);\r\n }\r\n }\r\n }\r\n\r\n if(container){\r\n //public functions\r\n FP.version = '3.1.1';\r\n FP.setAutoScrolling = setAutoScrolling;\r\n FP.setRecordHistory = setRecordHistory;\r\n FP.setScrollingSpeed = setScrollingSpeed;\r\n FP.setFitToSection = setFitToSection;\r\n FP.setLockAnchors = setLockAnchors;\r\n FP.setMouseWheelScrolling = setMouseWheelScrolling;\r\n FP.setAllowScrolling = setAllowScrolling;\r\n FP.setKeyboardScrolling = setKeyboardScrolling;\r\n FP.moveSectionUp = moveSectionUp;\r\n FP.moveSectionDown = moveSectionDown;\r\n FP.silentMoveTo = silentMoveTo;\r\n FP.moveTo = moveTo;\r\n FP.moveSlideRight = moveSlideRight;\r\n FP.moveSlideLeft = moveSlideLeft;\r\n FP.fitToSection = fitToSection;\r\n FP.reBuild = reBuild;\r\n FP.setResponsive = setResponsive;\r\n FP.getFullpageData = function(){ return options; };\r\n FP.destroy = destroy;\r\n FP.getActiveSection = getActiveSection;\r\n FP.getActiveSlide = getActiveSlide;\r\n\r\n FP.test = {\r\n top: '0px',\r\n translate3d: 'translate3d(0px, 0px, 0px)',\r\n translate3dH: (function(){\r\n var a = [];\r\n for(var i = 0; i < $(options.sectionSelector, container).length; i++){\r\n a.push('translate3d(0px, 0px, 0px)');\r\n }\r\n return a;\r\n })(),\r\n left: (function(){\r\n var a = [];\r\n for(var i = 0; i < $(options.sectionSelector, container).length; i++){\r\n a.push(0);\r\n }\r\n return a;\r\n })(),\r\n options: options,\r\n setAutoScrolling: setAutoScrolling\r\n };\r\n\r\n //functions we want to share across files but which are not\r\n //mean to be used on their own by developers\r\n FP.shared = {\r\n afterRenderActions: afterRenderActions,\r\n isNormalScrollElement: false\r\n };\r\n\r\n window.fullpage_api = FP;\r\n\r\n //using jQuery initialization? Creating the $.fn.fullpage object\r\n if(options.$){\r\n Object.keys(FP).forEach(function (key) { \r\n options.$.fn.fullpage[key] = FP[key]; \r\n });\r\n }\r\n\r\n init();\r\n\r\n bindEvents();\r\n }\r\n\r\n function init(){\r\n //if css3 is not supported, it will use jQuery animations\r\n if(options.css3){\r\n options.css3 = support3d();\r\n }\r\n\r\n options.scrollBar = options.scrollBar || options.hybrid;\r\n\r\n setOptionsFromDOM();\r\n prepareDom();\r\n setAllowScrolling(true);\r\n setMouseHijack(true);\r\n setAutoScrolling(options.autoScrolling, 'internal');\r\n responsive();\r\n\r\n //setting the class for the body element\r\n setBodyClass();\r\n\r\n if(document.readyState === 'complete'){\r\n scrollToAnchor();\r\n }\r\n window.addEventListener('load', scrollToAnchor);\r\n\r\n //if we use scrollOverflow we'll fire afterRender in the scrolloverflow file\r\n if(!options.scrollOverflow){\r\n afterRenderActions();\r\n }\r\n\r\n doubleCheckHeight();\r\n }\r\n\r\n function bindEvents(){\r\n\r\n //when scrolling...\r\n window.addEventListener('scroll', scrollHandler);\r\n\r\n //detecting any change on the URL to scroll to the given anchor link\r\n //(a way to detect back history button as we play with the hashes on the URL)\r\n window.addEventListener('hashchange', hashChangeHandler);\r\n \r\n // on window focus\r\n window.addEventListener('focus', focusHandler);\r\n\r\n //when opening a new tab (ctrl + t), `control` won't be pressed when coming back.\r\n window.addEventListener('blur', blurHandler);\r\n\r\n //when resizing the site, we adjust the heights of the sections, slimScroll...\r\n window.addEventListener('resize', resizeHandler);\r\n\r\n //Sliding with arrow keys, both, vertical and horizontal\r\n document.addEventListener('keydown', keydownHandler);\r\n\r\n //to prevent scrolling while zooming\r\n document.addEventListener('keyup', keyUpHandler);\r\n\r\n //Scrolls to the section when clicking the navigation bullet\r\n //simulating the jQuery .on('click') event using delegation\r\n ['click', 'touchstart'].forEach(function(eventName){\r\n document.addEventListener(eventName, delegatedEvents);\r\n });\r\n\r\n /**\r\n * Applying normalScroll elements.\r\n * Ignoring the scrolls over the specified selectors.\r\n */\r\n if(options.normalScrollElements){\r\n ['mouseenter', 'touchstart'].forEach(function(eventName){\r\n forMouseLeaveOrTouch(eventName, false);\r\n });\r\n\r\n ['mouseleave', 'touchend'].forEach(function(eventName){\r\n forMouseLeaveOrTouch(eventName, true);\r\n });\r\n }\r\n }\r\n\r\n function delegatedEvents(e){\r\n var target = e.target;\r\n\r\n if(target && closest(target, SECTION_NAV_SEL + ' a')){\r\n sectionBulletHandler.call(target, e);\r\n }\r\n else if(matches(target, SECTION_NAV_TOOLTIP_SEL)){\r\n tooltipTextHandler.call(target);\r\n }\r\n else if(matches(target, SLIDES_ARROW_SEL)){\r\n slideArrowHandler.call(target, e);\r\n }\r\n else if(matches(target, SLIDES_NAV_LINK_SEL) || closest(target, SLIDES_NAV_LINK_SEL) != null){\r\n slideBulletHandler.call(target, e);\r\n }\r\n else if(closest(target, options.menu + ' [data-menuanchor]')){\r\n menuItemsHandler.call(target, e);\r\n }\r\n }\r\n\r\n function forMouseLeaveOrTouch(eventName, allowScrolling){\r\n //a way to pass arguments to the onMouseEnterOrLeave function\r\n document['fp_' + eventName] = allowScrolling;\r\n document.addEventListener(eventName, onMouseEnterOrLeave, true); //capturing phase\r\n }\r\n\r\n function onMouseEnterOrLeave(e) {\r\n var type = e.type;\r\n var isInsideOneNormalScroll = false;\r\n var isUsingScrollOverflow = options.scrollOverflow;\r\n\r\n //onMouseLeave will use the destination target, not the one we are moving away from\r\n var target = type === 'mouseleave' ? e.toElement || e.relatedTarget : e.target;\r\n\r\n //coming from closing a normalScrollElements modal or moving outside viewport?\r\n if(target == document || !target){\r\n setMouseHijack(true);\r\n\r\n if(isUsingScrollOverflow){\r\n options.scrollOverflowHandler.setIscroll(target, true);\r\n }\r\n return;\r\n }\r\n\r\n if(type === 'touchend'){\r\n g_canFireMouseEnterNormalScroll = false;\r\n setTimeout(function(){\r\n g_canFireMouseEnterNormalScroll = true;\r\n }, 800);\r\n }\r\n\r\n //preventing mouseenter event to do anything when coming from a touchEnd event\r\n //fixing issue #3576\r\n if(type === 'mouseenter' && !g_canFireMouseEnterNormalScroll){\r\n return;\r\n }\r\n\r\n var normalSelectors = options.normalScrollElements.split(',');\r\n\r\n normalSelectors.forEach(function(normalSelector){\r\n if(!isInsideOneNormalScroll){\r\n var isNormalScrollTarget = matches(target, normalSelector);\r\n\r\n //leaving a child inside the normalScoll element is not leaving the normalScroll #3661\r\n var isNormalScrollChildFocused = closest(target, normalSelector);\r\n\r\n if(isNormalScrollTarget || isNormalScrollChildFocused){\r\n if(!FP.shared.isNormalScrollElement){\r\n setMouseHijack(false);\r\n\r\n if(isUsingScrollOverflow){\r\n options.scrollOverflowHandler.setIscroll(target, false);\r\n }\r\n }\r\n FP.shared.isNormalScrollElement = true;\r\n isInsideOneNormalScroll = true;\r\n }\r\n }\r\n });\r\n\r\n //not inside a single normal scroll element anymore?\r\n if(!isInsideOneNormalScroll && FP.shared.isNormalScrollElement){\r\n setMouseHijack(true);\r\n \r\n if(isUsingScrollOverflow){\r\n options.scrollOverflowHandler.setIscroll(target, true);\r\n }\r\n\r\n FP.shared.isNormalScrollElement = false;\r\n }\r\n }\r\n\r\n /**\r\n * Checks the viewport a few times on a define interval of time to \r\n * see if it has changed in any of those. If that's the case, it resizes.\r\n */\r\n function doubleCheckHeight(){\r\n for(var i = 1; i < 4; i++){\r\n g_doubleCheckHeightId = setTimeout(adjustToNewViewport, 350 * i);\r\n }\r\n }\r\n\r\n /**\r\n * Adjusts a section to the viewport if it has changed.\r\n */\r\n function adjustToNewViewport(){\r\n var newWindowHeight = getWindowHeight();\r\n var newWindowWidth = getWindowWidth();\r\n\r\n if(windowsHeight !== newWindowHeight || windowsWidth !== newWindowWidth){\r\n windowsHeight = newWindowHeight;\r\n windowsWidth = newWindowWidth;\r\n reBuild(true);\r\n }\r\n }\r\n\r\n /**\r\n * Setting options from DOM elements if they are not provided.\r\n */\r\n function setOptionsFromDOM(){\r\n\r\n //no anchors option? Checking for them in the DOM attributes\r\n if(!options.anchors.length){\r\n var anchorsAttribute = '[data-anchor]';\r\n var anchors = $(options.sectionSelector.split(',').join(anchorsAttribute + ',') + anchorsAttribute, container);\r\n if(anchors.length && anchors.length === $(options.sectionSelector, container).length){\r\n g_initialAnchorsInDom = true;\r\n anchors.forEach(function(item){\r\n options.anchors.push(item.getAttribute('data-anchor').toString());\r\n });\r\n }\r\n }\r\n\r\n //no tooltips option? Checking for them in the DOM attributes\r\n if(!options.navigationTooltips.length){\r\n var tooltipsAttribute = '[data-tooltip]';\r\n var tooltips = $(options.sectionSelector.split(',').join(tooltipsAttribute + ',') + tooltipsAttribute, container);\r\n if(tooltips.length){\r\n tooltips.forEach(function(item){\r\n options.navigationTooltips.push(item.getAttribute('data-tooltip').toString());\r\n });\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Works over the DOM structure to set it up for the current fullpage options.\r\n */\r\n function prepareDom(){\r\n css(container, {\r\n 'height': '100%',\r\n 'position': 'relative'\r\n });\r\n\r\n //adding a class to recognize the container internally in the code\r\n addClass(container, WRAPPER);\r\n addClass($html, ENABLED);\r\n\r\n //due to https://github.com/alvarotrigo/fullPage.js/issues/1502\r\n windowsHeight = getWindowHeight();\r\n\r\n removeClass(container, DESTROYED); //in case it was destroyed before initializing it again\r\n\r\n addInternalSelectors();\r\n\r\n var sections = $(SECTION_SEL);\r\n\r\n //styling the sections / slides / menu\r\n for(var i = 0; i 0) {\r\n styleSlides(section, slides, numSlides);\r\n }else{\r\n if(options.verticalCentered){\r\n addTableClass(section);\r\n }\r\n }\r\n }\r\n\r\n //fixed elements need to be moved out of the plugin container due to problems with CSS3.\r\n if(options.fixedElements && options.css3){\r\n $(options.fixedElements).forEach(function(item){\r\n $body.appendChild(item);\r\n });\r\n }\r\n\r\n //vertical centered of the navigation + active bullet\r\n if(options.navigation){\r\n addVerticalNavigation();\r\n }\r\n\r\n enableYoutubeAPI();\r\n\r\n if(options.scrollOverflow){\r\n scrollBarHandler = options.scrollOverflowHandler.init(options);\r\n }\r\n }\r\n\r\n /**\r\n * Styles the horizontal slides for a section.\r\n */\r\n function styleSlides(section, slides, numSlides){\r\n var sliderWidth = numSlides * 100;\r\n var slideWidth = 100 / numSlides;\r\n\r\n var slidesWrapper = document.createElement('div');\r\n slidesWrapper.className = SLIDES_WRAPPER; //fp-slides\r\n wrapAll(slides, slidesWrapper);\r\n\r\n var slidesContainer = document.createElement('div');\r\n slidesContainer.className = SLIDES_CONTAINER; //fp-slidesContainer\r\n wrapAll(slides, slidesContainer);\r\n\r\n css($(SLIDES_CONTAINER_SEL, section), {'width': sliderWidth + '%'});\r\n\r\n if(numSlides > 1){\r\n if(options.controlArrows){\r\n createSlideArrows(section);\r\n }\r\n\r\n if(options.slidesNavigation){\r\n addSlidesNavigation(section, numSlides);\r\n }\r\n }\r\n\r\n slides.forEach(function(slide) {\r\n css(slide, {'width': slideWidth + '%'});\r\n\r\n if(options.verticalCentered){\r\n addTableClass(slide);\r\n }\r\n });\r\n\r\n var startingSlide = $(SLIDE_ACTIVE_SEL, section)[0];\r\n\r\n //if the slide won't be an starting point, the default will be the first one\r\n //the active section isn't the first one? Is not the first slide of the first section? Then we load that section/slide by default.\r\n if( startingSlide != null && (index($(SECTION_ACTIVE_SEL), SECTION_SEL) !== 0 || (index($(SECTION_ACTIVE_SEL), SECTION_SEL) === 0 && index(startingSlide) !== 0))){\r\n silentLandscapeScroll(startingSlide, 'internal');\r\n }else{\r\n addClass(slides[0], ACTIVE);\r\n }\r\n }\r\n\r\n /**\r\n * Styling vertical sections\r\n */\r\n function styleSection(section, index){\r\n //if no active section is defined, the 1st one will be the default one\r\n if(!index && $(SECTION_ACTIVE_SEL)[0] == null) {\r\n addClass(section, ACTIVE);\r\n }\r\n startingSection = $(SECTION_ACTIVE_SEL)[0];\r\n\r\n css(section, {'height': windowsHeight + 'px'});\r\n\r\n if(options.paddingTop){\r\n css(section, {'padding-top': options.paddingTop});\r\n }\r\n\r\n if(options.paddingBottom){\r\n css(section, {'padding-bottom': options.paddingBottom});\r\n }\r\n\r\n if (typeof options.sectionsColor[index] !== 'undefined') {\r\n css(section, {'background-color': options.sectionsColor[index]});\r\n }\r\n\r\n if (typeof options.anchors[index] !== 'undefined') {\r\n section.setAttribute('data-anchor', options.anchors[index]);\r\n }\r\n }\r\n\r\n /**\r\n * Sets the data-anchor attributes to the menu elements and activates the current one.\r\n */\r\n function styleMenu(section, index){\r\n if (typeof options.anchors[index] !== 'undefined') {\r\n //activating the menu / nav element on load\r\n if(hasClass(section, ACTIVE)){\r\n activateMenuAndNav(options.anchors[index], index);\r\n }\r\n }\r\n\r\n //moving the menu outside the main container if it is inside (avoid problems with fixed positions when using CSS3 tranforms)\r\n if(options.menu && options.css3 && closest($(options.menu)[0], WRAPPER_SEL) != null){\r\n $(options.menu).forEach(function(menu) {\r\n $body.appendChild(menu);\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Adds internal classes to be able to provide customizable selectors\r\n * keeping the link with the style sheet.\r\n */\r\n function addInternalSelectors(){\r\n addClass($(options.sectionSelector, container), SECTION);\r\n addClass($(options.slideSelector, container), SLIDE);\r\n }\r\n\r\n /**\r\n * Creates the control arrows for the given section\r\n */\r\n function createSlideArrows(section){\r\n var arrows = [createElementFromHTML('
    '), createElementFromHTML('
    ')];\r\n after($(SLIDES_WRAPPER_SEL, section)[0], arrows);\r\n\r\n if(options.controlArrowColor !== '#fff'){\r\n css($(SLIDES_ARROW_NEXT_SEL, section), {'border-color': 'transparent transparent transparent '+options.controlArrowColor});\r\n css($(SLIDES_ARROW_PREV_SEL, section), {'border-color': 'transparent '+ options.controlArrowColor + ' transparent transparent'});\r\n }\r\n\r\n if(!options.loopHorizontal){\r\n hide($(SLIDES_ARROW_PREV_SEL, section));\r\n }\r\n }\r\n\r\n /**\r\n * Creates a vertical navigation bar.\r\n */\r\n function addVerticalNavigation(){\r\n var navigation = document.createElement('div');\r\n navigation.setAttribute('id', SECTION_NAV);\r\n\r\n var divUl = document.createElement('ul');\r\n navigation.appendChild(divUl);\r\n\r\n appendTo(navigation, $body);\r\n var nav = $(SECTION_NAV_SEL)[0];\r\n\r\n addClass(nav, 'fp-' + options.navigationPosition);\r\n\r\n if(options.showActiveTooltip){\r\n addClass(nav, SHOW_ACTIVE_TOOLTIP);\r\n }\r\n\r\n var li = '';\r\n\r\n for (var i = 0; i < $(SECTION_SEL).length; i++) {\r\n var link = '';\r\n if (options.anchors.length) {\r\n link = options.anchors[i];\r\n }\r\n\r\n li += '
  • ' + getBulletLinkName(i, 'Section') + '';\r\n\r\n // Only add tooltip if needed (defined by user)\r\n var tooltip = options.navigationTooltips[i];\r\n\r\n if (typeof tooltip !== 'undefined' && tooltip !== '') {\r\n li += '
    ' + tooltip + '
    ';\r\n }\r\n\r\n li += '
  • ';\r\n }\r\n $('ul', nav)[0].innerHTML = li;\r\n \r\n //activating the current active section\r\n\r\n var bullet = $('li', $(SECTION_NAV_SEL)[0])[index($(SECTION_ACTIVE_SEL)[0], SECTION_SEL)];\r\n addClass($('a', bullet), ACTIVE);\r\n }\r\n\r\n /**\r\n * Gets the name for screen readers for a section/slide navigation bullet.\r\n */\r\n function getBulletLinkName(i, defaultName, item){\r\n var anchor = defaultName === 'Section' ? options.anchors[i] : item.getAttribute('data-anchor');\r\n return options.navigationTooltips[i]\r\n || anchor\r\n || defaultName + ' ' + (i+1);\r\n }\r\n\r\n /*\r\n * Enables the Youtube videos API so we can control their flow if necessary.\r\n */\r\n function enableYoutubeAPI(){\r\n $('iframe[src*=\"youtube.com/embed/\"]', container).forEach(function(item){\r\n addURLParam(item, 'enablejsapi=1');\r\n });\r\n }\r\n\r\n /**\r\n * Adds a new parameter and its value to the `src` of a given element\r\n */\r\n function addURLParam(element, newParam){\r\n var originalSrc = element.getAttribute('src');\r\n element.setAttribute('src', originalSrc + getUrlParamSign(originalSrc) + newParam);\r\n }\r\n\r\n /*\r\n * Returns the prefix sign to use for a new parameter in an existen URL.\r\n *\r\n * @return {String} ? | &\r\n */\r\n function getUrlParamSign(url){\r\n return ( !/\\?/.test( url ) ) ? '?' : '&';\r\n }\r\n\r\n /**\r\n * Actions and callbacks to fire afterRender\r\n */\r\n function afterRenderActions(){\r\n var section = $(SECTION_ACTIVE_SEL)[0];\r\n\r\n addClass(section, COMPLETELY);\r\n\r\n lazyLoad(section);\r\n lazyLoadOthers();\r\n playMedia(section);\r\n\r\n if(options.scrollOverflow){\r\n options.scrollOverflowHandler.afterLoad();\r\n }\r\n\r\n if(isDestinyTheStartingSection() && isFunction(options.afterLoad) ){\r\n fireCallback('afterLoad', {\r\n activeSection: section,\r\n element: section,\r\n direction: null,\r\n\r\n //for backwards compatibility callback (to be removed in a future!)\r\n anchorLink: section.getAttribute('data-anchor'),\r\n sectionIndex: index(section, SECTION_SEL)\r\n });\r\n }\r\n\r\n if(isFunction(options.afterRender)){\r\n fireCallback('afterRender');\r\n }\r\n }\r\n\r\n /**\r\n * Determines if the URL anchor destiny is the starting section (the one using 'active' class before initialization)\r\n */\r\n function isDestinyTheStartingSection(){\r\n var anchor = getAnchorsURL();\r\n var destinationSection = getSectionByAnchor(anchor.section);\r\n return !anchor.section || !destinationSection || typeof destinationSection !=='undefined' && index(destinationSection) === index(startingSection);\r\n }\r\n\r\n var isScrolling = false;\r\n var lastScroll = 0;\r\n\r\n //when scrolling...\r\n function scrollHandler(){\r\n var currentSection;\r\n\r\n if(isResizing){\r\n return;\r\n }\r\n \r\n if(!options.autoScrolling || options.scrollBar){\r\n var currentScroll = getScrollTop();\r\n var scrollDirection = getScrollDirection(currentScroll);\r\n var visibleSectionIndex = 0;\r\n var screen_mid = currentScroll + (getWindowHeight() / 2.0);\r\n var isAtBottom = $body.offsetHeight - getWindowHeight() === currentScroll;\r\n var sections = $(SECTION_SEL);\r\n\r\n //when using `auto-height` for a small last section it won't be centered in the viewport\r\n if(isAtBottom){\r\n visibleSectionIndex = sections.length - 1;\r\n }\r\n //is at top? when using `auto-height` for a small first section it won't be centered in the viewport\r\n else if(!currentScroll){\r\n visibleSectionIndex = 0;\r\n }\r\n\r\n //taking the section which is showing more content in the viewport\r\n else{\r\n for (var i = 0; i < sections.length; ++i) {\r\n var section = sections[i];\r\n\r\n // Pick the the last section which passes the middle line of the screen.\r\n if (section.offsetTop <= screen_mid)\r\n {\r\n visibleSectionIndex = i;\r\n }\r\n }\r\n }\r\n\r\n if(isCompletelyInViewPort(scrollDirection)){\r\n if(!hasClass($(SECTION_ACTIVE_SEL)[0], COMPLETELY)){\r\n addClass($(SECTION_ACTIVE_SEL)[0], COMPLETELY);\r\n removeClass(siblings($(SECTION_ACTIVE_SEL)[0]), COMPLETELY);\r\n }\r\n }\r\n\r\n //geting the last one, the current one on the screen\r\n currentSection = sections[visibleSectionIndex];\r\n\r\n //setting the visible section as active when manually scrolling\r\n //executing only once the first time we reach the section\r\n if(!hasClass(currentSection, ACTIVE)){\r\n isScrolling = true;\r\n var leavingSection = $(SECTION_ACTIVE_SEL)[0];\r\n var leavingSectionIndex = index(leavingSection, SECTION_SEL) + 1;\r\n var yMovement = getYmovement(currentSection);\r\n var anchorLink = currentSection.getAttribute('data-anchor');\r\n var sectionIndex = index(currentSection, SECTION_SEL) + 1;\r\n var activeSlide = $(SLIDE_ACTIVE_SEL, currentSection)[0];\r\n var slideIndex;\r\n var slideAnchorLink;\r\n var callbacksParams = {\r\n activeSection: leavingSection,\r\n sectionIndex: sectionIndex -1,\r\n anchorLink: anchorLink,\r\n element: currentSection,\r\n leavingSection: leavingSectionIndex,\r\n direction: yMovement\r\n };\r\n\r\n if(activeSlide){\r\n slideAnchorLink = activeSlide.getAttribute('data-anchor');\r\n slideIndex = index(activeSlide);\r\n }\r\n\r\n if(canScroll){\r\n addClass(currentSection, ACTIVE);\r\n removeClass(siblings(currentSection), ACTIVE);\r\n\r\n if(isFunction( options.onLeave )){\r\n fireCallback('onLeave', callbacksParams);\r\n }\r\n if(isFunction( options.afterLoad )){\r\n fireCallback('afterLoad', callbacksParams);\r\n }\r\n\r\n stopMedia(leavingSection);\r\n lazyLoad(currentSection);\r\n playMedia(currentSection);\r\n\r\n activateMenuAndNav(anchorLink, sectionIndex - 1);\r\n\r\n if(options.anchors.length){\r\n //needed to enter in hashChange event when using the menu with anchor links\r\n lastScrolledDestiny = anchorLink;\r\n }\r\n setState(slideIndex, slideAnchorLink, anchorLink, sectionIndex);\r\n }\r\n\r\n //small timeout in order to avoid entering in hashChange event when scrolling is not finished yet\r\n clearTimeout(scrollId);\r\n scrollId = setTimeout(function(){\r\n isScrolling = false;\r\n }, 100);\r\n }\r\n\r\n if(options.fitToSection){\r\n //for the auto adjust of the viewport to fit a whole section\r\n clearTimeout(scrollId2);\r\n\r\n scrollId2 = setTimeout(function(){\r\n //checking it again in case it changed during the delay\r\n if(options.fitToSection &&\r\n\r\n //is the destination element bigger than the viewport?\r\n $(SECTION_ACTIVE_SEL)[0].offsetHeight <= windowsHeight\r\n ){\r\n fitToSection();\r\n }\r\n }, options.fitToSectionDelay);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Fits the site to the nearest active section\r\n */\r\n function fitToSection(){\r\n //checking fitToSection again in case it was set to false before the timeout delay\r\n if(canScroll){\r\n //allows to scroll to an active section and\r\n //if the section is already active, we prevent firing callbacks\r\n isResizing = true;\r\n\r\n scrollPage($(SECTION_ACTIVE_SEL)[0]);\r\n isResizing = false;\r\n }\r\n }\r\n\r\n /**\r\n * Determines whether the active section has seen in its whole or not.\r\n */\r\n function isCompletelyInViewPort(movement){\r\n var top = $(SECTION_ACTIVE_SEL)[0].offsetTop;\r\n var bottom = top + getWindowHeight();\r\n\r\n if(movement == 'up'){\r\n return bottom >= (getScrollTop() + getWindowHeight());\r\n }\r\n return top <= getScrollTop();\r\n }\r\n\r\n /**\r\n * Determines whether a section is in the viewport or not.\r\n */\r\n function isSectionInViewport (el) {\r\n var rect = el.getBoundingClientRect();\r\n var top = rect.top;\r\n var bottom = rect.bottom;\r\n\r\n //sometimes there's a 1px offset on the bottom of the screen even when the \r\n //section's height is the window.innerHeight one. I guess because pixels won't allow decimals.\r\n //using this prevents from lazyLoading the section that is not yet visible \r\n //(only 1 pixel offset is)\r\n var pixelOffset = 2;\r\n \r\n var isTopInView = top + pixelOffset < windowsHeight && top > 0;\r\n var isBottomInView = bottom > pixelOffset && bottom < windowsHeight;\r\n\r\n return isTopInView || isBottomInView;\r\n }\r\n\r\n /**\r\n * Gets the directon of the the scrolling fired by the scroll event.\r\n */\r\n function getScrollDirection(currentScroll){\r\n var direction = currentScroll > lastScroll ? 'down' : 'up';\r\n\r\n lastScroll = currentScroll;\r\n\r\n //needed for auto-height sections to determine if we want to scroll to the top or bottom of the destination\r\n previousDestTop = currentScroll;\r\n\r\n return direction;\r\n }\r\n\r\n /**\r\n * Determines the way of scrolling up or down:\r\n * by 'automatically' scrolling a section or by using the default and normal scrolling.\r\n */\r\n function scrolling(type){\r\n if (!isScrollAllowed.m[type]){\r\n return;\r\n }\r\n\r\n var scrollSection = (type === 'down') ? moveSectionDown : moveSectionUp;\r\n\r\n if(options.scrollOverflow){\r\n var scrollable = options.scrollOverflowHandler.scrollable($(SECTION_ACTIVE_SEL)[0]);\r\n var check = (type === 'down') ? 'bottom' : 'top';\r\n\r\n if(scrollable != null ){\r\n //is the scrollbar at the start/end of the scroll?\r\n if(options.scrollOverflowHandler.isScrolled(check, scrollable)){\r\n scrollSection();\r\n }else{\r\n return true;\r\n }\r\n }else{\r\n // moved up/down\r\n scrollSection();\r\n }\r\n }else{\r\n // moved up/down\r\n scrollSection();\r\n }\r\n }\r\n\r\n /*\r\n * Preventing bouncing in iOS #2285\r\n */\r\n function preventBouncing(e){\r\n if(options.autoScrolling && isReallyTouch(e) && isScrollAllowed.m.up){\r\n //preventing the easing on iOS devices\r\n preventDefault(e);\r\n }\r\n }\r\n\r\n var touchStartY = 0;\r\n var touchStartX = 0;\r\n var touchEndY = 0;\r\n var touchEndX = 0;\r\n\r\n /* Detecting touch events\r\n\r\n * As we are changing the top property of the page on scrolling, we can not use the traditional way to detect it.\r\n * This way, the touchstart and the touch moves shows an small difference between them which is the\r\n * used one to determine the direction.\r\n */\r\n function touchMoveHandler(e){\r\n var activeSection = closest(e.target, SECTION_SEL) || $(SECTION_ACTIVE_SEL)[0];\r\n\r\n if (isReallyTouch(e) ) {\r\n\r\n if(options.autoScrolling){\r\n //preventing the easing on iOS devices\r\n preventDefault(e);\r\n }\r\n\r\n var touchEvents = getEventsPage(e);\r\n\r\n touchEndY = touchEvents.y;\r\n touchEndX = touchEvents.x;\r\n\r\n //if movement in the X axys is greater than in the Y and the currect section has slides...\r\n if ($(SLIDES_WRAPPER_SEL, activeSection).length && Math.abs(touchStartX - touchEndX) > (Math.abs(touchStartY - touchEndY))) {\r\n\r\n //is the movement greater than the minimum resistance to scroll?\r\n if (!slideMoving && Math.abs(touchStartX - touchEndX) > (getWindowWidth() / 100 * options.touchSensitivity)) {\r\n if (touchStartX > touchEndX) {\r\n if(isScrollAllowed.m.right){\r\n moveSlideRight(activeSection); //next\r\n }\r\n } else {\r\n if(isScrollAllowed.m.left){\r\n moveSlideLeft(activeSection); //prev\r\n }\r\n }\r\n }\r\n }\r\n\r\n //vertical scrolling (only when autoScrolling is enabled)\r\n else if(options.autoScrolling && canScroll){\r\n\r\n //is the movement greater than the minimum resistance to scroll?\r\n if (Math.abs(touchStartY - touchEndY) > (window.innerHeight / 100 * options.touchSensitivity)) {\r\n if (touchStartY > touchEndY) {\r\n scrolling('down');\r\n } else if (touchEndY > touchStartY) {\r\n scrolling('up');\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * As IE >= 10 fires both touch and mouse events when using a mouse in a touchscreen\r\n * this way we make sure that is really a touch event what IE is detecting.\r\n */\r\n function isReallyTouch(e){\r\n //if is not IE || IE is detecting `touch` or `pen`\r\n return typeof e.pointerType === 'undefined' || e.pointerType != 'mouse';\r\n }\r\n\r\n /**\r\n * Handler for the touch start event.\r\n */\r\n function touchStartHandler(e){\r\n\r\n //stopping the auto scroll to adjust to a section\r\n if(options.fitToSection){\r\n activeAnimation = false;\r\n }\r\n\r\n if(isReallyTouch(e)){\r\n var touchEvents = getEventsPage(e);\r\n touchStartY = touchEvents.y;\r\n touchStartX = touchEvents.x;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the average of the last `number` elements of the given array.\r\n */\r\n function getAverage(elements, number){\r\n var sum = 0;\r\n\r\n //taking `number` elements from the end to make the average, if there are not enought, 1\r\n var lastElements = elements.slice(Math.max(elements.length - number, 1));\r\n\r\n for(var i = 0; i < lastElements.length; i++){\r\n sum = sum + lastElements[i];\r\n }\r\n\r\n return Math.ceil(sum/number);\r\n }\r\n\r\n /**\r\n * Detecting mousewheel scrolling\r\n *\r\n * http://blogs.sitepointstatic.com/examples/tech/mouse-wheel/index.html\r\n * http://www.sitepoint.com/html5-javascript-mouse-wheel/\r\n */\r\n var prevTime = new Date().getTime();\r\n\r\n function MouseWheelHandler(e) {\r\n var curTime = new Date().getTime();\r\n var isNormalScroll = hasClass($(COMPLETELY_SEL)[0], NORMAL_SCROLL);\r\n\r\n //is scroll allowed?\r\n if (!isScrollAllowed.m.down && !isScrollAllowed.m.up) {\r\n preventDefault(e);\r\n return false;\r\n }\r\n\r\n //autoscrolling and not zooming?\r\n if(options.autoScrolling && !controlPressed && !isNormalScroll){\r\n // cross-browser wheel delta\r\n e = e || window.event;\r\n var value = e.wheelDelta || -e.deltaY || -e.detail;\r\n var delta = Math.max(-1, Math.min(1, value));\r\n\r\n var horizontalDetection = typeof e.wheelDeltaX !== 'undefined' || typeof e.deltaX !== 'undefined';\r\n var isScrollingVertically = (Math.abs(e.wheelDeltaX) < Math.abs(e.wheelDelta)) || (Math.abs(e.deltaX ) < Math.abs(e.deltaY) || !horizontalDetection);\r\n\r\n //Limiting the array to 150 (lets not waste memory!)\r\n if(scrollings.length > 149){\r\n scrollings.shift();\r\n }\r\n\r\n //keeping record of the previous scrollings\r\n scrollings.push(Math.abs(value));\r\n\r\n //preventing to scroll the site on mouse wheel when scrollbar is present\r\n if(options.scrollBar){\r\n preventDefault(e);\r\n }\r\n\r\n //time difference between the last scroll and the current one\r\n var timeDiff = curTime-prevTime;\r\n prevTime = curTime;\r\n\r\n //haven't they scrolled in a while?\r\n //(enough to be consider a different scrolling action to scroll another section)\r\n if(timeDiff > 200){\r\n //emptying the array, we dont care about old scrollings for our averages\r\n scrollings = [];\r\n }\r\n\r\n if(canScroll){\r\n var averageEnd = getAverage(scrollings, 10);\r\n var averageMiddle = getAverage(scrollings, 70);\r\n var isAccelerating = averageEnd >= averageMiddle;\r\n\r\n //to avoid double swipes...\r\n if(isAccelerating && isScrollingVertically){\r\n //scrolling down?\r\n if (delta < 0) {\r\n scrolling('down');\r\n\r\n //scrolling up?\r\n }else {\r\n scrolling('up');\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n if(options.fitToSection){\r\n //stopping the auto scroll to adjust to a section\r\n activeAnimation = false;\r\n }\r\n }\r\n\r\n /**\r\n * Slides a slider to the given direction.\r\n * Optional `section` param.\r\n */\r\n function moveSlide(direction, section){\r\n var activeSection = section == null ? $(SECTION_ACTIVE_SEL)[0] : section;\r\n var slides = $(SLIDES_WRAPPER_SEL, activeSection)[0];\r\n\r\n // more than one slide needed and nothing should be sliding\r\n if (slides == null || slideMoving || $(SLIDE_SEL, slides).length < 2) {\r\n return;\r\n }\r\n\r\n var currentSlide = $(SLIDE_ACTIVE_SEL, slides)[0];\r\n var destiny = null;\r\n\r\n if(direction === 'left'){\r\n destiny = prevUntil(currentSlide, SLIDE_SEL);\r\n }else{\r\n destiny = nextUntil(currentSlide, SLIDE_SEL);\r\n }\r\n\r\n //isn't there a next slide in the secuence?\r\n if(destiny == null){\r\n //respect loopHorizontal settin\r\n if (!options.loopHorizontal) return;\r\n\r\n var slideSiblings = siblings(currentSlide);\r\n if(direction === 'left'){\r\n destiny = slideSiblings[slideSiblings.length - 1]; //last\r\n }else{\r\n destiny = slideSiblings[0]; //first\r\n }\r\n }\r\n\r\n slideMoving = true && !FP.test.isTesting;\r\n landscapeScroll(slides, destiny, direction);\r\n }\r\n\r\n /**\r\n * Maintains the active slides in the viewport\r\n * (Because the `scroll` animation might get lost with some actions, such as when using continuousVertical)\r\n */\r\n function keepSlidesPosition(){\r\n var activeSlides = $(SLIDE_ACTIVE_SEL);\r\n for( var i =0; i previousDestTop;\r\n var sectionBottom = position - windowsHeight + elementHeight;\r\n var bigSectionsDestination = options.bigSectionsDestination;\r\n\r\n //is the destination element bigger than the viewport?\r\n if(elementHeight > windowsHeight){\r\n //scrolling up?\r\n if(!isScrollingDown && !bigSectionsDestination || bigSectionsDestination === 'bottom' ){\r\n position = sectionBottom;\r\n }\r\n }\r\n\r\n //sections equal or smaller than the viewport height && scrolling down? || is resizing and its in the last section\r\n else if(isScrollingDown || (isResizing && next(element) == null) ){\r\n //The bottom of the destination will be at the bottom of the viewport\r\n position = sectionBottom;\r\n }\r\n\r\n /*\r\n Keeping record of the last scrolled position to determine the scrolling direction.\r\n No conventional methods can be used as the scroll bar might not be present\r\n AND the section might not be active if it is auto-height and didnt reach the middle\r\n of the viewport.\r\n */\r\n previousDestTop = position;\r\n return position;\r\n }\r\n\r\n /**\r\n * Scrolls the site to the given element and scrolls to the slide if a callback is given.\r\n */\r\n function scrollPage(element, callback, isMovementUp){\r\n if(element == null){ return; } //there's no element to scroll, leaving the function\r\n\r\n var dtop = getDestinationPosition(element);\r\n var slideAnchorLink;\r\n var slideIndex;\r\n\r\n //local variables\r\n var v = {\r\n element: element,\r\n callback: callback,\r\n isMovementUp: isMovementUp,\r\n dtop: dtop,\r\n yMovement: getYmovement(element),\r\n anchorLink: element.getAttribute('data-anchor'),\r\n sectionIndex: index(element, SECTION_SEL),\r\n activeSlide: $(SLIDE_ACTIVE_SEL, element)[0],\r\n activeSection: $(SECTION_ACTIVE_SEL)[0],\r\n leavingSection: index($(SECTION_ACTIVE_SEL), SECTION_SEL) + 1,\r\n\r\n //caching the value of isResizing at the momment the function is called\r\n //because it will be checked later inside a setTimeout and the value might change\r\n localIsResizing: isResizing\r\n };\r\n\r\n //quiting when destination scroll is the same as the current one\r\n if((v.activeSection == element && !isResizing) || (options.scrollBar && getScrollTop() === v.dtop && !hasClass(element, AUTO_HEIGHT) )){ return; }\r\n\r\n if(v.activeSlide != null){\r\n slideAnchorLink = v.activeSlide.getAttribute('data-anchor');\r\n slideIndex = index(v.activeSlide);\r\n }\r\n\r\n //callback (onLeave) if the site is not just resizing and readjusting the slides\r\n if(!v.localIsResizing){\r\n var direction = v.yMovement;\r\n\r\n //required for continousVertical\r\n if(typeof isMovementUp !== 'undefined'){\r\n direction = isMovementUp ? 'up' : 'down';\r\n }\r\n\r\n //for the callback\r\n v.direction = direction;\r\n\r\n if(isFunction(options.onLeave)){\r\n if(fireCallback('onLeave', v) === false){\r\n return;\r\n }\r\n }\r\n }\r\n\r\n // If continuousVertical && we need to wrap around\r\n if (options.autoScrolling && options.continuousVertical && typeof (v.isMovementUp) !== \"undefined\" &&\r\n ((!v.isMovementUp && v.yMovement == 'up') || // Intending to scroll down but about to go up or\r\n (v.isMovementUp && v.yMovement == 'down'))) { // intending to scroll up but about to go down\r\n\r\n v = createInfiniteSections(v);\r\n }\r\n\r\n //pausing media of the leaving section (if we are not just resizing, as destinatino will be the same one)\r\n if(!v.localIsResizing){\r\n stopMedia(v.activeSection);\r\n }\r\n\r\n if(options.scrollOverflow){\r\n options.scrollOverflowHandler.beforeLeave();\r\n }\r\n\r\n addClass(element, ACTIVE);\r\n removeClass(siblings(element), ACTIVE);\r\n lazyLoad(element);\r\n\r\n if(options.scrollOverflow){\r\n options.scrollOverflowHandler.onLeave();\r\n }\r\n\r\n //preventing from activating the MouseWheelHandler event\r\n //more than once if the page is scrolling\r\n canScroll = false || FP.test.isTesting;\r\n\r\n setState(slideIndex, slideAnchorLink, v.anchorLink, v.sectionIndex);\r\n\r\n performMovement(v);\r\n\r\n //flag to avoid callingn `scrollPage()` twice in case of using anchor links\r\n lastScrolledDestiny = v.anchorLink;\r\n\r\n //avoid firing it twice (as it does also on scroll)\r\n activateMenuAndNav(v.anchorLink, v.sectionIndex);\r\n }\r\n\r\n /**\r\n * Dispatch events & callbacks making sure it does it on the right format, depending on\r\n * whether v2compatible is being used or not.\r\n */\r\n function fireCallback(eventName, v){\r\n var eventData = getEventData(eventName, v);\r\n\r\n if(!options.v2compatible){\r\n trigger(container, eventName, eventData);\r\n\r\n if(options[eventName].apply(eventData[Object.keys(eventData)[0]], toArray(eventData)) === false){\r\n return false;\r\n }\r\n }\r\n else{\r\n if(options[eventName].apply(eventData[0], eventData.slice(1)) === false){\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Makes sure to only create a Panel object if the element exist\r\n */\r\n function nullOrSection(el){\r\n return el ? new Section(el) : null;\r\n }\r\n\r\n function nullOrSlide(el){\r\n return el ? new Slide(el) : null;\r\n }\r\n\r\n /**\r\n * Gets the event's data for the given event on the right format. Depending on whether\r\n * v2compatible is being used or not.\r\n */\r\n function getEventData(eventName, v){\r\n var paramsPerEvent;\r\n\r\n if(!options.v2compatible){\r\n\r\n //using functions to run only the necessary bits within the object\r\n paramsPerEvent = {\r\n afterRender: function(){\r\n return {\r\n section: nullOrSection($(SECTION_ACTIVE_SEL)[0]),\r\n slide: nullOrSlide($(SLIDE_ACTIVE_SEL, $(SECTION_ACTIVE_SEL)[0])[0])\r\n };\r\n },\r\n onLeave: function(){\r\n return {\r\n origin: nullOrSection(v.activeSection),\r\n destination: nullOrSection(v.element),\r\n direction: v.direction\r\n };\r\n },\r\n\r\n afterLoad: function(){\r\n return paramsPerEvent.onLeave();\r\n },\r\n\r\n afterSlideLoad: function(){\r\n return {\r\n section: nullOrSection(v.section),\r\n origin: nullOrSlide(v.prevSlide),\r\n destination: nullOrSlide(v.destiny),\r\n direction: v.direction\r\n };\r\n },\r\n\r\n onSlideLeave: function(){\r\n return paramsPerEvent.afterSlideLoad();\r\n }\r\n };\r\n }\r\n else{\r\n paramsPerEvent = {\r\n afterRender: function(){ return [container]; },\r\n onLeave: function(){ return [v.activeSection, v.leavingSection, (v.sectionIndex + 1), v.direction]; },\r\n afterLoad: function(){ return [v.element, v.anchorLink, (v.sectionIndex + 1)]; },\r\n afterSlideLoad: function(){ return [v.destiny, v.anchorLink, (v.sectionIndex + 1), v.slideAnchor, v.slideIndex]; },\r\n onSlideLeave: function(){ return [v.prevSlide, v.anchorLink, (v.sectionIndex + 1), v.prevSlideIndex, v.direction, v.slideIndex]; },\r\n };\r\n }\r\n\r\n return paramsPerEvent[eventName]();\r\n }\r\n\r\n /**\r\n * Performs the vertical movement (by CSS3 or by jQuery)\r\n */\r\n function performMovement(v){\r\n var isFastSpeed = options.scrollingSpeed < 700;\r\n var transitionLapse = isFastSpeed ? 700 : options.scrollingSpeed; \r\n\r\n // using CSS3 translate functionality\r\n if (options.css3 && options.autoScrolling && !options.scrollBar) {\r\n\r\n // The first section can have a negative value in iOS 10. Not quite sure why: -0.0142822265625\r\n // that's why we round it to 0.\r\n var translate3d = 'translate3d(0px, -' + Math.round(v.dtop) + 'px, 0px)';\r\n transformContainer(translate3d, true);\r\n\r\n //even when the scrollingSpeed is 0 there's a little delay, which might cause the\r\n //scrollingSpeed to change in case of using silentMoveTo();\r\n if(options.scrollingSpeed){\r\n clearTimeout(afterSectionLoadsId);\r\n afterSectionLoadsId = setTimeout(function () {\r\n afterSectionLoads(v);\r\n\r\n //disabling canScroll when using fastSpeed\r\n canScroll = !isFastSpeed;\r\n }, options.scrollingSpeed); \r\n }else{\r\n afterSectionLoads(v);\r\n }\r\n }\r\n\r\n // using JS to animate\r\n else{\r\n var scrollSettings = getScrollSettings(v.dtop);\r\n FP.test.top = -v.dtop + 'px';\r\n\r\n css($htmlBody, {'scroll-behavior': 'unset'});\r\n\r\n scrollTo(scrollSettings.element, scrollSettings.options, options.scrollingSpeed, function(){\r\n if(options.scrollBar){\r\n\r\n /* Hack!\r\n The timeout prevents setting the most dominant section in the viewport as \"active\" when the user\r\n scrolled to a smaller section by using the mousewheel (auto scrolling) rather than draging the scroll bar.\r\n\r\n When using scrollBar:true It seems like the scroll events still getting propagated even after the scrolling animation has finished.\r\n */\r\n setTimeout(function(){\r\n afterSectionLoads(v);\r\n },30);\r\n }else{\r\n \r\n afterSectionLoads(v);\r\n\r\n //disabling canScroll when using fastSpeed\r\n canScroll = !isFastSpeed;\r\n }\r\n });\r\n }\r\n\r\n // enabling canScroll after the minimum transition laps\r\n if(isFastSpeed){\r\n clearTimeout(g_transitionLapseId);\r\n g_transitionLapseId = setTimeout(function(){\r\n canScroll = true;\r\n }, transitionLapse);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the scrolling settings depending on the plugin autoScrolling option\r\n */\r\n function getScrollSettings(top){\r\n var scroll = {};\r\n\r\n //top property animation\r\n if(options.autoScrolling && !options.scrollBar){\r\n scroll.options = -top;\r\n scroll.element = $(WRAPPER_SEL)[0];\r\n }\r\n\r\n //window real scrolling\r\n else{\r\n scroll.options = top;\r\n scroll.element = window;\r\n }\r\n\r\n return scroll;\r\n }\r\n\r\n /**\r\n * Adds sections before or after the current one to create the infinite effect.\r\n */\r\n function createInfiniteSections(v){\r\n // Scrolling down\r\n if (!v.isMovementUp) {\r\n // Move all previous sections to after the active section\r\n after($(SECTION_ACTIVE_SEL)[0], prevAll(v.activeSection, SECTION_SEL).reverse());\r\n }\r\n else { // Scrolling up\r\n // Move all next sections to before the active section\r\n before($(SECTION_ACTIVE_SEL)[0], nextAll(v.activeSection, SECTION_SEL));\r\n }\r\n\r\n // Maintain the displayed position (now that we changed the element order)\r\n silentScroll($(SECTION_ACTIVE_SEL)[0].offsetTop);\r\n\r\n // Maintain the active slides visible in the viewport\r\n keepSlidesPosition();\r\n\r\n // save for later the elements that still need to be reordered\r\n v.wrapAroundElements = v.activeSection;\r\n\r\n // Recalculate animation variables\r\n v.dtop = v.element.offsetTop;\r\n v.yMovement = getYmovement(v.element);\r\n\r\n return v;\r\n }\r\n\r\n /**\r\n * Fix section order after continuousVertical changes have been animated\r\n */\r\n function continuousVerticalFixSectionOrder (v) {\r\n // If continuousVertical is in effect (and autoScrolling would also be in effect then),\r\n // finish moving the elements around so the direct navigation will function more simply\r\n if (v.wrapAroundElements == null) {\r\n return;\r\n }\r\n\r\n if (v.isMovementUp) {\r\n before($(SECTION_SEL)[0], v.wrapAroundElements);\r\n }\r\n else {\r\n after($(SECTION_SEL)[$(SECTION_SEL).length-1], v.wrapAroundElements);\r\n }\r\n\r\n silentScroll($(SECTION_ACTIVE_SEL)[0].offsetTop);\r\n\r\n // Maintain the active slides visible in the viewport\r\n keepSlidesPosition();\r\n }\r\n\r\n /**\r\n * Actions to do once the section is loaded.\r\n */\r\n function afterSectionLoads (v){\r\n continuousVerticalFixSectionOrder(v);\r\n\r\n //callback (afterLoad) if the site is not just resizing and readjusting the slides\r\n if(isFunction(options.afterLoad) && !v.localIsResizing){\r\n fireCallback('afterLoad', v);\r\n }\r\n\r\n if(options.scrollOverflow){\r\n options.scrollOverflowHandler.afterLoad();\r\n }\r\n\r\n if(!v.localIsResizing){\r\n playMedia(v.element);\r\n }\r\n\r\n addClass(v.element, COMPLETELY);\r\n removeClass(siblings(v.element), COMPLETELY);\r\n lazyLoadOthers();\r\n\r\n canScroll = true;\r\n\r\n if(isFunction(v.callback)){\r\n v.callback();\r\n }\r\n }\r\n\r\n /**\r\n * Sets the value for the given attribute from the `data-` attribute with the same suffix\r\n * ie: data-srcset ==> srcset | data-src ==> src\r\n */\r\n function setSrc(element, attribute){\r\n element.setAttribute(attribute, element.getAttribute('data-' + attribute));\r\n element.removeAttribute('data-' + attribute);\r\n }\r\n\r\n /**\r\n * Makes sure lazyload is done for other sections in the viewport that are not the\r\n * active one. \r\n */\r\n function lazyLoadOthers(){\r\n var hasAutoHeightSections = $(AUTO_HEIGHT_SEL)[0] || isResponsiveMode() && $(AUTO_HEIGHT_RESPONSIVE_SEL)[0];\r\n\r\n //quitting when it doesn't apply\r\n if (!options.lazyLoading || !hasAutoHeightSections){\r\n return;\r\n }\r\n\r\n //making sure to lazy load auto-height sections that are in the viewport\r\n $(SECTION_SEL + ':not(' + ACTIVE_SEL + ')').forEach(function(section){\r\n if(isSectionInViewport(section)){\r\n lazyLoad(section);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Lazy loads image, video and audio elements.\r\n */\r\n function lazyLoad(destiny){\r\n if (!options.lazyLoading){\r\n return;\r\n }\r\n\r\n var panel = getSlideOrSection(destiny);\r\n\r\n $('img[data-src], img[data-srcset], source[data-src], source[data-srcset], video[data-src], audio[data-src], iframe[data-src]', panel).forEach(function(element){\r\n ['src', 'srcset'].forEach(function(type){\r\n var attribute = element.getAttribute('data-' + type);\r\n if(attribute != null && attribute){\r\n setSrc(element, type);\r\n element.addEventListener('load', function(){\r\n onMediaLoad(destiny);\r\n });\r\n }\r\n });\r\n\r\n if(matches(element, 'source')){\r\n var elementToPlay = closest(element, 'video, audio');\r\n if(elementToPlay){\r\n elementToPlay.load();\r\n elementToPlay.onloadeddata = function(){\r\n onMediaLoad(destiny);\r\n };\r\n }\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Callback firing when a lazy load media element has loaded.\r\n * Making sure it only fires one per section in normal conditions (if load time is not huge)\r\n */\r\n function onMediaLoad(section){\r\n if(options.scrollOverflow){\r\n clearTimeout(g_mediaLoadedId);\r\n g_mediaLoadedId = setTimeout(function(){\r\n if(!hasClass($body, RESPONSIVE)){\r\n scrollBarHandler.createScrollBar(section);\r\n }\r\n }, 200);\r\n }\r\n }\r\n\r\n /**\r\n * Plays video and audio elements.\r\n */\r\n function playMedia(destiny){\r\n var panel = getSlideOrSection(destiny);\r\n\r\n //playing HTML5 media elements\r\n $('video, audio', panel).forEach(function(element){\r\n if( element.hasAttribute('data-autoplay') && typeof element.play === 'function' ) {\r\n element.play();\r\n }\r\n });\r\n\r\n //youtube videos\r\n $('iframe[src*=\"youtube.com/embed/\"]', panel).forEach(function(element){\r\n if ( element.hasAttribute('data-autoplay') ){\r\n playYoutube(element);\r\n }\r\n\r\n //in case the URL was not loaded yet. On page load we need time for the new URL (with the API string) to load.\r\n element.onload = function() {\r\n if ( element.hasAttribute('data-autoplay') ){\r\n playYoutube(element);\r\n }\r\n };\r\n });\r\n }\r\n\r\n /**\r\n * Plays a youtube video\r\n */\r\n function playYoutube(element){\r\n element.contentWindow.postMessage('{\"event\":\"command\",\"func\":\"playVideo\",\"args\":\"\"}', '*');\r\n }\r\n\r\n /**\r\n * Stops video and audio elements.\r\n */\r\n function stopMedia(destiny){\r\n var panel = getSlideOrSection(destiny);\r\n\r\n //stopping HTML5 media elements\r\n $('video, audio', panel).forEach(function(element){\r\n if( !element.hasAttribute('data-keepplaying') && typeof element.pause === 'function' ) {\r\n element.pause();\r\n }\r\n });\r\n\r\n //youtube videos\r\n $('iframe[src*=\"youtube.com/embed/\"]', panel).forEach(function(element){\r\n if( /youtube\\.com\\/embed\\//.test(element.getAttribute('src')) && !element.hasAttribute('data-keepplaying')){\r\n element.contentWindow.postMessage('{\"event\":\"command\",\"func\":\"pauseVideo\",\"args\":\"\"}','*');\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Gets the active slide (or section) for the given section\r\n */\r\n function getSlideOrSection(destiny){\r\n var slide = $(SLIDE_ACTIVE_SEL, destiny);\r\n if( slide.length ) {\r\n destiny = slide[0];\r\n }\r\n\r\n return destiny;\r\n }\r\n\r\n /**\r\n * Scrolls to the anchor in the URL when loading the site\r\n */\r\n function scrollToAnchor(){\r\n var anchors = getAnchorsURL();\r\n var sectionAnchor = anchors.section;\r\n var slideAnchor = anchors.slide;\r\n\r\n if(sectionAnchor){ //if theres any #\r\n if(options.animateAnchor){\r\n scrollPageAndSlide(sectionAnchor, slideAnchor);\r\n }else{\r\n silentMoveTo(sectionAnchor, slideAnchor);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Detecting any change on the URL to scroll to the given anchor link\r\n * (a way to detect back history button as we play with the hashes on the URL)\r\n */\r\n function hashChangeHandler(){\r\n if(!isScrolling && !options.lockAnchors){\r\n var anchors = getAnchorsURL();\r\n var sectionAnchor = anchors.section;\r\n var slideAnchor = anchors.slide;\r\n\r\n //when moving to a slide in the first section for the first time (first time to add an anchor to the URL)\r\n var isFirstSlideMove = (typeof lastScrolledDestiny === 'undefined');\r\n var isFirstScrollMove = (typeof lastScrolledDestiny === 'undefined' && typeof slideAnchor === 'undefined' && !slideMoving);\r\n\r\n if(sectionAnchor && sectionAnchor.length){\r\n /*in order to call scrollpage() only once for each destination at a time\r\n It is called twice for each scroll otherwise, as in case of using anchorlinks `hashChange`\r\n event is fired on every scroll too.*/\r\n if ((sectionAnchor && sectionAnchor !== lastScrolledDestiny) && !isFirstSlideMove\r\n || isFirstScrollMove\r\n || (!slideMoving && lastScrolledSlide != slideAnchor )){\r\n\r\n scrollPageAndSlide(sectionAnchor, slideAnchor);\r\n }\r\n }\r\n }\r\n }\r\n\r\n //gets the URL anchors (section and slide)\r\n function getAnchorsURL(){\r\n var section;\r\n var slide;\r\n var hash = window.location.hash;\r\n\r\n if(hash.length){\r\n //getting the anchor link in the URL and deleting the `#`\r\n var anchorsParts = hash.replace('#', '').split('/');\r\n\r\n //using / for visual reasons and not as a section/slide separator #2803\r\n var isFunkyAnchor = hash.indexOf('#/') > -1;\r\n\r\n section = isFunkyAnchor ? '/' + anchorsParts[1] : decodeURIComponent(anchorsParts[0]);\r\n\r\n var slideAnchor = isFunkyAnchor ? anchorsParts[2] : anchorsParts[1];\r\n if(slideAnchor && slideAnchor.length){\r\n slide = decodeURIComponent(slideAnchor);\r\n }\r\n }\r\n\r\n return {\r\n section: section,\r\n slide: slide\r\n };\r\n }\r\n\r\n //Sliding with arrow keys, both, vertical and horizontal\r\n function keydownHandler(e) {\r\n clearTimeout(keydownId);\r\n\r\n var activeElement = document.activeElement;\r\n var keyCode = e.keyCode;\r\n\r\n //tab?\r\n if(keyCode === 9){\r\n onTab(e);\r\n }\r\n\r\n else if(!matches(activeElement, 'textarea') && !matches(activeElement, 'input') && !matches(activeElement, 'select') &&\r\n activeElement.getAttribute('contentEditable') !== \"true\" && activeElement.getAttribute('contentEditable') !== '' &&\r\n options.keyboardScrolling && options.autoScrolling){\r\n\r\n //preventing the scroll with arrow keys & spacebar & Page Up & Down keys\r\n var keyControls = [40, 38, 32, 33, 34];\r\n if(keyControls.indexOf(keyCode) > -1){\r\n preventDefault(e);\r\n }\r\n\r\n controlPressed = e.ctrlKey;\r\n\r\n keydownId = setTimeout(function(){\r\n onkeydown(e);\r\n },150);\r\n }\r\n }\r\n\r\n function tooltipTextHandler(){\r\n /*jshint validthis:true */\r\n trigger(prev(this), 'click');\r\n }\r\n\r\n //to prevent scrolling while zooming\r\n function keyUpHandler(e){\r\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\r\n controlPressed = e.ctrlKey;\r\n }\r\n }\r\n\r\n //binding the mousemove when the mouse's middle button is released\r\n function mouseDownHandler(e){\r\n //middle button\r\n if (e.which == 2){\r\n oldPageY = e.pageY;\r\n container.addEventListener('mousemove', mouseMoveHandler);\r\n }\r\n }\r\n\r\n //unbinding the mousemove when the mouse's middle button is released\r\n function mouseUpHandler(e){\r\n //middle button\r\n if (e.which == 2){\r\n container.removeEventListener('mousemove', mouseMoveHandler);\r\n }\r\n }\r\n\r\n /**\r\n * Makes sure the tab key will only focus elements within the current section/slide\r\n * preventing this way from breaking the page.\r\n * Based on \"Modals and keyboard traps\"\r\n * from https://developers.google.com/web/fundamentals/accessibility/focus/using-tabindex\r\n */\r\n function onTab(e){\r\n var isShiftPressed = e.shiftKey;\r\n var activeElement = document.activeElement;\r\n var focusableElements = getFocusables(getSlideOrSection($(SECTION_ACTIVE_SEL)[0]));\r\n\r\n function preventAndFocusFirst(e){\r\n preventDefault(e);\r\n return focusableElements[0] ? focusableElements[0].focus() : null;\r\n }\r\n\r\n //outside any section or slide? Let's not hijack the tab!\r\n if(isFocusOutside(e)){\r\n return;\r\n }\r\n\r\n //is there an element with focus?\r\n if(activeElement){\r\n if(closest(activeElement, SECTION_ACTIVE_SEL + ',' + SECTION_ACTIVE_SEL + ' ' + SLIDE_ACTIVE_SEL) == null){\r\n activeElement = preventAndFocusFirst(e);\r\n }\r\n }\r\n\r\n //no element if focused? Let's focus the first one of the section/slide\r\n else{\r\n preventAndFocusFirst(e);\r\n }\r\n\r\n //when reached the first or last focusable element of the section/slide\r\n //we prevent the tab action to keep it in the last focusable element\r\n if(!isShiftPressed && activeElement == focusableElements[focusableElements.length - 1] ||\r\n isShiftPressed && activeElement == focusableElements[0]\r\n ){\r\n preventDefault(e);\r\n }\r\n }\r\n\r\n /**\r\n * Gets all the focusable elements inside the passed element.\r\n */\r\n function getFocusables(el){\r\n return [].slice.call($(focusableElementsString, el)).filter(function(item) {\r\n return item.getAttribute('tabindex') !== '-1'\r\n //are also not hidden elements (or with hidden parents)\r\n && item.offsetParent !== null;\r\n });\r\n }\r\n\r\n /**\r\n * Determines whether the focus is outside fullpage.js sections/slides or not.\r\n */\r\n function isFocusOutside(e){\r\n var allFocusables = getFocusables(document);\r\n var currentFocusIndex = allFocusables.indexOf(document.activeElement);\r\n var focusDestinationIndex = e.shiftKey ? currentFocusIndex - 1 : currentFocusIndex + 1;\r\n var focusDestination = allFocusables[focusDestinationIndex];\r\n var destinationItemSlide = nullOrSlide(closest(focusDestination, SLIDE_SEL));\r\n var destinationItemSection = nullOrSection(closest(focusDestination, SECTION_SEL));\r\n\r\n return !destinationItemSlide && !destinationItemSection;\r\n }\r\n\r\n //Scrolling horizontally when clicking on the slider controls.\r\n function slideArrowHandler(){\r\n /*jshint validthis:true */\r\n var section = closest(this, SECTION_SEL);\r\n\r\n /*jshint validthis:true */\r\n if (hasClass(this, SLIDES_PREV)) {\r\n if(isScrollAllowed.m.left){\r\n moveSlideLeft(section);\r\n }\r\n } else {\r\n if(isScrollAllowed.m.right){\r\n moveSlideRight(section);\r\n }\r\n }\r\n }\r\n \r\n // changing isWindowFocused to true on focus event\r\n function focusHandler(){\r\n isWindowFocused = true;\r\n }\r\n\r\n //when opening a new tab (ctrl + t), `control` won't be pressed when coming back.\r\n function blurHandler(){\r\n isWindowFocused = false;\r\n controlPressed = false;\r\n }\r\n\r\n //Scrolls to the section when clicking the navigation bullet\r\n function sectionBulletHandler(e){\r\n preventDefault(e);\r\n\r\n /*jshint validthis:true */\r\n var indexBullet = index(closest(this, SECTION_NAV_SEL + ' li'));\r\n scrollPage($(SECTION_SEL)[indexBullet]);\r\n }\r\n\r\n //Scrolls the slider to the given slide destination for the given section\r\n function slideBulletHandler(e){\r\n preventDefault(e);\r\n\r\n /*jshint validthis:true */\r\n var slides = $(SLIDES_WRAPPER_SEL, closest(this, SECTION_SEL))[0];\r\n var destiny = $(SLIDE_SEL, slides)[index(closest(this, 'li'))];\r\n\r\n landscapeScroll(slides, destiny);\r\n }\r\n\r\n //Menu item handler when not using anchors or using lockAnchors:true\r\n function menuItemsHandler(e){\r\n if($(options.menu)[0] && (options.lockAnchors || !options.anchors.length)){\r\n preventDefault(e);\r\n /*jshint validthis:true */\r\n moveTo(this.getAttribute('data-menuanchor'));\r\n }\r\n }\r\n\r\n /**\r\n * Keydown event\r\n */\r\n function onkeydown(e){\r\n var shiftPressed = e.shiftKey;\r\n var activeElement = document.activeElement;\r\n var isMediaFocused = matches(activeElement, 'video') || matches(activeElement, 'audio');\r\n\r\n //do nothing if we can not scroll or we are not using horizotnal key arrows.\r\n if(!canScroll && [37,39].indexOf(e.keyCode) < 0){\r\n return;\r\n }\r\n\r\n switch (e.keyCode) {\r\n //up\r\n case 38:\r\n case 33:\r\n if(isScrollAllowed.k.up){\r\n moveSectionUp();\r\n }\r\n break;\r\n\r\n //down\r\n case 32: //spacebar\r\n\r\n if(shiftPressed && isScrollAllowed.k.up && !isMediaFocused){\r\n moveSectionUp();\r\n break;\r\n }\r\n /* falls through */\r\n case 40:\r\n case 34:\r\n if(isScrollAllowed.k.down){\r\n // space bar?\r\n if(e.keyCode !== 32 || !isMediaFocused){\r\n moveSectionDown();\r\n }\r\n }\r\n break;\r\n\r\n //Home\r\n case 36:\r\n if(isScrollAllowed.k.up){\r\n moveTo(1);\r\n }\r\n break;\r\n\r\n //End\r\n case 35:\r\n if(isScrollAllowed.k.down){\r\n moveTo( $(SECTION_SEL).length );\r\n }\r\n break;\r\n\r\n //left\r\n case 37:\r\n if(isScrollAllowed.k.left){\r\n moveSlideLeft();\r\n }\r\n break;\r\n\r\n //right\r\n case 39:\r\n if(isScrollAllowed.k.right){\r\n moveSlideRight();\r\n }\r\n break;\r\n\r\n default:\r\n return; // exit this handler for other keys\r\n }\r\n }\r\n\r\n /**\r\n * Detecting the direction of the mouse movement.\r\n * Used only for the middle button of the mouse.\r\n */\r\n var oldPageY = 0;\r\n function mouseMoveHandler(e){\r\n if(!options.autoScrolling){\r\n return;\r\n }\r\n if(canScroll){\r\n // moving up\r\n if (e.pageY < oldPageY && isScrollAllowed.m.up){\r\n moveSectionUp();\r\n }\r\n\r\n // moving down\r\n else if(e.pageY > oldPageY && isScrollAllowed.m.down){\r\n moveSectionDown();\r\n }\r\n }\r\n oldPageY = e.pageY;\r\n }\r\n\r\n /**\r\n * Scrolls horizontal sliders.\r\n */\r\n function landscapeScroll(slides, destiny, direction){\r\n var section = closest(slides, SECTION_SEL);\r\n var v = {\r\n slides: slides,\r\n destiny: destiny,\r\n direction: direction,\r\n destinyPos: {left: destiny.offsetLeft},\r\n slideIndex: index(destiny),\r\n section: section,\r\n sectionIndex: index(section, SECTION_SEL),\r\n anchorLink: section.getAttribute('data-anchor'),\r\n slidesNav: $(SLIDES_NAV_SEL, section)[0],\r\n slideAnchor: getAnchor(destiny),\r\n prevSlide: $(SLIDE_ACTIVE_SEL, section)[0],\r\n prevSlideIndex: index($(SLIDE_ACTIVE_SEL, section)[0]),\r\n\r\n //caching the value of isResizing at the momment the function is called\r\n //because it will be checked later inside a setTimeout and the value might change\r\n localIsResizing: isResizing\r\n };\r\n v.xMovement = getXmovement(v.prevSlideIndex, v.slideIndex);\r\n v.direction = v.direction ? v.direction : v.xMovement;\r\n\r\n //important!! Only do it when not resizing\r\n if(!v.localIsResizing){\r\n //preventing from scrolling to the next/prev section when using scrollHorizontally\r\n canScroll = false;\r\n }\r\n\r\n if(options.onSlideLeave){\r\n\r\n //if the site is not just resizing and readjusting the slides\r\n if(!v.localIsResizing && v.xMovement!=='none'){\r\n if(isFunction( options.onSlideLeave )){\r\n if( fireCallback('onSlideLeave', v) === false){\r\n slideMoving = false;\r\n return;\r\n }\r\n }\r\n }\r\n }\r\n\r\n addClass(destiny, ACTIVE);\r\n removeClass(siblings(destiny), ACTIVE);\r\n\r\n if(!v.localIsResizing){\r\n stopMedia(v.prevSlide);\r\n lazyLoad(destiny);\r\n }\r\n\r\n if(!options.loopHorizontal && options.controlArrows){\r\n //hidding it for the fist slide, showing for the rest\r\n toggle($(SLIDES_ARROW_PREV_SEL, section), v.slideIndex!==0);\r\n\r\n //hidding it for the last slide, showing for the rest\r\n toggle($(SLIDES_ARROW_NEXT_SEL, section), next(destiny) != null);\r\n }\r\n\r\n //only changing the URL if the slides are in the current section (not for resize re-adjusting)\r\n if(hasClass(section, ACTIVE) && !v.localIsResizing){\r\n setState(v.slideIndex, v.slideAnchor, v.anchorLink, v.sectionIndex);\r\n }\r\n\r\n performHorizontalMove(slides, v, true);\r\n }\r\n\r\n\r\n function afterSlideLoads(v){\r\n activeSlidesNavigation(v.slidesNav, v.slideIndex);\r\n\r\n //if the site is not just resizing and readjusting the slides\r\n if(!v.localIsResizing){\r\n if(isFunction( options.afterSlideLoad )){\r\n fireCallback('afterSlideLoad', v);\r\n }\r\n\r\n //needs to be inside the condition to prevent problems with continuousVertical and scrollHorizontally\r\n //and to prevent double scroll right after a windows resize\r\n canScroll = true;\r\n\r\n playMedia(v.destiny);\r\n }\r\n\r\n //letting them slide again\r\n slideMoving = false;\r\n }\r\n\r\n /**\r\n * Performs the horizontal movement. (CSS3 or jQuery)\r\n *\r\n * @param fireCallback {Bool} - determines whether or not to fire the callback\r\n */\r\n function performHorizontalMove(slides, v, fireCallback){\r\n var destinyPos = v.destinyPos;\r\n\r\n if(options.css3){\r\n var translate3d = 'translate3d(-' + Math.round(destinyPos.left) + 'px, 0px, 0px)';\r\n\r\n FP.test.translate3dH[v.sectionIndex] = translate3d;\r\n css(addAnimation($(SLIDES_CONTAINER_SEL, slides)), getTransforms(translate3d));\r\n\r\n afterSlideLoadsId = setTimeout(function(){\r\n if(fireCallback){\r\n afterSlideLoads(v);\r\n }\r\n }, options.scrollingSpeed);\r\n }else{\r\n FP.test.left[v.sectionIndex] = Math.round(destinyPos.left);\r\n\r\n scrollTo(slides, Math.round(destinyPos.left), options.scrollingSpeed, function(){\r\n if(fireCallback){\r\n afterSlideLoads(v);\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Sets the state for the horizontal bullet navigations.\r\n */\r\n function activeSlidesNavigation(slidesNav, slideIndex){\r\n if(options.slidesNavigation && slidesNav != null){\r\n removeClass($(ACTIVE_SEL, slidesNav), ACTIVE);\r\n addClass( $('a', $('li', slidesNav)[slideIndex] ), ACTIVE);\r\n }\r\n }\r\n\r\n var previousHeight = windowsHeight;\r\n\r\n /*\r\n * Resize event handler.\r\n */ \r\n function resizeHandler(){\r\n clearTimeout(resizeId);\r\n\r\n //in order to call the functions only when the resize is finished\r\n //http://stackoverflow.com/questions/4298612/jquery-how-to-call-resize-event-only-once-its-finished-resizing \r\n resizeId = setTimeout(function(){\r\n\r\n //issue #3336 \r\n //(some apps or browsers, like Chrome/Firefox for Mobile take time to report the real height)\r\n //so we check it 3 times with intervals in that case\r\n for(var i = 0; i< 4; i++){\r\n resizeHandlerId = setTimeout(resizeActions, 200 * i);\r\n }\r\n }, 200);\r\n }\r\n\r\n /**\r\n * When resizing the site, we adjust the heights of the sections, slimScroll...\r\n */\r\n function resizeActions(){\r\n isResizing = true;\r\n\r\n //checking if it needs to get responsive\r\n responsive();\r\n\r\n // rebuild immediately on touch devices\r\n if (isTouchDevice) {\r\n var activeElement = document.activeElement;\r\n\r\n //if the keyboard is NOT visible\r\n if (!matches(activeElement, 'textarea') && !matches(activeElement, 'input') && !matches(activeElement, 'select')) {\r\n var currentHeight = getWindowHeight();\r\n\r\n //making sure the change in the viewport size is enough to force a rebuild. (20 % of the window to avoid problems when hidding scroll bars)\r\n if( Math.abs(currentHeight - previousHeight) > (20 * Math.max(previousHeight, currentHeight) / 100) ){\r\n reBuild(true);\r\n previousHeight = currentHeight;\r\n }\r\n }\r\n }\r\n else{\r\n adjustToNewViewport();\r\n }\r\n\r\n isResizing = false;\r\n }\r\n\r\n /**\r\n * Checks if the site needs to get responsive and disables autoScrolling if so.\r\n * A class `fp-responsive` is added to the plugin's container in case the user wants to use it for his own responsive CSS.\r\n */\r\n function responsive(){\r\n var widthLimit = options.responsive || options.responsiveWidth; //backwards compatiblity\r\n var heightLimit = options.responsiveHeight;\r\n\r\n //only calculating what we need. Remember its called on the resize event.\r\n var isBreakingPointWidth = widthLimit && window.innerWidth < widthLimit;\r\n var isBreakingPointHeight = heightLimit && window.innerHeight < heightLimit;\r\n\r\n if(widthLimit && heightLimit){\r\n setResponsive(isBreakingPointWidth || isBreakingPointHeight);\r\n }\r\n else if(widthLimit){\r\n setResponsive(isBreakingPointWidth);\r\n }\r\n else if(heightLimit){\r\n setResponsive(isBreakingPointHeight);\r\n }\r\n }\r\n\r\n /**\r\n * Adds transition animations for the given element\r\n */\r\n function addAnimation(element){\r\n var transition = 'all ' + options.scrollingSpeed + 'ms ' + options.easingcss3;\r\n\r\n removeClass(element, NO_TRANSITION);\r\n return css(element, {\r\n '-webkit-transition': transition,\r\n 'transition': transition\r\n });\r\n }\r\n\r\n /**\r\n * Remove transition animations for the given element\r\n */\r\n function removeAnimation(element){\r\n return addClass(element, NO_TRANSITION);\r\n }\r\n\r\n /**\r\n * Activating the vertical navigation bullets according to the given slide name.\r\n */\r\n function activateNavDots(name, sectionIndex){\r\n if(options.navigation && $(SECTION_NAV_SEL)[0] != null){\r\n removeClass($(ACTIVE_SEL, $(SECTION_NAV_SEL)[0]), ACTIVE);\r\n if(name){\r\n addClass( $('a[href=\"#' + name + '\"]', $(SECTION_NAV_SEL)[0]), ACTIVE);\r\n }else{\r\n addClass($('a', $('li', $(SECTION_NAV_SEL)[0])[sectionIndex]), ACTIVE);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Activating the website main menu elements according to the given slide name.\r\n */\r\n function activateMenuElement(name){\r\n $(options.menu).forEach(function(menu) {\r\n if(options.menu && menu != null){\r\n removeClass($(ACTIVE_SEL, menu), ACTIVE);\r\n addClass($('[data-menuanchor=\"'+name+'\"]', menu), ACTIVE);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Sets to active the current menu and vertical nav items.\r\n */\r\n function activateMenuAndNav(anchor, index){\r\n activateMenuElement(anchor);\r\n activateNavDots(anchor, index);\r\n }\r\n\r\n /**\r\n * Retuns `up` or `down` depending on the scrolling movement to reach its destination\r\n * from the current section.\r\n */\r\n function getYmovement(destiny){\r\n var fromIndex = index($(SECTION_ACTIVE_SEL)[0], SECTION_SEL);\r\n var toIndex = index(destiny, SECTION_SEL);\r\n if( fromIndex == toIndex){\r\n return 'none';\r\n }\r\n if(fromIndex > toIndex){\r\n return 'up';\r\n }\r\n return 'down';\r\n }\r\n\r\n /**\r\n * Retuns `right` or `left` depending on the scrolling movement to reach its destination\r\n * from the current slide.\r\n */\r\n function getXmovement(fromIndex, toIndex){\r\n if( fromIndex == toIndex){\r\n return 'none';\r\n }\r\n if(fromIndex > toIndex){\r\n return 'left';\r\n }\r\n return 'right';\r\n }\r\n\r\n function addTableClass(element){\r\n //In case we are styling for the 2nd time as in with reponsiveSlides\r\n if(!hasClass(element, TABLE)){\r\n var wrapper = document.createElement('div');\r\n wrapper.className = TABLE_CELL;\r\n wrapper.style.height = getTableHeight(element) + 'px';\r\n\r\n addClass(element, TABLE);\r\n wrapInner(element, wrapper);\r\n }\r\n }\r\n\r\n function getTableHeight(element){\r\n var sectionHeight = windowsHeight;\r\n\r\n if(options.paddingTop || options.paddingBottom){\r\n var section = element;\r\n if(!hasClass(section, SECTION)){\r\n section = closest(element, SECTION_SEL);\r\n }\r\n\r\n var paddings = parseInt(getComputedStyle(section)['padding-top']) + parseInt(getComputedStyle(section)['padding-bottom']);\r\n sectionHeight = (windowsHeight - paddings);\r\n }\r\n\r\n return sectionHeight;\r\n }\r\n\r\n /**\r\n * Adds a css3 transform property to the container class with or without animation depending on the animated param.\r\n */\r\n function transformContainer(translate3d, animated){\r\n if(animated){\r\n addAnimation(container);\r\n }else{\r\n removeAnimation(container);\r\n }\r\n\r\n css(container, getTransforms(translate3d));\r\n FP.test.translate3d = translate3d;\r\n\r\n //syncronously removing the class after the animation has been applied.\r\n setTimeout(function(){\r\n removeClass(container, NO_TRANSITION);\r\n },10);\r\n }\r\n\r\n /**\r\n * Gets a section by its anchor / index\r\n */\r\n function getSectionByAnchor(sectionAnchor){\r\n var section = $(SECTION_SEL + '[data-anchor=\"'+sectionAnchor+'\"]', container)[0];\r\n if(!section){\r\n var sectionIndex = typeof sectionAnchor !== 'undefined' ? sectionAnchor -1 : 0;\r\n section = $(SECTION_SEL)[sectionIndex];\r\n }\r\n\r\n return section;\r\n }\r\n\r\n /**\r\n * Gets a slide inside a given section by its anchor / index\r\n */\r\n function getSlideByAnchor(slideAnchor, section){\r\n var slide = $(SLIDE_SEL + '[data-anchor=\"'+slideAnchor+'\"]', section)[0];\r\n if(slide == null){\r\n slideAnchor = typeof slideAnchor !== 'undefined' ? slideAnchor : 0;\r\n slide = $(SLIDE_SEL, section)[slideAnchor];\r\n }\r\n\r\n return slide;\r\n }\r\n\r\n /**\r\n * Scrolls to the given section and slide anchors\r\n */\r\n function scrollPageAndSlide(sectionAnchor, slideAnchor){\r\n var section = getSectionByAnchor(sectionAnchor);\r\n\r\n //do nothing if there's no section with the given anchor name\r\n if(section == null) return;\r\n\r\n var slide = getSlideByAnchor(slideAnchor, section);\r\n\r\n //we need to scroll to the section and then to the slide\r\n if (getAnchor(section) !== lastScrolledDestiny && !hasClass(section, ACTIVE)){\r\n scrollPage(section, function(){\r\n scrollSlider(slide);\r\n });\r\n }\r\n //if we were already in the section\r\n else{\r\n scrollSlider(slide);\r\n }\r\n }\r\n\r\n /**\r\n * Scrolls the slider to the given slide destination for the given section\r\n */\r\n function scrollSlider(slide){\r\n if(slide != null){\r\n landscapeScroll(closest(slide, SLIDES_WRAPPER_SEL), slide);\r\n }\r\n }\r\n\r\n /**\r\n * Creates a landscape navigation bar with dots for horizontal sliders.\r\n */\r\n function addSlidesNavigation(section, numSlides){\r\n appendTo(createElementFromHTML('
      '), section);\r\n var nav = $(SLIDES_NAV_SEL, section)[0];\r\n\r\n //top or bottom\r\n addClass(nav, 'fp-' + options.slidesNavPosition);\r\n\r\n for(var i=0; i< numSlides; i++){\r\n var slide = $(SLIDE_SEL, section)[i];\r\n appendTo(createElementFromHTML('
    • '+ getBulletLinkName(i, 'Slide', slide) +'
    • '), $('ul', nav)[0] );\r\n }\r\n\r\n //centering it\r\n css(nav, {'margin-left': '-' + (nav.innerWidth/2) + 'px'});\r\n\r\n addClass($('a', $('li', nav)[0] ), ACTIVE);\r\n }\r\n\r\n\r\n /**\r\n * Sets the state of the website depending on the active section/slide.\r\n * It changes the URL hash when needed and updates the body class.\r\n */\r\n function setState(slideIndex, slideAnchor, anchorLink, sectionIndex){\r\n var sectionHash = '';\r\n\r\n if(options.anchors.length && !options.lockAnchors){\r\n\r\n //isn't it the first slide?\r\n if(slideIndex){\r\n if(anchorLink != null){\r\n sectionHash = anchorLink;\r\n }\r\n\r\n //slide without anchor link? We take the index instead.\r\n if(slideAnchor == null){\r\n slideAnchor = slideIndex;\r\n }\r\n\r\n lastScrolledSlide = slideAnchor;\r\n setUrlHash(sectionHash + '/' + slideAnchor);\r\n\r\n //first slide won't have slide anchor, just the section one\r\n }else if(slideIndex != null){\r\n lastScrolledSlide = slideAnchor;\r\n setUrlHash(anchorLink);\r\n }\r\n\r\n //section without slides\r\n else{\r\n setUrlHash(anchorLink);\r\n }\r\n }\r\n\r\n setBodyClass();\r\n }\r\n\r\n /**\r\n * Sets the URL hash.\r\n */\r\n function setUrlHash(url){\r\n if(options.recordHistory){\r\n location.hash = url;\r\n }else{\r\n //Mobile Chrome doesn't work the normal way, so... lets use HTML5 for phones :)\r\n if(isTouchDevice || isTouch){\r\n window.history.replaceState(undefined, undefined, '#' + url);\r\n }else{\r\n var baseUrl = window.location.href.split('#')[0];\r\n window.location.replace( baseUrl + '#' + url );\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Gets the anchor for the given slide / section. Its index will be used if there's none.\r\n */\r\n function getAnchor(element){\r\n if(!element){\r\n return null;\r\n }\r\n var anchor = element.getAttribute('data-anchor');\r\n var elementIndex = index(element);\r\n\r\n //Slide without anchor link? We take the index instead.\r\n if(anchor == null){\r\n anchor = elementIndex;\r\n }\r\n\r\n return anchor;\r\n }\r\n\r\n /**\r\n * Sets a class for the body of the page depending on the active section / slide\r\n */\r\n function setBodyClass(){\r\n var section = $(SECTION_ACTIVE_SEL)[0];\r\n var slide = $(SLIDE_ACTIVE_SEL, section)[0];\r\n\r\n var sectionAnchor = getAnchor(section);\r\n var slideAnchor = getAnchor(slide);\r\n\r\n var text = String(sectionAnchor);\r\n\r\n if(slide){\r\n text = text + '-' + slideAnchor;\r\n }\r\n\r\n //changing slash for dash to make it a valid CSS style\r\n text = text.replace('/', '-').replace('#','');\r\n\r\n //removing previous anchor classes\r\n var classRe = new RegExp('\\\\b\\\\s?' + VIEWING_PREFIX + '-[^\\\\s]+\\\\b', \"g\");\r\n $body.className = $body.className.replace(classRe, '');\r\n\r\n //adding the current anchor\r\n addClass($body, VIEWING_PREFIX + '-' + text);\r\n }\r\n\r\n /**\r\n * Checks for translate3d support\r\n * @return boolean\r\n * http://stackoverflow.com/questions/5661671/detecting-transform-translate3d-support\r\n */\r\n function support3d() {\r\n var el = document.createElement('p'),\r\n has3d,\r\n transforms = {\r\n 'webkitTransform':'-webkit-transform',\r\n 'OTransform':'-o-transform',\r\n 'msTransform':'-ms-transform',\r\n 'MozTransform':'-moz-transform',\r\n 'transform':'transform'\r\n };\r\n\r\n //preventing the style p:empty{display: none;} from returning the wrong result\r\n el.style.display = 'block';\r\n\r\n // Add it to the body to get the computed style.\r\n document.body.insertBefore(el, null);\r\n\r\n for (var t in transforms) {\r\n if (el.style[t] !== undefined) {\r\n el.style[t] = 'translate3d(1px,1px,1px)';\r\n has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);\r\n }\r\n }\r\n\r\n document.body.removeChild(el);\r\n\r\n return (has3d !== undefined && has3d.length > 0 && has3d !== 'none');\r\n }\r\n\r\n /**\r\n * Removes the auto scrolling action fired by the mouse wheel and trackpad.\r\n * After this function is called, the mousewheel and trackpad movements won't scroll through sections.\r\n */\r\n function removeMouseWheelHandler(){\r\n if (document.addEventListener) {\r\n document.removeEventListener('mousewheel', MouseWheelHandler, false); //IE9, Chrome, Safari, Oper\r\n document.removeEventListener('wheel', MouseWheelHandler, false); //Firefox\r\n document.removeEventListener('MozMousePixelScroll', MouseWheelHandler, false); //old Firefox\r\n } else {\r\n document.detachEvent('onmousewheel', MouseWheelHandler); //IE 6/7/8\r\n }\r\n }\r\n\r\n /**\r\n * Adds the auto scrolling action for the mouse wheel and trackpad.\r\n * After this function is called, the mousewheel and trackpad movements will scroll through sections\r\n * https://developer.mozilla.org/en-US/docs/Web/Events/wheel\r\n */\r\n function addMouseWheelHandler(){\r\n var prefix = '';\r\n var _addEventListener;\r\n\r\n if (window.addEventListener){\r\n _addEventListener = \"addEventListener\";\r\n }else{\r\n _addEventListener = \"attachEvent\";\r\n prefix = 'on';\r\n }\r\n\r\n // detect available wheel event\r\n var support = 'onwheel' in document.createElement('div') ? 'wheel' : // Modern browsers support \"wheel\"\r\n document.onmousewheel !== undefined ? 'mousewheel' : // Webkit and IE support at least \"mousewheel\"\r\n 'DOMMouseScroll'; // let's assume that remaining browsers are older Firefox\r\n var passiveEvent = g_supportsPassive ? {passive: false }: false;\r\n\r\n if(support == 'DOMMouseScroll'){\r\n document[ _addEventListener ](prefix + 'MozMousePixelScroll', MouseWheelHandler, passiveEvent);\r\n }\r\n\r\n //handle MozMousePixelScroll in older Firefox\r\n else{\r\n document[ _addEventListener ](prefix + support, MouseWheelHandler, passiveEvent);\r\n }\r\n }\r\n\r\n /**\r\n * Binding the mousemove when the mouse's middle button is pressed\r\n */\r\n function addMiddleWheelHandler(){\r\n container.addEventListener('mousedown', mouseDownHandler);\r\n container.addEventListener('mouseup', mouseUpHandler);\r\n }\r\n\r\n /**\r\n * Unbinding the mousemove when the mouse's middle button is released\r\n */\r\n function removeMiddleWheelHandler(){\r\n container.removeEventListener('mousedown', mouseDownHandler);\r\n container.removeEventListener('mouseup', mouseUpHandler);\r\n }\r\n\r\n /**\r\n * Adds the possibility to auto scroll through sections on touch devices.\r\n */\r\n function addTouchHandler(){\r\n if(isTouchDevice || isTouch){\r\n if(options.autoScrolling){\r\n $body.removeEventListener(events.touchmove, preventBouncing, {passive: false});\r\n $body.addEventListener(events.touchmove, preventBouncing, {passive: false});\r\n }\r\n\r\n var touchWrapper = options.touchWrapper;\r\n touchWrapper.removeEventListener(events.touchstart, touchStartHandler);\r\n touchWrapper.removeEventListener(events.touchmove, touchMoveHandler, {passive: false});\r\n\r\n touchWrapper.addEventListener(events.touchstart, touchStartHandler);\r\n touchWrapper.addEventListener(events.touchmove, touchMoveHandler, {passive: false});\r\n }\r\n }\r\n\r\n /**\r\n * Removes the auto scrolling for touch devices.\r\n */\r\n function removeTouchHandler(){\r\n if(isTouchDevice || isTouch){\r\n // normalScrollElements requires it off #2691\r\n if(options.autoScrolling){\r\n $body.removeEventListener(events.touchmove, touchMoveHandler, {passive: false});\r\n $body.removeEventListener(events.touchmove, preventBouncing, {passive: false});\r\n }\r\n\r\n var touchWrapper = options.touchWrapper;\r\n touchWrapper.removeEventListener(events.touchstart, touchStartHandler);\r\n touchWrapper.removeEventListener(events.touchmove, touchMoveHandler, {passive: false});\r\n }\r\n }\r\n\r\n /*\r\n * Returns and object with Microsoft pointers (for IE<11 and for IE >= 11)\r\n * http://msdn.microsoft.com/en-us/library/ie/dn304886(v=vs.85).aspx\r\n */\r\n function getMSPointer(){\r\n var pointer;\r\n\r\n //IE >= 11 & rest of browsers\r\n if(window.PointerEvent){\r\n pointer = { down: 'pointerdown', move: 'pointermove'};\r\n }\r\n\r\n //IE < 11\r\n else{\r\n pointer = { down: 'MSPointerDown', move: 'MSPointerMove'};\r\n }\r\n\r\n return pointer;\r\n }\r\n\r\n /**\r\n * Gets the pageX and pageY properties depending on the browser.\r\n * https://github.com/alvarotrigo/fullPage.js/issues/194#issuecomment-34069854\r\n */\r\n function getEventsPage(e){\r\n var events = [];\r\n\r\n events.y = (typeof e.pageY !== 'undefined' && (e.pageY || e.pageX) ? e.pageY : e.touches[0].pageY);\r\n events.x = (typeof e.pageX !== 'undefined' && (e.pageY || e.pageX) ? e.pageX : e.touches[0].pageX);\r\n\r\n //in touch devices with scrollBar:true, e.pageY is detected, but we have to deal with touch events. #1008\r\n if(isTouch && isReallyTouch(e) && options.scrollBar && typeof e.touches !== 'undefined'){\r\n events.y = e.touches[0].pageY;\r\n events.x = e.touches[0].pageX;\r\n }\r\n\r\n return events;\r\n }\r\n\r\n /**\r\n * Slides silently (with no animation) the active slider to the given slide.\r\n * @param noCallback {bool} true or defined -> no callbacks\r\n */\r\n function silentLandscapeScroll(activeSlide, noCallbacks){\r\n setScrollingSpeed(0, 'internal');\r\n\r\n if(typeof noCallbacks !== 'undefined'){\r\n //preventing firing callbacks afterSlideLoad etc.\r\n isResizing = true;\r\n }\r\n\r\n landscapeScroll(closest(activeSlide, SLIDES_WRAPPER_SEL), activeSlide);\r\n\r\n if(typeof noCallbacks !== 'undefined'){\r\n isResizing = false;\r\n }\r\n\r\n setScrollingSpeed(originals.scrollingSpeed, 'internal');\r\n }\r\n\r\n /**\r\n * Scrolls silently (with no animation) the page to the given Y position.\r\n */\r\n function silentScroll(top){\r\n // The first section can have a negative value in iOS 10. Not quite sure why: -0.0142822265625\r\n // that's why we round it to 0.\r\n var roundedTop = Math.round(top);\r\n\r\n if (options.css3 && options.autoScrolling && !options.scrollBar){\r\n var translate3d = 'translate3d(0px, -' + roundedTop + 'px, 0px)';\r\n transformContainer(translate3d, false);\r\n }\r\n else if(options.autoScrolling && !options.scrollBar){\r\n css(container, {'top': -roundedTop + 'px'});\r\n FP.test.top = -roundedTop + 'px';\r\n }\r\n else{\r\n var scrollSettings = getScrollSettings(roundedTop);\r\n setScrolling(scrollSettings.element, scrollSettings.options);\r\n }\r\n }\r\n\r\n /**\r\n * Returns the cross-browser transform string.\r\n */\r\n function getTransforms(translate3d){\r\n return {\r\n '-webkit-transform': translate3d,\r\n '-moz-transform': translate3d,\r\n '-ms-transform':translate3d,\r\n 'transform': translate3d\r\n };\r\n }\r\n\r\n /**\r\n * Allowing or disallowing the mouse/swipe scroll in a given direction. (not for keyboard)\r\n * @type m (mouse) or k (keyboard)\r\n */\r\n function setIsScrollAllowed(value, direction, type){\r\n //up, down, left, right\r\n if(direction !== 'all'){\r\n isScrollAllowed[type][direction] = value;\r\n }\r\n\r\n //all directions?\r\n else{\r\n Object.keys(isScrollAllowed[type]).forEach(function(key){\r\n isScrollAllowed[type][key] = value;\r\n });\r\n }\r\n }\r\n\r\n /*\r\n * Destroys fullpage.js plugin events and optinally its html markup and styles\r\n */\r\n function destroy(all){\r\n setAutoScrolling(false, 'internal');\r\n setAllowScrolling(true);\r\n setMouseHijack(false);\r\n setKeyboardScrolling(false);\r\n addClass(container, DESTROYED);\r\n\r\n [\r\n afterSlideLoadsId, \r\n afterSectionLoadsId,\r\n resizeId,\r\n scrollId,\r\n scrollId2,\r\n g_doubleCheckHeightId,\r\n resizeHandlerId,\r\n g_transitionLapseId\r\n ].forEach(function(timeoutId){\r\n clearTimeout(timeoutId);\r\n });\r\n\r\n window.removeEventListener('scroll', scrollHandler);\r\n window.removeEventListener('hashchange', hashChangeHandler);\r\n window.removeEventListener('resize', resizeHandler);\r\n\r\n document.removeEventListener('keydown', keydownHandler);\r\n document.removeEventListener('keyup', keyUpHandler);\r\n\r\n ['click', 'touchstart'].forEach(function(eventName){\r\n document.removeEventListener(eventName, delegatedEvents);\r\n });\r\n\r\n ['mouseenter', 'touchstart', 'mouseleave', 'touchend'].forEach(function(eventName){\r\n document.removeEventListener(eventName, onMouseEnterOrLeave, true); //true is required!\r\n });\r\n\r\n //lets make a mess!\r\n if(all){\r\n destroyStructure();\r\n }\r\n }\r\n\r\n /*\r\n * Removes inline styles added by fullpage.js\r\n */\r\n function destroyStructure(){\r\n //reseting the `top` or `translate` properties to 0\r\n silentScroll(0);\r\n\r\n //loading all the lazy load content\r\n $('img[data-src], source[data-src], audio[data-src], iframe[data-src]', container).forEach(function(item){\r\n setSrc(item, 'src');\r\n });\r\n\r\n $('img[data-srcset]').forEach(function(item){\r\n setSrc(item, 'srcset');\r\n });\r\n\r\n remove($(SECTION_NAV_SEL + ', ' + SLIDES_NAV_SEL + ', ' + SLIDES_ARROW_SEL));\r\n\r\n //removing inline styles\r\n css($(SECTION_SEL), {\r\n 'height': '',\r\n 'background-color' : '',\r\n 'padding': ''\r\n });\r\n\r\n css($(SLIDE_SEL), {\r\n 'width': ''\r\n });\r\n\r\n css(container, {\r\n 'height': '',\r\n 'position': '',\r\n '-ms-touch-action': '',\r\n 'touch-action': ''\r\n });\r\n\r\n css($htmlBody, {\r\n 'overflow': '',\r\n 'height': ''\r\n });\r\n\r\n // remove .fp-enabled class\r\n removeClass($html, ENABLED);\r\n\r\n // remove .fp-responsive class\r\n removeClass($body, RESPONSIVE);\r\n\r\n // remove all of the .fp-viewing- classes\r\n $body.className.split(/\\s+/).forEach(function (className) {\r\n if (className.indexOf(VIEWING_PREFIX) === 0) {\r\n removeClass($body, className);\r\n }\r\n });\r\n\r\n //removing added classes\r\n $(SECTION_SEL + ', ' + SLIDE_SEL).forEach(function(item){\r\n if(options.scrollOverflowHandler && options.scrollOverflow){\r\n options.scrollOverflowHandler.remove(item);\r\n }\r\n removeClass(item, TABLE + ' ' + ACTIVE + ' ' + COMPLETELY);\r\n var previousStyles = item.getAttribute('data-fp-styles');\r\n if(previousStyles){\r\n item.setAttribute('style', item.getAttribute('data-fp-styles'));\r\n }\r\n\r\n //removing anchors if they were not set using the HTML markup\r\n if(hasClass(item, SECTION) && !g_initialAnchorsInDom){\r\n item.removeAttribute('data-anchor');\r\n }\r\n });\r\n\r\n //removing the applied transition from the fullpage wrapper\r\n removeAnimation(container);\r\n\r\n //Unwrapping content\r\n [TABLE_CELL_SEL, SLIDES_CONTAINER_SEL,SLIDES_WRAPPER_SEL].forEach(function(selector){\r\n $(selector, container).forEach(function(item){\r\n //unwrap not being use in case there's no child element inside and its just text\r\n unwrap(item);\r\n });\r\n });\r\n\r\n //removing the applied transition from the fullpage wrapper\r\n css(container, {\r\n '-webkit-transition': 'none',\r\n 'transition': 'none'\r\n });\r\n\r\n //scrolling the page to the top with no animation\r\n window.scrollTo(0, 0);\r\n\r\n //removing selectors\r\n var usedSelectors = [SECTION, SLIDE, SLIDES_CONTAINER];\r\n usedSelectors.forEach(function(item){\r\n removeClass($('.' + item), item);\r\n });\r\n }\r\n\r\n /*\r\n * Sets the state for a variable with multiple states (original, and temporal)\r\n * Some variables such as `autoScrolling` or `recordHistory` might change automatically its state when using `responsive` or `autoScrolling:false`.\r\n * This function is used to keep track of both states, the original and the temporal one.\r\n * If type is not 'internal', then we assume the user is globally changing the variable.\r\n */\r\n function setVariableState(variable, value, type){\r\n options[variable] = value;\r\n if(type !== 'internal'){\r\n originals[variable] = value;\r\n }\r\n }\r\n\r\n /**\r\n * Displays warnings\r\n */\r\n function displayWarnings(){\r\n var l = options['li' + 'c' + 'enseK' + 'e' + 'y'];\r\n var msgStyle = 'font-size: 15px;background:yellow;';\r\n\r\n if(!isOK){\r\n showError('error', 'Fullpage.js version 3 has changed its license to GPLv3 and it requires a `licenseKey` option. Read about it here:');\r\n showError('error', 'https://github.com/alvarotrigo/fullPage.js#options');\r\n }\r\n else if(l && l.length < 20){\r\n console.warn('%c This website was made using fullPage.js slider. More info on the following website:', msgStyle);\r\n console.warn('%c https://alvarotrigo.com/fullPage/', msgStyle);\r\n }\r\n\r\n if(hasClass($html, ENABLED)){\r\n showError('error', 'Fullpage.js can only be initialized once and you are doing it multiple times!');\r\n return;\r\n }\r\n\r\n // Disable mutually exclusive settings\r\n if (options.continuousVertical &&\r\n (options.loopTop || options.loopBottom)) {\r\n options.continuousVertical = false;\r\n showError('warn', 'Option `loopTop/loopBottom` is mutually exclusive with `continuousVertical`; `continuousVertical` disabled');\r\n }\r\n\r\n if(options.scrollOverflow &&\r\n (options.scrollBar || !options.autoScrolling)){\r\n showError('warn', 'Options scrollBar:true and autoScrolling:false are mutually exclusive with scrollOverflow:true. Sections with scrollOverflow might not work well in Firefox');\r\n }\r\n\r\n if(options.continuousVertical && (options.scrollBar || !options.autoScrolling)){\r\n options.continuousVertical = false;\r\n showError('warn', 'Scroll bars (`scrollBar:true` or `autoScrolling:false`) are mutually exclusive with `continuousVertical`; `continuousVertical` disabled');\r\n }\r\n\r\n if(options.scrollOverflow && options.scrollOverflowHandler == null){\r\n options.scrollOverflow = false;\r\n showError('error', 'The option `scrollOverflow:true` requires the file `scrolloverflow.min.js`. Please include it before fullPage.js.');\r\n }\r\n\r\n //using extensions? Wrong file!\r\n extensions.forEach(function(extension){\r\n //is the option set to true?\r\n if(options[extension]){\r\n showError('warn', 'fullpage.js extensions require fullpage.extensions.min.js file instead of the usual fullpage.js. Requested: '+ extension);\r\n }\r\n });\r\n\r\n //anchors can not have the same value as any element ID or NAME\r\n options.anchors.forEach(function(name){\r\n\r\n //case insensitive selectors (http://stackoverflow.com/a/19465187/1081396)\r\n var nameAttr = [].slice.call($('[name]')).filter(function(item) {\r\n return item.getAttribute('name') && item.getAttribute('name').toLowerCase() == name.toLowerCase();\r\n });\r\n\r\n var idAttr = [].slice.call($('[id]')).filter(function(item) {\r\n return item.getAttribute('id') && item.getAttribute('id').toLowerCase() == name.toLowerCase();\r\n });\r\n\r\n if(idAttr.length || nameAttr.length ){\r\n showError('error', 'data-anchor tags can not have the same value as any `id` element on the site (or `name` element for IE).');\r\n var propertyName = idAttr.length ? 'id' : 'name';\r\n\r\n if(idAttr.length || nameAttr.length){\r\n showError('error', '\"' + name + '\" is is being used by another element `'+ propertyName +'` property');\r\n }\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Getting the position of the element to scroll when using jQuery animations\r\n */\r\n function getScrolledPosition(element){\r\n var position;\r\n\r\n //is not the window element and is a slide?\r\n if(element.self != window && hasClass(element, SLIDES_WRAPPER)){\r\n position = element.scrollLeft;\r\n }\r\n else if(!options.autoScrolling || options.scrollBar){\r\n position = getScrollTop();\r\n }\r\n else{\r\n position = element.offsetTop;\r\n }\r\n\r\n //gets the top property of the wrapper\r\n return position;\r\n }\r\n\r\n /**\r\n * Simulates the animated scrollTop of jQuery. Used when css3:false or scrollBar:true or autoScrolling:false\r\n * http://stackoverflow.com/a/16136789/1081396\r\n */\r\n function scrollTo(element, to, duration, callback) {\r\n var start = getScrolledPosition(element);\r\n var change = to - start;\r\n var currentTime = 0;\r\n var increment = 20;\r\n activeAnimation = true;\r\n\r\n var animateScroll = function(){\r\n if(activeAnimation){ //in order to stope it from other function whenever we want\r\n var val = to;\r\n\r\n currentTime += increment;\r\n\r\n if(duration){\r\n val = window.fp_easings[options.easing](currentTime, start, change, duration);\r\n }\r\n\r\n setScrolling(element, val);\r\n\r\n if(currentTime < duration) {\r\n setTimeout(animateScroll, increment);\r\n }else if(typeof callback !== 'undefined'){\r\n callback();\r\n }\r\n }else if (currentTime < duration){\r\n callback();\r\n }\r\n };\r\n\r\n animateScroll();\r\n }\r\n\r\n /**\r\n * Scrolls the page / slider the given number of pixels.\r\n * It will do it one or another way dependiong on the library's config.\r\n */\r\n function setScrolling(element, val){\r\n if(!options.autoScrolling || options.scrollBar || (element.self != window && hasClass(element, SLIDES_WRAPPER))){\r\n\r\n //scrolling horizontally through the slides?\r\n if(element.self != window && hasClass(element, SLIDES_WRAPPER)){\r\n element.scrollLeft = val;\r\n }\r\n //vertical scroll\r\n else{\r\n element.scrollTo(0, val);\r\n }\r\n }else{\r\n element.style.top = val + 'px';\r\n }\r\n }\r\n\r\n /**\r\n * Gets the active slide.\r\n */\r\n function getActiveSlide(){\r\n var activeSlide = $(SLIDE_ACTIVE_SEL, $(SECTION_ACTIVE_SEL)[0])[0];\r\n return nullOrSlide(activeSlide);\r\n }\r\n\r\n /**\r\n * Gets the active section.\r\n */\r\n function getActiveSection(){\r\n return new Section($(SECTION_ACTIVE_SEL)[0]);\r\n }\r\n\r\n /**\r\n * Item. Slide or Section objects share the same properties.\r\n */\r\n function Item(el, selector){\r\n this.anchor = el.getAttribute('data-anchor');\r\n this.item = el;\r\n this.index = index(el, selector);\r\n this.isLast = this.index === el.parentElement.querySelectorAll(selector).length -1;\r\n this.isFirst = !this.index;\r\n }\r\n\r\n /**\r\n * Section object\r\n */\r\n function Section(el){\r\n Item.call(this, el, SECTION_SEL);\r\n }\r\n\r\n /**\r\n * Slide object\r\n */\r\n function Slide(el){\r\n Item.call(this, el, SLIDE_SEL);\r\n }\r\n\r\n return FP;\r\n } //end of $.fn.fullpage\r\n\r\n //utils\r\n /**\r\n * Shows a message in the console of the given type.\r\n */\r\n function showError(type, text){\r\n window.console && window.console[type] && window.console[type]('fullPage: ' + text);\r\n }\r\n\r\n /**\r\n * Equivalent of jQuery function $().\r\n */\r\n function $(selector, context){\r\n context = arguments.length > 1 ? context : document;\r\n return context ? context.querySelectorAll(selector) : null;\r\n }\r\n\r\n /**\r\n * Extends a given Object properties and its childs.\r\n */\r\n function deepExtend(out) {\r\n out = out || {};\r\n for (var i = 1, len = arguments.length; i < len; ++i){\r\n var obj = arguments[i];\r\n\r\n if(!obj){\r\n continue;\r\n }\r\n\r\n for(var key in obj){\r\n if (!obj.hasOwnProperty(key)){\r\n continue;\r\n }\r\n\r\n // based on https://javascriptweblog.wordpress.com/2011/08/08/fixing-the-javascript-typeof-operator/\r\n if (Object.prototype.toString.call(obj[key]) === '[object Object]'){\r\n out[key] = deepExtend(out[key], obj[key]);\r\n continue;\r\n }\r\n\r\n out[key] = obj[key];\r\n }\r\n }\r\n return out;\r\n }\r\n\r\n /**\r\n * Checks if the passed element contains the passed class.\r\n */\r\n function hasClass(el, className){\r\n if(el == null){\r\n return false;\r\n }\r\n if (el.classList){\r\n return el.classList.contains(className);\r\n }\r\n return new RegExp('(^| )' + className + '( |$)', 'gi').test(el.className);\r\n }\r\n\r\n /**\r\n * Gets the window height. Crossbrowser.\r\n */\r\n function getWindowHeight(){\r\n return 'innerHeight' in window ? window.innerHeight : document.documentElement.offsetHeight;\r\n }\r\n\r\n /**\r\n * Gets the window width.\r\n */\r\n function getWindowWidth(){\r\n return window.innerWidth;\r\n }\r\n\r\n /**\r\n * Set's the CSS properties for the passed item/s.\r\n * @param {NodeList|HTMLElement} items\r\n * @param {Object} props css properties and values.\r\n */\r\n function css(items, props) {\r\n items = getList(items);\r\n\r\n var key;\r\n for (key in props) {\r\n if (props.hasOwnProperty(key)) {\r\n if (key !== null) {\r\n for (var i = 0; i < items.length; i++) {\r\n var item = items[i];\r\n item.style[key] = props[key];\r\n }\r\n }\r\n }\r\n }\r\n\r\n return items;\r\n }\r\n\r\n /**\r\n * Generic function to get the previous or next element.\r\n */\r\n function until(item, selector, fn){\r\n var sibling = item[fn];\r\n while(sibling && !matches(sibling, selector)){\r\n sibling = sibling[fn];\r\n }\r\n\r\n return sibling;\r\n }\r\n\r\n /**\r\n * Gets the previous element to the passed element that matches the passed selector.\r\n */\r\n function prevUntil(item, selector){\r\n return until(item, selector, 'previousElementSibling');\r\n }\r\n\r\n /**\r\n * Gets the next element to the passed element that matches the passed selector.\r\n */\r\n function nextUntil(item, selector){\r\n return until(item, selector, 'nextElementSibling');\r\n }\r\n\r\n /**\r\n * Gets the previous element to the passed element.\r\n */\r\n function prev(item){\r\n return item.previousElementSibling;\r\n }\r\n\r\n /**\r\n * Gets the next element to the passed element.\r\n */\r\n function next(item){\r\n return item.nextElementSibling;\r\n }\r\n\r\n /**\r\n * Gets the last element from the passed list of elements.\r\n */\r\n function last(item){\r\n return item[item.length-1];\r\n }\r\n\r\n /**\r\n * Gets index from the passed element.\r\n * @param {String} selector is optional.\r\n */\r\n function index(item, selector) {\r\n item = isArrayOrList(item) ? item[0] : item;\r\n var children = selector != null? $(selector, item.parentNode) : item.parentNode.childNodes;\r\n var num = 0;\r\n for (var i=0; iafdas');\r\n * wrapInner(document.querySelector('#pepe'), element);\r\n *\r\n * https://jsfiddle.net/zexxz0tw/6/\r\n *\r\n * https://stackoverflow.com/a/21817590/1081396\r\n */\r\n function wrapInner(parent, wrapper) {\r\n if (typeof wrapper === \"string\"){\r\n wrapper = createElementFromHTML(wrapper);\r\n }\r\n\r\n parent.appendChild(wrapper);\r\n\r\n while(parent.firstChild !== wrapper){\r\n wrapper.appendChild(parent.firstChild);\r\n }\r\n }\r\n\r\n /**\r\n * Usage:\r\n * unwrap(document.querySelector('#pepe'));\r\n * unwrap(element);\r\n *\r\n * https://jsfiddle.net/szjt0hxq/1/\r\n *\r\n */\r\n function unwrap(wrapper) {\r\n var wrapperContent = document.createDocumentFragment();\r\n while (wrapper.firstChild) {\r\n wrapperContent.appendChild(wrapper.firstChild);\r\n }\r\n\r\n wrapper.parentNode.replaceChild(wrapperContent, wrapper);\r\n }\r\n\r\n /**\r\n * http://stackoverflow.com/questions/22100853/dom-pure-javascript-solution-to-jquery-closest-implementation\r\n * Returns the element or `false` if there's none\r\n */\r\n function closest(el, selector) {\r\n if(el && el.nodeType === 1){\r\n if(matches(el, selector)){\r\n return el;\r\n }\r\n return closest(el.parentNode, selector);\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * Places one element (rel) after another one or group of them (reference).\r\n * @param {HTMLElement} reference\r\n * @param {HTMLElement|NodeList|String} el\r\n * https://jsfiddle.net/9s97hhzv/1/\r\n */\r\n function after(reference, el) {\r\n insertBefore(reference, reference.nextSibling, el);\r\n }\r\n\r\n /**\r\n * Places one element (rel) before another one or group of them (reference).\r\n * @param {HTMLElement} reference\r\n * @param {HTMLElement|NodeList|String} el\r\n * https://jsfiddle.net/9s97hhzv/1/\r\n */\r\n function before(reference, el) {\r\n insertBefore(reference, reference, el);\r\n }\r\n\r\n /**\r\n * Based in https://stackoverflow.com/a/19316024/1081396\r\n * and https://stackoverflow.com/a/4793630/1081396\r\n */\r\n function insertBefore(reference, beforeElement, el){\r\n if(!isArrayOrList(el)){\r\n if(typeof el == 'string'){\r\n el = createElementFromHTML(el);\r\n }\r\n el = [el];\r\n }\r\n\r\n for(var i = 0; iH1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0= 3 +* https://github.com/alvarotrigo/fullPage.js +*/ +/** +* Customized version of iScroll.js 0.1.3 +* It fixes bugs affecting its integration with fullpage.js +* @license +*/ +/*! iScroll v5.2.0 ~ (c) 2008-2016 Matteo Spinelli ~ http://cubiq.org/license */ +(function (window, document, Math) { +var rAF = window.requestAnimationFrame || + window.webkitRequestAnimationFrame || + window.mozRequestAnimationFrame || + window.oRequestAnimationFrame || + window.msRequestAnimationFrame || + function (callback) { window.setTimeout(callback, 1000 / 60); }; + +var utils = (function () { + var me = {}; + + var _elementStyle = document.createElement('div').style; + var _vendor = (function () { + var vendors = ['t', 'webkitT', 'MozT', 'msT', 'OT'], + transform, + i = 0, + l = vendors.length; + + for ( ; i < l; i++ ) { + transform = vendors[i] + 'ransform'; + if ( transform in _elementStyle ) return vendors[i].substr(0, vendors[i].length-1); + } + + return false; + })(); + + function _prefixStyle (style) { + if ( _vendor === false ) return false; + if ( _vendor === '' ) return style; + return _vendor + style.charAt(0).toUpperCase() + style.substr(1); + } + + me.getTime = Date.now || function getTime () { return new Date().getTime(); }; + + me.extend = function (target, obj) { + for ( var i in obj ) { + target[i] = obj[i]; + } + }; + + me.addEvent = function (el, type, fn, capture) { + el.addEventListener(type, fn, !!capture); + }; + + me.removeEvent = function (el, type, fn, capture) { + el.removeEventListener(type, fn, !!capture); + }; + + me.prefixPointerEvent = function (pointerEvent) { + return window.MSPointerEvent ? + 'MSPointer' + pointerEvent.charAt(7).toUpperCase() + pointerEvent.substr(8): + pointerEvent; + }; + + me.momentum = function (current, start, time, lowerMargin, wrapperSize, deceleration) { + var distance = current - start, + speed = Math.abs(distance) / time, + destination, + duration; + + deceleration = deceleration === undefined ? 0.0006 : deceleration; + + destination = current + ( speed * speed ) / ( 2 * deceleration ) * ( distance < 0 ? -1 : 1 ); + duration = speed / deceleration; + + if ( destination < lowerMargin ) { + destination = wrapperSize ? lowerMargin - ( wrapperSize / 2.5 * ( speed / 8 ) ) : lowerMargin; + distance = Math.abs(destination - current); + duration = distance / speed; + } else if ( destination > 0 ) { + destination = wrapperSize ? wrapperSize / 2.5 * ( speed / 8 ) : 0; + distance = Math.abs(current) + destination; + duration = distance / speed; + } + + return { + destination: Math.round(destination), + duration: duration + }; + }; + + var _transform = _prefixStyle('transform'); + + me.extend(me, { + hasTransform: _transform !== false, + hasPerspective: _prefixStyle('perspective') in _elementStyle, + hasTouch: 'ontouchstart' in window, + hasPointer: !!(window.PointerEvent || window.MSPointerEvent), // IE10 is prefixed + hasTransition: _prefixStyle('transition') in _elementStyle + }); + + /* + This should find all Android browsers lower than build 535.19 (both stock browser and webview) + - galaxy S2 is ok + - 2.3.6 : `AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1` + - 4.0.4 : `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30` + - galaxy S3 is badAndroid (stock brower, webview) + `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30` + - galaxy S4 is badAndroid (stock brower, webview) + `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30` + - galaxy S5 is OK + `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)` + - galaxy S6 is OK + `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)` + */ + me.isBadAndroid = (function() { + var appVersion = window.navigator.appVersion; + // Android browser is not a chrome browser. + if (/Android/.test(appVersion) && !(/Chrome\/\d/.test(appVersion))) { + var safariVersion = appVersion.match(/Safari\/(\d+.\d)/); + if(safariVersion && typeof safariVersion === "object" && safariVersion.length >= 2) { + return parseFloat(safariVersion[1]) < 535.19; + } else { + return true; + } + } else { + return false; + } + })(); + + me.extend(me.style = {}, { + transform: _transform, + transitionTimingFunction: _prefixStyle('transitionTimingFunction'), + transitionDuration: _prefixStyle('transitionDuration'), + transitionDelay: _prefixStyle('transitionDelay'), + transformOrigin: _prefixStyle('transformOrigin') + }); + + me.hasClass = function (e, c) { + var re = new RegExp("(^|\\s)" + c + "(\\s|$)"); + return re.test(e.className); + }; + + me.addClass = function (e, c) { + if ( me.hasClass(e, c) ) { + return; + } + + var newclass = e.className.split(' '); + newclass.push(c); + e.className = newclass.join(' '); + }; + + me.removeClass = function (e, c) { + if ( !me.hasClass(e, c) ) { + return; + } + + var re = new RegExp("(^|\\s)" + c + "(\\s|$)", 'g'); + e.className = e.className.replace(re, ' '); + }; + + me.offset = function (el) { + var left = -el.offsetLeft, + top = -el.offsetTop; + + // jshint -W084 + while (el = el.offsetParent) { + left -= el.offsetLeft; + top -= el.offsetTop; + } + // jshint +W084 + + return { + left: left, + top: top + }; + }; + + me.preventDefaultException = function (el, exceptions) { + for ( var i in exceptions ) { + if ( exceptions[i].test(el[i]) ) { + return true; + } + } + + return false; + }; + + me.extend(me.eventType = {}, { + touchstart: 1, + touchmove: 1, + touchend: 1, + + mousedown: 2, + mousemove: 2, + mouseup: 2, + + pointerdown: 3, + pointermove: 3, + pointerup: 3, + + MSPointerDown: 3, + MSPointerMove: 3, + MSPointerUp: 3 + }); + + me.extend(me.ease = {}, { + quadratic: { + style: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)', + fn: function (k) { + return k * ( 2 - k ); + } + }, + circular: { + style: 'cubic-bezier(0.1, 0.57, 0.1, 1)', // Not properly "circular" but this looks better, it should be (0.075, 0.82, 0.165, 1) + fn: function (k) { + return Math.sqrt( 1 - ( --k * k ) ); + } + }, + back: { + style: 'cubic-bezier(0.175, 0.885, 0.32, 1.275)', + fn: function (k) { + var b = 4; + return ( k = k - 1 ) * k * ( ( b + 1 ) * k + b ) + 1; + } + }, + bounce: { + style: '', + fn: function (k) { + if ( ( k /= 1 ) < ( 1 / 2.75 ) ) { + return 7.5625 * k * k; + } else if ( k < ( 2 / 2.75 ) ) { + return 7.5625 * ( k -= ( 1.5 / 2.75 ) ) * k + 0.75; + } else if ( k < ( 2.5 / 2.75 ) ) { + return 7.5625 * ( k -= ( 2.25 / 2.75 ) ) * k + 0.9375; + } else { + return 7.5625 * ( k -= ( 2.625 / 2.75 ) ) * k + 0.984375; + } + } + }, + elastic: { + style: '', + fn: function (k) { + var f = 0.22, + e = 0.4; + + if ( k === 0 ) { return 0; } + if ( k == 1 ) { return 1; } + + return ( e * Math.pow( 2, - 10 * k ) * Math.sin( ( k - f / 4 ) * ( 2 * Math.PI ) / f ) + 1 ); + } + } + }); + + me.tap = function (e, eventName) { + var ev = document.createEvent('Event'); + ev.initEvent(eventName, true, true); + ev.pageX = e.pageX; + ev.pageY = e.pageY; + e.target.dispatchEvent(ev); + }; + + me.click = function (e) { + var target = e.target, + ev; + + if ( !(/(SELECT|INPUT|TEXTAREA)/i).test(target.tagName) ) { + // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent + // initMouseEvent is deprecated. + ev = document.createEvent(window.MouseEvent ? 'MouseEvents' : 'Event'); + ev.initEvent('click', true, true); + ev.view = e.view || window; + ev.detail = 1; + ev.screenX = target.screenX || 0; + ev.screenY = target.screenY || 0; + ev.clientX = target.clientX || 0; + ev.clientY = target.clientY || 0; + ev.ctrlKey = !!e.ctrlKey; + ev.altKey = !!e.altKey; + ev.shiftKey = !!e.shiftKey; + ev.metaKey = !!e.metaKey; + ev.button = 0; + ev.relatedTarget = null; + ev._constructed = true; + target.dispatchEvent(ev); + } + }; + + return me; +})(); +function IScroll (el, options) { + this.wrapper = typeof el == 'string' ? document.querySelector(el) : el; + this.scroller = this.wrapper.children[0]; + this.scrollerStyle = this.scroller.style; // cache style for better performance + + this.options = { + + resizeScrollbars: true, + + mouseWheelSpeed: 20, + + snapThreshold: 0.334, + +// INSERT POINT: OPTIONS + disablePointer : !utils.hasPointer, + disableTouch : utils.hasPointer || !utils.hasTouch, + disableMouse : utils.hasPointer || utils.hasTouch, + startX: 0, + startY: 0, + scrollY: true, + directionLockThreshold: 5, + momentum: true, + + bounce: true, + bounceTime: 600, + bounceEasing: '', + + preventDefault: true, + preventDefaultException: { tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT|LABEL)$/ }, + + HWCompositing: true, + useTransition: true, + useTransform: true, + bindToWrapper: typeof window.onmousedown === "undefined" + }; + + for ( var i in options ) { + this.options[i] = options[i]; + } + + // Normalize options + this.translateZ = this.options.HWCompositing && utils.hasPerspective ? ' translateZ(0)' : ''; + + this.options.useTransition = utils.hasTransition && this.options.useTransition; + this.options.useTransform = utils.hasTransform && this.options.useTransform; + + this.options.eventPassthrough = this.options.eventPassthrough === true ? 'vertical' : this.options.eventPassthrough; + this.options.preventDefault = !this.options.eventPassthrough && this.options.preventDefault; + + // If you want eventPassthrough I have to lock one of the axes + this.options.scrollY = this.options.eventPassthrough == 'vertical' ? false : this.options.scrollY; + this.options.scrollX = this.options.eventPassthrough == 'horizontal' ? false : this.options.scrollX; + + // With eventPassthrough we also need lockDirection mechanism + this.options.freeScroll = this.options.freeScroll && !this.options.eventPassthrough; + this.options.directionLockThreshold = this.options.eventPassthrough ? 0 : this.options.directionLockThreshold; + + this.options.bounceEasing = typeof this.options.bounceEasing == 'string' ? utils.ease[this.options.bounceEasing] || utils.ease.circular : this.options.bounceEasing; + + this.options.resizePolling = this.options.resizePolling === undefined ? 60 : this.options.resizePolling; + + if ( this.options.tap === true ) { + this.options.tap = 'tap'; + } + + // https://github.com/cubiq/iscroll/issues/1029 + if (!this.options.useTransition && !this.options.useTransform) { + if(!(/relative|absolute/i).test(this.scrollerStyle.position)) { + this.scrollerStyle.position = "relative"; + } + } + + if ( this.options.shrinkScrollbars == 'scale' ) { + this.options.useTransition = false; + } + + this.options.invertWheelDirection = this.options.invertWheelDirection ? -1 : 1; + +// INSERT POINT: NORMALIZATION + + // Some defaults + this.x = 0; + this.y = 0; + this.directionX = 0; + this.directionY = 0; + this._events = {}; + +// INSERT POINT: DEFAULTS + + this._init(); + this.refresh(); + + this.scrollTo(this.options.startX, this.options.startY); + this.enable(); +} + +IScroll.prototype = { + version: '5.2.0', + + _init: function () { + this._initEvents(); + + if ( this.options.scrollbars || this.options.indicators ) { + this._initIndicators(); + } + + if ( this.options.mouseWheel ) { + this._initWheel(); + } + + if ( this.options.snap ) { + this._initSnap(); + } + + if ( this.options.keyBindings ) { + this._initKeys(); + } + +// INSERT POINT: _init + + }, + + destroy: function () { + this._initEvents(true); + clearTimeout(this.resizeTimeout); + this.resizeTimeout = null; + this._execEvent('destroy'); + }, + + _transitionEnd: function (e) { + if ( e.target != this.scroller || !this.isInTransition ) { + return; + } + + this._transitionTime(); + if ( !this.resetPosition(this.options.bounceTime) ) { + this.isInTransition = false; + this._execEvent('scrollEnd'); + } + }, + + _start: function (e) { + // React to left mouse button only + if ( utils.eventType[e.type] != 1 ) { + // for button property + // http://unixpapa.com/js/mouse.html + var button; + if (!e.which) { + /* IE case */ + button = (e.button < 2) ? 0 : + ((e.button == 4) ? 1 : 2); + } else { + /* All others */ + button = e.button; + } + if ( button !== 0 ) { + return; + } + } + + if ( !this.enabled || (this.initiated && utils.eventType[e.type] !== this.initiated) ) { + return; + } + + if ( this.options.preventDefault && !utils.isBadAndroid && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) { + e.preventDefault(); + } + + var point = e.touches ? e.touches[0] : e, + pos; + + this.initiated = utils.eventType[e.type]; + this.moved = false; + this.distX = 0; + this.distY = 0; + this.directionX = 0; + this.directionY = 0; + this.directionLocked = 0; + + this.startTime = utils.getTime(); + + if ( this.options.useTransition && this.isInTransition ) { + this._transitionTime(); + this.isInTransition = false; + pos = this.getComputedPosition(); + this._translate(Math.round(pos.x), Math.round(pos.y)); + this._execEvent('scrollEnd'); + } else if ( !this.options.useTransition && this.isAnimating ) { + this.isAnimating = false; + this._execEvent('scrollEnd'); + } + + this.startX = this.x; + this.startY = this.y; + this.absStartX = this.x; + this.absStartY = this.y; + this.pointX = point.pageX; + this.pointY = point.pageY; + + this._execEvent('beforeScrollStart'); + }, + + _move: function (e) { + if ( !this.enabled || utils.eventType[e.type] !== this.initiated ) { + return; + } + + if ( this.options.preventDefault ) { // increases performance on Android? TODO: check! + e.preventDefault(); + } + + var point = e.touches ? e.touches[0] : e, + deltaX = point.pageX - this.pointX, + deltaY = point.pageY - this.pointY, + timestamp = utils.getTime(), + newX, newY, + absDistX, absDistY; + + this.pointX = point.pageX; + this.pointY = point.pageY; + + this.distX += deltaX; + this.distY += deltaY; + absDistX = Math.abs(this.distX); + absDistY = Math.abs(this.distY); + + // We need to move at least 10 pixels for the scrolling to initiate + if ( timestamp - this.endTime > 300 && (absDistX < 10 && absDistY < 10) ) { + return; + } + + // If you are scrolling in one direction lock the other + if ( !this.directionLocked && !this.options.freeScroll ) { + if ( absDistX > absDistY + this.options.directionLockThreshold ) { + this.directionLocked = 'h'; // lock horizontally + } else if ( absDistY >= absDistX + this.options.directionLockThreshold ) { + this.directionLocked = 'v'; // lock vertically + } else { + this.directionLocked = 'n'; // no lock + } + } + + if ( this.directionLocked == 'h' ) { + if ( this.options.eventPassthrough == 'vertical' ) { + e.preventDefault(); + } else if ( this.options.eventPassthrough == 'horizontal' ) { + this.initiated = false; + return; + } + + deltaY = 0; + } else if ( this.directionLocked == 'v' ) { + if ( this.options.eventPassthrough == 'horizontal' ) { + e.preventDefault(); + } else if ( this.options.eventPassthrough == 'vertical' ) { + this.initiated = false; + return; + } + + deltaX = 0; + } + + deltaX = this.hasHorizontalScroll ? deltaX : 0; + deltaY = this.hasVerticalScroll ? deltaY : 0; + + newX = this.x + deltaX; + newY = this.y + deltaY; + + // Slow down if outside of the boundaries + if ( newX > 0 || newX < this.maxScrollX ) { + newX = this.options.bounce ? this.x + deltaX / 3 : newX > 0 ? 0 : this.maxScrollX; + } + if ( newY > 0 || newY < this.maxScrollY ) { + newY = this.options.bounce ? this.y + deltaY / 3 : newY > 0 ? 0 : this.maxScrollY; + } + + this.directionX = deltaX > 0 ? -1 : deltaX < 0 ? 1 : 0; + this.directionY = deltaY > 0 ? -1 : deltaY < 0 ? 1 : 0; + + if ( !this.moved ) { + this._execEvent('scrollStart'); + } + + this.moved = true; + + this._translate(newX, newY); + +/* REPLACE START: _move */ + + if ( timestamp - this.startTime > 300 ) { + this.startTime = timestamp; + this.startX = this.x; + this.startY = this.y; + } + +/* REPLACE END: _move */ + + }, + + _end: function (e) { + if ( !this.enabled || utils.eventType[e.type] !== this.initiated ) { + return; + } + + if ( this.options.preventDefault && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) { + e.preventDefault(); + } + + var point = e.changedTouches ? e.changedTouches[0] : e, + momentumX, + momentumY, + duration = utils.getTime() - this.startTime, + newX = Math.round(this.x), + newY = Math.round(this.y), + distanceX = Math.abs(newX - this.startX), + distanceY = Math.abs(newY - this.startY), + time = 0, + easing = ''; + + this.isInTransition = 0; + this.initiated = 0; + this.endTime = utils.getTime(); + + // reset if we are outside of the boundaries + if ( this.resetPosition(this.options.bounceTime) ) { + return; + } + + this.scrollTo(newX, newY); // ensures that the last position is rounded + + // we scrolled less than 10 pixels + if ( !this.moved ) { + if ( this.options.tap ) { + utils.tap(e, this.options.tap); + } + + if ( this.options.click ) { + utils.click(e); + } + + this._execEvent('scrollCancel'); + return; + } + + if ( this._events.flick && duration < 200 && distanceX < 100 && distanceY < 100 ) { + this._execEvent('flick'); + return; + } + + // start momentum animation if needed + if ( this.options.momentum && duration < 300 ) { + momentumX = this.hasHorizontalScroll ? utils.momentum(this.x, this.startX, duration, this.maxScrollX, this.options.bounce ? this.wrapperWidth : 0, this.options.deceleration) : { destination: newX, duration: 0 }; + momentumY = this.hasVerticalScroll ? utils.momentum(this.y, this.startY, duration, this.maxScrollY, this.options.bounce ? this.wrapperHeight : 0, this.options.deceleration) : { destination: newY, duration: 0 }; + newX = momentumX.destination; + newY = momentumY.destination; + time = Math.max(momentumX.duration, momentumY.duration); + this.isInTransition = 1; + } + + + if ( this.options.snap ) { + var snap = this._nearestSnap(newX, newY); + this.currentPage = snap; + time = this.options.snapSpeed || Math.max( + Math.max( + Math.min(Math.abs(newX - snap.x), 1000), + Math.min(Math.abs(newY - snap.y), 1000) + ), 300); + newX = snap.x; + newY = snap.y; + + this.directionX = 0; + this.directionY = 0; + easing = this.options.bounceEasing; + } + +// INSERT POINT: _end + + if ( newX != this.x || newY != this.y ) { + // change easing function when scroller goes out of the boundaries + if ( newX > 0 || newX < this.maxScrollX || newY > 0 || newY < this.maxScrollY ) { + easing = utils.ease.quadratic; + } + + this.scrollTo(newX, newY, time, easing); + return; + } + + this._execEvent('scrollEnd'); + }, + + _resize: function () { + var that = this; + + clearTimeout(this.resizeTimeout); + + this.resizeTimeout = setTimeout(function () { + that.refresh(); + }, this.options.resizePolling); + }, + + resetPosition: function (time) { + var x = this.x, + y = this.y; + + time = time || 0; + + if ( !this.hasHorizontalScroll || this.x > 0 ) { + x = 0; + } else if ( this.x < this.maxScrollX ) { + x = this.maxScrollX; + } + + if ( !this.hasVerticalScroll || this.y > 0 ) { + y = 0; + } else if ( this.y < this.maxScrollY ) { + y = this.maxScrollY; + } + + if ( x == this.x && y == this.y ) { + return false; + } + + this.scrollTo(x, y, time, this.options.bounceEasing); + + return true; + }, + + disable: function () { + this.enabled = false; + }, + + enable: function () { + this.enabled = true; + }, + + refresh: function () { + var rf = this.wrapper.offsetHeight; // Force reflow + + this.wrapperWidth = this.wrapper.clientWidth; + this.wrapperHeight = this.wrapper.clientHeight; + +/* REPLACE START: refresh */ + + this.scrollerWidth = this.scroller.offsetWidth; + this.scrollerHeight = this.scroller.offsetHeight; + + this.maxScrollX = this.wrapperWidth - this.scrollerWidth; + this.maxScrollY = this.wrapperHeight - this.scrollerHeight; + +/* REPLACE END: refresh */ + + this.hasHorizontalScroll = this.options.scrollX && this.maxScrollX < 0; + this.hasVerticalScroll = this.options.scrollY && this.maxScrollY < 0; + + if ( !this.hasHorizontalScroll ) { + this.maxScrollX = 0; + this.scrollerWidth = this.wrapperWidth; + } + + if ( !this.hasVerticalScroll ) { + this.maxScrollY = 0; + this.scrollerHeight = this.wrapperHeight; + } + + this.endTime = 0; + this.directionX = 0; + this.directionY = 0; + + this.wrapperOffset = utils.offset(this.wrapper); + + this._execEvent('refresh'); + + this.resetPosition(); + +// INSERT POINT: _refresh + + }, + + on: function (type, fn) { + if ( !this._events[type] ) { + this._events[type] = []; + } + + this._events[type].push(fn); + }, + + off: function (type, fn) { + if ( !this._events[type] ) { + return; + } + + var index = this._events[type].indexOf(fn); + + if ( index > -1 ) { + this._events[type].splice(index, 1); + } + }, + + _execEvent: function (type) { + if ( !this._events[type] ) { + return; + } + + var i = 0, + l = this._events[type].length; + + if ( !l ) { + return; + } + + for ( ; i < l; i++ ) { + this._events[type][i].apply(this, [].slice.call(arguments, 1)); + } + }, + + scrollBy: function (x, y, time, easing) { + x = this.x + x; + y = this.y + y; + time = time || 0; + + this.scrollTo(x, y, time, easing); + }, + + scrollTo: function (x, y, time, easing) { + easing = easing || utils.ease.circular; + + this.isInTransition = this.options.useTransition && time > 0; + var transitionType = this.options.useTransition && easing.style; + if ( !time || transitionType ) { + if(transitionType) { + this._transitionTimingFunction(easing.style); + this._transitionTime(time); + } + this._translate(x, y); + } else { + this._animate(x, y, time, easing.fn); + } + }, + + scrollToElement: function (el, time, offsetX, offsetY, easing) { + el = el.nodeType ? el : this.scroller.querySelector(el); + + if ( !el ) { + return; + } + + var pos = utils.offset(el); + + pos.left -= this.wrapperOffset.left; + pos.top -= this.wrapperOffset.top; + + // if offsetX/Y are true we center the element to the screen + if ( offsetX === true ) { + offsetX = Math.round(el.offsetWidth / 2 - this.wrapper.offsetWidth / 2); + } + if ( offsetY === true ) { + offsetY = Math.round(el.offsetHeight / 2 - this.wrapper.offsetHeight / 2); + } + + pos.left -= offsetX || 0; + pos.top -= offsetY || 0; + + pos.left = pos.left > 0 ? 0 : pos.left < this.maxScrollX ? this.maxScrollX : pos.left; + pos.top = pos.top > 0 ? 0 : pos.top < this.maxScrollY ? this.maxScrollY : pos.top; + + time = time === undefined || time === null || time === 'auto' ? Math.max(Math.abs(this.x-pos.left), Math.abs(this.y-pos.top)) : time; + + this.scrollTo(pos.left, pos.top, time, easing); + }, + + _transitionTime: function (time) { + if (!this.options.useTransition) { + return; + } + time = time || 0; + var durationProp = utils.style.transitionDuration; + if(!durationProp) { + return; + } + + this.scrollerStyle[durationProp] = time + 'ms'; + + if ( !time && utils.isBadAndroid ) { + this.scrollerStyle[durationProp] = '0.0001ms'; + // remove 0.0001ms + var self = this; + rAF(function() { + if(self.scrollerStyle[durationProp] === '0.0001ms') { + self.scrollerStyle[durationProp] = '0s'; + } + }); + } + + + if ( this.indicators ) { + for ( var i = this.indicators.length; i--; ) { + this.indicators[i].transitionTime(time); + } + } + + +// INSERT POINT: _transitionTime + + }, + + _transitionTimingFunction: function (easing) { + this.scrollerStyle[utils.style.transitionTimingFunction] = easing; + + + if ( this.indicators ) { + for ( var i = this.indicators.length; i--; ) { + this.indicators[i].transitionTimingFunction(easing); + } + } + + +// INSERT POINT: _transitionTimingFunction + + }, + + _translate: function (x, y) { + if ( this.options.useTransform ) { + +/* REPLACE START: _translate */ + + this.scrollerStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.translateZ; + +/* REPLACE END: _translate */ + + } else { + x = Math.round(x); + y = Math.round(y); + this.scrollerStyle.left = x + 'px'; + this.scrollerStyle.top = y + 'px'; + } + + this.x = x; + this.y = y; + + + if ( this.indicators ) { + for ( var i = this.indicators.length; i--; ) { + this.indicators[i].updatePosition(); + } + } + + +// INSERT POINT: _translate + + }, + + _initEvents: function (remove) { + var eventType = remove ? utils.removeEvent : utils.addEvent, + target = this.options.bindToWrapper ? this.wrapper : window; + + eventType(window, 'orientationchange', this); + eventType(window, 'resize', this); + + if ( this.options.click ) { + eventType(this.wrapper, 'click', this, true); + } + + if ( !this.options.disableMouse ) { + eventType(this.wrapper, 'mousedown', this); + eventType(target, 'mousemove', this); + eventType(target, 'mousecancel', this); + eventType(target, 'mouseup', this); + } + + if ( utils.hasPointer && !this.options.disablePointer ) { + eventType(this.wrapper, utils.prefixPointerEvent('pointerdown'), this); + eventType(target, utils.prefixPointerEvent('pointermove'), this); + eventType(target, utils.prefixPointerEvent('pointercancel'), this); + eventType(target, utils.prefixPointerEvent('pointerup'), this); + } + + if ( utils.hasTouch && !this.options.disableTouch ) { + eventType(this.wrapper, 'touchstart', this); + eventType(target, 'touchmove', this); + eventType(target, 'touchcancel', this); + eventType(target, 'touchend', this); + } + + eventType(this.scroller, 'transitionend', this); + eventType(this.scroller, 'webkitTransitionEnd', this); + eventType(this.scroller, 'oTransitionEnd', this); + eventType(this.scroller, 'MSTransitionEnd', this); + }, + + getComputedPosition: function () { + var matrix = window.getComputedStyle(this.scroller, null), + x, y; + + if ( this.options.useTransform ) { + matrix = matrix[utils.style.transform].split(')')[0].split(', '); + x = +(matrix[12] || matrix[4]); + y = +(matrix[13] || matrix[5]); + } else { + x = +matrix.left.replace(/[^-\d.]/g, ''); + y = +matrix.top.replace(/[^-\d.]/g, ''); + } + + return { x: x, y: y }; + }, + _initIndicators: function () { + var interactive = this.options.interactiveScrollbars, + customStyle = typeof this.options.scrollbars != 'string', + indicators = [], + indicator; + + var that = this; + + this.indicators = []; + + if ( this.options.scrollbars ) { + // Vertical scrollbar + if ( this.options.scrollY ) { + indicator = { + el: createDefaultScrollbar('v', interactive, this.options.scrollbars), + interactive: interactive, + defaultScrollbars: true, + customStyle: customStyle, + resize: this.options.resizeScrollbars, + shrink: this.options.shrinkScrollbars, + fade: this.options.fadeScrollbars, + listenX: false + }; + + this.wrapper.appendChild(indicator.el); + indicators.push(indicator); + } + + // Horizontal scrollbar + if ( this.options.scrollX ) { + indicator = { + el: createDefaultScrollbar('h', interactive, this.options.scrollbars), + interactive: interactive, + defaultScrollbars: true, + customStyle: customStyle, + resize: this.options.resizeScrollbars, + shrink: this.options.shrinkScrollbars, + fade: this.options.fadeScrollbars, + listenY: false + }; + + this.wrapper.appendChild(indicator.el); + indicators.push(indicator); + } + } + + if ( this.options.indicators ) { + // TODO: check concat compatibility + indicators = indicators.concat(this.options.indicators); + } + + for ( var i = indicators.length; i--; ) { + this.indicators.push( new Indicator(this, indicators[i]) ); + } + + // TODO: check if we can use array.map (wide compatibility and performance issues) + function _indicatorsMap (fn) { + if (that.indicators) { + for ( var i = that.indicators.length; i--; ) { + fn.call(that.indicators[i]); + } + } + } + + if ( this.options.fadeScrollbars ) { + this.on('scrollEnd', function () { + _indicatorsMap(function () { + this.fade(); + }); + }); + + this.on('scrollCancel', function () { + _indicatorsMap(function () { + this.fade(); + }); + }); + + this.on('scrollStart', function () { + _indicatorsMap(function () { + this.fade(1); + }); + }); + + this.on('beforeScrollStart', function () { + _indicatorsMap(function () { + this.fade(1, true); + }); + }); + } + + + this.on('refresh', function () { + _indicatorsMap(function () { + this.refresh(); + }); + }); + + this.on('destroy', function () { + _indicatorsMap(function () { + this.destroy(); + }); + + delete this.indicators; + }); + }, + + _initWheel: function () { + utils.addEvent(this.wrapper, 'wheel', this); + utils.addEvent(this.wrapper, 'mousewheel', this); + utils.addEvent(this.wrapper, 'DOMMouseScroll', this); + + this.on('destroy', function () { + clearTimeout(this.wheelTimeout); + this.wheelTimeout = null; + utils.removeEvent(this.wrapper, 'wheel', this); + utils.removeEvent(this.wrapper, 'mousewheel', this); + utils.removeEvent(this.wrapper, 'DOMMouseScroll', this); + }); + }, + + _wheel: function (e) { + if ( !this.enabled ) { + return; + } + + // in IE we can not preventDefault() or otherwise it won't scroll to the prev/next section. + // I commented on it here back then: https://github.com/cubiq/iscroll/issues/980 + // isIE taken from: https://stackoverflow.com/a/49986758/1081396 + var isIE = window.navigator.userAgent.match(/(MSIE|Trident)/); + if(!isIE){ + e.preventDefault(); + } + + var wheelDeltaX, wheelDeltaY, + newX, newY, + that = this; + + if ( this.wheelTimeout === undefined ) { + that._execEvent('scrollStart'); + } + + // Execute the scrollEnd event after 400ms the wheel stopped scrolling + clearTimeout(this.wheelTimeout); + this.wheelTimeout = setTimeout(function () { + if(!that.options.snap) { + that._execEvent('scrollEnd'); + } + that.wheelTimeout = undefined; + }, 400); + + if ( 'deltaX' in e ) { + if (e.deltaMode === 1) { + wheelDeltaX = -e.deltaX * this.options.mouseWheelSpeed; + wheelDeltaY = -e.deltaY * this.options.mouseWheelSpeed; + } else { + wheelDeltaX = -e.deltaX; + wheelDeltaY = -e.deltaY; + } + } else if ( 'wheelDeltaX' in e ) { + wheelDeltaX = e.wheelDeltaX / 120 * this.options.mouseWheelSpeed; + wheelDeltaY = e.wheelDeltaY / 120 * this.options.mouseWheelSpeed; + } else if ( 'wheelDelta' in e ) { + wheelDeltaX = wheelDeltaY = e.wheelDelta / 120 * this.options.mouseWheelSpeed; + } else if ( 'detail' in e ) { + wheelDeltaX = wheelDeltaY = -e.detail / 3 * this.options.mouseWheelSpeed; + } else { + return; + } + + wheelDeltaX *= this.options.invertWheelDirection; + wheelDeltaY *= this.options.invertWheelDirection; + + if ( !this.hasVerticalScroll ) { + wheelDeltaX = wheelDeltaY; + wheelDeltaY = 0; + } + + if ( this.options.snap ) { + newX = this.currentPage.pageX; + newY = this.currentPage.pageY; + + if ( wheelDeltaX > 0 ) { + newX--; + } else if ( wheelDeltaX < 0 ) { + newX++; + } + + if ( wheelDeltaY > 0 ) { + newY--; + } else if ( wheelDeltaY < 0 ) { + newY++; + } + + this.goToPage(newX, newY); + + return; + } + + newX = this.x + Math.round(this.hasHorizontalScroll ? wheelDeltaX : 0); + newY = this.y + Math.round(this.hasVerticalScroll ? wheelDeltaY : 0); + + this.directionX = wheelDeltaX > 0 ? -1 : wheelDeltaX < 0 ? 1 : 0; + this.directionY = wheelDeltaY > 0 ? -1 : wheelDeltaY < 0 ? 1 : 0; + + if ( newX > 0 ) { + newX = 0; + } else if ( newX < this.maxScrollX ) { + newX = this.maxScrollX; + } + + if ( newY > 0 ) { + newY = 0; + } else if ( newY < this.maxScrollY ) { + newY = this.maxScrollY; + } + + this.scrollTo(newX, newY, 0); + +// INSERT POINT: _wheel + }, + + _initSnap: function () { + this.currentPage = {}; + + if ( typeof this.options.snap == 'string' ) { + this.options.snap = this.scroller.querySelectorAll(this.options.snap); + } + + this.on('refresh', function () { + var i = 0, l, + m = 0, n, + cx, cy, + x = 0, y, + stepX = this.options.snapStepX || this.wrapperWidth, + stepY = this.options.snapStepY || this.wrapperHeight, + el; + + this.pages = []; + + if ( !this.wrapperWidth || !this.wrapperHeight || !this.scrollerWidth || !this.scrollerHeight ) { + return; + } + + if ( this.options.snap === true ) { + cx = Math.round( stepX / 2 ); + cy = Math.round( stepY / 2 ); + + while ( x > -this.scrollerWidth ) { + this.pages[i] = []; + l = 0; + y = 0; + + while ( y > -this.scrollerHeight ) { + this.pages[i][l] = { + x: Math.max(x, this.maxScrollX), + y: Math.max(y, this.maxScrollY), + width: stepX, + height: stepY, + cx: x - cx, + cy: y - cy + }; + + y -= stepY; + l++; + } + + x -= stepX; + i++; + } + } else { + el = this.options.snap; + l = el.length; + n = -1; + + for ( ; i < l; i++ ) { + if ( i === 0 || el[i].offsetLeft <= el[i-1].offsetLeft ) { + m = 0; + n++; + } + + if ( !this.pages[m] ) { + this.pages[m] = []; + } + + x = Math.max(-el[i].offsetLeft, this.maxScrollX); + y = Math.max(-el[i].offsetTop, this.maxScrollY); + cx = x - Math.round(el[i].offsetWidth / 2); + cy = y - Math.round(el[i].offsetHeight / 2); + + this.pages[m][n] = { + x: x, + y: y, + width: el[i].offsetWidth, + height: el[i].offsetHeight, + cx: cx, + cy: cy + }; + + if ( x > this.maxScrollX ) { + m++; + } + } + } + + this.goToPage(this.currentPage.pageX || 0, this.currentPage.pageY || 0, 0); + + // Update snap threshold if needed + if ( this.options.snapThreshold % 1 === 0 ) { + this.snapThresholdX = this.options.snapThreshold; + this.snapThresholdY = this.options.snapThreshold; + } else { + this.snapThresholdX = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width * this.options.snapThreshold); + this.snapThresholdY = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height * this.options.snapThreshold); + } + }); + + this.on('flick', function () { + var time = this.options.snapSpeed || Math.max( + Math.max( + Math.min(Math.abs(this.x - this.startX), 1000), + Math.min(Math.abs(this.y - this.startY), 1000) + ), 300); + + this.goToPage( + this.currentPage.pageX + this.directionX, + this.currentPage.pageY + this.directionY, + time + ); + }); + }, + + _nearestSnap: function (x, y) { + if ( !this.pages.length ) { + return { x: 0, y: 0, pageX: 0, pageY: 0 }; + } + + var i = 0, + l = this.pages.length, + m = 0; + + // Check if we exceeded the snap threshold + if ( Math.abs(x - this.absStartX) < this.snapThresholdX && + Math.abs(y - this.absStartY) < this.snapThresholdY ) { + return this.currentPage; + } + + if ( x > 0 ) { + x = 0; + } else if ( x < this.maxScrollX ) { + x = this.maxScrollX; + } + + if ( y > 0 ) { + y = 0; + } else if ( y < this.maxScrollY ) { + y = this.maxScrollY; + } + + for ( ; i < l; i++ ) { + if ( x >= this.pages[i][0].cx ) { + x = this.pages[i][0].x; + break; + } + } + + l = this.pages[i].length; + + for ( ; m < l; m++ ) { + if ( y >= this.pages[0][m].cy ) { + y = this.pages[0][m].y; + break; + } + } + + if ( i == this.currentPage.pageX ) { + i += this.directionX; + + if ( i < 0 ) { + i = 0; + } else if ( i >= this.pages.length ) { + i = this.pages.length - 1; + } + + x = this.pages[i][0].x; + } + + if ( m == this.currentPage.pageY ) { + m += this.directionY; + + if ( m < 0 ) { + m = 0; + } else if ( m >= this.pages[0].length ) { + m = this.pages[0].length - 1; + } + + y = this.pages[0][m].y; + } + + return { + x: x, + y: y, + pageX: i, + pageY: m + }; + }, + + goToPage: function (x, y, time, easing) { + easing = easing || this.options.bounceEasing; + + if ( x >= this.pages.length ) { + x = this.pages.length - 1; + } else if ( x < 0 ) { + x = 0; + } + + if ( y >= this.pages[x].length ) { + y = this.pages[x].length - 1; + } else if ( y < 0 ) { + y = 0; + } + + var posX = this.pages[x][y].x, + posY = this.pages[x][y].y; + + time = time === undefined ? this.options.snapSpeed || Math.max( + Math.max( + Math.min(Math.abs(posX - this.x), 1000), + Math.min(Math.abs(posY - this.y), 1000) + ), 300) : time; + + this.currentPage = { + x: posX, + y: posY, + pageX: x, + pageY: y + }; + + this.scrollTo(posX, posY, time, easing); + }, + + next: function (time, easing) { + var x = this.currentPage.pageX, + y = this.currentPage.pageY; + + x++; + + if ( x >= this.pages.length && this.hasVerticalScroll ) { + x = 0; + y++; + } + + this.goToPage(x, y, time, easing); + }, + + prev: function (time, easing) { + var x = this.currentPage.pageX, + y = this.currentPage.pageY; + + x--; + + if ( x < 0 && this.hasVerticalScroll ) { + x = 0; + y--; + } + + this.goToPage(x, y, time, easing); + }, + + _initKeys: function (e) { + // default key bindings + var keys = { + pageUp: 33, + pageDown: 34, + end: 35, + home: 36, + left: 37, + up: 38, + right: 39, + down: 40 + }; + var i; + + // if you give me characters I give you keycode + if ( typeof this.options.keyBindings == 'object' ) { + for ( i in this.options.keyBindings ) { + if ( typeof this.options.keyBindings[i] == 'string' ) { + this.options.keyBindings[i] = this.options.keyBindings[i].toUpperCase().charCodeAt(0); + } + } + } else { + this.options.keyBindings = {}; + } + + for ( i in keys ) { + this.options.keyBindings[i] = this.options.keyBindings[i] || keys[i]; + } + + utils.addEvent(window, 'keydown', this); + + this.on('destroy', function () { + utils.removeEvent(window, 'keydown', this); + }); + }, + + _key: function (e) { + if ( !this.enabled ) { + return; + } + + var snap = this.options.snap, // we are using this alot, better to cache it + newX = snap ? this.currentPage.pageX : this.x, + newY = snap ? this.currentPage.pageY : this.y, + now = utils.getTime(), + prevTime = this.keyTime || 0, + acceleration = 0.250, + pos; + + if ( this.options.useTransition && this.isInTransition ) { + pos = this.getComputedPosition(); + + this._translate(Math.round(pos.x), Math.round(pos.y)); + this.isInTransition = false; + } + + this.keyAcceleration = now - prevTime < 200 ? Math.min(this.keyAcceleration + acceleration, 50) : 0; + + switch ( e.keyCode ) { + case this.options.keyBindings.pageUp: + if ( this.hasHorizontalScroll && !this.hasVerticalScroll ) { + newX += snap ? 1 : this.wrapperWidth; + } else { + newY += snap ? 1 : this.wrapperHeight; + } + break; + case this.options.keyBindings.pageDown: + if ( this.hasHorizontalScroll && !this.hasVerticalScroll ) { + newX -= snap ? 1 : this.wrapperWidth; + } else { + newY -= snap ? 1 : this.wrapperHeight; + } + break; + case this.options.keyBindings.end: + newX = snap ? this.pages.length-1 : this.maxScrollX; + newY = snap ? this.pages[0].length-1 : this.maxScrollY; + break; + case this.options.keyBindings.home: + newX = 0; + newY = 0; + break; + case this.options.keyBindings.left: + newX += snap ? -1 : 5 + this.keyAcceleration>>0; + break; + case this.options.keyBindings.up: + newY += snap ? 1 : 5 + this.keyAcceleration>>0; + break; + case this.options.keyBindings.right: + newX -= snap ? -1 : 5 + this.keyAcceleration>>0; + break; + case this.options.keyBindings.down: + newY -= snap ? 1 : 5 + this.keyAcceleration>>0; + break; + default: + return; + } + + if ( snap ) { + this.goToPage(newX, newY); + return; + } + + if ( newX > 0 ) { + newX = 0; + this.keyAcceleration = 0; + } else if ( newX < this.maxScrollX ) { + newX = this.maxScrollX; + this.keyAcceleration = 0; + } + + if ( newY > 0 ) { + newY = 0; + this.keyAcceleration = 0; + } else if ( newY < this.maxScrollY ) { + newY = this.maxScrollY; + this.keyAcceleration = 0; + } + + this.scrollTo(newX, newY, 0); + + this.keyTime = now; + }, + + _animate: function (destX, destY, duration, easingFn) { + var that = this, + startX = this.x, + startY = this.y, + startTime = utils.getTime(), + destTime = startTime + duration; + + function step () { + var now = utils.getTime(), + newX, newY, + easing; + + if ( now >= destTime ) { + that.isAnimating = false; + that._translate(destX, destY); + + if ( !that.resetPosition(that.options.bounceTime) ) { + that._execEvent('scrollEnd'); + } + + return; + } + + now = ( now - startTime ) / duration; + easing = easingFn(now); + newX = ( destX - startX ) * easing + startX; + newY = ( destY - startY ) * easing + startY; + that._translate(newX, newY); + + if ( that.isAnimating ) { + rAF(step); + } + } + + this.isAnimating = true; + step(); + }, + handleEvent: function (e) { + switch ( e.type ) { + case 'touchstart': + case 'pointerdown': + case 'MSPointerDown': + case 'mousedown': + this._start(e); + break; + case 'touchmove': + case 'pointermove': + case 'MSPointerMove': + case 'mousemove': + this._move(e); + break; + case 'touchend': + case 'pointerup': + case 'MSPointerUp': + case 'mouseup': + case 'touchcancel': + case 'pointercancel': + case 'MSPointerCancel': + case 'mousecancel': + this._end(e); + break; + case 'orientationchange': + case 'resize': + this._resize(); + break; + case 'transitionend': + case 'webkitTransitionEnd': + case 'oTransitionEnd': + case 'MSTransitionEnd': + this._transitionEnd(e); + break; + case 'wheel': + case 'DOMMouseScroll': + case 'mousewheel': + this._wheel(e); + break; + case 'keydown': + this._key(e); + break; + case 'click': + if ( this.enabled && !e._constructed ) { + e.preventDefault(); + e.stopPropagation(); + } + break; + } + } +}; +function createDefaultScrollbar (direction, interactive, type) { + var scrollbar = document.createElement('div'), + indicator = document.createElement('div'); + + if ( type === true ) { + scrollbar.style.cssText = 'position:absolute;z-index:9999'; + indicator.style.cssText = '-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px'; + } + + indicator.className = 'iScrollIndicator'; + + if ( direction == 'h' ) { + if ( type === true ) { + scrollbar.style.cssText += ';height:7px;left:2px;right:2px;bottom:0'; + indicator.style.height = '100%'; + } + scrollbar.className = 'iScrollHorizontalScrollbar'; + } else { + if ( type === true ) { + scrollbar.style.cssText += ';width:7px;bottom:2px;top:2px;right:1px'; + indicator.style.width = '100%'; + } + scrollbar.className = 'iScrollVerticalScrollbar'; + } + + scrollbar.style.cssText += ';overflow:hidden'; + + if ( !interactive ) { + scrollbar.style.pointerEvents = 'none'; + } + + scrollbar.appendChild(indicator); + + return scrollbar; +} + +function Indicator (scroller, options) { + this.wrapper = typeof options.el == 'string' ? document.querySelector(options.el) : options.el; + this.wrapperStyle = this.wrapper.style; + this.indicator = this.wrapper.children[0]; + this.indicatorStyle = this.indicator.style; + this.scroller = scroller; + + this.options = { + listenX: true, + listenY: true, + interactive: false, + resize: true, + defaultScrollbars: false, + shrink: false, + fade: false, + speedRatioX: 0, + speedRatioY: 0 + }; + + for ( var i in options ) { + this.options[i] = options[i]; + } + + this.sizeRatioX = 1; + this.sizeRatioY = 1; + this.maxPosX = 0; + this.maxPosY = 0; + + if ( this.options.interactive ) { + if ( !this.options.disableTouch ) { + utils.addEvent(this.indicator, 'touchstart', this); + utils.addEvent(window, 'touchend', this); + } + if ( !this.options.disablePointer ) { + utils.addEvent(this.indicator, utils.prefixPointerEvent('pointerdown'), this); + utils.addEvent(window, utils.prefixPointerEvent('pointerup'), this); + } + if ( !this.options.disableMouse ) { + utils.addEvent(this.indicator, 'mousedown', this); + utils.addEvent(window, 'mouseup', this); + } + } + + if ( this.options.fade ) { + this.wrapperStyle[utils.style.transform] = this.scroller.translateZ; + var durationProp = utils.style.transitionDuration; + if(!durationProp) { + return; + } + this.wrapperStyle[durationProp] = utils.isBadAndroid ? '0.0001ms' : '0ms'; + // remove 0.0001ms + var self = this; + if(utils.isBadAndroid) { + rAF(function() { + if(self.wrapperStyle[durationProp] === '0.0001ms') { + self.wrapperStyle[durationProp] = '0s'; + } + }); + } + this.wrapperStyle.opacity = '0'; + } +} + +Indicator.prototype = { + handleEvent: function (e) { + switch ( e.type ) { + case 'touchstart': + case 'pointerdown': + case 'MSPointerDown': + case 'mousedown': + this._start(e); + break; + case 'touchmove': + case 'pointermove': + case 'MSPointerMove': + case 'mousemove': + this._move(e); + break; + case 'touchend': + case 'pointerup': + case 'MSPointerUp': + case 'mouseup': + case 'touchcancel': + case 'pointercancel': + case 'MSPointerCancel': + case 'mousecancel': + this._end(e); + break; + } + }, + + destroy: function () { + if ( this.options.fadeScrollbars ) { + clearTimeout(this.fadeTimeout); + this.fadeTimeout = null; + } + if ( this.options.interactive ) { + utils.removeEvent(this.indicator, 'touchstart', this); + utils.removeEvent(this.indicator, utils.prefixPointerEvent('pointerdown'), this); + utils.removeEvent(this.indicator, 'mousedown', this); + + utils.removeEvent(window, 'touchmove', this); + utils.removeEvent(window, utils.prefixPointerEvent('pointermove'), this); + utils.removeEvent(window, 'mousemove', this); + + utils.removeEvent(window, 'touchend', this); + utils.removeEvent(window, utils.prefixPointerEvent('pointerup'), this); + utils.removeEvent(window, 'mouseup', this); + } + + if ( this.options.defaultScrollbars ) { + this.wrapper.parentNode.removeChild(this.wrapper); + } + }, + + _start: function (e) { + var point = e.touches ? e.touches[0] : e; + + e.preventDefault(); + e.stopPropagation(); + + this.transitionTime(); + + this.initiated = true; + this.moved = false; + this.lastPointX = point.pageX; + this.lastPointY = point.pageY; + + this.startTime = utils.getTime(); + + if ( !this.options.disableTouch ) { + utils.addEvent(window, 'touchmove', this); + } + if ( !this.options.disablePointer ) { + utils.addEvent(window, utils.prefixPointerEvent('pointermove'), this); + } + if ( !this.options.disableMouse ) { + utils.addEvent(window, 'mousemove', this); + } + + this.scroller._execEvent('beforeScrollStart'); + }, + + _move: function (e) { + var point = e.touches ? e.touches[0] : e, + deltaX, deltaY, + newX, newY, + timestamp = utils.getTime(); + + if ( !this.moved ) { + this.scroller._execEvent('scrollStart'); + } + + this.moved = true; + + deltaX = point.pageX - this.lastPointX; + this.lastPointX = point.pageX; + + deltaY = point.pageY - this.lastPointY; + this.lastPointY = point.pageY; + + newX = this.x + deltaX; + newY = this.y + deltaY; + + this._pos(newX, newY); + +// INSERT POINT: indicator._move + + e.preventDefault(); + e.stopPropagation(); + }, + + _end: function (e) { + if ( !this.initiated ) { + return; + } + + this.initiated = false; + + e.preventDefault(); + e.stopPropagation(); + + utils.removeEvent(window, 'touchmove', this); + utils.removeEvent(window, utils.prefixPointerEvent('pointermove'), this); + utils.removeEvent(window, 'mousemove', this); + + if ( this.scroller.options.snap ) { + var snap = this.scroller._nearestSnap(this.scroller.x, this.scroller.y); + + var time = this.options.snapSpeed || Math.max( + Math.max( + Math.min(Math.abs(this.scroller.x - snap.x), 1000), + Math.min(Math.abs(this.scroller.y - snap.y), 1000) + ), 300); + + if ( this.scroller.x != snap.x || this.scroller.y != snap.y ) { + this.scroller.directionX = 0; + this.scroller.directionY = 0; + this.scroller.currentPage = snap; + this.scroller.scrollTo(snap.x, snap.y, time, this.scroller.options.bounceEasing); + } + } + + if ( this.moved ) { + this.scroller._execEvent('scrollEnd'); + } + }, + + transitionTime: function (time) { + time = time || 0; + var durationProp = utils.style.transitionDuration; + if(!durationProp) { + return; + } + + this.indicatorStyle[durationProp] = time + 'ms'; + + if ( !time && utils.isBadAndroid ) { + this.indicatorStyle[durationProp] = '0.0001ms'; + // remove 0.0001ms + var self = this; + rAF(function() { + if(self.indicatorStyle[durationProp] === '0.0001ms') { + self.indicatorStyle[durationProp] = '0s'; + } + }); + } + }, + + transitionTimingFunction: function (easing) { + this.indicatorStyle[utils.style.transitionTimingFunction] = easing; + }, + + refresh: function () { + this.transitionTime(); + + if ( this.options.listenX && !this.options.listenY ) { + this.indicatorStyle.display = this.scroller.hasHorizontalScroll ? 'block' : 'none'; + } else if ( this.options.listenY && !this.options.listenX ) { + this.indicatorStyle.display = this.scroller.hasVerticalScroll ? 'block' : 'none'; + } else { + this.indicatorStyle.display = this.scroller.hasHorizontalScroll || this.scroller.hasVerticalScroll ? 'block' : 'none'; + } + + if ( this.scroller.hasHorizontalScroll && this.scroller.hasVerticalScroll ) { + utils.addClass(this.wrapper, 'iScrollBothScrollbars'); + utils.removeClass(this.wrapper, 'iScrollLoneScrollbar'); + + if ( this.options.defaultScrollbars && this.options.customStyle ) { + if ( this.options.listenX ) { + this.wrapper.style.right = '8px'; + } else { + this.wrapper.style.bottom = '8px'; + } + } + } else { + utils.removeClass(this.wrapper, 'iScrollBothScrollbars'); + utils.addClass(this.wrapper, 'iScrollLoneScrollbar'); + + if ( this.options.defaultScrollbars && this.options.customStyle ) { + if ( this.options.listenX ) { + this.wrapper.style.right = '2px'; + } else { + this.wrapper.style.bottom = '2px'; + } + } + } + + var r = this.wrapper.offsetHeight; // force refresh + + if ( this.options.listenX ) { + this.wrapperWidth = this.wrapper.clientWidth; + if ( this.options.resize ) { + this.indicatorWidth = Math.max(Math.round(this.wrapperWidth * this.wrapperWidth / (this.scroller.scrollerWidth || this.wrapperWidth || 1)), 8); + this.indicatorStyle.width = this.indicatorWidth + 'px'; + } else { + this.indicatorWidth = this.indicator.clientWidth; + } + + this.maxPosX = this.wrapperWidth - this.indicatorWidth; + + if ( this.options.shrink == 'clip' ) { + this.minBoundaryX = -this.indicatorWidth + 8; + this.maxBoundaryX = this.wrapperWidth - 8; + } else { + this.minBoundaryX = 0; + this.maxBoundaryX = this.maxPosX; + } + + this.sizeRatioX = this.options.speedRatioX || (this.scroller.maxScrollX && (this.maxPosX / this.scroller.maxScrollX)); + } + + if ( this.options.listenY ) { + this.wrapperHeight = this.wrapper.clientHeight; + if ( this.options.resize ) { + this.indicatorHeight = Math.max(Math.round(this.wrapperHeight * this.wrapperHeight / (this.scroller.scrollerHeight || this.wrapperHeight || 1)), 8); + this.indicatorStyle.height = this.indicatorHeight + 'px'; + } else { + this.indicatorHeight = this.indicator.clientHeight; + } + + this.maxPosY = this.wrapperHeight - this.indicatorHeight; + + if ( this.options.shrink == 'clip' ) { + this.minBoundaryY = -this.indicatorHeight + 8; + this.maxBoundaryY = this.wrapperHeight - 8; + } else { + this.minBoundaryY = 0; + this.maxBoundaryY = this.maxPosY; + } + + this.maxPosY = this.wrapperHeight - this.indicatorHeight; + this.sizeRatioY = this.options.speedRatioY || (this.scroller.maxScrollY && (this.maxPosY / this.scroller.maxScrollY)); + } + + this.updatePosition(); + }, + + updatePosition: function () { + var x = this.options.listenX && Math.round(this.sizeRatioX * this.scroller.x) || 0, + y = this.options.listenY && Math.round(this.sizeRatioY * this.scroller.y) || 0; + + if ( !this.options.ignoreBoundaries ) { + if ( x < this.minBoundaryX ) { + if ( this.options.shrink == 'scale' ) { + this.width = Math.max(this.indicatorWidth + x, 8); + this.indicatorStyle.width = this.width + 'px'; + } + x = this.minBoundaryX; + } else if ( x > this.maxBoundaryX ) { + if ( this.options.shrink == 'scale' ) { + this.width = Math.max(this.indicatorWidth - (x - this.maxPosX), 8); + this.indicatorStyle.width = this.width + 'px'; + x = this.maxPosX + this.indicatorWidth - this.width; + } else { + x = this.maxBoundaryX; + } + } else if ( this.options.shrink == 'scale' && this.width != this.indicatorWidth ) { + this.width = this.indicatorWidth; + this.indicatorStyle.width = this.width + 'px'; + } + + if ( y < this.minBoundaryY ) { + if ( this.options.shrink == 'scale' ) { + this.height = Math.max(this.indicatorHeight + y * 3, 8); + this.indicatorStyle.height = this.height + 'px'; + } + y = this.minBoundaryY; + } else if ( y > this.maxBoundaryY ) { + if ( this.options.shrink == 'scale' ) { + this.height = Math.max(this.indicatorHeight - (y - this.maxPosY) * 3, 8); + this.indicatorStyle.height = this.height + 'px'; + y = this.maxPosY + this.indicatorHeight - this.height; + } else { + y = this.maxBoundaryY; + } + } else if ( this.options.shrink == 'scale' && this.height != this.indicatorHeight ) { + this.height = this.indicatorHeight; + this.indicatorStyle.height = this.height + 'px'; + } + } + + this.x = x; + this.y = y; + + if ( this.scroller.options.useTransform ) { + this.indicatorStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.scroller.translateZ; + } else { + this.indicatorStyle.left = x + 'px'; + this.indicatorStyle.top = y + 'px'; + } + }, + + _pos: function (x, y) { + if ( x < 0 ) { + x = 0; + } else if ( x > this.maxPosX ) { + x = this.maxPosX; + } + + if ( y < 0 ) { + y = 0; + } else if ( y > this.maxPosY ) { + y = this.maxPosY; + } + + x = this.options.listenX ? Math.round(x / this.sizeRatioX) : this.scroller.x; + y = this.options.listenY ? Math.round(y / this.sizeRatioY) : this.scroller.y; + + this.scroller.scrollTo(x, y); + }, + + fade: function (val, hold) { + if ( hold && !this.visible ) { + return; + } + + clearTimeout(this.fadeTimeout); + this.fadeTimeout = null; + + var time = val ? 250 : 500, + delay = val ? 0 : 300; + + val = val ? '1' : '0'; + + this.wrapperStyle[utils.style.transitionDuration] = time + 'ms'; + + this.fadeTimeout = setTimeout((function (val) { + this.wrapperStyle.opacity = val; + this.visible = +val; + }).bind(this, val), delay); + } +}; + +IScroll.utils = utils; + +if ( typeof module != 'undefined' && module.exports ) { + module.exports = IScroll; +} else if ( typeof define == 'function' && define.amd ) { + define( function () { return IScroll; } ); + + //making sure scrollOverflow works when using Require.js + //in the browser + if(typeof window !== 'undefined'){ + window.IScroll = IScroll; + } +} else { + window.IScroll = IScroll; +} + +})(window, document, Math); + + +/*! +* Scrolloverflow 2.0.7 module for fullPage.js >= 3 +* https://github.com/alvarotrigo/fullPage.js +* @license MIT licensed +* +* Copyright (C) 2015 alvarotrigo.com - A project by Alvaro Trigo +*/ +(function (window, document) { + window.fp_scrolloverflow = (function() { + + // check if IScroll is available in global scope + if (!window.IScroll) { + // otherwise create local one from module.exports + window.IScroll = module.exports; + } + + // keeping central set of classnames and selectors + var SCROLLABLE = 'fp-scrollable'; + var SCROLLABLE_SEL = '.' + SCROLLABLE; + + var ACTIVE = 'active'; + var ACTIVE_SEL = '.' + ACTIVE; + + var SECTION = 'fp-section'; + var SECTION_SEL = '.' + SECTION; + var SECTION_ACTIVE_SEL = SECTION_SEL + ACTIVE_SEL; + + var SLIDE = 'fp-slide'; + var SLIDE_SEL = '.' + SLIDE; + var SLIDE_ACTIVE_SEL = SLIDE_SEL + ACTIVE_SEL; + + var SLIDES_WRAPPER = 'fp-slides'; + var SLIDES_WRAPPER_SEL = '.' + SLIDES_WRAPPER; + + var TABLE_CELL = 'fp-tableCell'; + var TABLE_CELL_SEL = '.' + TABLE_CELL; + + var RESPONSIVE = 'fp-responsive'; + var AUTO_HEIGHT_RESPONSIVE= 'fp-auto-height-responsive'; + + /* + * Turns iScroll `mousewheel` option off dynamically + * https://github.com/cubiq/iscroll/issues/1036 + */ + IScroll.prototype.wheelOn = function () { + this.wrapper.addEventListener('wheel', this); + this.wrapper.addEventListener('mousewheel', this); + this.wrapper.addEventListener('DOMMouseScroll', this); + }; + + /* + * Turns iScroll `mousewheel` option on dynamically + * https://github.com/cubiq/iscroll/issues/1036 + */ + IScroll.prototype.wheelOff = function () { + this.wrapper.removeEventListener('wheel', this); + this.wrapper.removeEventListener('mousewheel', this); + this.wrapper.removeEventListener('DOMMouseScroll', this); + }; + + /** + * Returns an integer representing the padding dimensions in px. + */ + function getPaddings(element){ + var section = fp_utils.closest(element, SECTION_SEL); + if(section != null){ + return parseInt(getComputedStyle(section)['padding-bottom']) + parseInt(getComputedStyle(section)['padding-top']); + } + return 0; + } + + function scrollBarHandler(){ + var self = this; + self.options = null; + + self.init = function(options, iscrollOptions){ + self.options = options; + self.iscrollOptions = iscrollOptions; + + if(document.readyState === 'complete'){ + createScrollBarForAll(); + fullpage_api.shared.afterRenderActions(); + } + //after DOM and images are loaded + window.addEventListener('load', function(){ + createScrollBarForAll(); + fullpage_api.shared.afterRenderActions(); + }); + + return self; + }; + + /** + * Creates the scrollbar for the sections and slides in the site + */ + function createScrollBarForAll(){ + if(fp_utils.hasClass(document.body, RESPONSIVE)){ + forEachSectionAndSlide(removeScrollBar); + } + else{ + forEachSectionAndSlide(createScrollBar); + } + } + + /** + * Checks if the element needs scrollbar and if the user wants to apply it. + * If so it creates it. + * + * @param {Object} element jQuery object of the section or slide + */ + function createScrollBar(element){ + //User doesn't want scrollbar here? Sayonara baby! + if(fp_utils.hasClass(element, 'fp-noscroll')) return; + + //necessary to make `scrollHeight` work under Opera 12 + fp_utils.css(element, {'overflow': 'hidden'}); + + var scrollOverflowHandler = self.options.scrollOverflowHandler; + var wrap = scrollOverflowHandler.wrapContent(); + var section = fp_utils.closest(element, SECTION_SEL); //in case element is a slide + var scrollable = scrollOverflowHandler.scrollable(element); + var contentHeight; + var paddings = getPaddings(section); + + //if there was scroll, the contentHeight will be the one in the scrollable section + if(scrollable != null){ + contentHeight = scrollOverflowHandler.scrollHeight(element); + } + else{ + contentHeight = element.scrollHeight; + if(self.options.verticalCentered){ + contentHeight = $(TABLE_CELL_SEL, element)[0].scrollHeight; + } + } + + var scrollHeight = fp_utils.getWindowHeight(); + var contentHeightWidthPaddings = contentHeight + paddings; + var scrollHeightWidthoutPaddings = scrollHeight - paddings; + + //needs scroll? + if ( contentHeightWidthPaddings > scrollHeight) { + //did we already have an scrollbar ? Updating it + if(scrollable != null){ + scrollOverflowHandler.update(element, scrollHeightWidthoutPaddings); + } + //creating the scrolling + else{ + if(self.options.verticalCentered){ + fp_utils.wrapInner($(TABLE_CELL_SEL, element)[0], wrap.scroller); + fp_utils.wrapInner($(TABLE_CELL_SEL, element)[0], wrap.scrollable); + }else{ + fp_utils.wrapInner(element, wrap.scroller); + fp_utils.wrapInner(element, wrap.scrollable); + } + scrollOverflowHandler.create(element, scrollHeightWidthoutPaddings, self.iscrollOptions); + } + } + + //removing the scrolling when it is not necessary anymore + else{ + scrollOverflowHandler.remove(element); + } + + //undo + fp_utils.css(element, {'overflow': ''}); + } + + /** + * Applies a callback function to each section in the site + * or the slides within them + */ + function forEachSectionAndSlide(callback){ + $(SECTION_SEL).forEach(function(section){ + var slides = $(SLIDE_SEL, section); + + if(slides.length){ + slides.forEach(function(slide){ + callback(slide); + }); + }else{ + callback(section); + } + }); + } + + /** + * Removes scrollOverflow for sections using the class `fp-auto-height-responsive` + */ + function removeScrollBar(element){ + var scrollOverflowHandler = self.options.scrollOverflowHandler; + if(fp_utils.hasClass( fp_utils.closest(element, SECTION_SEL), AUTO_HEIGHT_RESPONSIVE)){ + scrollOverflowHandler.remove(element); + } + } + + //public functions + self.createScrollBarForAll = createScrollBarForAll; + self.createScrollBar = createScrollBar; + } + + /** + * An object to handle overflow scrolling. + * This uses jquery.slimScroll to accomplish overflow scrolling. + * It is possible to pass in an alternate scrollOverflowHandler + * to the fullpage.js option that implements the same functions + * as this handler. + * + * @type {Object} + */ + var $ = null; + var g_fullpageOptions = null; + var iscrollHandler = { + refreshId: null, + iScrollInstances: [], + lastScrollY: null, + hasBeenInit: false, + + // Default options for iScroll.js used when using scrollOverflow + iscrollOptions: { + scrollbars: true, + mouseWheel: true, + hideScrollbars: false, + fadeScrollbars: false, + disableMouse: true, + interactiveScrollbars: true + }, + + init: function(options){ + $ = fp_utils.$; + g_fullpageOptions = options; + + var isTouch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0) || (navigator.maxTouchPoints)); + + //fixing bug in iScroll with links: https://github.com/cubiq/iscroll/issues/783 + iscrollHandler.iscrollOptions.click = isTouch; // see #2035 + + iscrollHandler.hasBeenInit = true; + + //extending iScroll options with the user custom ones + iscrollHandler.iscrollOptions = fp_utils.deepExtend(iscrollHandler.iscrollOptions, options.scrollOverflowOptions); + + return new scrollBarHandler().init(options, iscrollHandler.iscrollOptions); + }, + + // Enables or disables the mouse wheel for the active section or all slides in it + toggleWheel: function(value){ + var scrollable = $(SCROLLABLE_SEL, $(SECTION_ACTIVE_SEL)[0]); + scrollable.forEach(function(item){ + var iScrollInstance = item.fp_iscrollInstance; + if(iScrollInstance != null){ + if(value){ + iScrollInstance.wheelOn(); + } + else{ + iScrollInstance.wheelOff(); + } + } + }); + }, + + // Enables or disables the whole iScroll feature based on the given parameter. + setIscroll: function(target, enable){ + if(!iscrollHandler.hasBeenInit || !target){ + return; + } + var scrollable = fp_utils.closest(target, SCROLLABLE_SEL) || ($(SCROLLABLE_SEL, target) && $(SCROLLABLE_SEL, target)[0]); + var action = enable ? 'enable' : 'disable'; + + if(scrollable){ + scrollable.fp_iscrollInstance[action](); + } + }, + + /** + * Turns off iScroll for the destination section. + * When scrolling very fast on some trackpads (and Apple laptops) the inertial scrolling would + * scroll the destination section/slide before the sections animations ends. + */ + onLeave: function(){ + iscrollHandler.toggleWheel(false); + }, + + // Turns off iScroll for the leaving section + beforeLeave: function(){ + iscrollHandler.onLeave() + }, + + // Turns on iScroll on section load + afterLoad: function(){ + iscrollHandler.toggleWheel(true); + }, + + /** + * Called when overflow scrolling is needed for a section. + * + * @param {Object} element jQuery object containing current section + * @param {Number} scrollHeight Current window height in pixels + */ + create: function(element, scrollHeight, iscrollOptions) { + var scrollable = $(SCROLLABLE_SEL, element); + + scrollable.forEach(function(item) { + fp_utils.css(item, {'height': scrollHeight + 'px'}); + + var iScrollInstance = item.fp_iscrollInstance; + if (iScrollInstance != null) { + iscrollHandler.iScrollInstances.forEach(function(instance){ + instance.destroy(); + }); + } + + iScrollInstance = new IScroll(item, iscrollOptions); + iscrollHandler.iScrollInstances.push(iScrollInstance); + + if(!fp_utils.hasClass(fp_utils.closest(element, SECTION_SEL), ACTIVE)){ + //off by default until the section gets active + iScrollInstance.wheelOff(); + } + + item.fp_iscrollInstance = iScrollInstance; + }); + }, + + /** + * Return a boolean depending on whether the scrollable element is a + * the end or at the start of the scrolling depending on the given type. + * + * @param {String} type Either 'top' or 'bottom' + * @param {Object} scrollable jQuery object for the scrollable element + * @return {Boolean} + */ + isScrolled: function(type, scrollable) { + var scroller = scrollable.fp_iscrollInstance; + + //no scroller? + if (!scroller) { + return true; + } + + // two times reporting the same Y position ? + // that means we are on the top or on the bottom of the scroller + + if (type === 'top'){ + return scroller.y >= 0; + } else if (type === 'bottom') { + + // Checking the same position twice? We are at the very bottom (at least on Desktop) + var isDoubleChecking = iscrollHandler.lastScrollY === scroller.y; + iscrollHandler.lastScrollY = scroller.y; + + // An offset of 1px is required for IE / Edge to work + var offset = isDoubleChecking ? 1 : 0; + + return offset + (0 - scroller.y) + scrollable.offsetHeight >= scrollable.scrollHeight; + } + }, + + /** + * Returns the scrollable element for the given section. + * If there are landscape slides, will only return a scrollable element + * if it is in the active slide. + * + * @param {Object} activeSection jQuery object containing current section + * @return {Boolean} + */ + scrollable: function(activeSection){ + // if there are landscape slides, we check if the scrolling bar is in the current one or not + if ($(SLIDES_WRAPPER_SEL, activeSection).length) { + return $(SCROLLABLE_SEL, $(SLIDE_ACTIVE_SEL, activeSection)[0] )[0]; + } + return $(SCROLLABLE_SEL, activeSection)[0]; + }, + + /** + * Returns the scroll height of the wrapped content. + * If this is larger than the window height minus section padding, + * overflow scrolling is needed. + * + * @param {Object} element jQuery object containing current section + * @return {Number} + */ + scrollHeight: function(element) { + return $('.fp-scroller', $(SCROLLABLE_SEL, element)[0] )[0].scrollHeight; + }, + + /** + * Called when overflow scrolling is no longer needed for a section. + * + * @param {Object} element jQuery object containing current section + */ + remove: function(element) { + if(element == null) return; + + var scrollable = $(SCROLLABLE_SEL, element)[0]; + if (scrollable != null) { + var iScrollInstance = scrollable.fp_iscrollInstance; + if(iScrollInstance != null){ + iScrollInstance.destroy(); + } + + scrollable.fp_iscrollInstance = null; + + //unwrapping... + fp_utils.unwrap($('.fp-scroller', element)[0]); + fp_utils.unwrap($(SCROLLABLE_SEL, element)[0]); + } + }, + + /** + * Called when overflow scrolling has already been setup but the + * window height has potentially changed. + * + * @param {Object} element jQuery object containing current section + * @param {Number} scrollHeight Current window height in pixels + */ + update: function(element, scrollHeight) { + //using a timeout in order to execute the refresh function only once when `update` is called multiple times in a + //short period of time. + //it also comes on handy because iScroll requires the use of timeout when using `refresh`. + clearTimeout(iscrollHandler.refreshId); + iscrollHandler.refreshId = setTimeout(function(){ + iscrollHandler.iScrollInstances.forEach(function(instance){ + instance.refresh(); + + //ugly hack that we are forced to use due to the timeout delay + //otherwise done on the fullpage.js reBuild function + fullpage_api.silentMoveTo(fp_utils.index($(SECTION_ACTIVE_SEL)[0]) + 1); + }); + }, 150); + + //updating the wrappers height + fp_utils.css($(SCROLLABLE_SEL, element)[0], {'height': scrollHeight + 'px'}); + + if(g_fullpageOptions.verticalCentered){ + fp_utils.css($(SCROLLABLE_SEL, element)[0].parentNode, {'height': scrollHeight + 'px'}); + } + }, + + /** + * Called to get any additional elements needed to wrap the section + * content in order to facilitate overflow scrolling. + * + * @return {String|Object} Can be a string containing HTML, + * a DOM element, or jQuery object. + */ + wrapContent: function() { + var scrollable = document.createElement('div'); + scrollable.className = SCROLLABLE; + + var scroller = document.createElement('div'); + scroller.className = 'fp-scroller'; + + return { + scrollable: scrollable, + scroller: scroller + }; + } + }; + + return { + iscrollHandler: iscrollHandler + }; + })(); +})(window, document); diff --git a/assets/node_modules/fullpage.js/vendors/scrolloverflow.min.js b/assets/node_modules/fullpage.js/vendors/scrolloverflow.min.js new file mode 100755 index 0000000..2c498d0 --- /dev/null +++ b/assets/node_modules/fullpage.js/vendors/scrolloverflow.min.js @@ -0,0 +1,15 @@ +/** +* Customized version of iScroll.js 0.1.3 +* It fixes bugs affecting its integration with fullpage.js +* @license +*/ +!function(r,n,p){var f=r.requestAnimationFrame||r.webkitRequestAnimationFrame||r.mozRequestAnimationFrame||r.oRequestAnimationFrame||r.msRequestAnimationFrame||function(t){r.setTimeout(t,1e3/60)},m=function(){var e={},o=n.createElement("div").style,i=function(){for(var t=["t","webkitT","MozT","msT","OT"],i=0,s=t.length;io+this.options.directionLockThreshold?this.directionLocked="h":o>=e+this.options.directionLockThreshold?this.directionLocked="v":this.directionLocked="n"),"h"==this.directionLocked){if("vertical"==this.options.eventPassthrough)t.preventDefault();else if("horizontal"==this.options.eventPassthrough)return void(this.initiated=!1);h=0}else if("v"==this.directionLocked){if("horizontal"==this.options.eventPassthrough)t.preventDefault();else if("vertical"==this.options.eventPassthrough)return void(this.initiated=!1);r=0}r=this.hasHorizontalScroll?r:0,h=this.hasVerticalScroll?h:0,i=this.x+r,s=this.y+h,(0-this.scrollerWidth;){for(this.pages[r]=[],o=t=0;o>-this.scrollerHeight;)this.pages[r][t]={x:p.max(a,this.maxScrollX),y:p.max(o,this.maxScrollY),width:l,height:c,cx:a-s,cy:o-e},o-=c,t++;a-=l,r++}else for(t=(n=this.options.snap).length,i=-1;rthis.maxScrollX&&h++;this.goToPage(this.currentPage.pageX||0,this.currentPage.pageY||0,0),this.options.snapThreshold%1==0?(this.snapThresholdX=this.options.snapThreshold,this.snapThresholdY=this.options.snapThreshold):(this.snapThresholdX=p.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width*this.options.snapThreshold),this.snapThresholdY=p.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height*this.options.snapThreshold))}}),this.on("flick",function(){var t=this.options.snapSpeed||p.max(p.max(p.min(p.abs(this.x-this.startX),1e3),p.min(p.abs(this.y-this.startY),1e3)),300);this.goToPage(this.currentPage.pageX+this.directionX,this.currentPage.pageY+this.directionY,t)})},_nearestSnap:function(t,i){if(!this.pages.length)return{x:0,y:0,pageX:0,pageY:0};var s=0,e=this.pages.length,o=0;if(p.abs(t-this.absStartX)=this.pages[s][0].cx){t=this.pages[s][0].x;break}for(e=this.pages[s].length;o=this.pages[0][o].cy){i=this.pages[0][o].y;break}return s==this.currentPage.pageX&&((s+=this.directionX)<0?s=0:s>=this.pages.length&&(s=this.pages.length-1),t=this.pages[s][0].x),o==this.currentPage.pageY&&((o+=this.directionY)<0?o=0:o>=this.pages[0].length&&(o=this.pages[0].length-1),i=this.pages[0][o].y),{x:t,y:i,pageX:s,pageY:o}},goToPage:function(t,i,s,e){e=e||this.options.bounceEasing,t>=this.pages.length?t=this.pages.length-1:t<0&&(t=0),i>=this.pages[t].length?i=this.pages[t].length-1:i<0&&(i=0);var o=this.pages[t][i].x,n=this.pages[t][i].y;s=void 0===s?this.options.snapSpeed||p.max(p.max(p.min(p.abs(o-this.x),1e3),p.min(p.abs(n-this.y),1e3)),300):s,this.currentPage={x:o,y:n,pageX:t,pageY:i},this.scrollTo(o,n,s,e)},next:function(t,i){var s=this.currentPage.pageX,e=this.currentPage.pageY;++s>=this.pages.length&&this.hasVerticalScroll&&(s=0,e++),this.goToPage(s,e,t,i)},prev:function(t,i){var s=this.currentPage.pageX,e=this.currentPage.pageY;--s<0&&this.hasVerticalScroll&&(s=0,e--),this.goToPage(s,e,t,i)},_initKeys:function(t){var i,s={pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40};if("object"==typeof this.options.keyBindings)for(i in this.options.keyBindings)"string"==typeof this.options.keyBindings[i]&&(this.options.keyBindings[i]=this.options.keyBindings[i].toUpperCase().charCodeAt(0));else this.options.keyBindings={};for(i in s)this.options.keyBindings[i]=this.options.keyBindings[i]||s[i];m.addEvent(r,"keydown",this),this.on("destroy",function(){m.removeEvent(r,"keydown",this)})},_key:function(t){if(this.enabled){var i,s=this.options.snap,e=s?this.currentPage.pageX:this.x,o=s?this.currentPage.pageY:this.y,n=m.getTime(),r=this.keyTime||0;switch(this.options.useTransition&&this.isInTransition&&(i=this.getComputedPosition(),this._translate(p.round(i.x),p.round(i.y)),this.isInTransition=!1),this.keyAcceleration=n-r<200?p.min(this.keyAcceleration+.25,50):0,t.keyCode){case this.options.keyBindings.pageUp:this.hasHorizontalScroll&&!this.hasVerticalScroll?e+=s?1:this.wrapperWidth:o+=s?1:this.wrapperHeight;break;case this.options.keyBindings.pageDown:this.hasHorizontalScroll&&!this.hasVerticalScroll?e-=s?1:this.wrapperWidth:o-=s?1:this.wrapperHeight;break;case this.options.keyBindings.end:e=s?this.pages.length-1:this.maxScrollX,o=s?this.pages[0].length-1:this.maxScrollY;break;case this.options.keyBindings.home:o=e=0;break;case this.options.keyBindings.left:e+=s?-1:5+this.keyAcceleration>>0;break;case this.options.keyBindings.up:o+=s?1:5+this.keyAcceleration>>0;break;case this.options.keyBindings.right:e-=s?-1:5+this.keyAcceleration>>0;break;case this.options.keyBindings.down:o-=s?1:5+this.keyAcceleration>>0;break;default:return}s?this.goToPage(e,o):(0this.maxBoundaryX?t="scale"==this.options.shrink?(this.width=p.max(this.indicatorWidth-(t-this.maxPosX),8),this.indicatorStyle.width=this.width+"px",this.maxPosX+this.indicatorWidth-this.width):this.maxBoundaryX:"scale"==this.options.shrink&&this.width!=this.indicatorWidth&&(this.width=this.indicatorWidth,this.indicatorStyle.width=this.width+"px"),ithis.maxBoundaryY?i="scale"==this.options.shrink?(this.height=p.max(this.indicatorHeight-3*(i-this.maxPosY),8),this.indicatorStyle.height=this.height+"px",this.maxPosY+this.indicatorHeight-this.height):this.maxBoundaryY:"scale"==this.options.shrink&&this.height!=this.indicatorHeight&&(this.height=this.indicatorHeight,this.indicatorStyle.height=this.height+"px")),this.x=t,this.y=i,this.scroller.options.useTransform?this.indicatorStyle[m.style.transform]="translate("+t+"px,"+i+"px)"+this.scroller.translateZ:(this.indicatorStyle.left=t+"px",this.indicatorStyle.top=i+"px")},_pos:function(t,i){t<0?t=0:t>this.maxPosX&&(t=this.maxPosX),i<0?i=0:i>this.maxPosY&&(i=this.maxPosY),t=this.options.listenX?p.round(t/this.sizeRatioX):this.scroller.x,i=this.options.listenY?p.round(i/this.sizeRatioY):this.scroller.y,this.scroller.scrollTo(t,i)},fade:function(t,i){if(!i||this.visible){clearTimeout(this.fadeTimeout),this.fadeTimeout=null;var s=t?250:500,e=t?0:300;t=t?"1":"0",this.wrapperStyle[m.style.transitionDuration]=s+"ms",this.fadeTimeout=setTimeout(function(t){this.wrapperStyle.opacity=t,this.visible=+t}.bind(this,t),e)}}},t.utils=m,"undefined"!=typeof module&&module.exports?module.exports=t:"function"==typeof define&&define.amd?(define(function(){return t}),void 0!==r&&(r.IScroll=t)):r.IScroll=t}(window,document,Math), +/*! +* Scrolloverflow 2.0.7 module for fullPage.js >= 3 +* https://github.com/alvarotrigo/fullPage.js +* @license MIT licensed +* +* Copyright (C) 2015 alvarotrigo.com - A project by Alvaro Trigo +*/ +function(l,c){l.fp_scrolloverflow=function(){l.IScroll||(l.IScroll=module.exports);var s="fp-scrollable",n="."+s,t=".active",d=".fp-section",e=d+t,o=".fp-slide",u=".fp-tableCell";function r(){var p=this;function s(){fp_utils.hasClass(c.body,"fp-responsive")?i(e):i(t)}function t(t){if(!fp_utils.hasClass(t,"fp-noscroll")){fp_utils.css(t,{overflow:"hidden"});var i,s,e,o=p.options.scrollOverflowHandler,n=o.wrapContent(),r=fp_utils.closest(t,d),h=o.scrollable(t),a=(s=r,null!=(e=fp_utils.closest(s,d))?parseInt(getComputedStyle(e)["padding-bottom"])+parseInt(getComputedStyle(e)["padding-top"]):0);null!=h?i=o.scrollHeight(t):(i=t.scrollHeight,p.options.verticalCentered&&(i=f(u,t)[0].scrollHeight));var l=fp_utils.getWindowHeight(),c=l-a;l=i.scrollHeight}},scrollable:function(t){return f(".fp-slides",t).length?f(n,f(".fp-slide.active",t)[0])[0]:f(n,t)[0]},scrollHeight:function(t){return f(".fp-scroller",f(n,t)[0])[0].scrollHeight},remove:function(t){if(null!=t){var i=f(n,t)[0];if(null!=i){var s=i.fp_iscrollInstance;null!=s&&s.destroy(),i.fp_iscrollInstance=null,fp_utils.unwrap(f(".fp-scroller",t)[0]),fp_utils.unwrap(f(n,t)[0])}}},update:function(t,i){clearTimeout(a.refreshId),a.refreshId=setTimeout(function(){a.iScrollInstances.forEach(function(t){t.refresh(),fullpage_api.silentMoveTo(fp_utils.index(f(e)[0])+1)})},150),fp_utils.css(f(n,t)[0],{height:i+"px"}),h.verticalCentered&&fp_utils.css(f(n,t)[0].parentNode,{height:i+"px"})},wrapContent:function(){var t=c.createElement("div");t.className=s;var i=c.createElement("div");return i.className="fp-scroller",{scrollable:t,scroller:i}}};return{iscrollHandler:a}}()}(window,document); +//# sourceMappingURL=scrolloverflow.min.js.map diff --git a/assets/node_modules/fullpage.js/vendors/scrolloverflow.min.js.map b/assets/node_modules/fullpage.js/vendors/scrolloverflow.min.js.map new file mode 100644 index 0000000..496962d --- /dev/null +++ b/assets/node_modules/fullpage.js/vendors/scrolloverflow.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["scrolloverflow.js"],"names":["window","document","Math","rAF","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","callback","setTimeout","utils","me","_elementStyle","createElement","style","_vendor","vendors","i","l","length","substr","_prefixStyle","charAt","toUpperCase","getTime","Date","now","extend","target","obj","addEvent","el","type","fn","capture","addEventListener","removeEvent","removeEventListener","prefixPointerEvent","pointerEvent","MSPointerEvent","momentum","current","start","time","lowerMargin","wrapperSize","deceleration","destination","duration","distance","speed","abs","undefined","round","_transform","hasTransform","hasPerspective","hasTouch","hasPointer","PointerEvent","hasTransition","isBadAndroid","appVersion","navigator","test","safariVersion","match","parseFloat","transform","transitionTimingFunction","transitionDuration","transitionDelay","transformOrigin","hasClass","e","c","RegExp","className","addClass","newclass","split","push","join","removeClass","re","replace","offset","left","offsetLeft","top","offsetTop","offsetParent","preventDefaultException","exceptions","eventType","touchstart","touchmove","touchend","mousedown","mousemove","mouseup","pointerdown","pointermove","pointerup","MSPointerDown","MSPointerMove","MSPointerUp","ease","quadratic","k","circular","sqrt","back","bounce","elastic","pow","sin","f","PI","tap","eventName","ev","createEvent","initEvent","pageX","pageY","dispatchEvent","click","tagName","MouseEvent","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","_constructed","IScroll","options","this","wrapper","querySelector","scroller","children","scrollerStyle","resizeScrollbars","mouseWheelSpeed","snapThreshold","disablePointer","disableTouch","disableMouse","startX","startY","scrollY","directionLockThreshold","bounceTime","bounceEasing","preventDefault","HWCompositing","useTransition","useTransform","bindToWrapper","onmousedown","translateZ","eventPassthrough","scrollX","freeScroll","resizePolling","position","shrinkScrollbars","invertWheelDirection","x","y","directionX","directionY","_events","_init","refresh","scrollTo","enable","createDefaultScrollbar","direction","interactive","scrollbar","indicator","cssText","height","width","pointerEvents","appendChild","Indicator","wrapperStyle","indicatorStyle","listenX","listenY","resize","defaultScrollbars","shrink","fade","speedRatioX","speedRatioY","sizeRatioX","sizeRatioY","maxPosX","maxPosY","durationProp","self","opacity","prototype","version","_initEvents","scrollbars","indicators","_initIndicators","mouseWheel","_initWheel","snap","_initSnap","keyBindings","_initKeys","destroy","clearTimeout","resizeTimeout","_execEvent","_transitionEnd","isInTransition","_transitionTime","resetPosition","_start","which","enabled","initiated","pos","point","touches","moved","distX","distY","directionLocked","startTime","getComputedPosition","_translate","isAnimating","absStartX","absStartY","pointX","pointY","_move","newX","newY","absDistX","absDistY","deltaX","deltaY","timestamp","endTime","hasHorizontalScroll","hasVerticalScroll","maxScrollX","maxScrollY","_end","changedTouches","momentumX","momentumY","distanceX","distanceY","easing","flick","wrapperWidth","wrapperHeight","max","_nearestSnap","currentPage","snapSpeed","min","_resize","that","disable","offsetHeight","clientWidth","clientHeight","scrollerWidth","offsetWidth","scrollerHeight","wrapperOffset","on","off","index","indexOf","splice","apply","slice","call","arguments","scrollBy","transitionType","_transitionTimingFunction","_animate","scrollToElement","offsetX","offsetY","nodeType","transitionTime","updatePosition","remove","matrix","getComputedStyle","interactiveScrollbars","customStyle","fadeScrollbars","concat","_indicatorsMap","wheelTimeout","_wheel","userAgent","wheelDeltaX","wheelDeltaY","deltaMode","wheelDelta","goToPage","querySelectorAll","n","cx","cy","m","stepX","snapStepX","stepY","snapStepY","pages","snapThresholdX","snapThresholdY","posX","posY","next","prev","keys","pageUp","pageDown","end","home","up","right","down","charCodeAt","_key","prevTime","keyTime","keyAcceleration","keyCode","destX","destY","easingFn","destTime","step","handleEvent","stopPropagation","fadeTimeout","parentNode","removeChild","lastPointX","lastPointY","_pos","display","bottom","indicatorWidth","minBoundaryX","maxBoundaryX","indicatorHeight","minBoundaryY","maxBoundaryY","ignoreBoundaries","val","hold","visible","delay","bind","module","exports","define","amd","fp_scrolloverflow","SCROLLABLE","SCROLLABLE_SEL","ACTIVE_SEL","SECTION_SEL","SECTION_ACTIVE_SEL","SLIDE_SEL","TABLE_CELL_SEL","scrollBarHandler","createScrollBarForAll","fp_utils","body","forEachSectionAndSlide","removeScrollBar","createScrollBar","element","css","overflow","contentHeight","section","scrollOverflowHandler","wrap","wrapContent","closest","scrollable","paddings","parseInt","scrollHeight","verticalCentered","$","getWindowHeight","scrollHeightWidthoutPaddings","update","wrapInner","create","iscrollOptions","forEach","slides","slide","init","readyState","fullpage_api","shared","afterRenderActions","wheelOn","wheelOff","g_fullpageOptions","iscrollHandler","refreshId","iScrollInstances","lastScrollY","hasBeenInit","hideScrollbars","isTouch","msMaxTouchPoints","deepExtend","scrollOverflowOptions","toggleWheel","value","item","iScrollInstance","fp_iscrollInstance","setIscroll","action","onLeave","beforeLeave","afterLoad","instance","isScrolled","isDoubleChecking","activeSection","unwrap","silentMoveTo"],"mappings":";;;;;CAUA,SAAWA,EAAQC,EAAUC,GAC7B,IAAIC,EAAMH,EAAOI,uBACbJ,EAAOK,6BACPL,EAAOM,0BACPN,EAAOO,wBACPP,EAAOQ,yBACP,SAAUC,GAAYT,EAAOU,WAAWD,EAAU,IAAO,KAEzDE,EAAQ,WACR,IAAIC,EAAK,GAELC,EAAgBZ,EAASa,cAAc,OAAOC,MAC9CC,EAAU,WAMV,IALA,IAAIC,EAAU,CAAC,IAAK,UAAW,OAAQ,MAAO,MAE1CC,EAAI,EACJC,EAAIF,EAAQG,OAERF,EAAIC,EAAGD,IAEX,GADYD,EAAQC,GAAK,aACPL,EAAgB,OAAOI,EAAQC,GAAGG,OAAO,EAAGJ,EAAQC,GAAGE,OAAO,GAGpF,OAAO,EAXG,GAcd,SAASE,EAAcP,GACnB,OAAiB,IAAZC,IACY,KAAZA,EAAwBD,EACtBC,EAAUD,EAAMQ,OAAO,GAAGC,cAAgBT,EAAMM,OAAO,IAGlET,EAAGa,QAAUC,KAAKC,KAAO,WAAsB,OAAO,IAAID,MAAOD,WAEjEb,EAAGgB,OAAS,SAAUC,EAAQC,GAC1B,IAAM,IAAIZ,KAAKY,EACXD,EAAOX,GAAKY,EAAIZ,IAIxBN,EAAGmB,SAAW,SAAUC,EAAIC,EAAMC,EAAIC,GAClCH,EAAGI,iBAAiBH,EAAMC,IAAMC,IAGpCvB,EAAGyB,YAAc,SAAUL,EAAIC,EAAMC,EAAIC,GACrCH,EAAGM,oBAAoBL,EAAMC,IAAMC,IAGvCvB,EAAG2B,mBAAqB,SAAUC,GAC9B,OAAOxC,EAAOyC,eACV,YAAcD,EAAajB,OAAO,GAAGC,cAAgBgB,EAAanB,OAAO,GACzEmB,GAGR5B,EAAG8B,SAAW,SAAUC,EAASC,EAAOC,EAAMC,EAAaC,EAAaC,GAC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9U,UAAYuT,EAEvB,IAAIhP,EAAWrJ,EAASa,cAAc,OAGtC,OAFAwI,EAASvE,UAAY,cAEd,CACH8U,WAAYA,EACZvQ,SAAUA,KAKtB,MAAO,CACH8R,eAAgBA,GApcG,GAD/B,CAwcGpb,OAAQC","file":"scrolloverflow.min.js","sourcesContent":["/*!\n* Scrolloverflow 2.0.7 module for fullPage.js >= 3\n* https://github.com/alvarotrigo/fullPage.js\n*/\n/**\n* Customized version of iScroll.js 0.1.3\n* It fixes bugs affecting its integration with fullpage.js\n* @license\n*/\n/*! iScroll v5.2.0 ~ (c) 2008-2016 Matteo Spinelli ~ http://cubiq.org/license */\n(function (window, document, Math) {\nvar rAF = window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.oRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n function (callback) { window.setTimeout(callback, 1000 / 60); };\n\nvar utils = (function () {\n var me = {};\n\n var _elementStyle = document.createElement('div').style;\n var _vendor = (function () {\n var vendors = ['t', 'webkitT', 'MozT', 'msT', 'OT'],\n transform,\n i = 0,\n l = vendors.length;\n\n for ( ; i < l; i++ ) {\n transform = vendors[i] + 'ransform';\n if ( transform in _elementStyle ) return vendors[i].substr(0, vendors[i].length-1);\n }\n\n return false;\n })();\n\n function _prefixStyle (style) {\n if ( _vendor === false ) return false;\n if ( _vendor === '' ) return style;\n return _vendor + style.charAt(0).toUpperCase() + style.substr(1);\n }\n\n me.getTime = Date.now || function getTime () { return new Date().getTime(); };\n\n me.extend = function (target, obj) {\n for ( var i in obj ) {\n target[i] = obj[i];\n }\n };\n\n me.addEvent = function (el, type, fn, capture) {\n el.addEventListener(type, fn, !!capture);\n };\n\n me.removeEvent = function (el, type, fn, capture) {\n el.removeEventListener(type, fn, !!capture);\n };\n\n me.prefixPointerEvent = function (pointerEvent) {\n return window.MSPointerEvent ?\n 'MSPointer' + pointerEvent.charAt(7).toUpperCase() + pointerEvent.substr(8):\n pointerEvent;\n };\n\n me.momentum = function (current, start, time, lowerMargin, wrapperSize, deceleration) {\n var distance = current - start,\n speed = Math.abs(distance) / time,\n destination,\n duration;\n\n deceleration = deceleration === undefined ? 0.0006 : deceleration;\n\n destination = current + ( speed * speed ) / ( 2 * deceleration ) * ( distance < 0 ? -1 : 1 );\n duration = speed / deceleration;\n\n if ( destination < lowerMargin ) {\n destination = wrapperSize ? lowerMargin - ( wrapperSize / 2.5 * ( speed / 8 ) ) : lowerMargin;\n distance = Math.abs(destination - current);\n duration = distance / speed;\n } else if ( destination > 0 ) {\n destination = wrapperSize ? wrapperSize / 2.5 * ( speed / 8 ) : 0;\n distance = Math.abs(current) + destination;\n duration = distance / speed;\n }\n\n return {\n destination: Math.round(destination),\n duration: duration\n };\n };\n\n var _transform = _prefixStyle('transform');\n\n me.extend(me, {\n hasTransform: _transform !== false,\n hasPerspective: _prefixStyle('perspective') in _elementStyle,\n hasTouch: 'ontouchstart' in window,\n hasPointer: !!(window.PointerEvent || window.MSPointerEvent), // IE10 is prefixed\n hasTransition: _prefixStyle('transition') in _elementStyle\n });\n\n /*\n This should find all Android browsers lower than build 535.19 (both stock browser and webview)\n - galaxy S2 is ok\n - 2.3.6 : `AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1`\n - 4.0.4 : `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n - galaxy S3 is badAndroid (stock brower, webview)\n `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n - galaxy S4 is badAndroid (stock brower, webview)\n `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n - galaxy S5 is OK\n `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`\n - galaxy S6 is OK\n `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`\n */\n me.isBadAndroid = (function() {\n var appVersion = window.navigator.appVersion;\n // Android browser is not a chrome browser.\n if (/Android/.test(appVersion) && !(/Chrome\\/\\d/.test(appVersion))) {\n var safariVersion = appVersion.match(/Safari\\/(\\d+.\\d)/);\n if(safariVersion && typeof safariVersion === \"object\" && safariVersion.length >= 2) {\n return parseFloat(safariVersion[1]) < 535.19;\n } else {\n return true;\n }\n } else {\n return false;\n }\n })();\n\n me.extend(me.style = {}, {\n transform: _transform,\n transitionTimingFunction: _prefixStyle('transitionTimingFunction'),\n transitionDuration: _prefixStyle('transitionDuration'),\n transitionDelay: _prefixStyle('transitionDelay'),\n transformOrigin: _prefixStyle('transformOrigin')\n });\n\n me.hasClass = function (e, c) {\n var re = new RegExp(\"(^|\\\\s)\" + c + \"(\\\\s|$)\");\n return re.test(e.className);\n };\n\n me.addClass = function (e, c) {\n if ( me.hasClass(e, c) ) {\n return;\n }\n\n var newclass = e.className.split(' ');\n newclass.push(c);\n e.className = newclass.join(' ');\n };\n\n me.removeClass = function (e, c) {\n if ( !me.hasClass(e, c) ) {\n return;\n }\n\n var re = new RegExp(\"(^|\\\\s)\" + c + \"(\\\\s|$)\", 'g');\n e.className = e.className.replace(re, ' ');\n };\n\n me.offset = function (el) {\n var left = -el.offsetLeft,\n top = -el.offsetTop;\n\n // jshint -W084\n while (el = el.offsetParent) {\n left -= el.offsetLeft;\n top -= el.offsetTop;\n }\n // jshint +W084\n\n return {\n left: left,\n top: top\n };\n };\n\n me.preventDefaultException = function (el, exceptions) {\n for ( var i in exceptions ) {\n if ( exceptions[i].test(el[i]) ) {\n return true;\n }\n }\n\n return false;\n };\n\n me.extend(me.eventType = {}, {\n touchstart: 1,\n touchmove: 1,\n touchend: 1,\n\n mousedown: 2,\n mousemove: 2,\n mouseup: 2,\n\n pointerdown: 3,\n pointermove: 3,\n pointerup: 3,\n\n MSPointerDown: 3,\n MSPointerMove: 3,\n MSPointerUp: 3\n });\n\n me.extend(me.ease = {}, {\n quadratic: {\n style: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)',\n fn: function (k) {\n return k * ( 2 - k );\n }\n },\n circular: {\n style: 'cubic-bezier(0.1, 0.57, 0.1, 1)', // Not properly \"circular\" but this looks better, it should be (0.075, 0.82, 0.165, 1)\n fn: function (k) {\n return Math.sqrt( 1 - ( --k * k ) );\n }\n },\n back: {\n style: 'cubic-bezier(0.175, 0.885, 0.32, 1.275)',\n fn: function (k) {\n var b = 4;\n return ( k = k - 1 ) * k * ( ( b + 1 ) * k + b ) + 1;\n }\n },\n bounce: {\n style: '',\n fn: function (k) {\n if ( ( k /= 1 ) < ( 1 / 2.75 ) ) {\n return 7.5625 * k * k;\n } else if ( k < ( 2 / 2.75 ) ) {\n return 7.5625 * ( k -= ( 1.5 / 2.75 ) ) * k + 0.75;\n } else if ( k < ( 2.5 / 2.75 ) ) {\n return 7.5625 * ( k -= ( 2.25 / 2.75 ) ) * k + 0.9375;\n } else {\n return 7.5625 * ( k -= ( 2.625 / 2.75 ) ) * k + 0.984375;\n }\n }\n },\n elastic: {\n style: '',\n fn: function (k) {\n var f = 0.22,\n e = 0.4;\n\n if ( k === 0 ) { return 0; }\n if ( k == 1 ) { return 1; }\n\n return ( e * Math.pow( 2, - 10 * k ) * Math.sin( ( k - f / 4 ) * ( 2 * Math.PI ) / f ) + 1 );\n }\n }\n });\n\n me.tap = function (e, eventName) {\n var ev = document.createEvent('Event');\n ev.initEvent(eventName, true, true);\n ev.pageX = e.pageX;\n ev.pageY = e.pageY;\n e.target.dispatchEvent(ev);\n };\n\n me.click = function (e) {\n var target = e.target,\n ev;\n\n if ( !(/(SELECT|INPUT|TEXTAREA)/i).test(target.tagName) ) {\n // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent\n // initMouseEvent is deprecated.\n ev = document.createEvent(window.MouseEvent ? 'MouseEvents' : 'Event');\n ev.initEvent('click', true, true);\n ev.view = e.view || window;\n ev.detail = 1;\n ev.screenX = target.screenX || 0;\n ev.screenY = target.screenY || 0;\n ev.clientX = target.clientX || 0;\n ev.clientY = target.clientY || 0;\n ev.ctrlKey = !!e.ctrlKey;\n ev.altKey = !!e.altKey;\n ev.shiftKey = !!e.shiftKey;\n ev.metaKey = !!e.metaKey;\n ev.button = 0;\n ev.relatedTarget = null;\n ev._constructed = true;\n target.dispatchEvent(ev);\n }\n };\n\n return me;\n})();\nfunction IScroll (el, options) {\n this.wrapper = typeof el == 'string' ? document.querySelector(el) : el;\n this.scroller = this.wrapper.children[0];\n this.scrollerStyle = this.scroller.style; // cache style for better performance\n\n this.options = {\n\n resizeScrollbars: true,\n\n mouseWheelSpeed: 20,\n\n snapThreshold: 0.334,\n\n// INSERT POINT: OPTIONS\n disablePointer : !utils.hasPointer,\n disableTouch : utils.hasPointer || !utils.hasTouch,\n disableMouse : utils.hasPointer || utils.hasTouch,\n startX: 0,\n startY: 0,\n scrollY: true,\n directionLockThreshold: 5,\n momentum: true,\n\n bounce: true,\n bounceTime: 600,\n bounceEasing: '',\n\n preventDefault: true,\n preventDefaultException: { tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT|LABEL)$/ },\n\n HWCompositing: true,\n useTransition: true,\n useTransform: true,\n bindToWrapper: typeof window.onmousedown === \"undefined\"\n };\n\n for ( var i in options ) {\n this.options[i] = options[i];\n }\n\n // Normalize options\n this.translateZ = this.options.HWCompositing && utils.hasPerspective ? ' translateZ(0)' : '';\n\n this.options.useTransition = utils.hasTransition && this.options.useTransition;\n this.options.useTransform = utils.hasTransform && this.options.useTransform;\n\n this.options.eventPassthrough = this.options.eventPassthrough === true ? 'vertical' : this.options.eventPassthrough;\n this.options.preventDefault = !this.options.eventPassthrough && this.options.preventDefault;\n\n // If you want eventPassthrough I have to lock one of the axes\n this.options.scrollY = this.options.eventPassthrough == 'vertical' ? false : this.options.scrollY;\n this.options.scrollX = this.options.eventPassthrough == 'horizontal' ? false : this.options.scrollX;\n\n // With eventPassthrough we also need lockDirection mechanism\n this.options.freeScroll = this.options.freeScroll && !this.options.eventPassthrough;\n this.options.directionLockThreshold = this.options.eventPassthrough ? 0 : this.options.directionLockThreshold;\n\n this.options.bounceEasing = typeof this.options.bounceEasing == 'string' ? utils.ease[this.options.bounceEasing] || utils.ease.circular : this.options.bounceEasing;\n\n this.options.resizePolling = this.options.resizePolling === undefined ? 60 : this.options.resizePolling;\n\n if ( this.options.tap === true ) {\n this.options.tap = 'tap';\n }\n\n // https://github.com/cubiq/iscroll/issues/1029\n if (!this.options.useTransition && !this.options.useTransform) {\n if(!(/relative|absolute/i).test(this.scrollerStyle.position)) {\n this.scrollerStyle.position = \"relative\";\n }\n }\n\n if ( this.options.shrinkScrollbars == 'scale' ) {\n this.options.useTransition = false;\n }\n\n this.options.invertWheelDirection = this.options.invertWheelDirection ? -1 : 1;\n\n// INSERT POINT: NORMALIZATION\n\n // Some defaults\n this.x = 0;\n this.y = 0;\n this.directionX = 0;\n this.directionY = 0;\n this._events = {};\n\n// INSERT POINT: DEFAULTS\n\n this._init();\n this.refresh();\n\n this.scrollTo(this.options.startX, this.options.startY);\n this.enable();\n}\n\nIScroll.prototype = {\n version: '5.2.0',\n\n _init: function () {\n this._initEvents();\n\n if ( this.options.scrollbars || this.options.indicators ) {\n this._initIndicators();\n }\n\n if ( this.options.mouseWheel ) {\n this._initWheel();\n }\n\n if ( this.options.snap ) {\n this._initSnap();\n }\n\n if ( this.options.keyBindings ) {\n this._initKeys();\n }\n\n// INSERT POINT: _init\n\n },\n\n destroy: function () {\n this._initEvents(true);\n clearTimeout(this.resizeTimeout);\n this.resizeTimeout = null;\n this._execEvent('destroy');\n },\n\n _transitionEnd: function (e) {\n if ( e.target != this.scroller || !this.isInTransition ) {\n return;\n }\n\n this._transitionTime();\n if ( !this.resetPosition(this.options.bounceTime) ) {\n this.isInTransition = false;\n this._execEvent('scrollEnd');\n }\n },\n\n _start: function (e) {\n // React to left mouse button only\n if ( utils.eventType[e.type] != 1 ) {\n // for button property\n // http://unixpapa.com/js/mouse.html\n var button;\n if (!e.which) {\n /* IE case */\n button = (e.button < 2) ? 0 :\n ((e.button == 4) ? 1 : 2);\n } else {\n /* All others */\n button = e.button;\n }\n if ( button !== 0 ) {\n return;\n }\n }\n\n if ( !this.enabled || (this.initiated && utils.eventType[e.type] !== this.initiated) ) {\n return;\n }\n\n if ( this.options.preventDefault && !utils.isBadAndroid && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {\n e.preventDefault();\n }\n\n var point = e.touches ? e.touches[0] : e,\n pos;\n\n this.initiated = utils.eventType[e.type];\n this.moved = false;\n this.distX = 0;\n this.distY = 0;\n this.directionX = 0;\n this.directionY = 0;\n this.directionLocked = 0;\n\n this.startTime = utils.getTime();\n\n if ( this.options.useTransition && this.isInTransition ) {\n this._transitionTime();\n this.isInTransition = false;\n pos = this.getComputedPosition();\n this._translate(Math.round(pos.x), Math.round(pos.y));\n this._execEvent('scrollEnd');\n } else if ( !this.options.useTransition && this.isAnimating ) {\n this.isAnimating = false;\n this._execEvent('scrollEnd');\n }\n\n this.startX = this.x;\n this.startY = this.y;\n this.absStartX = this.x;\n this.absStartY = this.y;\n this.pointX = point.pageX;\n this.pointY = point.pageY;\n\n this._execEvent('beforeScrollStart');\n },\n\n _move: function (e) {\n if ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {\n return;\n }\n\n if ( this.options.preventDefault ) { // increases performance on Android? TODO: check!\n e.preventDefault();\n }\n\n var point = e.touches ? e.touches[0] : e,\n deltaX = point.pageX - this.pointX,\n deltaY = point.pageY - this.pointY,\n timestamp = utils.getTime(),\n newX, newY,\n absDistX, absDistY;\n\n this.pointX = point.pageX;\n this.pointY = point.pageY;\n\n this.distX += deltaX;\n this.distY += deltaY;\n absDistX = Math.abs(this.distX);\n absDistY = Math.abs(this.distY);\n\n // We need to move at least 10 pixels for the scrolling to initiate\n if ( timestamp - this.endTime > 300 && (absDistX < 10 && absDistY < 10) ) {\n return;\n }\n\n // If you are scrolling in one direction lock the other\n if ( !this.directionLocked && !this.options.freeScroll ) {\n if ( absDistX > absDistY + this.options.directionLockThreshold ) {\n this.directionLocked = 'h'; // lock horizontally\n } else if ( absDistY >= absDistX + this.options.directionLockThreshold ) {\n this.directionLocked = 'v'; // lock vertically\n } else {\n this.directionLocked = 'n'; // no lock\n }\n }\n\n if ( this.directionLocked == 'h' ) {\n if ( this.options.eventPassthrough == 'vertical' ) {\n e.preventDefault();\n } else if ( this.options.eventPassthrough == 'horizontal' ) {\n this.initiated = false;\n return;\n }\n\n deltaY = 0;\n } else if ( this.directionLocked == 'v' ) {\n if ( this.options.eventPassthrough == 'horizontal' ) {\n e.preventDefault();\n } else if ( this.options.eventPassthrough == 'vertical' ) {\n this.initiated = false;\n return;\n }\n\n deltaX = 0;\n }\n\n deltaX = this.hasHorizontalScroll ? deltaX : 0;\n deltaY = this.hasVerticalScroll ? deltaY : 0;\n\n newX = this.x + deltaX;\n newY = this.y + deltaY;\n\n // Slow down if outside of the boundaries\n if ( newX > 0 || newX < this.maxScrollX ) {\n newX = this.options.bounce ? this.x + deltaX / 3 : newX > 0 ? 0 : this.maxScrollX;\n }\n if ( newY > 0 || newY < this.maxScrollY ) {\n newY = this.options.bounce ? this.y + deltaY / 3 : newY > 0 ? 0 : this.maxScrollY;\n }\n\n this.directionX = deltaX > 0 ? -1 : deltaX < 0 ? 1 : 0;\n this.directionY = deltaY > 0 ? -1 : deltaY < 0 ? 1 : 0;\n\n if ( !this.moved ) {\n this._execEvent('scrollStart');\n }\n\n this.moved = true;\n\n this._translate(newX, newY);\n\n/* REPLACE START: _move */\n\n if ( timestamp - this.startTime > 300 ) {\n this.startTime = timestamp;\n this.startX = this.x;\n this.startY = this.y;\n }\n\n/* REPLACE END: _move */\n\n },\n\n _end: function (e) {\n if ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {\n return;\n }\n\n if ( this.options.preventDefault && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {\n e.preventDefault();\n }\n\n var point = e.changedTouches ? e.changedTouches[0] : e,\n momentumX,\n momentumY,\n duration = utils.getTime() - this.startTime,\n newX = Math.round(this.x),\n newY = Math.round(this.y),\n distanceX = Math.abs(newX - this.startX),\n distanceY = Math.abs(newY - this.startY),\n time = 0,\n easing = '';\n\n this.isInTransition = 0;\n this.initiated = 0;\n this.endTime = utils.getTime();\n\n // reset if we are outside of the boundaries\n if ( this.resetPosition(this.options.bounceTime) ) {\n return;\n }\n\n this.scrollTo(newX, newY); // ensures that the last position is rounded\n\n // we scrolled less than 10 pixels\n if ( !this.moved ) {\n if ( this.options.tap ) {\n utils.tap(e, this.options.tap);\n }\n\n if ( this.options.click ) {\n utils.click(e);\n }\n\n this._execEvent('scrollCancel');\n return;\n }\n\n if ( this._events.flick && duration < 200 && distanceX < 100 && distanceY < 100 ) {\n this._execEvent('flick');\n return;\n }\n\n // start momentum animation if needed\n if ( this.options.momentum && duration < 300 ) {\n momentumX = this.hasHorizontalScroll ? utils.momentum(this.x, this.startX, duration, this.maxScrollX, this.options.bounce ? this.wrapperWidth : 0, this.options.deceleration) : { destination: newX, duration: 0 };\n momentumY = this.hasVerticalScroll ? utils.momentum(this.y, this.startY, duration, this.maxScrollY, this.options.bounce ? this.wrapperHeight : 0, this.options.deceleration) : { destination: newY, duration: 0 };\n newX = momentumX.destination;\n newY = momentumY.destination;\n time = Math.max(momentumX.duration, momentumY.duration);\n this.isInTransition = 1;\n }\n\n\n if ( this.options.snap ) {\n var snap = this._nearestSnap(newX, newY);\n this.currentPage = snap;\n time = this.options.snapSpeed || Math.max(\n Math.max(\n Math.min(Math.abs(newX - snap.x), 1000),\n Math.min(Math.abs(newY - snap.y), 1000)\n ), 300);\n newX = snap.x;\n newY = snap.y;\n\n this.directionX = 0;\n this.directionY = 0;\n easing = this.options.bounceEasing;\n }\n\n// INSERT POINT: _end\n\n if ( newX != this.x || newY != this.y ) {\n // change easing function when scroller goes out of the boundaries\n if ( newX > 0 || newX < this.maxScrollX || newY > 0 || newY < this.maxScrollY ) {\n easing = utils.ease.quadratic;\n }\n\n this.scrollTo(newX, newY, time, easing);\n return;\n }\n\n this._execEvent('scrollEnd');\n },\n\n _resize: function () {\n var that = this;\n\n clearTimeout(this.resizeTimeout);\n\n this.resizeTimeout = setTimeout(function () {\n that.refresh();\n }, this.options.resizePolling);\n },\n\n resetPosition: function (time) {\n var x = this.x,\n y = this.y;\n\n time = time || 0;\n\n if ( !this.hasHorizontalScroll || this.x > 0 ) {\n x = 0;\n } else if ( this.x < this.maxScrollX ) {\n x = this.maxScrollX;\n }\n\n if ( !this.hasVerticalScroll || this.y > 0 ) {\n y = 0;\n } else if ( this.y < this.maxScrollY ) {\n y = this.maxScrollY;\n }\n\n if ( x == this.x && y == this.y ) {\n return false;\n }\n\n this.scrollTo(x, y, time, this.options.bounceEasing);\n\n return true;\n },\n\n disable: function () {\n this.enabled = false;\n },\n\n enable: function () {\n this.enabled = true;\n },\n\n refresh: function () {\n var rf = this.wrapper.offsetHeight; // Force reflow\n\n this.wrapperWidth = this.wrapper.clientWidth;\n this.wrapperHeight = this.wrapper.clientHeight;\n\n/* REPLACE START: refresh */\n\n this.scrollerWidth = this.scroller.offsetWidth;\n this.scrollerHeight = this.scroller.offsetHeight;\n\n this.maxScrollX = this.wrapperWidth - this.scrollerWidth;\n this.maxScrollY = this.wrapperHeight - this.scrollerHeight;\n\n/* REPLACE END: refresh */\n\n this.hasHorizontalScroll = this.options.scrollX && this.maxScrollX < 0;\n this.hasVerticalScroll = this.options.scrollY && this.maxScrollY < 0;\n\n if ( !this.hasHorizontalScroll ) {\n this.maxScrollX = 0;\n this.scrollerWidth = this.wrapperWidth;\n }\n\n if ( !this.hasVerticalScroll ) {\n this.maxScrollY = 0;\n this.scrollerHeight = this.wrapperHeight;\n }\n\n this.endTime = 0;\n this.directionX = 0;\n this.directionY = 0;\n\n this.wrapperOffset = utils.offset(this.wrapper);\n\n this._execEvent('refresh');\n\n this.resetPosition();\n\n// INSERT POINT: _refresh\n\n },\n\n on: function (type, fn) {\n if ( !this._events[type] ) {\n this._events[type] = [];\n }\n\n this._events[type].push(fn);\n },\n\n off: function (type, fn) {\n if ( !this._events[type] ) {\n return;\n }\n\n var index = this._events[type].indexOf(fn);\n\n if ( index > -1 ) {\n this._events[type].splice(index, 1);\n }\n },\n\n _execEvent: function (type) {\n if ( !this._events[type] ) {\n return;\n }\n\n var i = 0,\n l = this._events[type].length;\n\n if ( !l ) {\n return;\n }\n\n for ( ; i < l; i++ ) {\n this._events[type][i].apply(this, [].slice.call(arguments, 1));\n }\n },\n\n scrollBy: function (x, y, time, easing) {\n x = this.x + x;\n y = this.y + y;\n time = time || 0;\n\n this.scrollTo(x, y, time, easing);\n },\n\n scrollTo: function (x, y, time, easing) {\n easing = easing || utils.ease.circular;\n\n this.isInTransition = this.options.useTransition && time > 0;\n var transitionType = this.options.useTransition && easing.style;\n if ( !time || transitionType ) {\n if(transitionType) {\n this._transitionTimingFunction(easing.style);\n this._transitionTime(time);\n }\n this._translate(x, y);\n } else {\n this._animate(x, y, time, easing.fn);\n }\n },\n\n scrollToElement: function (el, time, offsetX, offsetY, easing) {\n el = el.nodeType ? el : this.scroller.querySelector(el);\n\n if ( !el ) {\n return;\n }\n\n var pos = utils.offset(el);\n\n pos.left -= this.wrapperOffset.left;\n pos.top -= this.wrapperOffset.top;\n\n // if offsetX/Y are true we center the element to the screen\n if ( offsetX === true ) {\n offsetX = Math.round(el.offsetWidth / 2 - this.wrapper.offsetWidth / 2);\n }\n if ( offsetY === true ) {\n offsetY = Math.round(el.offsetHeight / 2 - this.wrapper.offsetHeight / 2);\n }\n\n pos.left -= offsetX || 0;\n pos.top -= offsetY || 0;\n\n pos.left = pos.left > 0 ? 0 : pos.left < this.maxScrollX ? this.maxScrollX : pos.left;\n pos.top = pos.top > 0 ? 0 : pos.top < this.maxScrollY ? this.maxScrollY : pos.top;\n\n time = time === undefined || time === null || time === 'auto' ? Math.max(Math.abs(this.x-pos.left), Math.abs(this.y-pos.top)) : time;\n\n this.scrollTo(pos.left, pos.top, time, easing);\n },\n\n _transitionTime: function (time) {\n if (!this.options.useTransition) {\n return;\n }\n time = time || 0;\n var durationProp = utils.style.transitionDuration;\n if(!durationProp) {\n return;\n }\n\n this.scrollerStyle[durationProp] = time + 'ms';\n\n if ( !time && utils.isBadAndroid ) {\n this.scrollerStyle[durationProp] = '0.0001ms';\n // remove 0.0001ms\n var self = this;\n rAF(function() {\n if(self.scrollerStyle[durationProp] === '0.0001ms') {\n self.scrollerStyle[durationProp] = '0s';\n }\n });\n }\n\n\n if ( this.indicators ) {\n for ( var i = this.indicators.length; i--; ) {\n this.indicators[i].transitionTime(time);\n }\n }\n\n\n// INSERT POINT: _transitionTime\n\n },\n\n _transitionTimingFunction: function (easing) {\n this.scrollerStyle[utils.style.transitionTimingFunction] = easing;\n\n\n if ( this.indicators ) {\n for ( var i = this.indicators.length; i--; ) {\n this.indicators[i].transitionTimingFunction(easing);\n }\n }\n\n\n// INSERT POINT: _transitionTimingFunction\n\n },\n\n _translate: function (x, y) {\n if ( this.options.useTransform ) {\n\n/* REPLACE START: _translate */\n\n this.scrollerStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.translateZ;\n\n/* REPLACE END: _translate */\n\n } else {\n x = Math.round(x);\n y = Math.round(y);\n this.scrollerStyle.left = x + 'px';\n this.scrollerStyle.top = y + 'px';\n }\n\n this.x = x;\n this.y = y;\n\n\n if ( this.indicators ) {\n for ( var i = this.indicators.length; i--; ) {\n this.indicators[i].updatePosition();\n }\n }\n\n\n// INSERT POINT: _translate\n\n },\n\n _initEvents: function (remove) {\n var eventType = remove ? utils.removeEvent : utils.addEvent,\n target = this.options.bindToWrapper ? this.wrapper : window;\n\n eventType(window, 'orientationchange', this);\n eventType(window, 'resize', this);\n\n if ( this.options.click ) {\n eventType(this.wrapper, 'click', this, true);\n }\n\n if ( !this.options.disableMouse ) {\n eventType(this.wrapper, 'mousedown', this);\n eventType(target, 'mousemove', this);\n eventType(target, 'mousecancel', this);\n eventType(target, 'mouseup', this);\n }\n\n if ( utils.hasPointer && !this.options.disablePointer ) {\n eventType(this.wrapper, utils.prefixPointerEvent('pointerdown'), this);\n eventType(target, utils.prefixPointerEvent('pointermove'), this);\n eventType(target, utils.prefixPointerEvent('pointercancel'), this);\n eventType(target, utils.prefixPointerEvent('pointerup'), this);\n }\n\n if ( utils.hasTouch && !this.options.disableTouch ) {\n eventType(this.wrapper, 'touchstart', this);\n eventType(target, 'touchmove', this);\n eventType(target, 'touchcancel', this);\n eventType(target, 'touchend', this);\n }\n\n eventType(this.scroller, 'transitionend', this);\n eventType(this.scroller, 'webkitTransitionEnd', this);\n eventType(this.scroller, 'oTransitionEnd', this);\n eventType(this.scroller, 'MSTransitionEnd', this);\n },\n\n getComputedPosition: function () {\n var matrix = window.getComputedStyle(this.scroller, null),\n x, y;\n\n if ( this.options.useTransform ) {\n matrix = matrix[utils.style.transform].split(')')[0].split(', ');\n x = +(matrix[12] || matrix[4]);\n y = +(matrix[13] || matrix[5]);\n } else {\n x = +matrix.left.replace(/[^-\\d.]/g, '');\n y = +matrix.top.replace(/[^-\\d.]/g, '');\n }\n\n return { x: x, y: y };\n },\n _initIndicators: function () {\n var interactive = this.options.interactiveScrollbars,\n customStyle = typeof this.options.scrollbars != 'string',\n indicators = [],\n indicator;\n\n var that = this;\n\n this.indicators = [];\n\n if ( this.options.scrollbars ) {\n // Vertical scrollbar\n if ( this.options.scrollY ) {\n indicator = {\n el: createDefaultScrollbar('v', interactive, this.options.scrollbars),\n interactive: interactive,\n defaultScrollbars: true,\n customStyle: customStyle,\n resize: this.options.resizeScrollbars,\n shrink: this.options.shrinkScrollbars,\n fade: this.options.fadeScrollbars,\n listenX: false\n };\n\n this.wrapper.appendChild(indicator.el);\n indicators.push(indicator);\n }\n\n // Horizontal scrollbar\n if ( this.options.scrollX ) {\n indicator = {\n el: createDefaultScrollbar('h', interactive, this.options.scrollbars),\n interactive: interactive,\n defaultScrollbars: true,\n customStyle: customStyle,\n resize: this.options.resizeScrollbars,\n shrink: this.options.shrinkScrollbars,\n fade: this.options.fadeScrollbars,\n listenY: false\n };\n\n this.wrapper.appendChild(indicator.el);\n indicators.push(indicator);\n }\n }\n\n if ( this.options.indicators ) {\n // TODO: check concat compatibility\n indicators = indicators.concat(this.options.indicators);\n }\n\n for ( var i = indicators.length; i--; ) {\n this.indicators.push( new Indicator(this, indicators[i]) );\n }\n\n // TODO: check if we can use array.map (wide compatibility and performance issues)\n function _indicatorsMap (fn) {\n if (that.indicators) {\n for ( var i = that.indicators.length; i--; ) {\n fn.call(that.indicators[i]);\n }\n }\n }\n\n if ( this.options.fadeScrollbars ) {\n this.on('scrollEnd', function () {\n _indicatorsMap(function () {\n this.fade();\n });\n });\n\n this.on('scrollCancel', function () {\n _indicatorsMap(function () {\n this.fade();\n });\n });\n\n this.on('scrollStart', function () {\n _indicatorsMap(function () {\n this.fade(1);\n });\n });\n\n this.on('beforeScrollStart', function () {\n _indicatorsMap(function () {\n this.fade(1, true);\n });\n });\n }\n\n\n this.on('refresh', function () {\n _indicatorsMap(function () {\n this.refresh();\n });\n });\n\n this.on('destroy', function () {\n _indicatorsMap(function () {\n this.destroy();\n });\n\n delete this.indicators;\n });\n },\n\n _initWheel: function () {\n utils.addEvent(this.wrapper, 'wheel', this);\n utils.addEvent(this.wrapper, 'mousewheel', this);\n utils.addEvent(this.wrapper, 'DOMMouseScroll', this);\n\n this.on('destroy', function () {\n clearTimeout(this.wheelTimeout);\n this.wheelTimeout = null;\n utils.removeEvent(this.wrapper, 'wheel', this);\n utils.removeEvent(this.wrapper, 'mousewheel', this);\n utils.removeEvent(this.wrapper, 'DOMMouseScroll', this);\n });\n },\n\n _wheel: function (e) {\n if ( !this.enabled ) {\n return;\n }\n\n // in IE we can not preventDefault() or otherwise it won't scroll to the prev/next section.\n // I commented on it here back then: https://github.com/cubiq/iscroll/issues/980\n // isIE taken from: https://stackoverflow.com/a/49986758/1081396\n var isIE = window.navigator.userAgent.match(/(MSIE|Trident)/);\n if(!isIE){\n e.preventDefault();\n }\n\n var wheelDeltaX, wheelDeltaY,\n newX, newY,\n that = this;\n\n if ( this.wheelTimeout === undefined ) {\n that._execEvent('scrollStart');\n }\n\n // Execute the scrollEnd event after 400ms the wheel stopped scrolling\n clearTimeout(this.wheelTimeout);\n this.wheelTimeout = setTimeout(function () {\n if(!that.options.snap) {\n that._execEvent('scrollEnd');\n }\n that.wheelTimeout = undefined;\n }, 400);\n\n if ( 'deltaX' in e ) {\n if (e.deltaMode === 1) {\n wheelDeltaX = -e.deltaX * this.options.mouseWheelSpeed;\n wheelDeltaY = -e.deltaY * this.options.mouseWheelSpeed;\n } else {\n wheelDeltaX = -e.deltaX;\n wheelDeltaY = -e.deltaY;\n }\n } else if ( 'wheelDeltaX' in e ) {\n wheelDeltaX = e.wheelDeltaX / 120 * this.options.mouseWheelSpeed;\n wheelDeltaY = e.wheelDeltaY / 120 * this.options.mouseWheelSpeed;\n } else if ( 'wheelDelta' in e ) {\n wheelDeltaX = wheelDeltaY = e.wheelDelta / 120 * this.options.mouseWheelSpeed;\n } else if ( 'detail' in e ) {\n wheelDeltaX = wheelDeltaY = -e.detail / 3 * this.options.mouseWheelSpeed;\n } else {\n return;\n }\n\n wheelDeltaX *= this.options.invertWheelDirection;\n wheelDeltaY *= this.options.invertWheelDirection;\n\n if ( !this.hasVerticalScroll ) {\n wheelDeltaX = wheelDeltaY;\n wheelDeltaY = 0;\n }\n\n if ( this.options.snap ) {\n newX = this.currentPage.pageX;\n newY = this.currentPage.pageY;\n\n if ( wheelDeltaX > 0 ) {\n newX--;\n } else if ( wheelDeltaX < 0 ) {\n newX++;\n }\n\n if ( wheelDeltaY > 0 ) {\n newY--;\n } else if ( wheelDeltaY < 0 ) {\n newY++;\n }\n\n this.goToPage(newX, newY);\n\n return;\n }\n\n newX = this.x + Math.round(this.hasHorizontalScroll ? wheelDeltaX : 0);\n newY = this.y + Math.round(this.hasVerticalScroll ? wheelDeltaY : 0);\n\n this.directionX = wheelDeltaX > 0 ? -1 : wheelDeltaX < 0 ? 1 : 0;\n this.directionY = wheelDeltaY > 0 ? -1 : wheelDeltaY < 0 ? 1 : 0;\n\n if ( newX > 0 ) {\n newX = 0;\n } else if ( newX < this.maxScrollX ) {\n newX = this.maxScrollX;\n }\n\n if ( newY > 0 ) {\n newY = 0;\n } else if ( newY < this.maxScrollY ) {\n newY = this.maxScrollY;\n }\n\n this.scrollTo(newX, newY, 0);\n\n// INSERT POINT: _wheel\n },\n\n _initSnap: function () {\n this.currentPage = {};\n\n if ( typeof this.options.snap == 'string' ) {\n this.options.snap = this.scroller.querySelectorAll(this.options.snap);\n }\n\n this.on('refresh', function () {\n var i = 0, l,\n m = 0, n,\n cx, cy,\n x = 0, y,\n stepX = this.options.snapStepX || this.wrapperWidth,\n stepY = this.options.snapStepY || this.wrapperHeight,\n el;\n\n this.pages = [];\n\n if ( !this.wrapperWidth || !this.wrapperHeight || !this.scrollerWidth || !this.scrollerHeight ) {\n return;\n }\n\n if ( this.options.snap === true ) {\n cx = Math.round( stepX / 2 );\n cy = Math.round( stepY / 2 );\n\n while ( x > -this.scrollerWidth ) {\n this.pages[i] = [];\n l = 0;\n y = 0;\n\n while ( y > -this.scrollerHeight ) {\n this.pages[i][l] = {\n x: Math.max(x, this.maxScrollX),\n y: Math.max(y, this.maxScrollY),\n width: stepX,\n height: stepY,\n cx: x - cx,\n cy: y - cy\n };\n\n y -= stepY;\n l++;\n }\n\n x -= stepX;\n i++;\n }\n } else {\n el = this.options.snap;\n l = el.length;\n n = -1;\n\n for ( ; i < l; i++ ) {\n if ( i === 0 || el[i].offsetLeft <= el[i-1].offsetLeft ) {\n m = 0;\n n++;\n }\n\n if ( !this.pages[m] ) {\n this.pages[m] = [];\n }\n\n x = Math.max(-el[i].offsetLeft, this.maxScrollX);\n y = Math.max(-el[i].offsetTop, this.maxScrollY);\n cx = x - Math.round(el[i].offsetWidth / 2);\n cy = y - Math.round(el[i].offsetHeight / 2);\n\n this.pages[m][n] = {\n x: x,\n y: y,\n width: el[i].offsetWidth,\n height: el[i].offsetHeight,\n cx: cx,\n cy: cy\n };\n\n if ( x > this.maxScrollX ) {\n m++;\n }\n }\n }\n\n this.goToPage(this.currentPage.pageX || 0, this.currentPage.pageY || 0, 0);\n\n // Update snap threshold if needed\n if ( this.options.snapThreshold % 1 === 0 ) {\n this.snapThresholdX = this.options.snapThreshold;\n this.snapThresholdY = this.options.snapThreshold;\n } else {\n this.snapThresholdX = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width * this.options.snapThreshold);\n this.snapThresholdY = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height * this.options.snapThreshold);\n }\n });\n\n this.on('flick', function () {\n var time = this.options.snapSpeed || Math.max(\n Math.max(\n Math.min(Math.abs(this.x - this.startX), 1000),\n Math.min(Math.abs(this.y - this.startY), 1000)\n ), 300);\n\n this.goToPage(\n this.currentPage.pageX + this.directionX,\n this.currentPage.pageY + this.directionY,\n time\n );\n });\n },\n\n _nearestSnap: function (x, y) {\n if ( !this.pages.length ) {\n return { x: 0, y: 0, pageX: 0, pageY: 0 };\n }\n\n var i = 0,\n l = this.pages.length,\n m = 0;\n\n // Check if we exceeded the snap threshold\n if ( Math.abs(x - this.absStartX) < this.snapThresholdX &&\n Math.abs(y - this.absStartY) < this.snapThresholdY ) {\n return this.currentPage;\n }\n\n if ( x > 0 ) {\n x = 0;\n } else if ( x < this.maxScrollX ) {\n x = this.maxScrollX;\n }\n\n if ( y > 0 ) {\n y = 0;\n } else if ( y < this.maxScrollY ) {\n y = this.maxScrollY;\n }\n\n for ( ; i < l; i++ ) {\n if ( x >= this.pages[i][0].cx ) {\n x = this.pages[i][0].x;\n break;\n }\n }\n\n l = this.pages[i].length;\n\n for ( ; m < l; m++ ) {\n if ( y >= this.pages[0][m].cy ) {\n y = this.pages[0][m].y;\n break;\n }\n }\n\n if ( i == this.currentPage.pageX ) {\n i += this.directionX;\n\n if ( i < 0 ) {\n i = 0;\n } else if ( i >= this.pages.length ) {\n i = this.pages.length - 1;\n }\n\n x = this.pages[i][0].x;\n }\n\n if ( m == this.currentPage.pageY ) {\n m += this.directionY;\n\n if ( m < 0 ) {\n m = 0;\n } else if ( m >= this.pages[0].length ) {\n m = this.pages[0].length - 1;\n }\n\n y = this.pages[0][m].y;\n }\n\n return {\n x: x,\n y: y,\n pageX: i,\n pageY: m\n };\n },\n\n goToPage: function (x, y, time, easing) {\n easing = easing || this.options.bounceEasing;\n\n if ( x >= this.pages.length ) {\n x = this.pages.length - 1;\n } else if ( x < 0 ) {\n x = 0;\n }\n\n if ( y >= this.pages[x].length ) {\n y = this.pages[x].length - 1;\n } else if ( y < 0 ) {\n y = 0;\n }\n\n var posX = this.pages[x][y].x,\n posY = this.pages[x][y].y;\n\n time = time === undefined ? this.options.snapSpeed || Math.max(\n Math.max(\n Math.min(Math.abs(posX - this.x), 1000),\n Math.min(Math.abs(posY - this.y), 1000)\n ), 300) : time;\n\n this.currentPage = {\n x: posX,\n y: posY,\n pageX: x,\n pageY: y\n };\n\n this.scrollTo(posX, posY, time, easing);\n },\n\n next: function (time, easing) {\n var x = this.currentPage.pageX,\n y = this.currentPage.pageY;\n\n x++;\n\n if ( x >= this.pages.length && this.hasVerticalScroll ) {\n x = 0;\n y++;\n }\n\n this.goToPage(x, y, time, easing);\n },\n\n prev: function (time, easing) {\n var x = this.currentPage.pageX,\n y = this.currentPage.pageY;\n\n x--;\n\n if ( x < 0 && this.hasVerticalScroll ) {\n x = 0;\n y--;\n }\n\n this.goToPage(x, y, time, easing);\n },\n\n _initKeys: function (e) {\n // default key bindings\n var keys = {\n pageUp: 33,\n pageDown: 34,\n end: 35,\n home: 36,\n left: 37,\n up: 38,\n right: 39,\n down: 40\n };\n var i;\n\n // if you give me characters I give you keycode\n if ( typeof this.options.keyBindings == 'object' ) {\n for ( i in this.options.keyBindings ) {\n if ( typeof this.options.keyBindings[i] == 'string' ) {\n this.options.keyBindings[i] = this.options.keyBindings[i].toUpperCase().charCodeAt(0);\n }\n }\n } else {\n this.options.keyBindings = {};\n }\n\n for ( i in keys ) {\n this.options.keyBindings[i] = this.options.keyBindings[i] || keys[i];\n }\n\n utils.addEvent(window, 'keydown', this);\n\n this.on('destroy', function () {\n utils.removeEvent(window, 'keydown', this);\n });\n },\n\n _key: function (e) {\n if ( !this.enabled ) {\n return;\n }\n\n var snap = this.options.snap, // we are using this alot, better to cache it\n newX = snap ? this.currentPage.pageX : this.x,\n newY = snap ? this.currentPage.pageY : this.y,\n now = utils.getTime(),\n prevTime = this.keyTime || 0,\n acceleration = 0.250,\n pos;\n\n if ( this.options.useTransition && this.isInTransition ) {\n pos = this.getComputedPosition();\n\n this._translate(Math.round(pos.x), Math.round(pos.y));\n this.isInTransition = false;\n }\n\n this.keyAcceleration = now - prevTime < 200 ? Math.min(this.keyAcceleration + acceleration, 50) : 0;\n\n switch ( e.keyCode ) {\n case this.options.keyBindings.pageUp:\n if ( this.hasHorizontalScroll && !this.hasVerticalScroll ) {\n newX += snap ? 1 : this.wrapperWidth;\n } else {\n newY += snap ? 1 : this.wrapperHeight;\n }\n break;\n case this.options.keyBindings.pageDown:\n if ( this.hasHorizontalScroll && !this.hasVerticalScroll ) {\n newX -= snap ? 1 : this.wrapperWidth;\n } else {\n newY -= snap ? 1 : this.wrapperHeight;\n }\n break;\n case this.options.keyBindings.end:\n newX = snap ? this.pages.length-1 : this.maxScrollX;\n newY = snap ? this.pages[0].length-1 : this.maxScrollY;\n break;\n case this.options.keyBindings.home:\n newX = 0;\n newY = 0;\n break;\n case this.options.keyBindings.left:\n newX += snap ? -1 : 5 + this.keyAcceleration>>0;\n break;\n case this.options.keyBindings.up:\n newY += snap ? 1 : 5 + this.keyAcceleration>>0;\n break;\n case this.options.keyBindings.right:\n newX -= snap ? -1 : 5 + this.keyAcceleration>>0;\n break;\n case this.options.keyBindings.down:\n newY -= snap ? 1 : 5 + this.keyAcceleration>>0;\n break;\n default:\n return;\n }\n\n if ( snap ) {\n this.goToPage(newX, newY);\n return;\n }\n\n if ( newX > 0 ) {\n newX = 0;\n this.keyAcceleration = 0;\n } else if ( newX < this.maxScrollX ) {\n newX = this.maxScrollX;\n this.keyAcceleration = 0;\n }\n\n if ( newY > 0 ) {\n newY = 0;\n this.keyAcceleration = 0;\n } else if ( newY < this.maxScrollY ) {\n newY = this.maxScrollY;\n this.keyAcceleration = 0;\n }\n\n this.scrollTo(newX, newY, 0);\n\n this.keyTime = now;\n },\n\n _animate: function (destX, destY, duration, easingFn) {\n var that = this,\n startX = this.x,\n startY = this.y,\n startTime = utils.getTime(),\n destTime = startTime + duration;\n\n function step () {\n var now = utils.getTime(),\n newX, newY,\n easing;\n\n if ( now >= destTime ) {\n that.isAnimating = false;\n that._translate(destX, destY);\n\n if ( !that.resetPosition(that.options.bounceTime) ) {\n that._execEvent('scrollEnd');\n }\n\n return;\n }\n\n now = ( now - startTime ) / duration;\n easing = easingFn(now);\n newX = ( destX - startX ) * easing + startX;\n newY = ( destY - startY ) * easing + startY;\n that._translate(newX, newY);\n\n if ( that.isAnimating ) {\n rAF(step);\n }\n }\n\n this.isAnimating = true;\n step();\n },\n handleEvent: function (e) {\n switch ( e.type ) {\n case 'touchstart':\n case 'pointerdown':\n case 'MSPointerDown':\n case 'mousedown':\n this._start(e);\n break;\n case 'touchmove':\n case 'pointermove':\n case 'MSPointerMove':\n case 'mousemove':\n this._move(e);\n break;\n case 'touchend':\n case 'pointerup':\n case 'MSPointerUp':\n case 'mouseup':\n case 'touchcancel':\n case 'pointercancel':\n case 'MSPointerCancel':\n case 'mousecancel':\n this._end(e);\n break;\n case 'orientationchange':\n case 'resize':\n this._resize();\n break;\n case 'transitionend':\n case 'webkitTransitionEnd':\n case 'oTransitionEnd':\n case 'MSTransitionEnd':\n this._transitionEnd(e);\n break;\n case 'wheel':\n case 'DOMMouseScroll':\n case 'mousewheel':\n this._wheel(e);\n break;\n case 'keydown':\n this._key(e);\n break;\n case 'click':\n if ( this.enabled && !e._constructed ) {\n e.preventDefault();\n e.stopPropagation();\n }\n break;\n }\n }\n};\nfunction createDefaultScrollbar (direction, interactive, type) {\n var scrollbar = document.createElement('div'),\n indicator = document.createElement('div');\n\n if ( type === true ) {\n scrollbar.style.cssText = 'position:absolute;z-index:9999';\n indicator.style.cssText = '-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px';\n }\n\n indicator.className = 'iScrollIndicator';\n\n if ( direction == 'h' ) {\n if ( type === true ) {\n scrollbar.style.cssText += ';height:7px;left:2px;right:2px;bottom:0';\n indicator.style.height = '100%';\n }\n scrollbar.className = 'iScrollHorizontalScrollbar';\n } else {\n if ( type === true ) {\n scrollbar.style.cssText += ';width:7px;bottom:2px;top:2px;right:1px';\n indicator.style.width = '100%';\n }\n scrollbar.className = 'iScrollVerticalScrollbar';\n }\n\n scrollbar.style.cssText += ';overflow:hidden';\n\n if ( !interactive ) {\n scrollbar.style.pointerEvents = 'none';\n }\n\n scrollbar.appendChild(indicator);\n\n return scrollbar;\n}\n\nfunction Indicator (scroller, options) {\n this.wrapper = typeof options.el == 'string' ? document.querySelector(options.el) : options.el;\n this.wrapperStyle = this.wrapper.style;\n this.indicator = this.wrapper.children[0];\n this.indicatorStyle = this.indicator.style;\n this.scroller = scroller;\n\n this.options = {\n listenX: true,\n listenY: true,\n interactive: false,\n resize: true,\n defaultScrollbars: false,\n shrink: false,\n fade: false,\n speedRatioX: 0,\n speedRatioY: 0\n };\n\n for ( var i in options ) {\n this.options[i] = options[i];\n }\n\n this.sizeRatioX = 1;\n this.sizeRatioY = 1;\n this.maxPosX = 0;\n this.maxPosY = 0;\n\n if ( this.options.interactive ) {\n if ( !this.options.disableTouch ) {\n utils.addEvent(this.indicator, 'touchstart', this);\n utils.addEvent(window, 'touchend', this);\n }\n if ( !this.options.disablePointer ) {\n utils.addEvent(this.indicator, utils.prefixPointerEvent('pointerdown'), this);\n utils.addEvent(window, utils.prefixPointerEvent('pointerup'), this);\n }\n if ( !this.options.disableMouse ) {\n utils.addEvent(this.indicator, 'mousedown', this);\n utils.addEvent(window, 'mouseup', this);\n }\n }\n\n if ( this.options.fade ) {\n this.wrapperStyle[utils.style.transform] = this.scroller.translateZ;\n var durationProp = utils.style.transitionDuration;\n if(!durationProp) {\n return;\n }\n this.wrapperStyle[durationProp] = utils.isBadAndroid ? '0.0001ms' : '0ms';\n // remove 0.0001ms\n var self = this;\n if(utils.isBadAndroid) {\n rAF(function() {\n if(self.wrapperStyle[durationProp] === '0.0001ms') {\n self.wrapperStyle[durationProp] = '0s';\n }\n });\n }\n this.wrapperStyle.opacity = '0';\n }\n}\n\nIndicator.prototype = {\n handleEvent: function (e) {\n switch ( e.type ) {\n case 'touchstart':\n case 'pointerdown':\n case 'MSPointerDown':\n case 'mousedown':\n this._start(e);\n break;\n case 'touchmove':\n case 'pointermove':\n case 'MSPointerMove':\n case 'mousemove':\n this._move(e);\n break;\n case 'touchend':\n case 'pointerup':\n case 'MSPointerUp':\n case 'mouseup':\n case 'touchcancel':\n case 'pointercancel':\n case 'MSPointerCancel':\n case 'mousecancel':\n this._end(e);\n break;\n }\n },\n\n destroy: function () {\n if ( this.options.fadeScrollbars ) {\n clearTimeout(this.fadeTimeout);\n this.fadeTimeout = null;\n }\n if ( this.options.interactive ) {\n utils.removeEvent(this.indicator, 'touchstart', this);\n utils.removeEvent(this.indicator, utils.prefixPointerEvent('pointerdown'), this);\n utils.removeEvent(this.indicator, 'mousedown', this);\n\n utils.removeEvent(window, 'touchmove', this);\n utils.removeEvent(window, utils.prefixPointerEvent('pointermove'), this);\n utils.removeEvent(window, 'mousemove', this);\n\n utils.removeEvent(window, 'touchend', this);\n utils.removeEvent(window, utils.prefixPointerEvent('pointerup'), this);\n utils.removeEvent(window, 'mouseup', this);\n }\n\n if ( this.options.defaultScrollbars ) {\n this.wrapper.parentNode.removeChild(this.wrapper);\n }\n },\n\n _start: function (e) {\n var point = e.touches ? e.touches[0] : e;\n\n e.preventDefault();\n e.stopPropagation();\n\n this.transitionTime();\n\n this.initiated = true;\n this.moved = false;\n this.lastPointX = point.pageX;\n this.lastPointY = point.pageY;\n\n this.startTime = utils.getTime();\n\n if ( !this.options.disableTouch ) {\n utils.addEvent(window, 'touchmove', this);\n }\n if ( !this.options.disablePointer ) {\n utils.addEvent(window, utils.prefixPointerEvent('pointermove'), this);\n }\n if ( !this.options.disableMouse ) {\n utils.addEvent(window, 'mousemove', this);\n }\n\n this.scroller._execEvent('beforeScrollStart');\n },\n\n _move: function (e) {\n var point = e.touches ? e.touches[0] : e,\n deltaX, deltaY,\n newX, newY,\n timestamp = utils.getTime();\n\n if ( !this.moved ) {\n this.scroller._execEvent('scrollStart');\n }\n\n this.moved = true;\n\n deltaX = point.pageX - this.lastPointX;\n this.lastPointX = point.pageX;\n\n deltaY = point.pageY - this.lastPointY;\n this.lastPointY = point.pageY;\n\n newX = this.x + deltaX;\n newY = this.y + deltaY;\n\n this._pos(newX, newY);\n\n// INSERT POINT: indicator._move\n\n e.preventDefault();\n e.stopPropagation();\n },\n\n _end: function (e) {\n if ( !this.initiated ) {\n return;\n }\n\n this.initiated = false;\n\n e.preventDefault();\n e.stopPropagation();\n\n utils.removeEvent(window, 'touchmove', this);\n utils.removeEvent(window, utils.prefixPointerEvent('pointermove'), this);\n utils.removeEvent(window, 'mousemove', this);\n\n if ( this.scroller.options.snap ) {\n var snap = this.scroller._nearestSnap(this.scroller.x, this.scroller.y);\n\n var time = this.options.snapSpeed || Math.max(\n Math.max(\n Math.min(Math.abs(this.scroller.x - snap.x), 1000),\n Math.min(Math.abs(this.scroller.y - snap.y), 1000)\n ), 300);\n\n if ( this.scroller.x != snap.x || this.scroller.y != snap.y ) {\n this.scroller.directionX = 0;\n this.scroller.directionY = 0;\n this.scroller.currentPage = snap;\n this.scroller.scrollTo(snap.x, snap.y, time, this.scroller.options.bounceEasing);\n }\n }\n\n if ( this.moved ) {\n this.scroller._execEvent('scrollEnd');\n }\n },\n\n transitionTime: function (time) {\n time = time || 0;\n var durationProp = utils.style.transitionDuration;\n if(!durationProp) {\n return;\n }\n\n this.indicatorStyle[durationProp] = time + 'ms';\n\n if ( !time && utils.isBadAndroid ) {\n this.indicatorStyle[durationProp] = '0.0001ms';\n // remove 0.0001ms\n var self = this;\n rAF(function() {\n if(self.indicatorStyle[durationProp] === '0.0001ms') {\n self.indicatorStyle[durationProp] = '0s';\n }\n });\n }\n },\n\n transitionTimingFunction: function (easing) {\n this.indicatorStyle[utils.style.transitionTimingFunction] = easing;\n },\n\n refresh: function () {\n this.transitionTime();\n\n if ( this.options.listenX && !this.options.listenY ) {\n this.indicatorStyle.display = this.scroller.hasHorizontalScroll ? 'block' : 'none';\n } else if ( this.options.listenY && !this.options.listenX ) {\n this.indicatorStyle.display = this.scroller.hasVerticalScroll ? 'block' : 'none';\n } else {\n this.indicatorStyle.display = this.scroller.hasHorizontalScroll || this.scroller.hasVerticalScroll ? 'block' : 'none';\n }\n\n if ( this.scroller.hasHorizontalScroll && this.scroller.hasVerticalScroll ) {\n utils.addClass(this.wrapper, 'iScrollBothScrollbars');\n utils.removeClass(this.wrapper, 'iScrollLoneScrollbar');\n\n if ( this.options.defaultScrollbars && this.options.customStyle ) {\n if ( this.options.listenX ) {\n this.wrapper.style.right = '8px';\n } else {\n this.wrapper.style.bottom = '8px';\n }\n }\n } else {\n utils.removeClass(this.wrapper, 'iScrollBothScrollbars');\n utils.addClass(this.wrapper, 'iScrollLoneScrollbar');\n\n if ( this.options.defaultScrollbars && this.options.customStyle ) {\n if ( this.options.listenX ) {\n this.wrapper.style.right = '2px';\n } else {\n this.wrapper.style.bottom = '2px';\n }\n }\n }\n\n var r = this.wrapper.offsetHeight; // force refresh\n\n if ( this.options.listenX ) {\n this.wrapperWidth = this.wrapper.clientWidth;\n if ( this.options.resize ) {\n this.indicatorWidth = Math.max(Math.round(this.wrapperWidth * this.wrapperWidth / (this.scroller.scrollerWidth || this.wrapperWidth || 1)), 8);\n this.indicatorStyle.width = this.indicatorWidth + 'px';\n } else {\n this.indicatorWidth = this.indicator.clientWidth;\n }\n\n this.maxPosX = this.wrapperWidth - this.indicatorWidth;\n\n if ( this.options.shrink == 'clip' ) {\n this.minBoundaryX = -this.indicatorWidth + 8;\n this.maxBoundaryX = this.wrapperWidth - 8;\n } else {\n this.minBoundaryX = 0;\n this.maxBoundaryX = this.maxPosX;\n }\n\n this.sizeRatioX = this.options.speedRatioX || (this.scroller.maxScrollX && (this.maxPosX / this.scroller.maxScrollX));\n }\n\n if ( this.options.listenY ) {\n this.wrapperHeight = this.wrapper.clientHeight;\n if ( this.options.resize ) {\n this.indicatorHeight = Math.max(Math.round(this.wrapperHeight * this.wrapperHeight / (this.scroller.scrollerHeight || this.wrapperHeight || 1)), 8);\n this.indicatorStyle.height = this.indicatorHeight + 'px';\n } else {\n this.indicatorHeight = this.indicator.clientHeight;\n }\n\n this.maxPosY = this.wrapperHeight - this.indicatorHeight;\n\n if ( this.options.shrink == 'clip' ) {\n this.minBoundaryY = -this.indicatorHeight + 8;\n this.maxBoundaryY = this.wrapperHeight - 8;\n } else {\n this.minBoundaryY = 0;\n this.maxBoundaryY = this.maxPosY;\n }\n\n this.maxPosY = this.wrapperHeight - this.indicatorHeight;\n this.sizeRatioY = this.options.speedRatioY || (this.scroller.maxScrollY && (this.maxPosY / this.scroller.maxScrollY));\n }\n\n this.updatePosition();\n },\n\n updatePosition: function () {\n var x = this.options.listenX && Math.round(this.sizeRatioX * this.scroller.x) || 0,\n y = this.options.listenY && Math.round(this.sizeRatioY * this.scroller.y) || 0;\n\n if ( !this.options.ignoreBoundaries ) {\n if ( x < this.minBoundaryX ) {\n if ( this.options.shrink == 'scale' ) {\n this.width = Math.max(this.indicatorWidth + x, 8);\n this.indicatorStyle.width = this.width + 'px';\n }\n x = this.minBoundaryX;\n } else if ( x > this.maxBoundaryX ) {\n if ( this.options.shrink == 'scale' ) {\n this.width = Math.max(this.indicatorWidth - (x - this.maxPosX), 8);\n this.indicatorStyle.width = this.width + 'px';\n x = this.maxPosX + this.indicatorWidth - this.width;\n } else {\n x = this.maxBoundaryX;\n }\n } else if ( this.options.shrink == 'scale' && this.width != this.indicatorWidth ) {\n this.width = this.indicatorWidth;\n this.indicatorStyle.width = this.width + 'px';\n }\n\n if ( y < this.minBoundaryY ) {\n if ( this.options.shrink == 'scale' ) {\n this.height = Math.max(this.indicatorHeight + y * 3, 8);\n this.indicatorStyle.height = this.height + 'px';\n }\n y = this.minBoundaryY;\n } else if ( y > this.maxBoundaryY ) {\n if ( this.options.shrink == 'scale' ) {\n this.height = Math.max(this.indicatorHeight - (y - this.maxPosY) * 3, 8);\n this.indicatorStyle.height = this.height + 'px';\n y = this.maxPosY + this.indicatorHeight - this.height;\n } else {\n y = this.maxBoundaryY;\n }\n } else if ( this.options.shrink == 'scale' && this.height != this.indicatorHeight ) {\n this.height = this.indicatorHeight;\n this.indicatorStyle.height = this.height + 'px';\n }\n }\n\n this.x = x;\n this.y = y;\n\n if ( this.scroller.options.useTransform ) {\n this.indicatorStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.scroller.translateZ;\n } else {\n this.indicatorStyle.left = x + 'px';\n this.indicatorStyle.top = y + 'px';\n }\n },\n\n _pos: function (x, y) {\n if ( x < 0 ) {\n x = 0;\n } else if ( x > this.maxPosX ) {\n x = this.maxPosX;\n }\n\n if ( y < 0 ) {\n y = 0;\n } else if ( y > this.maxPosY ) {\n y = this.maxPosY;\n }\n\n x = this.options.listenX ? Math.round(x / this.sizeRatioX) : this.scroller.x;\n y = this.options.listenY ? Math.round(y / this.sizeRatioY) : this.scroller.y;\n\n this.scroller.scrollTo(x, y);\n },\n\n fade: function (val, hold) {\n if ( hold && !this.visible ) {\n return;\n }\n\n clearTimeout(this.fadeTimeout);\n this.fadeTimeout = null;\n\n var time = val ? 250 : 500,\n delay = val ? 0 : 300;\n\n val = val ? '1' : '0';\n\n this.wrapperStyle[utils.style.transitionDuration] = time + 'ms';\n\n this.fadeTimeout = setTimeout((function (val) {\n this.wrapperStyle.opacity = val;\n this.visible = +val;\n }).bind(this, val), delay);\n }\n};\n\nIScroll.utils = utils;\n\nif ( typeof module != 'undefined' && module.exports ) {\n module.exports = IScroll;\n} else if ( typeof define == 'function' && define.amd ) {\n define( function () { return IScroll; } );\n\n //making sure scrollOverflow works when using Require.js\n //in the browser\n if(typeof window !== 'undefined'){\n window.IScroll = IScroll;\n }\n} else {\n window.IScroll = IScroll;\n}\n\n})(window, document, Math);\n\n\n/*!\n* Scrolloverflow 2.0.7 module for fullPage.js >= 3\n* https://github.com/alvarotrigo/fullPage.js\n* @license MIT licensed\n*\n* Copyright (C) 2015 alvarotrigo.com - A project by Alvaro Trigo\n*/\n(function (window, document) {\n window.fp_scrolloverflow = (function() {\n\n // check if IScroll is available in global scope\n if (!window.IScroll) {\n // otherwise create local one from module.exports\n window.IScroll = module.exports;\n }\n\n // keeping central set of classnames and selectors\n var SCROLLABLE = 'fp-scrollable';\n var SCROLLABLE_SEL = '.' + SCROLLABLE;\n\n var ACTIVE = 'active';\n var ACTIVE_SEL = '.' + ACTIVE;\n\n var SECTION = 'fp-section';\n var SECTION_SEL = '.' + SECTION;\n var SECTION_ACTIVE_SEL = SECTION_SEL + ACTIVE_SEL;\n\n var SLIDE = 'fp-slide';\n var SLIDE_SEL = '.' + SLIDE;\n var SLIDE_ACTIVE_SEL = SLIDE_SEL + ACTIVE_SEL;\n\n var SLIDES_WRAPPER = 'fp-slides';\n var SLIDES_WRAPPER_SEL = '.' + SLIDES_WRAPPER;\n\n var TABLE_CELL = 'fp-tableCell';\n var TABLE_CELL_SEL = '.' + TABLE_CELL;\n\n var RESPONSIVE = 'fp-responsive';\n var AUTO_HEIGHT_RESPONSIVE= 'fp-auto-height-responsive';\n\n /*\n * Turns iScroll `mousewheel` option off dynamically\n * https://github.com/cubiq/iscroll/issues/1036\n */\n IScroll.prototype.wheelOn = function () {\n this.wrapper.addEventListener('wheel', this);\n this.wrapper.addEventListener('mousewheel', this);\n this.wrapper.addEventListener('DOMMouseScroll', this);\n };\n\n /*\n * Turns iScroll `mousewheel` option on dynamically\n * https://github.com/cubiq/iscroll/issues/1036\n */\n IScroll.prototype.wheelOff = function () {\n this.wrapper.removeEventListener('wheel', this);\n this.wrapper.removeEventListener('mousewheel', this);\n this.wrapper.removeEventListener('DOMMouseScroll', this);\n };\n\n /**\n * Returns an integer representing the padding dimensions in px.\n */\n function getPaddings(element){\n var section = fp_utils.closest(element, SECTION_SEL);\n if(section != null){\n return parseInt(getComputedStyle(section)['padding-bottom']) + parseInt(getComputedStyle(section)['padding-top']);\n }\n return 0;\n }\n\n function scrollBarHandler(){\n var self = this;\n self.options = null;\n\n self.init = function(options, iscrollOptions){\n self.options = options;\n self.iscrollOptions = iscrollOptions;\n\n if(document.readyState === 'complete'){\n createScrollBarForAll();\n fullpage_api.shared.afterRenderActions();\n }\n //after DOM and images are loaded\n window.addEventListener('load', function(){\n createScrollBarForAll();\n fullpage_api.shared.afterRenderActions();\n });\n\n return self;\n };\n\n /**\n * Creates the scrollbar for the sections and slides in the site\n */\n function createScrollBarForAll(){\n if(fp_utils.hasClass(document.body, RESPONSIVE)){\n forEachSectionAndSlide(removeScrollBar);\n }\n else{\n forEachSectionAndSlide(createScrollBar);\n }\n }\n\n /**\n * Checks if the element needs scrollbar and if the user wants to apply it.\n * If so it creates it.\n *\n * @param {Object} element jQuery object of the section or slide\n */\n function createScrollBar(element){\n //User doesn't want scrollbar here? Sayonara baby!\n if(fp_utils.hasClass(element, 'fp-noscroll')) return;\n\n //necessary to make `scrollHeight` work under Opera 12\n fp_utils.css(element, {'overflow': 'hidden'});\n\n var scrollOverflowHandler = self.options.scrollOverflowHandler;\n var wrap = scrollOverflowHandler.wrapContent();\n var section = fp_utils.closest(element, SECTION_SEL); //in case element is a slide\n var scrollable = scrollOverflowHandler.scrollable(element);\n var contentHeight;\n var paddings = getPaddings(section);\n\n //if there was scroll, the contentHeight will be the one in the scrollable section\n if(scrollable != null){\n contentHeight = scrollOverflowHandler.scrollHeight(element);\n }\n else{\n contentHeight = element.scrollHeight;\n if(self.options.verticalCentered){\n contentHeight = $(TABLE_CELL_SEL, element)[0].scrollHeight;\n }\n }\n\n var scrollHeight = fp_utils.getWindowHeight();\n var contentHeightWidthPaddings = contentHeight + paddings;\n var scrollHeightWidthoutPaddings = scrollHeight - paddings;\n \n //needs scroll?\n if ( contentHeightWidthPaddings > scrollHeight) {\n //did we already have an scrollbar ? Updating it\n if(scrollable != null){\n scrollOverflowHandler.update(element, scrollHeightWidthoutPaddings);\n }\n //creating the scrolling\n else{\n if(self.options.verticalCentered){\n fp_utils.wrapInner($(TABLE_CELL_SEL, element)[0], wrap.scroller);\n fp_utils.wrapInner($(TABLE_CELL_SEL, element)[0], wrap.scrollable);\n }else{\n fp_utils.wrapInner(element, wrap.scroller);\n fp_utils.wrapInner(element, wrap.scrollable);\n }\n scrollOverflowHandler.create(element, scrollHeightWidthoutPaddings, self.iscrollOptions);\n }\n }\n\n //removing the scrolling when it is not necessary anymore\n else{\n scrollOverflowHandler.remove(element);\n }\n\n //undo\n fp_utils.css(element, {'overflow': ''});\n }\n\n /**\n * Applies a callback function to each section in the site\n * or the slides within them\n */\n function forEachSectionAndSlide(callback){\n $(SECTION_SEL).forEach(function(section){\n var slides = $(SLIDE_SEL, section);\n\n if(slides.length){\n slides.forEach(function(slide){\n callback(slide);\n });\n }else{\n callback(section);\n }\n });\n }\n\n /**\n * Removes scrollOverflow for sections using the class `fp-auto-height-responsive`\n */\n function removeScrollBar(element){\n var scrollOverflowHandler = self.options.scrollOverflowHandler;\n if(fp_utils.hasClass( fp_utils.closest(element, SECTION_SEL), AUTO_HEIGHT_RESPONSIVE)){\n scrollOverflowHandler.remove(element);\n }\n }\n\n //public functions\n self.createScrollBarForAll = createScrollBarForAll;\n self.createScrollBar = createScrollBar;\n }\n\n /**\n * An object to handle overflow scrolling.\n * This uses jquery.slimScroll to accomplish overflow scrolling.\n * It is possible to pass in an alternate scrollOverflowHandler\n * to the fullpage.js option that implements the same functions\n * as this handler.\n *\n * @type {Object}\n */\n var $ = null;\n var g_fullpageOptions = null;\n var iscrollHandler = {\n refreshId: null,\n iScrollInstances: [],\n lastScrollY: null,\n hasBeenInit: false,\n\n // Default options for iScroll.js used when using scrollOverflow\n iscrollOptions: {\n scrollbars: true,\n mouseWheel: true,\n hideScrollbars: false,\n fadeScrollbars: false,\n disableMouse: true,\n interactiveScrollbars: true\n },\n\n init: function(options){\n $ = fp_utils.$;\n g_fullpageOptions = options;\n\n var isTouch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0) || (navigator.maxTouchPoints));\n\n //fixing bug in iScroll with links: https://github.com/cubiq/iscroll/issues/783\n iscrollHandler.iscrollOptions.click = isTouch; // see #2035\n\n iscrollHandler.hasBeenInit = true;\n\n //extending iScroll options with the user custom ones\n iscrollHandler.iscrollOptions = fp_utils.deepExtend(iscrollHandler.iscrollOptions, options.scrollOverflowOptions);\n\n return new scrollBarHandler().init(options, iscrollHandler.iscrollOptions);\n },\n\n // Enables or disables the mouse wheel for the active section or all slides in it\n toggleWheel: function(value){\n var scrollable = $(SCROLLABLE_SEL, $(SECTION_ACTIVE_SEL)[0]);\n scrollable.forEach(function(item){\n var iScrollInstance = item.fp_iscrollInstance;\n if(iScrollInstance != null){\n if(value){\n iScrollInstance.wheelOn();\n }\n else{\n iScrollInstance.wheelOff();\n }\n }\n });\n },\n\n // Enables or disables the whole iScroll feature based on the given parameter.\n setIscroll: function(target, enable){\n if(!iscrollHandler.hasBeenInit || !target){\n return;\n }\n var scrollable = fp_utils.closest(target, SCROLLABLE_SEL) || ($(SCROLLABLE_SEL, target) && $(SCROLLABLE_SEL, target)[0]);\n var action = enable ? 'enable' : 'disable';\n \n if(scrollable){\n scrollable.fp_iscrollInstance[action]();\n }\n },\n\n /**\n * Turns off iScroll for the destination section.\n * When scrolling very fast on some trackpads (and Apple laptops) the inertial scrolling would\n * scroll the destination section/slide before the sections animations ends.\n */\n onLeave: function(){\n iscrollHandler.toggleWheel(false);\n },\n\n // Turns off iScroll for the leaving section\n beforeLeave: function(){\n iscrollHandler.onLeave()\n },\n\n // Turns on iScroll on section load\n afterLoad: function(){\n iscrollHandler.toggleWheel(true);\n },\n\n /**\n * Called when overflow scrolling is needed for a section.\n *\n * @param {Object} element jQuery object containing current section\n * @param {Number} scrollHeight Current window height in pixels\n */\n create: function(element, scrollHeight, iscrollOptions) {\n var scrollable = $(SCROLLABLE_SEL, element);\n\n scrollable.forEach(function(item) {\n fp_utils.css(item, {'height': scrollHeight + 'px'});\n\n var iScrollInstance = item.fp_iscrollInstance;\n if (iScrollInstance != null) {\n iscrollHandler.iScrollInstances.forEach(function(instance){\n instance.destroy();\n });\n }\n\n iScrollInstance = new IScroll(item, iscrollOptions);\n iscrollHandler.iScrollInstances.push(iScrollInstance);\n\n if(!fp_utils.hasClass(fp_utils.closest(element, SECTION_SEL), ACTIVE)){\n //off by default until the section gets active\n iScrollInstance.wheelOff();\n }\n\n item.fp_iscrollInstance = iScrollInstance;\n });\n },\n\n /**\n * Return a boolean depending on whether the scrollable element is a\n * the end or at the start of the scrolling depending on the given type.\n *\n * @param {String} type Either 'top' or 'bottom'\n * @param {Object} scrollable jQuery object for the scrollable element\n * @return {Boolean}\n */\n isScrolled: function(type, scrollable) {\n var scroller = scrollable.fp_iscrollInstance;\n\n //no scroller?\n if (!scroller) {\n return true;\n }\n\n // two times reporting the same Y position ? \n // that means we are on the top or on the bottom of the scroller\n \n if (type === 'top'){\n return scroller.y >= 0;\n } else if (type === 'bottom') {\n\n // Checking the same position twice? We are at the very bottom (at least on Desktop)\n var isDoubleChecking = iscrollHandler.lastScrollY === scroller.y;\n iscrollHandler.lastScrollY = scroller.y;\n \n // An offset of 1px is required for IE / Edge to work\n var offset = isDoubleChecking ? 1 : 0;\n\n return offset + (0 - scroller.y) + scrollable.offsetHeight >= scrollable.scrollHeight;\n }\n },\n\n /**\n * Returns the scrollable element for the given section.\n * If there are landscape slides, will only return a scrollable element\n * if it is in the active slide.\n *\n * @param {Object} activeSection jQuery object containing current section\n * @return {Boolean}\n */\n scrollable: function(activeSection){\n // if there are landscape slides, we check if the scrolling bar is in the current one or not\n if ($(SLIDES_WRAPPER_SEL, activeSection).length) {\n return $(SCROLLABLE_SEL, $(SLIDE_ACTIVE_SEL, activeSection)[0] )[0];\n }\n return $(SCROLLABLE_SEL, activeSection)[0];\n },\n\n /**\n * Returns the scroll height of the wrapped content.\n * If this is larger than the window height minus section padding,\n * overflow scrolling is needed.\n *\n * @param {Object} element jQuery object containing current section\n * @return {Number}\n */\n scrollHeight: function(element) {\n return $('.fp-scroller', $(SCROLLABLE_SEL, element)[0] )[0].scrollHeight;\n },\n\n /**\n * Called when overflow scrolling is no longer needed for a section.\n *\n * @param {Object} element jQuery object containing current section\n */\n remove: function(element) {\n if(element == null) return;\n\n var scrollable = $(SCROLLABLE_SEL, element)[0];\n if (scrollable != null) {\n var iScrollInstance = scrollable.fp_iscrollInstance;\n if(iScrollInstance != null){\n iScrollInstance.destroy();\n }\n\n scrollable.fp_iscrollInstance = null;\n\n //unwrapping...\n fp_utils.unwrap($('.fp-scroller', element)[0]);\n fp_utils.unwrap($(SCROLLABLE_SEL, element)[0]);\n }\n },\n\n /**\n * Called when overflow scrolling has already been setup but the\n * window height has potentially changed.\n *\n * @param {Object} element jQuery object containing current section\n * @param {Number} scrollHeight Current window height in pixels\n */\n update: function(element, scrollHeight) {\n //using a timeout in order to execute the refresh function only once when `update` is called multiple times in a\n //short period of time.\n //it also comes on handy because iScroll requires the use of timeout when using `refresh`.\n clearTimeout(iscrollHandler.refreshId);\n iscrollHandler.refreshId = setTimeout(function(){\n iscrollHandler.iScrollInstances.forEach(function(instance){\n instance.refresh();\n\n //ugly hack that we are forced to use due to the timeout delay\n //otherwise done on the fullpage.js reBuild function\n fullpage_api.silentMoveTo(fp_utils.index($(SECTION_ACTIVE_SEL)[0]) + 1);\n });\n }, 150);\n\n //updating the wrappers height\n fp_utils.css($(SCROLLABLE_SEL, element)[0], {'height': scrollHeight + 'px'});\n\n if(g_fullpageOptions.verticalCentered){\n fp_utils.css($(SCROLLABLE_SEL, element)[0].parentNode, {'height': scrollHeight + 'px'});\n }\n },\n\n /**\n * Called to get any additional elements needed to wrap the section\n * content in order to facilitate overflow scrolling.\n *\n * @return {String|Object} Can be a string containing HTML,\n * a DOM element, or jQuery object.\n */\n wrapContent: function() {\n var scrollable = document.createElement('div');\n scrollable.className = SCROLLABLE;\n\n var scroller = document.createElement('div');\n scroller.className = 'fp-scroller';\n\n return {\n scrollable: scrollable,\n scroller: scroller\n };\n }\n };\n\n return {\n iscrollHandler: iscrollHandler\n };\n })();\n})(window, document);\n"]} \ No newline at end of file diff --git a/assets/styles/main.sass b/assets/styles/main.sass index 3794f44..21b9a04 100644 --- a/assets/styles/main.sass +++ b/assets/styles/main.sass @@ -1,3 +1,15 @@ +@import "../node_modules/fullpage.js/dist/fillpage.css" + +html, body + margin: 0 + padding: 0 + +body + font-family: sans-serif + +* + box-sizing: border-box + h1, h2 text-align: center @@ -7,3 +19,37 @@ h1, h2 &.active display: inherit + +$headerHeigth: 150px +.header + height: $headerHeigth + position: fixed + background: #EDE0D4 + width: 100% + z-index: 1 + +#fullpage + margin-top: $headerHeigth + +.section + max-height: calc(100vh - $headerHeigth) + padding: 1rem + font-size: 1.5rem + + .choice + margin: 1rem + + input + padding: 1rem + +// https://coolors.co/palette/ede0d4-e6ccb2-ddb892-b08968-7f5539-9c6644 +.section0 + background: linear-gradient(#EDE0D4, #E6CCB2) +.section1 + background: linear-gradient(#E6CCB2, #DDB892) +.section2 + background: linear-gradient(#DDB892, #B08968) +.section3 + background: linear-gradient(#B08968, #7F5539) +.section4 + background: linear-gradient(#7F5539, #9C6644) diff --git a/config/_default/config.yml b/config/_default/config.yml index 9aa4ad4..408c84c 100644 --- a/config/_default/config.yml +++ b/config/_default/config.yml @@ -16,13 +16,13 @@ disableKinds: # ImageSize: 1040x # SocialImage: RESILIEN_LOGO_SLOGAN_disc_slogan.svg -outputs: - page: - - json - section: - - json - home: - - html +# outputs: +# page: +# - json +# section: +# - json +# home: +# - html minify: tdewolff: diff --git a/content/.drone.yml b/content/.drone.yml deleted file mode 100644 index 2020627..0000000 --- a/content/.drone.yml +++ /dev/null @@ -1,167 +0,0 @@ ---- -# drone encrypt weko/sisa-urfe_fr $REGISTRY_PASSWORD -kind: secret -name: REGISTRY_PASSWORD -data: g8m2Y3gcKcCC10HLLVQDTlsxIGBeAaNqAXXjOzFId3Ib88cvCGxqkE5su7Qvo97xvoqu/09jIWXjf30vecYiqum+pQv4imYfhuzzsrag - ---- -# drone encrypt weko/sisa-urfe_fr $REGISTRY_USER -kind: secret -name: REGISTRY_USER -data: pe0ODYOxonYnAjd2YR3O5LN/sHjWJc31Lmvom+VfnuKrrQ== - ---- -# drone encrypt weko/sisa-urfe_fr "{\"auths\":{\"https://registry.weko.io\":{\"auth\":\"$(echo -n "$REGISTRY_USER:$REGISTRY_PASSWORD" | base64)\",\"email\":\"$REGISTRY_USER\"}}}" -kind: secret -name: REGISTRY_CONFIG -data: i5xaNdkAH0n5IDgIn4OVRwViez97c62RHau8eELYJHnossMU797dow6bW77bGyMIx0ONwcOmdtDH92kpci/GeZmyPrCvODrXwt9pTAMEdVelQ3jy/mxpdtB/p5qJ6u+9CrUBw/S67ImY3yhr8o95pdpJFclkqWRsrjeg1BSHRF8RnEAQ9yBwXxoEXpSZBCnlSwG1z0cDY3JwFUH8LVQgldopiiaDAhk09dpk - ---- -# drone encrypt weko/sisa-urfe_fr $DIRECTUS_URL -kind: secret -name: DIRECTUS_URL -data: 3SzmP61E8oSo5PLSWnHRBUfUCa0Fe9cfc3C2ADXe7cvuY45sNXCn+YjVCL1M3yG5wJsEbEUh - ---- -# drone encrypt weko/sisa-urfe_fr $DIRECTUS_TOKEN -kind: secret -name: DIRECTUS_TOKEN -data: Dxlod5HBIa5S897CsQsaDPbZDqYLuIL7z4kQahf4jlWxyme79fsK7LhZVHPDRfQJf1HknAgGWJUUqhL3 - -# --- -# kind: pipeline -# type: docker -# name: prod -# -# platform: -# os: linux -# arch: arm64 -# -# steps: -# - name: install submodule -# image: drone/git -# commands: -# - git submodule update --init -# -# - name: install npm -# image: node:current-alpine -# volumes: -# - name: hugo-theme-lowtech_node_modules -# path: /drone/src/themes/hugo-theme-lowtech/node_modules -# # environment: -# # DIRECTUS_URL: -# # from_secret: DIRECTUS_URL -# # DIRECTUS_TOKEN: -# # from_secret: DIRECTUS_TOKEN -# commands: -# - (cd themes/hugo-theme-lowtech && npm i) -# # - node scripts/directus-to-markdown/index.js -# -# - name: build website -# image: jakejarvis/hugo-extended -# commands: -# - hugo --minify --environment production -# -# - name: typo -# image: node:current-alpine -# volumes: -# - name: hugo-theme-lowtech_node_modules -# path: /drone/src/themes/hugo-theme-lowtech/node_modules -# commands: -# - node themes/hugo-theme-lowtech/scripts/typo -# -# - name: push docker image on registry -# image: plugins/docker -# settings: -# username: -# from_secret: REGISTRY_USER -# password: -# from_secret: REGISTRY_PASSWORD -# repo: registry.weko.io/sisa-urfe_fr -# registry: registry.weko.io -# tags: -# - latest -# -# image_pull_secrets: -# - REGISTRY_CONFIG -# -# volumes: -# - name: hugo-theme-lowtech_node_modules -# host: -# path: /tmp/drone/cache/weko/sisa-urfe_fr/themes/hugo-theme-lowtech - ---- -kind: pipeline -type: docker -name: staging - -platform: - os: linux - arch: arm64 - -steps: -- name: install submodule - image: drone/git - commands: - - git submodule update --init - -- name: install npm - image: node:current-alpine - volumes: - - name: hugo-theme-lowtech_node_modules - path: /drone/src/themes/hugo-theme-lowtech/node_modules - - name: assets - path: /drone/src/assets/node_modules - environment: - DIRECTUS_URL: - from_secret: DIRECTUS_URL - DIRECTUS_TOKEN: - from_secret: DIRECTUS_TOKEN - commands: - - (cd themes/hugo-theme-lowtech && npm i) - - (cd assets && npm i) - - DRAFT=true node scripts/directus-to-markdown/index.js - -- name: build website - image: jakejarvis/hugo-extended - environment: - HUGO_PARAMS_DIRECTUS_URL: - from_secret: DIRECTUS_URL - HUGO_PARAMS_DIRECTUS_TOKEN: - from_secret: DIRECTUS_TOKEN - volumes: - - name: assets - path: /drone/src/assets/node_modules - commands: - - hugo --minify --buildDrafts --buildFuture --environment staging - -- name: typo - image: node:current-alpine - volumes: - - name: hugo-theme-lowtech_node_modules - path: /drone/src/themes/hugo-theme-lowtech/node_modules - commands: - - node themes/hugo-theme-lowtech/scripts/typo - -- name: push docker image on registry - image: plugins/docker - settings: - username: - from_secret: REGISTRY_USER - password: - from_secret: REGISTRY_PASSWORD - repo: registry.weko.io/sisa-urfe_fr - registry: registry.weko.io - tags: - - staging - -image_pull_secrets: -- REGISTRY_CONFIG - -volumes: -- name: assets - host: - path: /tmp/drone/cache/weko/sisa-urfe_fr/assets/node_modules -- name: hugo-theme-lowtech_node_modules - host: - path: /tmp/drone/cache/weko/sisa-urfe_fr/themes/hugo-theme-lowtech diff --git a/content/racine.md b/content/racine.md new file mode 100644 index 0000000..9fe0eaa --- /dev/null +++ b/content/racine.md @@ -0,0 +1,161 @@ +--- +id: 6 +sort: null +title: Facteurs de sécurité cavité ouverte sur tronc2 +results: + - id: 8 + sort: 0 + min: 0 + max: 2.5 + facteur: Très au delà de 5 + effets: Capacité de charge très supérieure à la charge de service + pde: Improbable + pde_qtra: 7 + - id: 9 + sort: 1 + min: 3 + max: 5.5 + facteur: Au delà de 5 + effets: Capacité de charge supérieure à la charge de service + pde: Très faible + pde_qtra: 6 + - id: 10 + sort: 2 + min: 6 + max: 8.5 + facteur: Entre 4 et 5 + effets: >- + Capacité de charge normalement (coef moyen) supérieure à la charge de + service + pde: Faible + pde_qtra: 5 + - id: 11 + sort: 3 + min: 9 + max: 11.5 + facteur: Entre 2 et 4 + effets: >- + Capacité de charge supérieure à la charge de service mais sous le coef + moyen + pde: Echec possible sous contraintes très anormales + pde_qtra: 4 + - id: 12 + sort: 4 + min: 12 + max: 14.5 + facteur: Entre 1 et 2 + effets: Capacité de charge s'approchant de la charge de service + pde: Echec possible sous contraintes anormales + pde_qtra: 3 + - id: 13 + sort: 5 + min: 15 + max: 17.5 + facteur: ~ 1 + effets: Capacité de charge plus ou moins égale à la charge de service + pde: Echec possible sous contraintes courantes + pde_qtra: 2 + - id: 14 + sort: 6 + min: 18 + max: null + facteur: < 1 + effets: Charge de service supérieure à la capacité de charge + pde: Echec imminent sous contraintes courantes ou masse propre + pde_qtra: 1 +questions: + - id: 14 + sort: 0 + title: Matériau résiduel (PRBS)2 + answers: + - id: 22 + sort: 0 + title: De 100% à 75%2 + weight: 1 + - id: 23 + sort: 1 + title: De 75% à 25% ou Cavité asymétrique + weight: 1.5 + - id: 24 + sort: 2 + title: de 25 à 10 % + weight: 2 + - id: 25 + sort: 3 + title: < 10 % + weight: 4 + - id: 15 + sort: 1 + title: Adaptations géométriques + answers: + - id: 26 + sort: 0 + title: Très forte croissance accrue + weight: -1 + - id: 27 + sort: 1 + title: Forte croissance accrue + weight: 0 + - id: 28 + sort: 2 + title: Faibles croissance accrue + weight: 3 + - id: 29 + sort: 3 + title: Sans croissance accrue + weight: 5 + - id: 16 + sort: 2 + title: Rapport H/D + answers: + - id: 30 + sort: 0 + title: < 15 + weight: 0 + - id: 31 + sort: 1 + title: Entre 15 et 30 + weight: 1 + - id: 32 + sort: 2 + title: Entre 30 et 50 + weight: 2 + - id: 33 + sort: 3 + title: Entre 50 et 70 + weight: 3 + - id: 34 + sort: 4 + title: '> 70' + weight: 4 + - id: 17 + sort: 3 + title: Organes de soutien structurel + answers: + - id: 35 + sort: 0 + title: Caractérisés et intègres + weight: 1 + - id: 36 + sort: 1 + title: Relatifs et intègres + weight: 2 + - id: 37 + sort: 2 + title: Caractérisés, partiellement dégradés + weight: 3 + - id: 38 + sort: 3 + title: Relatifs et partiellement dégradés + weight: 4 + - id: 39 + sort: 4 + title: Insuffisants et intègres + weight: 5 + - id: 40 + sort: 5 + title: Insuffisants et dégradés + weight: 6 +--- + + diff --git a/content/_index.md b/content/tronc.md similarity index 82% rename from content/_index.md rename to content/tronc.md index dda1889..5aa8673 100644 --- a/content/_index.md +++ b/content/tronc.md @@ -6,23 +6,23 @@ results: - id: 1 sort: 0 min: 0 - max: 2 + max: 2.5 facteur: Très au delà de 5 effets: Capacité de charge très supérieure à la charge de service pde: Improbable pde_qtra: 7 - id: 2 sort: 1 - min: 2.5 - max: 4.5 + min: 3 + max: 5.5 facteur: Au delà de 5 effets: Capacité de charge supérieure à la charge de service pde: Très faible pde_qtra: 6 - id: 3 sort: 2 - min: 5 - max: 7 + min: 6 + max: 8.5 facteur: Entre 4 et 5 effets: >- Capacité de charge normalement (coef moyen) supérieure à la charge de @@ -31,8 +31,8 @@ results: pde_qtra: 5 - id: 4 sort: 3 - min: 7.5 - max: 9.5 + min: 9 + max: 11.5 facteur: Entre 2 et 4 effets: >- Capacité de charge supérieure à la charge de service mais sous le coef @@ -41,23 +41,23 @@ results: pde_qtra: 4 - id: 5 sort: 4 - min: 10 - max: 12 + min: 12 + max: 14.5 facteur: Entre 1 et 2 effets: Capacité de charge s'approchant de la charge de service pde: Echec possible sous contraintes anormales pde_qtra: 3 - id: 6 sort: 5 - min: 12.5 - max: 14.5 + min: 15 + max: 17.5 facteur: ~ 1 effets: Capacité de charge plus ou moins égale à la charge de service pde: Echec possible sous contraintes courantes pde_qtra: 2 - id: 7 sort: 6 - min: 15 + min: 18 max: null facteur: < 1 effets: Charge de service supérieure à la capacité de charge @@ -68,16 +68,20 @@ questions: sort: 0 title: Matériau résiduel (PRBS) answers: - - id: 1 + - id: 21 sort: 0 - title: '= 25%' + title: De 100% à 75% weight: 1 - - id: 2 + - id: 1 sort: 1 + title: De 75% à 25% ou Cavité asymétrique + weight: 1.5 + - id: 2 + sort: 2 title: de 25 à 10 % weight: 2 - id: 3 - sort: 2 + sort: 3 title: < 10 % weight: 4 - id: 11 @@ -95,14 +99,14 @@ questions: - id: 8 sort: 2 title: Faibles croissance accrue - weight: 2 + weight: 3 - id: 9 sort: 3 title: Sans croissance accrue weight: 5 - id: 12 sort: 2 - title: Rapport H/D (+-20% de marge) + title: Rapport H/D answers: - id: 10 sort: 0 @@ -126,31 +130,31 @@ questions: weight: 4 - id: 13 sort: 3 - title: Organes de soutiens structurels + title: Organes de soutien structurel answers: - id: 15 sort: 0 - title: OSS caractérisés et intègres + title: Caractérisés et intègres weight: 1 - id: 16 sort: 1 - title: OSS relatifs et intègres + title: Relatifs et intègres weight: 2 - id: 17 sort: 2 - title: OSS caractérisés, partiellement dégradés + title: Caractérisés, partiellement dégradés weight: 3 - id: 18 sort: 3 - title: OSS relatifs et partiellement dégradés + title: Relatifs et partiellement dégradés weight: 4 - id: 19 sort: 4 - title: OSS insuffisants et intègres + title: Insuffisants et intègres weight: 5 - id: 20 sort: 5 - title: OSS insuffisants et dégradés + title: Insuffisants et dégradés weight: 6 --- diff --git a/layouts/index.html b/layouts/_default/single.html similarity index 86% rename from layouts/index.html rename to layouts/_default/single.html index 38b1b95..a83c08e 100644 --- a/layouts/index.html +++ b/layouts/_default/single.html @@ -14,10 +14,16 @@ -

      Ceiba App

      - +
      +

      Ceiba App

      +

      {{ .Title }}

      +
      {{ partial "scores" . }} + {{/* safeHTML ` +
      + ` */}} + {{ $js := resources.Get "js/sw.js" }} {{ with $js }} {{ $secureJS := . | js.Build }} @@ -30,5 +36,7 @@ {{ end }} + + diff --git a/layouts/home.html b/layouts/home.html new file mode 100644 index 0000000..61a9635 --- /dev/null +++ b/layouts/home.html @@ -0,0 +1,41 @@ + + + + + Hello World + + {{ $style := resources.Get "styles/main.sass" }} + {{ with $style }} + {{ $styleCSS := . | toCSS }} + + {{ end }} + + + + + +
      +

      Ceiba App

      +
      + + + {{ $js := resources.Get "js/sw.js" }} + {{ with $js }} + {{ $secureJS := . | js.Build }} + + {{ end }} + + {{ $js := resources.Get "js/main.js" }} + {{ with $js }} + {{ $secureJS := . | js.Build }} + + {{ end }} + + + + + diff --git a/layouts/partials/scores.html b/layouts/partials/scores.html index 833aa33..530a2cd 100644 --- a/layouts/partials/scores.html +++ b/layouts/partials/scores.html @@ -1,21 +1,23 @@ {{ $formId := .Params.id }}
      -

      {{ .Title }}

      -
      - {{ range .Params.questions }} -
      + + {{ range $index, $question := .Params.questions }} + {{ with $question }} +
      {{ .title }} {{ $questionId := .id }} {{ range .answers }} -
      +
      {{ end }} -
      +
      + {{ end }} {{ end }} +
      {{ range .Params.results }}
      Score :
      @@ -25,5 +27,6 @@ PdE QTRA : {{ .pde_qtra }}
      {{ end }} +