Coder Social home page Coder Social logo

swup / slide-theme Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 6.0 273 KB

A swup theme for slide and fade animations 🎨

Home Page: https://swup.js.org/themes/slide-theme

License: MIT License

JavaScript 39.50% CSS 60.50%
swup page-transitions theme animation slide

slide-theme's Introduction

Swup Slide Theme

A swup theme for in/out slide animations.

Makes the content slide out to one direction, and slide in from the other.

Installation

Install the theme from npm and import it into your bundle.

npm install @swup/slide-theme
import SwupSlideTheme from '@swup/slide-theme';

Or include the minified production file from a CDN:

<script src="https://unpkg.com/@swup/slide-theme@2"></script>

Usage

To run this theme, include an instance in the swup options.

const swup = new Swup({
  plugins: [new SwupSlideTheme()]
});

Options

mainElement

Changes the selector of the elements to slide in/out. Defaults to #swup.

reversed

Reverses the transition direction. Defaults to false.

Customization

You can override the plugin's custom properties to fine-tweak the animation. These are the defaults:

body {
  --swup-slide-theme-translate: 60px;
  --swup-slide-theme-duration-fade: .3s;
  --swup-slide-theme-duration-slide: .4s;
}

slide-theme's People

Contributors

daun avatar dependabot[bot] avatar gmrchk avatar hirasso avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

slide-theme's Issues

Targeting other element than default #swup

Using this option does not appear to be working

var swup = new Swup();
swup.usePlugin(SwupSlideTheme, {mainElement: '#another-element'}); 

Thanks, amazing amazing work

Change default side of slide

Hello ! It's possible to change the default side of slide ? Like in overlay theme (with direction: "to-right", for example)

That would be cool!

How to make "reversed" work?

Slide theme works but I can't make the reversed option work. Is this a correct syntax?

new SwupSlideTheme({ reversed: true});

p.s. it woks if I change it in SwupSlideTheme.js manually

Deprecated dependencies

What did you expect? 🧐

Upgraded to swup 4 from swup 3, using npm uninstall then npm install. Everything installs without errors or warnings with the exception of @swup/slide-theme

What actually happened? 😵‍💫

@swup/slide-theme installs the npm warnings (See 'Relevant log output).
macOS 13.6.4, node v20.11.0, npm 10.2.4

Swup and plugin versions 📝

[email protected]
@swup/[email protected]
@swup/[email protected]
@swup/[email protected]
@swup/[email protected]
@swup/[email protected]

What browsers are you seeing the problem on? 🧭

No response

Relevant log output 🤓

npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
npm WARN deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead

URL to minimal reproduction 🔗

Unable to provide a minimal reproduction URL

Checked all these? 📚

add live demo please

its really hard to recognize what this this work for me please add a live demo for this so we see preview before installing, thank you

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.