-
Notifications
You must be signed in to change notification settings - Fork 5
feat: implement hero section, navbar and footer #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
QwertyMD
wants to merge
4
commits into
BIC-DevSphere:develop
Choose a base branch
from
QwertyMD:feat/hero-section
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
281fe98
feat: implement hero section, navbar and footer
QwertyMD d91832a
feat: refactor gallery and user components, update styles and links
QwertyMD 26d717a
feat: update key props for better uniqueness
QwertyMD fe4e22c
feat: implement user home page and update some key props
QwertyMD File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import './gallery.css'; | ||
|
|
||
| interface GalleryItemProps { | ||
| imageSrc: string; | ||
| altText: string; | ||
| rotation?: number; | ||
| } | ||
|
|
||
| const GalleryItem: React.FC<GalleryItemProps> = ({ imageSrc, altText, rotation = 0 }) => { | ||
| return ( | ||
| <div className="gallery-item transition-transform hover:scale-102 mx-8 flex-shrink-0" style={{ transform: `rotate(${rotation}deg)` }}> | ||
| <div className="pin border-white border-2 shadow-lg z-10 rounded-sm bg-[#ef4444] w-3 h-10 absolute" /> | ||
| <div className="polaroid-card bg-white rounded-lg shadow-lg p-3 w-[250px]"> | ||
| <div className="overflow-hidden rounded-sm bg-gray-100"> | ||
| <img src={imageSrc} alt={altText} className="w-full h-52 object-cover bg-[#f3f4f6] rounded-sm" /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default GalleryItem; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| import GalleryItem from './GalleryItem'; | ||
| import './gallery.css'; | ||
|
|
||
| const exampleImages = [ | ||
| 'https://images.unsplash.com/photo-1506744038136-46273834b3fb?w=500&h=400&fit=crop', | ||
| 'https://images.unsplash.com/photo-1469474968028-56623f02e42e?w=500&h=400&fit=crop', | ||
| 'https://images.unsplash.com/photo-1447752875215-b2761acb3c5d?w=500&h=400&fit=crop', | ||
| 'https://images.unsplash.com/photo-1470071459604-3b5ec3a7fe05?w=500&h=400&fit=crop', | ||
| 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=500&h=400&fit=crop', | ||
| 'https://images.unsplash.com/photo-1426604966848-d7adac402bff?w=500&h=400&fit=crop', | ||
| ]; | ||
|
|
||
| const InfiniteGallery: React.FC = () => { | ||
| // Duplicate items to create seamless loop | ||
| const items = [...exampleImages, ...exampleImages, ...exampleImages]; | ||
|
|
||
| return ( | ||
| <div className="gallery-container w-full overflow-hidden py-10"> | ||
| {/* The Line - Static */} | ||
| <div className="h-0.5 bg-black"></div> | ||
|
|
||
| {/* Scrolling Track */} | ||
| <div className="gallery-track flex animate-scroll w-fit"> | ||
| {items.map((src, index) => ( | ||
| <GalleryItem | ||
| key={`gallery-item-${index}`} | ||
| imageSrc={src} | ||
| altText={`Gallery image ${index}`} | ||
| rotation={(index % 2 === 0 ? 2 : -2) + (Math.random() * 2 - 1)} | ||
| /> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default InfiniteGallery; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| .gallery-track { | ||
| animation: scroll 40s linear infinite; | ||
| } | ||
|
|
||
| .gallery-container:hover .gallery-track { | ||
| animation-play-state: paused; | ||
| } | ||
|
|
||
| @keyframes scroll { | ||
| 0% { | ||
| transform: translateX(0); | ||
| } | ||
| 100% { | ||
| transform: translateX(-33.333%); | ||
| } | ||
| } | ||
|
|
||
| .gallery-item:hover { | ||
| transform: rotate(0deg) !important; | ||
| } | ||
|
|
||
| .pin { | ||
| top: -14px; | ||
| left: 50%; | ||
| transform: translateX(-50%) translateY(20%); | ||
| } | ||
|
|
||
| .polaroid-card { | ||
| transform: translateY(10%); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rotationusesMath.random()during render. Any re-render (theme change, parent state update, StrictMode dev re-render, etc.) will cause images to “jump” to new rotations. Precompute a stable rotation list (e.g. viauseMemoseeded bysrc/index) so the layout stays deterministic.