Skip to content

Conversation

caitlynjin
Copy link
Contributor

Overview

Implemented a stretchy header effect to the GymDetailView header image.

Changes Made

  • Created a custom StretchyModifier view modifier that applies a stretchy effect to the header image.
  • Modified GymDetailView to contain the header image in a GeometryReader and used a geometry proxy to calculate its bounds.
    • Used the stretchy view modifier on the header image.

Related PRs or Issues

Screenshots

Stretchy Header
Before After
stretchy-header-before.mp4
stretchy-header-after.mp4

@caitlynjin caitlynjin requested a review from vinnie4k February 26, 2024 02:52
Copy link
Contributor

@vinnie4k vinnie4k left a 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)
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

- Renamed geometry proxy
@caitlynjin caitlynjin requested a review from vinnie4k March 6, 2024 19:27
Copy link
Contributor

@vinnie4k vinnie4k left a 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
Base automatically changed from caitlyn/fix-hours to main March 12, 2024 04:04
@caitlynjin caitlynjin merged commit a44c9ab into main Mar 12, 2024
@caitlynjin caitlynjin deleted the caitlyn/stretchy-header branch March 12, 2024 19:29
@caitlynjin caitlynjin mentioned this pull request Mar 12, 2024
caitlynjin added a commit that referenced this pull request Mar 12, 2024
* 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]>
This was referenced Mar 20, 2024
caitlynjin added a commit that referenced this pull request Mar 24, 2024
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants