Giter VIP home page Giter VIP logo

onepage.js's Introduction

One Page

Create full page websites and presentations!

Installation

npm install one-page --save

To do

  • responsive navbar
  • touch support
  • navigating by arrow keys
  • horizontal scroll

Usage

<link rel="stylesheet" href="node_modules/one-page/dist/onePage.min.css">
<script src="node_modules/one-page/dist/onePage.min.js"></script>

You can choose one of two modes: stack or normal.

Normal mode

HTML markup

<div id="container" class="sections-container">
  <section class="section">1</section>
  <section class="section">2</section>
  <section class="section">3</section>
  <section class="section">4</section>
</div>

JavaScript

const page = new OnePage({
  mode: 'normal',
  containerId: '#container'
})
page.initPage()

Stack mode

HTML markup

<section class="section stack">1</section>
<section class="section stack">2</section>
<section class="section stack">3</section>
<section class="section stack">4</section>

JavaScript

const page = new OnePage({
  mode: 'stack'
})
page.initPage()

Navbar

You can add navbar to allow navigating through buttons.

HTML markup

<nav class="navbar">
  <button type="button" class="link">
    1
  </button>
  <button type="button" class="link">
    2
  </button>
  <button type="button" class="link">
    3
  </button>
  <button type="button" class="link">
    4
  </button>
</nav>

It is very important that you use excatly same class name for every element.

JavaScript

You need to specify additional option during object creation.

const page = new OnePage({
  mode: 'stack',
  navbar: true
})
page.initPage()

onepage.js's People

Contributors

lukawski avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.