diff --git a/src/components/content/ColoringBookSection/data.ts b/src/components/content/ColoringBookSection/data.ts deleted file mode 100644 index abfee2c25f..0000000000 --- a/src/components/content/ColoringBookSection/data.ts +++ /dev/null @@ -1,21 +0,0 @@ -export default { - title: 'Have fun coloring and learn about Podman!', - description: - "A decentralized team of open source container tool superheroes comes to the rescue when an asteroid storm threatens the planet. Learn about each tool—Podman, CRI-O, Buildah, Skopeo, and OpenShift—as they redesign the planet's protective shields' container deployment to protect Earth.", - button: { - text: 'Download', - path: 'https://developers.redhat.com/e-books/container-commandos-coloring-book', - }, - extraBook: { - text: 'Podman in Action', - path: 'https://developers.redhat.com/sites/default/files/Podman%20in%20Action%20e-book%20cover_1.png', - }, - featureImage: { - src: 'images/optimized/comic-cover-224w-288h.webp', - alt: 'Container Commandos coloring book cover', - }, - collageImages: { - src: 'images/optimized/coloring-pages-496w-364h.webp', - alt: 'A collection of pages from the Podman coloring book.', - }, -}; diff --git a/src/components/content/ColoringBookSection/index.tsx b/src/components/content/ColoringBookSection/index.tsx deleted file mode 100644 index 2781e61de5..0000000000 --- a/src/components/content/ColoringBookSection/index.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import React from 'react'; -import Button from '@site/src/components/utilities/Button'; -import data from './data'; -function ColoringBookSection() { - return ( -
-
-
-

{data.title}

-

{data.description}

-
-
- {data.featureImage.alt} -
-
-
- {data.collageImages.alt} -
-
- ); -} - -export default ColoringBookSection; diff --git a/src/components/content/LiteratureCarousel/index.tsx b/src/components/content/LiteratureCarousel/index.tsx new file mode 100644 index 0000000000..faa497adfd --- /dev/null +++ b/src/components/content/LiteratureCarousel/index.tsx @@ -0,0 +1,104 @@ +import React, { useState, useEffect } from 'react'; +import { Icon } from '@iconify/react'; +import Button from '@site/src/components/utilities/Button'; +import { literature } from '@site/static/data/literature'; + +function LiteratureCarousel() { + const [activeIndex, setActiveIndex] = useState(0); + + // Randomize initial book on page load + useEffect(() => { + setActiveIndex(Math.floor(Math.random() * literature.length)); + }, []); + const currentBook = literature[activeIndex]; + + const navigateLeft = () => { + setActiveIndex((prev) => (prev > 0 ? prev - 1 : literature.length - 1)); + }; + + const navigateRight = () => { + setActiveIndex((prev) => (prev < literature.length - 1 ? prev + 1 : 0)); + }; + + return ( +
+
+ {/* Left Arrow */} + + + {/* Book Content - Fixed Width Container */} +
+
+ {/* Book Cover Image (only if available) */} + {currentBook.coverImage && ( +
+ {currentBook.coverImage.alt} +
+ )} + + {/* Text Content */} +
+

+ {currentBook.title} +

+

{currentBook.description}

+
+
+ + {/* Extra Images (like coloring pages collage) */} + {currentBook.extraImages && ( +
+ {currentBook.extraImages.alt} +
+ )} +
+ + {/* Right Arrow */} + +
+ + {/* Carousel Indicators */} +
+ {literature.map((_, index) => ( +
+
+ ); +} + +export default LiteratureCarousel; diff --git a/src/pages/features.tsx b/src/pages/features.tsx index e392ad1c4b..b44f852101 100644 --- a/src/pages/features.tsx +++ b/src/pages/features.tsx @@ -5,7 +5,7 @@ import { Icon } from '@iconify/react'; import Markdown from '@site/src/components/utilities/Markdown'; import PageHeader from '@site/src/components/layout/PageHeader'; import SectionHeader from '@site/src/components/layout/SectionHeader'; -import ColoringBookSection from '@site/src/components/content/ColoringBookSection'; +import LiteratureCarousel from '@site/src/components/content/LiteratureCarousel'; import FeaturesCarousel from '@site/src/components/content/FeaturesCarousel'; import BlogArticlesList from '@site/src/components/content/BlogArticlesList'; /* PAGE DATA */ @@ -205,7 +205,7 @@ function Features() { - + ); } diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 1df142b116..a9468c35e8 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -6,7 +6,7 @@ import HeroHeader from '@site/src/components/layout/HeroHeader'; import SectionHeader from '@site/src/components/layout/SectionHeader'; import InfoBanner from '@site/src/components/ui/InfoBanner'; import ThumbCard from '@site/src/components/ui/ThumbCard'; -import ColoringBookSection from '@site/src/components/content/ColoringBookSection'; +import LiteratureCarousel from '@site/src/components/content/LiteratureCarousel'; import TestimonialSection from '@site/src/components/content/TestimonialSection'; import BlogArticlesList from '@site/src/components/content/BlogArticlesList'; /* PAGE DATA */ @@ -57,7 +57,7 @@ function IndexPage() { - + ); } diff --git a/static/data/literature.ts b/static/data/literature.ts new file mode 100644 index 0000000000..a95513e057 --- /dev/null +++ b/static/data/literature.ts @@ -0,0 +1,47 @@ +export const literature = [ + { + id: 'container-commandos', + title: 'Have fun coloring and learn about Podman!', + description: + "A decentralized team of open source container tool superheroes comes to the rescue when an asteroid storm threatens the planet. Learn about each tool—Podman, CRI-O, Buildah, Skopeo, and OpenShift—as they redesign the planet's protective shields' container deployment to protect Earth.", + button: { + text: 'Download', + path: 'https://developers.redhat.com/e-books/container-commandos-coloring-book', + }, + coverImage: { + src: 'images/raw/comic-cover-224w-288h.png', + alt: 'Container Commandos coloring book cover', + }, + extraImages: { src: 'images/raw/coloring-pages.png', alt: 'A collection of pages from the Podman coloring book.' }, + }, + { + id: 'podman-in-action', + title: 'Podman in Action', + description: + 'Learn container management with Podman through hands-on examples. This comprehensive guide covers everything from basic container operations to advanced multi-container applications and Kubernetes integration.', + button: { + text: 'Download', + path: 'https://developers.redhat.com/e-books/podman-action', + }, + coverImage: { + src: 'images/raw/podman-in-action-cover.png', + alt: 'Podman in Action book cover', + }, + extraImages: null, + }, + { + id: 'podman-for-devops', + title: 'Podman for DevOps', + description: + 'Streamline your DevOps workflows with Podman. Discover how to integrate Podman into CI/CD pipelines, manage container lifecycles, and deploy scalable applications without the overhead of a container daemon.', + button: { + text: 'Learn More', + path: 'https://www.packtpub.com/en-us/product/podman-for-devops-9781835886632', + }, + coverImage: { + src: 'images/raw/podman-for-devops-cover.jpg', + alt: 'Podman for DevOps book cover', + }, + extraImages: null, + }, +]; diff --git a/static/images/raw/podman-for-devops-cover.jpg b/static/images/raw/podman-for-devops-cover.jpg new file mode 100644 index 0000000000..4469d0f99a Binary files /dev/null and b/static/images/raw/podman-for-devops-cover.jpg differ diff --git a/static/images/raw/podman-in-action-cover.png b/static/images/raw/podman-in-action-cover.png new file mode 100644 index 0000000000..514161b000 Binary files /dev/null and b/static/images/raw/podman-in-action-cover.png differ