GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - alvarotrigo/angular-fullpage: Official Angular wrapper for fullPage.js https://alvarotrigo.com/angular-fullpage/

BranchesTags
Open more actions menu

Latest commit

 

History

194 Commits
194 Commits

Folders and files

NameName
Last commit message
Last commit date
demo
demo
 
 
dist/@fullpage/angular-fullpage
dist/@fullpage/angular-fullpage
 
 
src
src
 
 
.editorconfig
.editorconfig
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
angular.json
angular.json
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 
tslint.json
tslint.json
 
 

Repository files navigation

Angular fullpage

preview

Official Angular wrapper for the fullpage.js library.

angular-fullpage version

  • Demo online | Stackblitz
  • fullpage.js Extensions
  • Brought by @imac2 thanks to Vong Panha Huot .

Table of Contents

  • Installation
  • License
  • Usage
    • Use extensions
    • Use scrolloverflow
  • Dynamic changes
  • Examples
  • Contributing
  • Resources

Installation

npm install @fullpage/angular-fullpage

This will install the Angular wrapper as well as fullpage.js library.

License

Non open source license

If you want to use angular-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.

Open source license

If you are creating an open source application under a license compatible with the GNU GPL license v3, 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.

Usage

// app.module.ts
import { AngularFullpageModule } from '@fullpage/angular-fullpage';

@NgModule({
  imports: [
    BrowserModule,
    AppRoutingModule,
    AngularFullpageModule //*** added
  ]
})

You should import the fullpage.js stylesheet on your style.scss or component.scss:

/* styles.scss or app.component.scss */
@import url(~fullpage.js/dist/fullpage.min.css);
/* standard css */
@import '~fullpage.js/dist/fullpage.min.css';

Then use the directive on your component:

// app.component.ts
export class AppComponent {
  config: any;
  fullpageApi: any;

  constructor() {

    // for more details on config options please visit fullPage.js docs
    this.config = {

      // fullpage options
      licenseKey: 'YOUR LICENSE KEY HERE',
      anchors: ['firstPage', 'secondPage', 'thirdPage', 'fourthPage', 'lastPage'],
      menu: '#menu',

      // fullpage callbacks
      afterResize: () => {
        console.log("After resize");
      },
      afterLoad: (origin, destination, direction) => {
        console.log(origin.index);
      }
    };
  }

  getRef(fullPageRef) {
    this.fullpageApi = fullPageRef;
  }

}

You can optionally import types:

import { fullpageOptions, fullpageApi } from 'fullpage.js/dist/fullpage.extensions.min';
config: fullpageOptions;
fullpageApi: fullpageApi;

Example of HTML:

<!-- app.component.html -->
<div fullpage id="fullpage" [options]="config" (ref)="getRef($event)">
  <div class="section">Some section1</div>
	<div class="section" (click)="fullpageApi.moveSectionDown()">Some section2</div>
	<div class="section">
		<div class="slide">Slide 2.1</div>
		<div class="slide">Slide 2.2</div>
		<div class="slide">Slide 2.3</div>
	</div>
	<div class="section" (click)="fullpageApi.moveTo('secondPage', 2)">Some section4</div>
</div>

Use extensions

In order to make use of fullpage.js extension you'll have to add the extension file to angular.json.

For example, if we want to use the scrollHorizontally extension we will have to add the path to our fullpage.scrollHorizontally.min.js file on the scripts array:

"assets": [
  "src/favicon.ico",
  "src/assets"
],

"styles": [
  "src/styles.css"
],

"scripts": [
  "src/assets/fullpage.scrollHorizontally.min.js"
],

Then pass the required options to fullPage.js. In this case scrollHorizontally:true.

Dynamic Changes

If you want to update fullPage.js with new changes in the DOM call the build() method after making those changes.

An example can be seen on the dynamic-changes example:

this.renderer.appendChild(this.fp_directive.nativeElement, section);
this.fullpageApi.build(); // <-- here

An example for *ngFor can be seen on the dynamic-changes-with-ngFor example:

<div fullpage id="fullpage" [options]="config" (ref)="getRef($event)">
    <div *ngFor="let section of sections" class="section">
		  <h1>Section {{section}}</h1>
	</div>
</div>

Methods

fullPage.js contains many methods. You can access them through the fullpageApi reference that you get from the (ref) output event. For example:

// In your component
fullpageApi: any;

getRef(fullPageRef) {
  this.fullpageApi = fullPageRef;
}

// Then you can use any method like:
moveSectionDown() {
  this.fullpageApi.moveSectionDown();
}

Callbacks

You can define callbacks in the config object when initializing fullPage. These callbacks will be triggered at the appropriate times during fullPage's lifecycle. For example:

config = {
  afterLoad: (origin, destination, direction) => {
    console.log('Section loaded:', destination.index);
  },
  onLeave: (origin, destination, direction) => {
    console.log('Leaving section:', origin.index);
  }
};

All available callbacks can be found in the fullPage.js documentation.

Examples

You can check some full examples on the demo folder and on the examples page.

Contributing

Found an issue? Have an idea? Check out the Contributing guide and open a PR

Resources

  • Wordpress theme
  • fullpage.js Extensions
  • CSS Easing Animation Tool - Matthew Lein (useful to define the easingcss3 value)
  • fullPage.js unpakg CDN
  • fullPage.js jsDelivr CDN
  • fullPage.js cdnJS CDN
  • fullPage.js documentation

About

Official Angular wrapper for fullPage.js https://alvarotrigo.com/angular-fullpage/

Topics

angularangular-cliangular-componentfullpagefullpagejsfullscreenmousewheelonepagescrollingslideshowsnap

Resources

Readme
GPL-3.0 license

Contributing

Contributing
Activity

Stars

177 stars

Watchers

6 watching

Forks

45 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.