haru-cat 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.ja.md +19 -3
- package/README.md +22 -4
- package/dist/HaruCat.d.ts +4 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +13 -8
- package/package.json +2 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
This file records notable changes to Haru Cat. It is maintained manually and
|
|
4
|
+
organized by release.
|
|
5
|
+
|
|
6
|
+
## 0.0.2 — 2026-07-26
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
- Add `offsetX` and `offsetY` props for independent horizontal and vertical
|
|
11
|
+
spacing.
|
|
12
|
+
- Add a `responsive` prop for controlling automatic sizing on smaller screens.
|
|
13
|
+
- Add controls to the development playground for checking size, offsets, and
|
|
14
|
+
responsive behavior.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Enable responsive sizing by default, including for existing usage. On smaller
|
|
19
|
+
screens, the image is limited to 30% of the viewport's shorter side. Set
|
|
20
|
+
`responsive={false}` to preserve the exact `size`.
|
|
21
|
+
- Account for viewport safe-area insets when positioning Haru-kun.
|
|
22
|
+
|
|
23
|
+
## 0.0.1 — 2026-07-23
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- Publish the initial Haru Cat npm package.
|
|
28
|
+
- Add the static `HaruCat` React component and Haru-kun artwork.
|
|
29
|
+
- Support bottom placement, size, offset, z-index, and custom class names.
|
|
30
|
+
- Include TypeScript types and ESM and CommonJS builds.
|
package/README.ja.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Haru Catは、小さなオリジナルキャラクター「ハルくん」をWebサイトの下部に表示するためのReactコンポーネントです。
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
現在のHaru Catは静止画像を表示します。
|
|
6
|
+
アニメーションはまだ含まれていません。
|
|
7
7
|
|
|
8
8
|
[English](./README.md)
|
|
9
9
|
|
|
@@ -38,18 +38,33 @@ export default function App() {
|
|
|
38
38
|
<HaruCat position="bottom-center" />
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
+
横方向と縦方向で異なる余白を指定する場合は、`offsetX`と`offsetY`を使用します。
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
<HaruCat offset={16} offsetX={32} offsetY={24} />
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`offsetX`と`offsetY`は、それぞれの方向で`offset`より優先されます。
|
|
48
|
+
`bottom-center`では、横方向の余白は適用されません。
|
|
49
|
+
|
|
41
50
|
## Props
|
|
42
51
|
|
|
43
52
|
| Prop | 型 | 初期値 | 説明 |
|
|
44
53
|
| --- | --- | --- | --- |
|
|
45
54
|
| `position` | `'bottom-left' \| 'bottom-center' \| 'bottom-right'` | `'bottom-right'` | 画面下部での表示位置です。 |
|
|
46
|
-
| `size` | `number` | `120` |
|
|
55
|
+
| `size` | `number` | `120` | 画像の基準となる幅と高さをピクセル単位で指定します。 |
|
|
47
56
|
| `offset` | `number` | `16` | 画面下端、および左右配置の場合は画面の端からの距離をピクセル単位で指定します。 |
|
|
57
|
+
| `offsetX` | `number` | `undefined` | 左端または右端からの距離です。横方向では`offset`より優先されます。 |
|
|
58
|
+
| `offsetY` | `number` | `undefined` | 画面下端からの距離です。縦方向では`offset`より優先されます。 |
|
|
59
|
+
| `responsive` | `boolean` | `true` | 小さい画面で、画像の大きさを画面の短い辺の30%以下に調整します。 |
|
|
48
60
|
| `zIndex` | `number` | `9999` | コンポーネントのCSS `z-index`です。 |
|
|
49
61
|
| `className` | `string` | `undefined` | 外側の要素に設定するクラス名です。 |
|
|
50
62
|
|
|
51
63
|
コンポーネントには`position: fixed`と`pointer-events: none`が設定されています。
|
|
52
64
|
そのため、ハルくんは画面下部に表示され続け、Webサイト上のボタンやリンク操作を妨げません。
|
|
65
|
+
利用するWebサイトで`viewport-fit=cover`が設定されている場合、Haru Catはブラウザが提供するセーフエリアの余白を自動的に画面端からの余白へ加算します。
|
|
66
|
+
|
|
67
|
+
小さい画面でも`size`を正確なピクセル値として使用したい場合は、`responsive={false}`を指定してください。
|
|
53
68
|
|
|
54
69
|
## TypeScript
|
|
55
70
|
|
|
@@ -74,6 +89,7 @@ npm run build
|
|
|
74
89
|
npm pack --dry-run
|
|
75
90
|
```
|
|
76
91
|
|
|
92
|
+
バージョンごとの変更内容は[CHANGELOG](./CHANGELOG.md)に記録しています。
|
|
77
93
|
プロジェクトの方針と今後の計画は、[Design Notes](https://github.com/Colorful12/haru-cat/blob/main/docs/design-notes.md)にまとめています。
|
|
78
94
|
|
|
79
95
|
## 制作者
|
package/README.md
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
Haru Cat is a React component for placing Haru-kun, a small original cat
|
|
4
4
|
character, at the bottom of your website.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
are planned for future versions.
|
|
6
|
+
Haru Cat currently displays a static image. Animation is not included yet.
|
|
8
7
|
|
|
9
8
|
[日本語](./README.ja.md)
|
|
10
9
|
|
|
@@ -39,18 +38,36 @@ You can also place Haru-kun at the bottom-left or bottom-center of the viewport.
|
|
|
39
38
|
<HaruCat position="bottom-center" />
|
|
40
39
|
```
|
|
41
40
|
|
|
41
|
+
Use `offsetX` and `offsetY` when the horizontal and vertical spacing should be
|
|
42
|
+
different.
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
<HaruCat offset={16} offsetX={32} offsetY={24} />
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`offsetX` and `offsetY` override `offset` on their respective axes. The
|
|
49
|
+
horizontal offset does not apply to `bottom-center`.
|
|
50
|
+
|
|
42
51
|
## Props
|
|
43
52
|
|
|
44
53
|
| Prop | Type | Default | Description |
|
|
45
54
|
| --- | --- | --- | --- |
|
|
46
55
|
| `position` | `'bottom-left' \| 'bottom-center' \| 'bottom-right'` | `'bottom-right'` | Position along the bottom of the viewport. |
|
|
47
|
-
| `size` | `number` | `120` |
|
|
56
|
+
| `size` | `number` | `120` | Preferred width and height of the image in pixels. |
|
|
48
57
|
| `offset` | `number` | `16` | Distance from the bottom and, when applicable, the left or right edge in pixels. |
|
|
58
|
+
| `offsetX` | `number` | `undefined` | Left or right distance in pixels. Overrides `offset` on the horizontal axis. |
|
|
59
|
+
| `offsetY` | `number` | `undefined` | Bottom distance in pixels. Overrides `offset` on the vertical axis. |
|
|
60
|
+
| `responsive` | `boolean` | `true` | Limits the image to 30% of the viewport's shorter side on smaller screens. |
|
|
49
61
|
| `zIndex` | `number` | `9999` | CSS `z-index` of the component. |
|
|
50
62
|
| `className` | `string` | `undefined` | Class name applied to the wrapper element. |
|
|
51
63
|
|
|
52
64
|
The component uses `position: fixed` and `pointer-events: none`, so Haru-kun
|
|
53
65
|
stays at the bottom of the viewport without blocking buttons or links.
|
|
66
|
+
When the host website uses `viewport-fit=cover`, Haru Cat automatically adds
|
|
67
|
+
the safe-area insets provided by the browser to the configured edge offsets.
|
|
68
|
+
|
|
69
|
+
Set `responsive={false}` when `size` must remain an exact pixel size on small
|
|
70
|
+
screens.
|
|
54
71
|
|
|
55
72
|
## TypeScript
|
|
56
73
|
|
|
@@ -75,7 +92,8 @@ npm run build
|
|
|
75
92
|
npm pack --dry-run
|
|
76
93
|
```
|
|
77
94
|
|
|
78
|
-
See the [
|
|
95
|
+
See the [changelog](./CHANGELOG.md) for version history and the
|
|
96
|
+
[design notes](https://github.com/Colorful12/haru-cat/blob/main/docs/design-notes.md)
|
|
79
97
|
for the project's principles and planned direction.
|
|
80
98
|
|
|
81
99
|
## Creators
|
package/dist/HaruCat.d.ts
CHANGED
|
@@ -3,7 +3,10 @@ export type HaruCatProps = {
|
|
|
3
3
|
position?: HaruCatPosition;
|
|
4
4
|
size?: number;
|
|
5
5
|
offset?: number;
|
|
6
|
+
offsetX?: number;
|
|
7
|
+
offsetY?: number;
|
|
8
|
+
responsive?: boolean;
|
|
6
9
|
zIndex?: number;
|
|
7
10
|
className?: string;
|
|
8
11
|
};
|
|
9
|
-
export declare function HaruCat({ position, size, offset, zIndex, className, }: HaruCatProps): import("react").JSX.Element;
|
|
12
|
+
export declare function HaruCat({ position, size, offset, offsetX, offsetY, responsive, zIndex, className, }: HaruCatProps): import("react").JSX.Element;
|