Giter Site home page Giter Site logo

vahidvdn / nativescript-ngx-slides Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joshdsommer/nativescript-ngx-slides

2.0 2.0 0.0 2.87 MB

A NativeScript + Angular module for to add a slides component to your mobile app

License: Other

TypeScript 70.67% HTML 2.75% CSS 4.59% JavaScript 22.00%

nativescript-ngx-slides's Introduction

NativeScript + Angular Slides for iOS and Android

NPM version Downloads Twitter Follow

Intro slides example:

Nativescript Slides. Click to Play

Image carousel example:

Nativescript Slides. Click to Play

videos are from the NativeScript Slides plugin. all features may not be implemented yet.

videos by Brad Martin

Example Usage:

import { SlidesModule } from "nativescript-ngx-slides";

import { AppComponent } from "./app.component";

@NgModule({
  declarations: [AppComponent],
  bootstrap: [AppComponent],
  imports: [NativeScriptModule, SlidesModule],
  schemas: [NO_ERRORS_SCHEMA]
})
export class AppModule {}

XML

<slides>
    <slide class="slide-1">
        <Label text="This is Panel 1"></Label>
    </slide>
    <slide class="slide-2">
        <Label text="This is Panel 2"></Label>
    </slide>
    <slide class="slide-3">
        <Label text="This is Panel 3"></Label>
    </slide>
    <slide class="slide-4">
        <Label text="This is Panel 4"></Label>
    </slide>
    <slide class="slide-5">
        <Label text="This is Panel 5"></Label>
    </slide>
</slides>

CSS

place this in the app.css file in the root of your project.

.slide-1 {
  background-color: darkslateblue;
}

.slide-2 {
  background-color: darkcyan;
}
.slide-3 {
  background-color: darkgreen;
}

.slide-4 {
  background-color: darkgoldenrod;
}
.slide-5 {
  background-color: darkslategray;
}
label {
  text-align: center;
  width: 100%;
  font-size: 35;
  margin-top: 35;
  color: #fff;
}

Great for Intros/Tutorials to Image Carousels.

This very much a work in progress. Please feel free to contribute.

Attributes for SlideContainer

  • loop : boolean - If true will cause the slide to be an endless loop. The suggested use case would be for a Image Carousel or something of that nature.

  • pageIndicators : boolean - If true adds indicator dots to the bottom of your slides.

  • swipeSpeed : number - Determines the speed of swipe. The bigger swipeSpeed property is, the faster you swipe the slides. Default value is 3. Try changing it to 15 to see the result.

Indicators

If the property pageIndicators is true you won't see the page indicators anymore as of 2.0.0 right away. there are two css classes exposed that you can setup however you like for active and inactive indicators. below is an example for semi translucent dots.

.slide-indicator-inactive {
  background-color: #fff;
  opacity: 0.4;
  width: 10;
  height: 10;
  margin-left: 2.5;
  margin-right: 2.5;
  margin-top: 0;
  border-radius: 5;
}

.slide-indicator-active {
  background-color: #fff;
  opacity: 0.9;
  width: 10;
  height: 10;
  margin-left: 2.5;
  margin-right: 2.5;
  margin-top: 0;
  border-radius: 5;
}

Plugin Development Work Flow:

  • Clone repository to your machine.
  • Run npm install to prepare the project
  • Run and deploy to your device or emulator with npm run android or npm run ios
  • Build a ngPackagr version with npm run build

Known issues

  • Does not work well inside of ScrollView or TabViews.

Contributors

TheOriginalJosh dobjek EddyVerbruggen Vahid Najafi Marco Mantovani
Josh Sommer dobjek Eddy Verbruggen Vahid Najafi Codeback Software

Contributing guidelines

Contributing guidelines

License

MIT

for {N} version 2.0.0+

nativescript-ngx-slides's People

Contributors

codeback avatar dobjek avatar eddyverbruggen avatar irman avatar jafaircl avatar joshdsommer avatar theoriginaljosh avatar vahidvdn avatar

Stargazers

 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.