Skip to content

Commit

Permalink
Merge pull request #31 from swup/next
Browse files Browse the repository at this point in the history
Update for swup 4
  • Loading branch information
hirasso authored Jul 26, 2023
2 parents 256b75b + b1ad26e commit 33eade4
Show file tree
Hide file tree
Showing 19 changed files with 5,525 additions and 8,392 deletions.
22 changes: 0 additions & 22 deletions .github/ISSUE_TEMPLATE/issue-template.md

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 12
registry-url: https://registry.npmjs.org/
node-version: 16
registry-url: https://registry.npmjs.org
- run: npm ci
- run: npm publish --access public
env:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/redeploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Redeploy Docs
on:
push:
branches: [master]

jobs:
redeploy-docs:
uses: swup/.github/.github/workflows/redeploy-docs.yml@master
secrets: inherit
35 changes: 35 additions & 0 deletions .github/workflows/version-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow bumps the package.json version and creates a PR

name: Update package version

on:
workflow_dispatch:
inputs:
segment:
description: 'Semver segment to update'
required: true
default: 'patch'
type: choice
options:
- minor
- patch

jobs:
update-version:
name: Update package version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- run: echo "Updating ${{ inputs.segment }} version"
- name: Update version
run: npm --no-git-tag-version version ${{ inputs.segment }}
- uses: peter-evans/create-pull-request@v4
with:
base: 'master'
branch: 'version/automated'
title: 'Update package version (automated)'
commit-message: 'Update package version'
body: 'Automated update to ${{ inputs.segment }} version'
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ wiki-wishlist
*.sublime-workspace
.editorconfig
.idea
lib
dist
/plugins
.vscode/*
!.vscode/settings.json
Expand Down
16 changes: 0 additions & 16 deletions .npmignore

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Georgy Marchuk
Copyright (c) 2023 Georgy Marchuk

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Swup Slide Theme

A [swup](https://swup.js.org) 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.

```bash
npm install @swup/slide-theme
```

```js
import SwupSlideTheme from '@swup/slide-theme';
```

Or include the minified production file from a CDN:

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

## Usage

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

```javascript
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:

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

0 comments on commit 33eade4

Please sign in to comment.