Skip to content

Commit

Permalink
Change project name, major ♻️, dynamic import, Nuxt compatability, …
Browse files Browse the repository at this point in the history
…update `LocomotiveScroll` version, version semantic change.

v1.0.0-alpha.1.
  • Loading branch information
somespecialone committed Dec 6, 2023
1 parent 7fe2a78 commit 118212d
Show file tree
Hide file tree
Showing 53 changed files with 1,882 additions and 1,169 deletions.
12 changes: 12 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"root": true,
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/eslint-config-typescript",
"@vue/eslint-config-prettier/skip-formatting"
],
"parserOptions": {
"ecmaVersion": "latest"
}
}
12 changes: 0 additions & 12 deletions .eslintrc.cjs

This file was deleted.

6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ updates:
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 3
open-pull-requests-limit: 2

- package-ecosystem: "npm"
directory: "/lib"
schedule:
interval: "weekly"
open-pull-requests-limit: 3
open-pull-requests-limit: 2

- package-ecosystem: "npm"
directory: "/docs"
schedule:
interval: "weekly"
open-pull-requests-limit: 3
open-pull-requests-limit: 2
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Docs

on:
push:
branches: [ master ]
branches: [ main ]
paths: [ "docs/**" ]

concurrency:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
timeout-minutes: 10
environment:
name: npm
url: https://www.npmjs.com/package/vuecomotive-scroll
url: https://www.npmjs.com/package/potiah
steps:
- uses: actions/download-artifact@v3
with:
Expand Down
82 changes: 45 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
<p align="center">
<a href="https://vuecomotive.somespecial.one" target="_blank" rel="noopener noreferrer">
<img width="240" src="https://raw.githubusercontent.com/somespecialone/vuecomotive-scroll/master/docs/public/logo.svg" alt="Vuecomotive logo">
<a href="https://potiah.somespecial.one" target="_blank" rel="noopener noreferrer">
<img width="240" src="https://raw.githubusercontent.com/somespecialone/potiah/main/docs/public/logo.svg" alt="potiah logo">
</a>
<h1 align="center">Vuecomotive Scroll</h1>
<h1 align="center">Potiah</h1>
</p>

