diff --git a/README.md b/README.md index c284e46..2ade05d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

- Pointeract + Pointeract

@@ -27,29 +27,29 @@ library security - package size + package size Typescript Made by Humans

- Introduction • - Advantages • - Get Started • - Features • - Comparison • - Get Involved • - License + + Demo + • + + Documentation + • + + npm +

## What's Pointeract? -Pointeract is a tiny utility library focusing on one thing - handling user interactions with DOM elements. It is fully typed, small, and easy to use. You need to bind your DOM elements, load some modules, and it will start monitoring user interactions and dispatch events like `trueClick` and `pan` with data. +Pointeract is a tiny JavaScript/TypeScript utility library focusing on one thing - handling user interactions with DOM elements, e.g. multitouch and touchpad. -It is built in an extensible architecture with base bundle size only **1KB** minified + gzipped, functionalities come from also byte-sized modules. It's fully **tree-shakable**, the fewer modules you use, the smaller your bundle is. - -Access our documentation [in the website](https://pointeract.consensia.cc/). +With the unique strength of versatile typings in TypeScript and its dynamic nature, Pointeract have achieved a highly _modular, extendable and efficient_ architecture. Its core bundle size is only **1KB** minified + gzipped, functionalities come from also byte-sized modules. It's fully **tree-shakable**, the fewer modules you use, the smaller your bundle is. ## Advantages @@ -88,17 +88,19 @@ Or include the following lines directly in your HTML file: This link ships the latest ESM version by default, to access CJS version or earlier versions, try using a different URL like: ```html - + ``` -The link above ships version 1.0.0 in CJS. +The link above ships version 1.0.1 in CJS. -## Currently Supported Interactions +## Currently Supported Features - **Click (Double Click, Triple Click, Quadruple Click, Any Click)** - **Drag** - **Pan and Zoom via Mouse Wheel (`ctrl`/`shift` key binding, touchpad support)** - **Pan and Zoom via Multitouch (Pan, Pinch)** +- **One-line Prevent Default** +- **Smooth Everything (drag / pan / zoom / any interaction involving numbers)** Those interactions are shipped via modules, which can be composed from a single drag-and-drop to a canvas app. @@ -112,7 +114,7 @@ There're already plenty of interaction libraries out there, most famous ones are | :--------------------------------------------------------------------------------------- | :---------------------------------------------------: | :----------------------------------------------: | :-------------------------------------------------: | | Written in TypeScript? | ✅ | ❌ | ✅ | | Tree-shakeable? | [✅](https://bundlephobia.com/package/pointeract) | [❌](https://bundlephobia.com/package/hammerjs) | [❌](https://bundlephobia.com/package/interactjs) | -| Bundle Size (Minified + Gzipped) | 👑 [2KB](https://bundlephobia.com/package/pointeract) | [7KB](https://bundlephobia.com/package/hammerjs) | [28KB](https://bundlephobia.com/package/interactjs) | +| Bundle Size (Minified + Gzipped) | 👑 [3KB](https://bundlephobia.com/package/pointeract) | [7KB](https://bundlephobia.com/package/hammerjs) | [28KB](https://bundlephobia.com/package/interactjs) | | Last Updated | 👑 Actively Maintained | 2015 | 2023 | | Features | Pointer and Wheel Related | Pointer Related | 👑 Pointer and Wheel Related + Comprehensive Utils | | Robust? (See [Testing](https://pointeract.consensia.cc/development/testing#monkey-test)) | ✅ | ❌ Element Jerks | ❌ Element Ignores the Second Touch | diff --git a/assets/logo-text.svg b/assets/logo-text.svg new file mode 100644 index 0000000..29c3d88 --- /dev/null +++ b/assets/logo-text.svg @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/logoText.svg b/assets/logoText.svg deleted file mode 100644 index 316fcba..0000000 --- a/assets/logoText.svg +++ /dev/null @@ -1,169 +0,0 @@ - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 26301be..15a6f22 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -14,8 +14,16 @@ export default defineConfig({ root: { label: 'English', lang: 'en' }, }, head: [ - ['link', { rel: 'icon', href: '/logoFlat.svg' }], + ['link', { rel: 'icon', href: '/favicon.ico' }], ['meta', { name: 'color-scheme', content: 'dark light' }], + [ + 'script', + { + differ: '', + src: 'https://analytics.consensia.cc/script.js', + 'data-website-id': 'f4ddf973-093c-4660-bda7-65a511d5b26c', + }, + ], [ 'meta', { @@ -32,25 +40,22 @@ export default defineConfig({ { text: 'Home', link: '/' }, { text: 'Documentation', link: '/get-started' }, ], - logo: { src: '/logoFlat.svg', alt: 'Pointeract logo' }, + logo: { src: '/logo-small.svg', alt: 'Pointeract logo' }, sidebar: [ { text: 'Introduction', items: [ { text: "What's Pointeract?", link: '/whats-pointeract' }, - { text: 'Get Started', link: '/get-started' }, { text: 'Playground', link: '/playground' }, + { text: 'Get Started', link: '/get-started' }, ], }, { text: 'Basic', - link: '/basic', items: [ - { text: 'Lifecycle', link: '/basic/lifecycle' }, - { text: 'Module Lifecycle', link: '/basic/module-lifecycle' }, - { text: 'Options', link: '/basic/options' }, - { text: 'Subscribe/Unsubscribe', link: '/basic/subscribe-unsubscribe' }, + { text: 'Use Pointeract', link: '/basic/use-pointeract' }, + { text: 'Types', link: '/basic/types' }, ], }, { @@ -62,6 +67,7 @@ export default defineConfig({ { text: 'Drag', link: '/modules/drag' }, { text: 'Wheel Pan Zoom', link: '/modules/wheel-pan-zoom' }, { text: 'Multitouch Pan Zoom', link: '/modules/multitouch-pan-zoom' }, + { text: 'Lubricator', link: '/modules/lubricator' }, ], }, { @@ -76,11 +82,9 @@ export default defineConfig({ }, { text: 'Development', + collapsed: true, items: [ { text: 'Custom Modules', link: '/development/custom-modules' }, - { text: 'Custom Events', link: '/development/custom-events' }, - { text: 'Custom Options', link: '/development/custom-options' }, - { text: 'Modifier', link: '/development/modifier' }, { text: 'Testing', link: '/development/testing' }, ], }, @@ -92,6 +96,7 @@ export default defineConfig({ { icon: 'github', link: 'https://github.com/hesprs/pointeract' }, ], editLink: { pattern: 'https://github.com/hesprs/pointeract/edit/main/docs/:path' }, + outline: 'deep', }, markdown: { config(md) { @@ -101,6 +106,7 @@ export default defineConfig({ }, vite: { plugins: [groupIconVitePlugin()], + publicDir: resolve(__dirname, '../public'), resolve: { alias: { '@': resolve(__dirname, '..', '..', 'src/'), diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts index 183e5ed..3da7b14 100644 --- a/docs/.vitepress/theme/index.ts +++ b/docs/.vitepress/theme/index.ts @@ -2,6 +2,7 @@ import './style.css'; import 'virtual:group-icons.css'; +import './style.css'; import type { Theme } from 'vitepress'; import DefaultTheme from 'vitepress/theme'; diff --git a/docs/.vitepress/theme/layout.vue b/docs/.vitepress/theme/layout.vue index 3e9097e..62e12a4 100644 --- a/docs/.vitepress/theme/layout.vue +++ b/docs/.vitepress/theme/layout.vue @@ -16,8 +16,6 @@ const setupToggleDark = (isDark: Ref) => { isDark.value = !isDark.value; return; } - - console.log('toggle-appearance'); document.documentElement.style.setProperty('--darkX', x + 'px'); document.documentElement.style.setProperty('--darkY', y + 'px'); diff --git a/docs/.vitepress/theme/style.css b/docs/.vitepress/theme/style.css index 9fa7fda..8dfaedf 100644 --- a/docs/.vitepress/theme/style.css +++ b/docs/.vitepress/theme/style.css @@ -49,10 +49,10 @@ --vp-c-default-3: var(--vp-c-gray-3); --vp-c-default-soft: var(--vp-c-gray-soft); - --vp-c-brand-1: var(--vp-c-indigo-1); - --vp-c-brand-2: var(--vp-c-indigo-2); - --vp-c-brand-3: var(--vp-c-indigo-3); - --vp-c-brand-soft: var(--vp-c-indigo-soft); + --vp-c-brand-1: var(--vp-c-orange-1) !important; + --vp-c-brand-2: var(--vp-c-orange-2) !important; + --vp-c-brand-3: var(--vp-c-orange-3) !important; + --vp-c-brand-soft: var(--vp-c-orange-soft) !important; --vp-c-tip-1: var(--vp-c-brand-1); --vp-c-tip-2: var(--vp-c-brand-2); @@ -68,6 +68,17 @@ --vp-c-danger-2: var(--vp-c-red-2); --vp-c-danger-3: var(--vp-c-red-3); --vp-c-danger-soft: var(--vp-c-red-soft); + + --vp-c-orange-3: #f9b44e; + --vp-c-orange-2: #ff9626; + --vp-c-orange-1: #ff6f0f; + --vp-c-yellow-soft: rgba(255, 191, 0, 0.16); +} + +html.dark { + --vp-c-orange-1: #f9b44e; + --vp-c-orange-2: #ff9626; + --vp-c-orange-3: #ff6f0f; } /** @@ -91,11 +102,15 @@ * -------------------------------------------------------------------------- */ :root { - --vp-home-hero-name-color: transparent; - --vp-home-hero-name-background: -webkit-linear-gradient(120deg, #bd34fe 30%, #41d1ff); - - --vp-home-hero-image-background-image: linear-gradient(-45deg, #bd34fe 50%, #47caff 50%); - --vp-home-hero-image-filter: blur(44px); + --vp-home-hero-name-color: transparent !important; + --vp-home-hero-name-background: linear-gradient(120deg, #ff3b3b, #ffc403) !important; + + --vp-home-hero-image-background-image: linear-gradient( + -45deg, + #3bffc1 50%, + #ffc847 50% + ) !important; + --vp-home-hero-image-filter: blur(44px) !important; } @media (min-width: 640px) { diff --git a/docs/components/playground.vue b/docs/components/playground.vue index 6697ec8..45758b3 100644 --- a/docs/components/playground.vue +++ b/docs/components/playground.vue @@ -1,5 +1,5 @@