From d12126ee8713da154afc07fa0651cc1d9c9457f7 Mon Sep 17 00:00:00 2001 From: Wanpan Date: Fri, 5 Jul 2024 17:48:58 +0800 Subject: [PATCH] docs: update --- .dumirc.ts | 4 ++-- README.md | 4 ++++ docs/demo/customization.tsx | 6 ++++-- tsconfig.json | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.dumirc.ts b/.dumirc.ts index c008e89..46d2110 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -10,6 +10,6 @@ export default defineConfig({ alias: { 'joystick-kit': path.join(__dirname, 'src'), }, - publicPath: process.env.NODE_ENV === 'production' ? '/joystick/' : '', - base: process.env.NODE_ENV === 'production' ? '/joystick/' : '', + publicPath: process.env.NODE_ENV === 'production' ? '/joystick/' : '/', + base: process.env.NODE_ENV === 'production' ? '/joystick/' : '/', }); diff --git a/README.md b/README.md index f4e4c28..270b7fb 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,7 @@ [![NPM downloads](http://img.shields.io/npm/dm/joystick-kit.svg?style=flat)](https://npmjs.org/package/joystick-kit) Virtual joystick | 虚拟摇杆 游戏手柄 + +[docs](https://wanpan11.github.io/joystick/) + +![image](https://github.com/wanpan11/joystick/assets/38714194/3d97d001-b19f-4a71-b5f1-1053106592fa) diff --git a/docs/demo/customization.tsx b/docs/demo/customization.tsx index bf4f687..e07de91 100644 --- a/docs/demo/customization.tsx +++ b/docs/demo/customization.tsx @@ -1,5 +1,7 @@ import Joystick from 'joystick-kit'; import React, { useEffect } from 'react'; +import back from '../../public/img/joystick_back.png'; +import front from '../../public/img/joystick_frontPressed.png'; export default function Demo() { useEffect(() => { @@ -10,8 +12,8 @@ export default function Demo() { size: 120, position: { top: 'calc(50% - 60px)', left: 'calc(50% - 60px)' }, backImg: { - back: '/img/joystick_back.png', - front: '/img/joystick_frontPressed.png', + back: back, + front: front, }, }); diff --git a/tsconfig.json b/tsconfig.json index 9c4ec07..4f5f3d1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,5 +12,5 @@ "joystick-kit/*": ["src/*", "*"] } }, - "include": [".dumirc.ts", "src/**/*", "docs/**/*"] + "include": [".dumirc.ts", "src/**/*", "docs/**/*", "./index.d.ts"] }