[![Made in Ukraine](https://img.shields.io/badge/made_in-ukraine-ffd700.svg?labelColor=0057b7)](https://stand-with-ukraine.pp.ua)
[![license](https://img.shields.io/github/license/somespecialone/vuecomotive-scroll)](https://github.com/somespecialone/vuecomotive-scroll/blob/master/LICENSE)
[![npm](https://img.shields.io/npm/v/vuecomotive-scroll)](https://www.npmjs.com/package/vuecomotive-scroll)
![npm bundle size](https://img.shields.io/bundlephobia/minzip/vuecomotive-scroll)
[![Docs](https://github.com/somespecialone/vuecomotive-scroll/actions/workflows/docs.yml/badge.svg)](https://github.com/somespecialone/vuecomotive-scroll/actions/workflows/docs.yml)
[![Publish](https://github.com/somespecialone/vuecomotive-scroll/actions/workflows/publish.yml/badge.svg)](https://github.com/somespecialone/vuecomotive-scroll/actions/workflows/publish.yml)
[![license](https://img.shields.io/github/license/somespecialone/potiah)](https://github.com/somespecialone/potiah/blob/main/LICENSE)
[![npm](https://img.shields.io/npm/v/potiah)](https://www.npmjs.com/package/potiah)
[![npm bundle size](https://img.shields.io/bundlephobia/minzip/potiah)](https://bundlephobia.com/package/potiah)
[![Docs](https://github.com/somespecialone/potiah/actions/workflows/docs.yml/badge.svg)](https://github.com/somespecialone/potiah/actions/workflows/docs.yml)
[![Publish](https://github.com/somespecialone/potiah/actions/workflows/publish.yml/badge.svg)](https://github.com/somespecialone/potiah/actions/workflows/publish.yml)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat)](https://github.com/prettier/prettier)
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz_small.svg)](https://stackblitz.com/github/somespecialone/potiah/tree/main/playground/?file=src%2Fpages%2FHomeRoute.vue&title=Potiah%20Playground)

Vuecomotive Scroll is a thin [Vue.js](https://vuejs.org) wrapper for
precious [Locomotive Scroll v5](https://github.com/locomotivemtl/locomotive-scroll) 🚂.
_Potiah_ (pronounced `/pot'jʌɦ/`, means _train_ in Ukrainian) is a thin [Vue.js](https://vuejs.org) wrapper for
precious [Locomotive Scroll](https://github.com/locomotivemtl/locomotive-scroll) 🚂.

It utilizes native `Vue` features such as components and composables to give maximum control over `LocomotiveScroll` API
to developer and make it easier to integrate it into a `Vue` app.
> _"It utilizes native `Vue` features such as components and composables to give maximum control over `LocomotiveScroll`
> API to developer and make it easier to integrate it into a `Vue` app."_
>
> &ndash; ChatGPT
[Documentation 📖](https://vuecomotive.somespecial.one)
* [Documentation 📖](https://potiah.somespecial.one)

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/somespecialone/vuecomotive-scroll/tree/master/demo/?file=src%2FApp.vue)
* [Online playground ✨](https://stackblitz.com/github/somespecialone/potiah/tree/main/playground/?file=src%2Fpages%2FHomeRoute.vue&title=Potiah%20Playground)

---

Expand All @@ -36,59 +39,60 @@ So there might be some breaking changes in the future unless stable (first major
### Bundler / package manager

```sh
npm install vuecomotive-scroll
npm install potiah
```

```sh
pnpm add vuecomotive-scroll
pnpm add potiah
```

```sh
yarn add vuecomotive-scroll
yarn add potiah
```

### Direct Download / CDN

Specified version

```html
<script src="https://unpkg.com/vuecomotive-scroll@0.2.2"></script>
<script src="https://unpkg.com/potiah@1.0.0-alpha.1"></script>
```

Latest

```html
<script src="https://unpkg.com/vuecomotive-scroll"></script>
<script src="https://unpkg.com/potiah"></script>
```

Also note, that you need to load [lenis styles](https://github.com/studio-freight/lenis#considerations) from CDN too
Also note, that you need to load [lenis styles](https://github.com/studio-freight/lenis#considerations) from CDN too

```html
<link rel="stylesheet" href="https://unpkg.com/vuecomotive-scroll/dist/lenis.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/locomotive-scroll@beta/bundled/locomotive-scroll.css">
```

## Basic usage

### Setup plugin

```js
import { createApp } from 'vue'

import 'vuecomotive-scroll/dist/lenis.css' // if you install trough package manager
import createVuecomotiveScroll from 'vuecomotive-scroll'
import 'locomotive-scroll/locomotive-scroll.css' // if you install trough package manager
import { createPotiah } from 'potiah'

import App from './App.vue'

const app = createApp(App)
const scroll = createVuecomotiveScroll()

app.use(scroll)
app.use(createPotiah())
app.mount('#app')
```

### Create view

```vue
<script setup lang="ts">
import { ScrollView } from 'potiah'
</script>
<template>
<ScrollView root :duration="1.7">
<!-- your components/content-->
Expand All @@ -99,6 +103,10 @@ app.mount('#app')
### Place scroll components

```vue
<script setup lang="ts">
import { ScrollView, ScrollComponent } from 'potiah'
</script>
<template>
<ScrollView root :duration="1.7">
<ScrollComponent class="first-scroll-component" :speed="0.2" css-progress>
Expand All @@ -112,10 +120,10 @@ app.mount('#app')
### Use composable

```vue
<script lang="ts">
import { useScroll } from 'vuecomotive-scroll'
<script setup lang="ts">
import { usePotiah } from 'potiah'
const { scrollTo } = useScroll()
const { scrollTo } = usePotiah()
// example
function handleClickOnSomeElement({target}) {
Expand All @@ -126,15 +134,15 @@ function handleClickOnSomeElement({target}) {

## Core

* `scroll` - 🚂.
* `Potiah` - 🚂.
* `<ScrollView />` - wrapper for scrollable scene. It can be whole document or any container element inside the DOM.
* `<ScrollComponent />` - `scroll element` within scroll scene. It gathers all `data-*`
attributes from [Locomotive Scroll element](https://scroll.locomotive.ca/docs/#/attributes).
* `useScroll` - composable that returns `scroll`, `scrollTo` function, refs with scroll data.

> For all details please visit [Documentation 📖](https://vuecomotive.somespecial.one)
* `usePotiah` - composable that returns current `Potiah` instance, `scrollTo` function, refs with scroll data.

## Licences:
> For more information please visit [Documentation 📖](https://potiah.somespecial.one)
* Train from logo - [Aslan Almukhambetov](https://dribbble.com/reggid) CC Attribution
License via [SVG Repo](https://www.svgrepo.com/)
## Credits:
* [Locomotive Scroll](https://github.com/locomotivemtl/locomotive-scroll)
* [Lenis](https://github.com/studio-freight/lenis)
* Train from logo - [Aslan Almukhambetov](https://dribbble.com/reggid) CC Attribution License via [SVG Repo](https://www.svgrepo.com/)
19 changes: 0 additions & 19 deletions demo/package.json

This file was deleted.

5 changes: 0 additions & 5 deletions demo/src/shims-vue.d.ts

This file was deleted.

14 changes: 0 additions & 14 deletions demo/vite.config.ts

This file was deleted.

27 changes: 19 additions & 8 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { defineConfig } from 'vitepress'
import pkg from '../../lib/package.json'

export default defineConfig({
title: 'Vuecomotive',
title: 'Potiah',
lang: 'en',
description: 'Vue.js wrapper for Locomotive Scroll',
appearance: 'dark',
lastUpdated: true,
Expand All @@ -17,9 +18,9 @@ export default defineConfig({
{ text: 'Core', link: '/core/scroll' },
{
text: 'Playground',
link: 'https://stackblitz.com/github/somespecialone/vuecomotive-scroll/tree/master/demo/?file=src%2FApp.vue'
link: 'https://stackblitz.com/github/somespecialone/potiah/tree/main/playground/?file=src%2Fpages%2FHomeRoute.vue&title=Potiah%20Playground'
},
{ text: pkg.version, link: 'https://github.com/somespecialone/vuecomotive-scroll/releases/tag/v' + pkg.version },
{ text: pkg.version, link: 'https://github.com/somespecialone/potiah/releases/tag/v' + pkg.version },
{ text: 'Support Ukraine', link: 'https://war.ukraine.ua/support-ukraine/' }
],
sidebar: [
Expand All @@ -33,18 +34,28 @@ export default defineConfig({
{
text: 'Core',
items: [
{ text: 'Scroll', link: '/core/scroll' },
{ text: 'Potiah', link: '/core/potiah' },
{ text: 'ScrollView', link: '/core/scroll-view' },
{ text: 'ScrollComponent', link: '/core/scroll-component' },
{ text: 'useScroll', link: '/core/use-scroll' }
{ text: 'usePotiah', link: '/core/use-potiah' }
]
},
{
text: 'SSR',
items: [
{ text: 'Compatability', link: '/ssr/compatability' },
{ text: 'Nuxt.js', link: '/ssr/nuxt' }
]
}
],
socialLinks: [{ icon: 'github', link: 'https://github.com/somespecialone/vuecomotive-scroll' }],
socialLinks: [{ icon: 'github', link: 'https://github.com/somespecialone/potiah' }],
editLink: {
pattern: 'https://github.com/somespecialone/vuecomotive-scroll/edit/master/docs/:path',
pattern: 'https://github.com/somespecialone/potiah/edit/master/docs/:path',
text: 'Edit this page on GitHub'
}
},
markdown: { theme: { light: 'material-theme-lighter', dark: 'material-theme-darker' } }
markdown: { theme: { light: 'material-theme-lighter', dark: 'material-theme-darker' } },
sitemap: {
hostname: 'https://potiah.somespecialone.one'
}
})

0 comments on commit 118212d

Please sign in to comment.