All Projects → dollars0427 → vue-booklet

dollars0427 / vue-booklet

Licence: MIT License
Vue compoment for create a e-book

Programming Languages

Vue
7211 projects
javascript
184084 projects - #8 most used programming language
SCSS
7915 projects
HTML
75241 projects

Projects that are alternatives of or similar to vue-booklet

mobx-react-matchmedia
A React HOC with mediaqueries for responsive layout
Stars: ✭ 32 (-3.03%)
Mutual labels:  responsive
bootstrap-4-react
Bootstrap 4 React components
Stars: ✭ 19 (-42.42%)
Mutual labels:  responsive
muilessium
UI Framework for simple websites - landings, blogs, etc.
Stars: ✭ 16 (-51.52%)
Mutual labels:  responsive
react-native-responsive-query
Responsive style hook for react native.
Stars: ✭ 43 (+30.3%)
Mutual labels:  responsive
use-table-tools
React Hooks for building kickass react table components
Stars: ✭ 18 (-45.45%)
Mutual labels:  responsive
react-native-responsive-linechart
A customizable and responsive line or area chart for react-native
Stars: ✭ 179 (+442.42%)
Mutual labels:  responsive
awrora-starter
Landing page template built with one of most popular javascript library Vue.JS, Vuetify (Material Design) and Nuxt.JS with SSR.
Stars: ✭ 38 (+15.15%)
Mutual labels:  responsive
Wedding
A basic wedding website I created for myself and Bec using the Bulma CSS framework, Particles.js, jQuery.countdown, Google Satisfy Font and FontAwesome icons.
Stars: ✭ 26 (-21.21%)
Mutual labels:  responsive
aioneframework
Aione Framework: All-in-one lightweight mobile first front-end framework to design websites, web applications, mobile applications, progressive web applications having large number of examples, documentation, tutorials, community support, components.
Stars: ✭ 13 (-60.61%)
Mutual labels:  responsive
englishextra.github.io
English Grammar for Russian-Speakers, a PWA website + SPA
Stars: ✭ 19 (-42.42%)
Mutual labels:  responsive
frames
🖼 A minimalistic take on responsive iframes in the spirit of Pym.js.
Stars: ✭ 19 (-42.42%)
Mutual labels:  responsive
image-processing-pipeline
An image build orchestrator for the modern web
Stars: ✭ 43 (+30.3%)
Mutual labels:  responsive
atomize
A library of atomic CSS classes.
Stars: ✭ 51 (+54.55%)
Mutual labels:  responsive
vue-resize-text
A vue directive which automatically resize font size based on element width.
Stars: ✭ 65 (+96.97%)
Mutual labels:  responsive
Jikan
A new CSS framework for better, faster and more beautiful UIs.
Stars: ✭ 19 (-42.42%)
Mutual labels:  responsive
GOSH-FHIRworks2020-React-Dashboard
🩺 Fully Responsive FHIR Dashboard written using @reactjs for NHS and GOSH hackathon
Stars: ✭ 21 (-36.36%)
Mutual labels:  responsive
MazeFlix
MazeFlix is an entertainment hub where you can find the latest and your favorite TV shows. You can view the details of the show, like a show or even comment. You can also see other comments which might give you a general idea about what people think about the show. It is built with HTML, CSS and JavaScript with data from the TvMaze API(tv show d…
Stars: ✭ 23 (-30.3%)
Mutual labels:  responsive
webpack-play
learning about webpack
Stars: ✭ 40 (+21.21%)
Mutual labels:  responsive
nuclear
Polymorphic and Multilingual CMS powered by Laravel
Stars: ✭ 31 (-6.06%)
Mutual labels:  responsive
pointcss
A lightweight and flexible CSS Framework for building modern responsive web apps
Stars: ✭ 33 (+0%)
Mutual labels:  responsive

vue-booklet

Vue book-like compoment for create a your own e-book

Vue Booklet is a compoment which can let your create a flipable book fastly, and is responsive. As it's used css animation, it will not support IE 9 and other old browser.

Demo

http://book.sardo.work

Installation

npm install vue-booklet --save

or

yarn add vue-booklet

Usage

Import module from vue-booklet, then register it to Vue:

import booklet from 'vue-booklet';

new Vue({
  el: '#your-dom-element',
   components: {
      booklet
   }
})

And import the css file in your html file:

<link rel="stylesheet" href="vue-booklet.min.css">

After that, you can use vue-booklet on your project now.

Without webpack

<head>
  <link rel="stylesheet" href="vue-booklet.min.css">
</head>
<div id="app">
  <Book>
    <div class="page cover">
      <article class="content">
        <h1>My first book</h1>
      </article>
    </div>
    <div class="page">
      <article class="content">
        <h1>Hello World !</h1>
        <p>Using vue-booklet to create a book which can fliped.</p>
        <p>Please feel free to use it.</p>
      </article>
    </div>
  </Book>
</div>

<script type="text/javascript" src="http://vuejs.org/js/vue.min.js"></script>
<script type="text/javascript" src="vue-booklet.min.js"></script>
<script>
var VueBooklet = window.VueBooklet;

new Vue({
  el: '#vue-booklet-container',
  components: {
    Book: VueBooklet,
  }
})
</script>

Example

<Book>
  <div class="page cover">
    <article class="content">
      <h1>My first book</h1>
    </article>
  </div>
  <div class="page">
    <article class="content">
      <h1>Hello World !</h1>
      <p>Using vue-booklet to create a book which can fliped.</p>
      <p>Please feel free to use it.</p>
    </article>
  </div>
</Book>

If you want to add page to book programmatically, here are one more example:

const newPage = document.createElement('div');
const newContent = document.createElement('div');
newPage.className = 'page';
newContent.className= 'content';
newPage.appendChild(newContent);
pages.appendChild(newPage);

Methods

prevPage(), nextPage()

Function for control the book without button.

this.$refs.book.nextPage();
this.$refs.book.prevPage();

movePage(pageNum)

Function for allow user move to specify page.

const pageNumber = '1';
this.$refs.book.movePage(pageNumber);

Props

displayPageNumber(optional)

Default value is true. Will not show page number when it is false.

enableControl(optional)

Default value is true. Will not allow user control the book when it is false. If you want to control it, add ref to book compoment and call function like this:

this.$refs.book.nextPage();
this.$refs.book.prevPage();

displayButton(optional)

Default value is true. Will not show nextPage and PrevPage button when it is false. Only work when the value of allowFlip is true.

enableSelectPage(optional)

Default value is true. Will not allow user select page when it is false. Only work when the value of allowFlip is true.

langcode(optional)

Set the language of booklet UI. Current support language is English (en), Traditional Chinese (zh-hant) and Simplified Chinese (zh-hans). You can add new langcode with translation props. Default value is en.

translation(optional)

Define translation of booklet UI. You can pass object or JSON string with translated text to it. Default value:

{
  'en': {
    'selectPage': 'Select page',
    'pages': 'Pages',
    'prev': 'Prev',
    'next': 'Next',
  },
  'zh-hant': {
    'selectPage': '跳至指定頁數',
    'pages': '頁數',
    'prev': '上一頁',
    'next': '下一頁',
  },
  'zh-hans': {
    'selectPage': '跳至指定页数',
    'pages': '页数',
    'prev': '上一页',
    'next': '下一页',
  },
}

pageTransitionTime (optional)

Set the transition time of each book page.

Default value is 0.8s.

onOpened(book, position) (optional)

A callback which happens after book opened. Pass the book dom which you can control it, and position of book.

onClosed(book, position) (optional)

A callback which happens after book closed. Pass the book dom which you can control it, and position of book.

onFlipStart(currentPage, direction) (optional)

A callback which happens before a page filped. Pass the page dom which you can control it, and direction for you to know filped to next page or previous page.

onFlipEnd(currentPage, direction) (optional)

A callback which happens after a page filped. Pass the page dom which you can control it, and direction for you to know filped to next page or previous page.

Developing

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].