react-holographic-cube 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. package/README.md +75 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,75 @@
1
+ # React Holographic Cube 🎲
2
+
3
+ A high-performance, cyberpunk-styled 3D spinning cube for React. Features physics-based friction, holographic visuals, and a floating drift animation when idle.
4
+
5
+ ![Holographic Cube Preview](https://media4.giphy.com/media/v1.Y2lkPTc5MGI3NjExZTVyamF6bjlsYjB5ZmdmbnlrY2RpNGtsYm9oZW0zNGN4eDZ1YmZmNiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/IWt8NLETm6OLAnHE8C/giphy.gif)
6
+ _(Note: You can replace this link with a screenshot of your actual cube later)_
7
+
8
+ ## Features
9
+
10
+ - **đŸ•šī¸ Physics-Based:** Real momentum and friction (no pre-baked animations).
11
+ - **🔮 Holographic Styling:** Glassy textures, neon borders, and "light pillar" effects.
12
+ - **💨 Anti-Stutter:** Uses a "treadmill" logic to spin infinitely without visual glitches.
13
+ - **🧊 Closed Geometry:** Fully 3D closed cube (including side caps).
14
+ - **📱 Responsive:** Scales nicely within its container.
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ npm install react-holographic-cube
20
+ ```
21
+
22
+ ## Usage
23
+
24
+ âš ī¸ Important: You must import the CSS file for the 3D styles to work!
25
+
26
+ ```javascript
27
+ import React from "react";
28
+ import InfiniteCube from "react-holographic-cube";
29
+
30
+ // 1. IMPORT THE CSS
31
+ import "react-holographic-cube/dist/styles.css";
32
+
33
+ const App = () => {
34
+ // Define the items to show on the faces
35
+ const items = ["đŸ”Ĩ", "💧", "đŸŒŋ", "⚡", "🔮", "🌙"];
36
+
37
+ const handleWin = (result) => {
38
+ console.log("The cube stopped on:", result);
39
+ };
40
+
41
+ return (
42
+ <div
43
+ style={{
44
+ background: "#050510",
45
+ height: "100vh",
46
+ display: "flex",
47
+ justifyContent: "center",
48
+ alignItems: "center",
49
+ flexDirection: "column",
50
+ }}
51
+ >
52
+ {/* 2. RENDER THE COMPONENT */}
53
+ <InfiniteCube items={items} onWinner={handleWin} perspective="1000px" />
54
+ </div>
55
+ );
56
+ };
57
+
58
+ export default App;
59
+ ```
60
+
61
+ ## Props
62
+
63
+ | Prop | Type | Default | Description |
64
+ | ------------- | --------------- | ------------- | ----------------------------------------------------------------------------- |
65
+ | `items` | `Array<string>` | `['1'...'6']` | An array of strings or emojis to display on the cube faces. |
66
+ | `onWinner` | `Function` | `null` | Callback function triggered when the spin finishes. Returns the winning item. |
67
+ | `perspective` | `String` | `"1000px"` | CSS perspective value. Higher = flatter look, Lower = more 3D distortion. |
68
+
69
+ ## License
70
+
71
+ MIT
72
+
73
+ ## Author
74
+
75
+ Marcos Pimienta
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-holographic-cube",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A 3D holographic spinning cube component for React",
5
5
  "source": "src/index.js",
6
6
  "main": "dist/index.js",
@@ -17,4 +17,4 @@
17
17
  "files": [
18
18
  "dist"
19
19
  ]
20
- }
20
+ }