• Stars
    star
    148
  • Rank 248,499 (Top 5 %)
  • Language
    JavaScript
  • Created over 9 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A plugin for Framework7 that displays a swipeable welcome screen to guide the user through a tutorial

Framework7 Plugin Welcomescreen

This plugin will show a tutorial screen when starting Framework7 apps and websites. (Note: There is also a generic version that does not rely on Framework7 available)

Screenshot

Framwork7 Welcomescreen Plugin Screenshot

Live demo

You can find a running demo here.

Install

1. Add dependency

With module bundler (Webpack, Vite...)

$ yarn add f7-welcomescreen

In your main js file do:

import F7WelcomescreenPlugin from 'f7-welcomescreen';

In your stylesheet add F7 styles (if not exist yet!). This is when using Webpack:

@import '~f7-welcomescreen/styles.css';

For Vite

@import 'f7-welcomescreen/styles.css';

Alternative: Without bundler (direct linking)

  1. Copy files f7-welcomescreen.min.js and f7-welcomescreen.min.css from dist into your project folder.
  2. Reference the files in HTML like this:
<head>
  <link rel="stylesheet" href="f7-welcomescreen.min.css"></link>
  <script src="f7-welcomescreen.min.js"></script>
</head>

3. Define slides

var welcomescreen_slides = [
  {
    id: 'slide0',
    title: 'Slide 0', // optional
    picture: '<div class="tutorialicon">β™₯</div>',
    text: 'Welcome to this tutorial. In the next steps we will guide you through a manual that will teach you how to use this app.',
  },
  {
    id: 'slide1',
    title: 'Slide 1', // optional
    picture: '<div class="tutorialicon">✲</div>',
    text: 'This is slide 2',
  },
  {
    id: 'slide2',
    title: 'Slide 2', // optional
    picture: '<div class="tutorialicon">β™«</div>',
    text: 'This is slide 3',
  },
  {
    id: 'slide3',
    //title: 'NO TITLE',
    picture: '<div class="tutorialicon">β˜†</div>',
    text: 'Thanks for reading! Enjoy this app.<br><br><a id="tutorial-close-btn" href="#">End Tutorial</a>',
  },
];

Used parameters are:

  • id Set an id for this slide
  • picture Set free html here
  • text You can set html here but I recommend using just plain text

4. Initialize & options

For Framework7 Core version

Framework7.use(F7WelcomescreenPlugin);

// Define options for welcomescreen plugin
var options = {
  bgcolor: '#0da6ec',
  fontcolor: '#fff',
};

var app = new Framework7({
  root: '#app', // or what ever your root is
  name: 'welcomescreen-demo', // choose a name
  welcomescreen: {
    // Setup welcomescreen plugin
    slides: welcomescreen_slides,
    options: options,
  },
});

For Framework7 React version

app.js

Framework7.use(F7WelcomescreenPlugin);

app.jsx

var options = {
  bgcolor: '#0da6ec',
  fontcolor: '#fff',
};

const f7params = {
  name: 'welcomescreen-demo',
  theme: 'auto',
  store: store,
  routes: routes,
  welcomescreen: {
    slides: welcomescreen_slides,
    options: options,
  },
};

For Framework7 Vue version

app.js

Framework7.use(F7WelcomescreenPlugin);

const app = createApp(App);
registerComponents(app);
app.mount('#app');

In your component add parameters in onMounted() and initilize:

onMounted(() => {
  f7ready((f7) => {
    f7.welcomescreen.init(welcomescreen_slides, options);
  });
});

You can use same values for welcomescreen_slides and options as with React and Core version above.

Available options (if not set, default will be used)

  • bgcolor Set background color
  • fontcolor Set font color
  • closeButton (Default: true) Enabled/disable close button
  • closeButtonText (Default: 'Skip') Close button text
  • cssClass (Default: '') Additional class on container
  • pagination (Default: true) Swiper pagination
  • navigation (Default: false) Swiper navigation
  • loop (Default: false) Swiper loop
  • template (Default: String) Pass in a custom Dom7 template to render Welcomescreen
  • open (Default: true) Open welcome screen on init
  • onOpened (Default: none) Callback function when welcomescreen is opened
  • onClosed (Default: none) Callback function when welcomescreen is closed
  • parallax (Default: true), Enable parallax
  • parallaxBackgroundImage (Default: 'http://lorempixel.com/900/600/nightlife/2/') Parallax default background image
  • parallaxBackground (Default percentage: '-23%') Parallax default background speed effect
  • parallaxSlideElements (Default number per element: {title: -100, subtitle: -200, text: -300}) Set speed of each element in parallax mode

Note:

  • number - value in px (as for title, subtitle in example above) to move element depending on progress. In this case such element will be moved on Β± this value in px depending on slide position (next or previous)
  • percentage - (as for "parallax-bg") to move element depending on progress and on its size. In this case such element will be moved on Β± this percentage of its size (width in horizontal direction, and height in vertical direction) depending on slide position (next or previous). So if element has 400px width and you specified data-swiper-parallax="50%" then it will be moved on Β± 200px

