{"id":25510387,"url":"https://github.com/rizkyngrh23/expand-hover-effect","last_synced_at":"2026-01-26T17:32:54.958Z","repository":{"id":275511224,"uuid":"874628442","full_name":"rizkyngrh23/expand-hover-effect","owner":"rizkyngrh23","description":"The Expand Hover Effect animates character cards on hover, expanding them to reveal videos and descriptions, enhancing user engagement and visual appeal.","archived":false,"fork":false,"pushed_at":"2025-02-03T01:26:08.000Z","size":19251,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-20T09:09:17.247Z","etag":null,"topics":["css-card-animation","gsap-animation","hover-effects","html-css-javascript","html5"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rizkyngrh23.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-18T07:11:49.000Z","updated_at":"2025-02-03T01:26:11.000Z","dependencies_parsed_at":"2025-02-03T02:35:04.332Z","dependency_job_id":null,"html_url":"https://github.com/rizkyngrh23/expand-hover-effect","commit_stats":null,"previous_names":["rizkyngrh23/expand-hover-effect"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rizkyngrh23/expand-hover-effect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rizkyngrh23%2Fexpand-hover-effect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rizkyngrh23%2Fexpand-hover-effect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rizkyngrh23%2Fexpand-hover-effect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rizkyngrh23%2Fexpand-hover-effect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rizkyngrh23","download_url":"https://codeload.github.com/rizkyngrh23/expand-hover-effect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rizkyngrh23%2Fexpand-hover-effect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28782959,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css-card-animation","gsap-animation","hover-effects","html-css-javascript","html5"],"created_at":"2025-02-19T09:39:46.879Z","updated_at":"2026-01-26T17:32:54.928Z","avatar_url":"https://github.com/rizkyngrh23.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Expand Hover Effect\n\nThe Expand Hover Effect animates character cards on hover, expanding them to reveal videos and descriptions, enhancing user engagement and visual appeal. \n\n## Project Overview\nThe goal of this project was to create a visually appealing and interactive web page that allows users to explore various elements related to the content.\n\n**Preview**\n   \u003cdiv align=\"center\"\u003e\n      \u003cimg src=\"https://github.com/user-attachments/assets/34c5d66a-e014-4c4d-b827-2eae21748139\" alt=\"preview\" width=\"800\" /\u003e\n   \u003c/div\u003e\n\n\n\n\n## Features\n- Interactive multimedia content.\n- Smooth hover animations for visual engagement.\n- Responsive design for both mobile and desktop devices.\n\n## Tools\n- HTML5\n- CSS3\n- JavaScript\n- GSAP (GreenSock Animation Platform)\n\n## Script Explanation\nThis project is focused on creating an interactive web page with hover effects, expanding images, and triggering animations using HTML, CSS, and JavaScript. Here's a breakdown of the main parts of the code:\n\n**1. HTML**\n\nThe HTML provides the basic structure of the web page. It includes:\n   - Image Previews: These are the main content blocks that showcase multimedia elements (images and videos).\n   - Overlay with Descriptions: Each block contains an overlay with descriptions that appear when the user hovers over the image or video.\nExample:\n\n```html\n\u003cdiv class=\"image-preview\"\u003e\n    \u003cimg src=\"path/to/image.jpg\" alt=\"description\"\u003e\n    \u003cvideo paused loop muted playsinline aria-hidden=\"true\"\u003e\n        \u003csource src=\"path/to/video.mp4\" type=\"video/mp4\"\u003e\n    \u003c/video\u003e\n    \u003cspan class=\"overlay\"\u003e\n        \u003cdiv class=\"desc\"\u003e\n            \u003ch1\u003eTitle\u003c/h1\u003e\n            \u003cp\u003eDescription goes here...\u003c/p\u003e\n        \u003c/div\u003e\n    \u003c/span\u003e\n\u003c/div\u003e\n```\n\u003cbr\u003e\n\n**2. CSS**\n\nThe CSS is used to style the web page and add interactivity. Key points:\n\n   - Layout: Flexbox is used to position elements within the .main-container so that each \"image-preview\" section takes equal space and adjusts based on the screen size.\n   - Hover Effects: When hovering over an image, CSS transitions are used to smoothly reveal the overlay and play the video.\n   - Responsiveness: The design is responsive, ensuring the layout adjusts properly for mobile and desktop views.\n\n```CSS\n.image-preview img, \n.image-preview video {\n    width: 100%;\n    height: 100%;\n    object-fit: cover; \n    position: absolute;\n    top: 0;\n    left: 0;\n    transition: opacity 0.5s ease; \n}\n\n.image-preview:hover .overlay {\n    opacity: 1;\n}\n```\n\u003cbr\u003e\n\n**3. JavaScript**\n\nJavaScript is used to enhance the page’s interactivity:\n\n   - Hover Animations: When the user hovers over an image or video, the size of the block expands dynamically using GSAP (GreenSock Animation Platform) for smooth transitions.\n   - Video Play on Hover: JavaScript ensures that the videos play when hovered over and pause when the mouse leaves.\n   - Animations: GSAP is used to animate the appearance of the image previews and to manage the hover interactions.\n\n```JavaScript\nwindow.onload = () =\u003e {\n    const setOpacity = (opacity) =\u003e image.forEach(img =\u003e img.style.opacity = opacity);\n\n    mainContainer.onmouseenter = () =\u003e setOpacity(0.2);\n    mainContainer.onmouseleave = () =\u003e setOpacity(1);\n\n    gsap.fromTo(imagePreview, {\n        clipPath: \"polygon(0 100%, 100% 100%, 100% 100%, 0 100%, opacity: 0)\",\n    }, {\n        duration: 1.5,\n        clipPath: \"polygon(0 0, 100% 0, 100% 100%, 0 100%)\",\n        opacity: 1,\n    });\n\n    imagePreview.forEach((preview, index) =\u003e {\n        const expandCard = (flexValue) =\u003e gsap.to(preview, { duration: 0.1, flex: flexValue });\n\n        preview.onmouseenter = () =\u003e {\n            expandCard(2);\n            video[index].play();\n        };\n\n        preview.onmouseleave = () =\u003e {\n            expandCard(1);\n            video[index].pause();\n        };\n    });\n};\n\n```\n\n## Getting Started\nTo get a local copy up and running, follow these steps:\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/rizkyngrh23/expand-hover-effect.git\n\n2. Navigate to the project directory:\n   ```bash\n   cd expand-hover-effect/Script\n3. Open the index.html file in your browser to view the project:\n   ```bash\n   open seminar.html\n\n## How to Use\n- Hover over the images to see the smooth hover effects, including the expansion of the image block and the appearance of an overlay with a description.\n- For videos, hovering will automatically play the video, and it will pause when the mouse leaves the area.\n\n## Installation Requirements\nThis project requires the following external library:\n   - GSAP (GreenSock Animation Platform)\n     \n     - You can include GSAP in your project via CDN by adding the following script in your HTML file before the closing \u003c/body\u003e tag:\n       ```html\n       \u003cscript src=\"https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.0/gsap.min.js\"\u003e\u003c/script\u003e\n       ```\n     - Alternatively, you can install GSAP via npm:\n       ```bash\n       npm install gsap\n       ```\n## License\nThis project is licensed under the [MIT License](LICENSE) - see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frizkyngrh23%2Fexpand-hover-effect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frizkyngrh23%2Fexpand-hover-effect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frizkyngrh23%2Fexpand-hover-effect/lists"}