diff --git a/README.md b/README.md index 6fbbe8c..a5dda35 100644 --- a/README.md +++ b/README.md @@ -58,22 +58,30 @@ function App() { ## Advanced Usage -The demos illustrate how the component can be initialised with more props - along with images and videos inside the child divs - for a richer user experience. Demo 3 also uses a custom video component with preview images, which optimises load and plays only when the current item is active/selected. +The demos illustrate how the component can be initialised with more props - along with images and videos inside the child divs - for a richer user experience. Demo 3 goes even further and uses a custom video component with preview images, optimised to only play video when the current item is active: ```jsx <> - + setSelectedIndex(i)} > - {demo2Images.map((imageUrl, index) => ( -
- -
+ {demo3Assets.map((item, index) => ( + ))}
@@ -135,8 +143,7 @@ Under the hood, Divz performs CSS3 transforms on the core component and the chil Sample media used in the [demos](https://lewhunt.github.io/divz/) are from various open source projects: -- Demo 2 images are generated in [Midjourney](https://www.midjourney.com/) by [Manoela Ilic](https://github.com/codrops/LayersAnimation/) -- Demo 3 images and videos are from [Pixabay](https://pixabay.com/) and [Runway](https://runwayml.com/) +- Demo 2 and 3 images and videos are from [Pixabay](https://pixabay.com/) and [Runway](https://runwayml.com/) - Demo 4 images are generated in [Midjourney](https://www.midjourney.com/) by [Manoela Ilic](https://github.com/codrops/GridItemHoverEffect/)
diff --git a/package.json b/package.json index 027ddb4..4889c90 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "author": "Lewis Hunt", "description": "A React UI component that lets you scroll, swipe & zoom through HTML elements on the 3D z-axis", "private": false, - "version": "1.1.7", + "version": "1.1.8", "type": "module", "homepage": "https://lewhunt.github.io/divz", "repository": "https://github.com/lewhunt/divz.git", diff --git a/src/App.tsx b/src/App.tsx index f43d47a..a8f4b95 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -17,7 +17,7 @@ function App() { }; return ( -
= 3 ? "dark-mode" : ""}`}> +
= 2 ? "dark-mode" : ""}`}>
{[1, 2, 3, 4].map((demoNumber) => ( @@ -72,33 +72,37 @@ function Demo1() { ); } -const demo2Images: string[] = []; - -/* Demo 2 images generated in Midjourney by Manoela Ilic: -https://github.com/codrops/LayersAnimation/ -*/ -for (let i = 1; i <= 5; i++) { - demo2Images.push(`./demo2/${i}.jpg`); -} - function Demo2() { - const [selectedIndex, setSelectedIndex] = useState(0); return ( <> - + - setSelectedIndex(i)} - onPlaying={(i) => console.log("divz playing: ", i)} - > - {demo2Images.map((imageUrl, index) => ( -
- -
- ))} + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
);