API

The following methods are available on a welcomescreen instance

app.welcomescreen.open(); // Open the screen
app.welcomescreen.close(); // Closes it
app.welcomescreen.next(); // Go to next slide
app.welcomescreen.previous(); // Go to previous slide
app.welcomescreen.slideTo(i); // Go to slide with index i

Example project

See demo directory. The demo has the following scripts:

  • yarn start Starts a http server and serves content from demo/build
  • yarn build Creates a new build into the demo/build directory
  • yarn watch Watches for changes in .js files and runs yarn build

I recommend to just run yarn start from the demo directory. Then open http://127.0.0.1:8080 in your browser.

Credits

Made with <3 by www.timo-ernst.net

My YouTube channel about Framework7: http://www.timoernst.tv

Thanks for helping @nolimits4web

More Repositories

1

Framework7-with-AngularJS-demo-app

⛔️ Unmaintained and deprecated!
JavaScript
81
star
2

Framework7-Pure-Angular-Template

⛔️ Unmaintained and deprecated! Don't use any more! Instead check official F7 templates: http://framework7.io/templates/
HTML
71
star
3

Toast-for-Framework7

A toast component plugin for iOS Framework7
JavaScript
43
star
4

pgchat

Demo chat app for PGDay EU 2017, built with Framework7-Vue
JavaScript
38
star
5

Framework7-Upscroller-Plugin

A little framework7 plugin to give users a button to scroll up
JavaScript
32
star
6

framework7-simplest-template

The simplest Framework7 template possible
HTML
18
star
7

tindercardsjs

A html-based js component that lets you swipe cards like in Tinder
JavaScript
14
star
8

swiper-react-demo

Demo application for my tutorial video for swiper-react on YouTube
JavaScript
13
star
9

Framework7-Typescript-Template

⛔️ Unmaintained and deprecated! Don't use any more! Instead check official F7 templates: http://framework7.io/templates/
JavaScript
13
star
10

swiper-react-responsive-breakpoints-demo

A demo which shows how to resize swiper-react carousels with breakpoints for responsive web design
HTML
12
star
11

welcomescreen.js

Guides the user through a swipeable tutorial screen for iOS and Android
JavaScript
10
star
12

Todo-App-Example-with-Vuex-and-Framework7

JavaScript
10
star
13

framework7-authentication-demo

Example code for my Framework7 auth tutorial with Firebase
JavaScript
10
star
14

jrpg

Source code for my tutorial about rpg.js
TypeScript
5
star
15

hcal

HTML5 calendar widget inspired by iOS
JavaScript
5
star
16

f7-node-autocomplete-search-demo

A demo app showing how to use F7 with Node to build an autocomplete search
JavaScript
5
star
17

Phonegap-Vue.js-Framework7-template

⛔️ Unmaintained and deprecated! Don't use any more! Instead check official F7 templates: http://framework7.io/templates/
Objective-C
4
star
18

Twitvue-Episode-01

Source code for Twitvue demo app
JavaScript
4
star
19

particle-animation-javascript

Demo code for my particle animation video in JavaScript/HTML5 Canvas
JavaScript
4
star
20

framework7-v2-router-demo

A demo app showing how to use Framework7 V2 Router
JavaScript
3
star
21

swiper-autoplay

A quick demo which shows how to use the autoplay feature in Swiper React
JavaScript
3
star
22

Framework7-Lazy-Loading-with-AngularJS

⛔️ Unmaintained and deprecated!
CSS
2
star
23

twitvue03

Sourcecode for episode 3 (Posting tweets to Twitter API) of the series on "How to create a Twitter app with VueJS, PhoneGap and Framework7"
JavaScript
2
star
24

Twitvue02

Sourcecode for Episode 2 of the YouTube series on how to create a Twitter app with VueJS, PhoneGap and Framework7 (Twitter oauth authentication)
JavaScript
1
star
25

framework7-pgchat-react

React version of PGChat (formerly Vue)
1
star
26

Framework7-v2-PhoneGap-Kitchen-Sink

Just a test of Framework7 V2 Kitchen Sink combined with PhoneGap.
HTML
1
star
27

swiper-react-arrow-colors

Demo app how to customize prev/next arrows in React Swiper Js
JavaScript
1
star
28

hwtest

JavaScript
1
star
29

snake

A simple snake game built with HTML and JavaScript
JavaScript
1
star
30

Twitvue04

Sourcecode for episode 4 (Port a Vue.js app to PhoneGap) of the series on "How to create a Twitter app with VueJS, PhoneGap and Framework7"
JavaScript
1
star
31

Framework7-Ajax-Pages-With-Angular-Demo

⛔️ Unmaintained and deprecated!
JavaScript
1
star