-
Notifications
You must be signed in to change notification settings - Fork 0
Implemented stretchy header #37
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
Conversation
…ui into caitlyn/issues
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.
Great work Caitlyn! Looks very clean. Please address my comments about the naming convention and request me again.
let height = geometryProxy.size.height | ||
|
||
content | ||
.frame(height: minY > 0 ? height + originY : height) |
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.
what does this logic do? I think that if some vertical delta component is non-negative, we change our height, otherwise we keep it the same. Is the purpose of this for making the header have more "range"/more animated?
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.
Yeah, the content
in this case is the image itself, and we are adjusting the height of the image based on the view's frame relative to the whole screen. If we scroll up, the image is lower on the screen, so we increase the height of the image and the .offset
modifier sets the image's y-offset so that it stays at the top of the screen. This creates an "animated stretchy" effect.
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.
+1
- Renamed geometry proxy
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.
Great job Caitlyn! One small comment about the file name, but otherwise good to go. Also, you may or may not have to rebase with main
to resolve merge conflicts, but we can deal with that once the chained branches are merged.
- Fixed naming error
* Update README.md * Create pull_request_template.md * Removed building hours and replaced status * Replaced GYMS with RECREATION CENTERS in home view * Replaced capacities with FITNESS CENTER CAPACITIES * Replaced buildings hours in gym cells - Created functions for open/close time logic based on fitness centers - Changed open/close status and time * Addressed Vin's comments - Renamed home page labels - Removed `GymDetailViewModel` - Added `fitnessCenterIsOpen()` and `determineStatus()` to `Gym` model - Created test cases for the above functions - Created dummy data for Teagle - Simplified status logic in `HomeGymCell` * Fixed dummy data and removed unused code * Fixed status colors and removed unused code * Addressed Vin's comments - Fixed grammatical errors * Implemented stretchy header (#37) * Made fitness center images stretchy headers * Modified gym images as stretchy headers * Update Package.resolved * Addressed Vin's comments - Renamed geometry proxy * Addressed Vin's comments - Fixed naming error * Create Package.resolved * Tab bar styling adjustment (#38) * Made fitness center images stretchy headers * Modified gym images as stretchy headers * Adjusted font/color on tab bar and added divider * Update Package.resolved * Addressed Vin's comments - Renamed variable name * Update project.pbxproj * Update Package.resolved --------- Co-authored-by: Vin Bui <[email protected]> Co-authored-by: Vin Bui <[email protected]>
* Update README.md * Create pull_request_template.md * Removed building hours and replaced status * Replaced GYMS with RECREATION CENTERS in home view * Replaced capacities with FITNESS CENTER CAPACITIES * Replaced buildings hours in gym cells - Created functions for open/close time logic based on fitness centers - Changed open/close status and time * Addressed Vin's comments - Renamed home page labels - Removed `GymDetailViewModel` - Added `fitnessCenterIsOpen()` and `determineStatus()` to `Gym` model - Created test cases for the above functions - Created dummy data for Teagle - Simplified status logic in `HomeGymCell` * Fixed dummy data and removed unused code * Fixed status colors and removed unused code * Addressed Vin's comments - Fixed grammatical errors * Implemented stretchy header (#37) * Made fitness center images stretchy headers * Modified gym images as stretchy headers * Update Package.resolved * Addressed Vin's comments - Renamed geometry proxy * Addressed Vin's comments - Fixed naming error * Create Package.resolved * Tab bar styling adjustment (#38) * Made fitness center images stretchy headers * Modified gym images as stretchy headers * Adjusted font/color on tab bar and added divider * Update Package.resolved * Addressed Vin's comments - Renamed variable name * Update project.pbxproj * Update Package.resolved * Update Swiftlint and remove CocoaPods (#40) * Update Swiftlint * Fix typo * Update ci_post_clone.sh * Update ENV * Update project.pbxproj * Update Package.resolved --------- Co-authored-by: Vin Bui <[email protected]> Co-authored-by: Vin Bui <[email protected]>
Overview
Implemented a stretchy header effect to the
GymDetailView
header image.Changes Made
StretchyModifier
view modifier that applies a stretchy effect to the header image.GymDetailView
to contain the header image in aGeometryReader
and used a geometry proxy to calculate its bounds.Related PRs or Issues
Screenshots
Stretchy Header
stretchy-header-before.mp4
stretchy-header-after.mp4