Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
## Overview

TODO

## Changes Made

### Change 1

- TODO
- TODO

### Change 2

- TODO
- TODO

## Test Coverage

- TODO

## Next Steps (optional)

TODO

## Related PRs or Issues (optional)

TODO

## Screenshots (optional)

<!-- use the following for videos -->
<details>
<summary>TODO</summary>
<table>
<tr>
<td>Before</td>
<td>After</td>
</tr>
<tr>
<td><video src="enterurlhere" type="video/mp4"></td>
<td><video src="enterurlhere" type="video/mp4"></td>
</tr>
</table>
</details>

<!-- use the following for images -->
<details>
<summary>TODO</summary>
<table>
<tr>
<td>Before</td>
<td>After</td>
</tr>
<tr>
<td><img src="enterurlhere" width="300px" height="auto"></td>
<td><img src="enterurlhere" width="300px" height="auto"></td>
</tr>
</table>
</details>

<!-- use the following if there is no before/after -->
<details>
<summary>TODO</summary>
<img src="enterurlhere" width="300px" height="auto">
<video src="enterurlhere" type="video/mp4">
</details>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Uplift - Cornell Fitness

<p align="center"><img src=https://raw.githubusercontent.com/cuappdev/uplift-ios/master/Uplift/Assets.xcassets/AppIcon.appiconset/ItunesArtwork%402x.png width=210 /></p>
<p align="center"><img src="https://github.com/cuappdev/assets/blob/master/app-icons/Uplift-83.5x83.5%402x.png" width=210 /></p>

Uplift is one of the latest apps by [Cornell AppDev](http://cornellappdev.com), an engineering project team at Cornell University focused on mobile app development. Uplift aims to be the go-to fitness and wellness tool that provides information and class times for gym resources at Cornell. Download the current release on the [App Store](https://apps.apple.com/bn/app/uplift-cornell-fitness/id1439374374)!

Expand Down
8 changes: 6 additions & 2 deletions Uplift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
2EF1A2582B129EEB007A299F /* Network.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EF1A2572B129EEB007A299F /* Network.swift */; };
842FB0CCD71C3202DE5836F1 /* Pods_Uplift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E86AC23F1B9AFB11552390BF /* Pods_Uplift.framework */; };
89921C392B8A98BA00364400 /* HomeGymCellViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89921C382B8A98BA00364400 /* HomeGymCellViewModel.swift */; };
89ECDA892B79885C0006A160 /* StretchyModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89ECDA882B79885C0006A160 /* StretchyModifier.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -147,6 +148,7 @@
2EF1A2572B129EEB007A299F /* Network.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Network.swift; sourceTree = "<group>"; };
61B508C772C15943F0FDB2E8 /* Pods-Uplift.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Uplift.debug.xcconfig"; path = "Target Support Files/Pods-Uplift/Pods-Uplift.debug.xcconfig"; sourceTree = "<group>"; };
89921C382B8A98BA00364400 /* HomeGymCellViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeGymCellViewModel.swift; sourceTree = "<group>"; };
89ECDA882B79885C0006A160 /* StretchyModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StretchyModifier.swift; sourceTree = "<group>"; };
D6EB08EC41E957E55D918532 /* Pods-Uplift.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Uplift.release.xcconfig"; path = "Target Support Files/Pods-Uplift/Pods-Uplift.release.xcconfig"; sourceTree = "<group>"; };
E86AC23F1B9AFB11552390BF /* Pods_Uplift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Uplift.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -336,6 +338,7 @@
2E6785BD2B3A513000DD3ADA /* SemiCircleShape.swift */,
2E15F5012B396EC500414BEC /* ShadowModifier.swift */,
2E5726C62B4A63AE00D3DB36 /* ShimmerModifier.swift */,
89ECDA882B79885C0006A160 /* StretchyModifier.swift */,
2E15F5112B3A3D0000414BEC /* TriangleShape.swift */,
);
path = Custom;
Expand Down Expand Up @@ -514,9 +517,9 @@
2EE5F3E02B12EDB6008E0299 /* XCRemoteSwiftPackageReference "apollo-ios" */,
2E6785BA2B3A48D700DD3ADA /* XCRemoteSwiftPackageReference "WrappingHStack" */,
2EC3EE642B3C000E00E927BF /* XCRemoteSwiftPackageReference "Kingfisher" */,
2E4F06DA2B4B48DC008905C8 /* XCLocalSwiftPackageReference "UpliftAPI" */,
2E45B23E2B4E361100FB83B7 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */,
2EE5D6512B65E7DC004BB8F5 /* XCRemoteSwiftPackageReference "appdev-announcements" */,
89950D882B98FC1F00DFB007 /* XCLocalSwiftPackageReference "UpliftAPI" */,
);
productRefGroup = 2E8FE38D2B1278B700B3DC6A /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -673,6 +676,7 @@
2E090EC52B12EF2600BAE982 /* Publishers.swift in Sources */,
2E39D8222B3B631200AD238B /* DividerLine.swift in Sources */,
2E15F5062B39F81B00414BEC /* MainView.swift in Sources */,
89ECDA892B79885C0006A160 /* StretchyModifier.swift in Sources */,
2E39D82A2B3B9F3D00AD238B /* FacilityExpandedView.swift in Sources */,
2E39D82C2B3BB35000AD238B /* FacilityExpandedViewModel.swift in Sources */,
2E3D6C202B1285D200B51BB2 /* UpliftEnvironment.swift in Sources */,
Expand Down Expand Up @@ -995,7 +999,7 @@
/* End XCConfigurationList section */

/* Begin XCLocalSwiftPackageReference section */
2E4F06DA2B4B48DC008905C8 /* XCLocalSwiftPackageReference "UpliftAPI" */ = {
89950D882B98FC1F00DFB007 /* XCLocalSwiftPackageReference "UpliftAPI" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = UpliftAPI;
};
Expand Down
3 changes: 2 additions & 1 deletion Uplift.xcworkspace/xcshareddata/swiftpm/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions Uplift/Utils/Custom/StretchyModifier.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// StretchyHeaderModifier.swift
// Uplift
//
// Created by Caitlyn Jin on 2/11/24.
// Copyright © 2024 Cornell AppDev. All rights reserved.
//

import SwiftUI

/// A view modifier that applies a stretchy effect to the header image.
struct StretchyModifier: ViewModifier {

var geometryProxy: GeometryProxy

func body(content: Content) -> some View {
let minY = geometryProxy.frame(in: .global).minY
let originY = geometryProxy.frame(in: .global).origin.y
let height = geometryProxy.size.height

content
.frame(height: minY > 0 ? height + originY : height)
.clipped()
.offset(y: minY > 0 ? -minY : 0)
}

}

extension View {

@ViewBuilder
func stretchy(_ gp: GeometryProxy) -> some View {
self
.modifier(StretchyModifier(geometryProxy: gp))
}

}
19 changes: 11 additions & 8 deletions Uplift/Views/Home/GymDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ struct GymDetailView: View {
heroSection
!gym.amenities.isEmpty ? amenitiesSection : nil
slidingTabBar(gymName: viewModel.determineGymNameEnum(gym: gym))
DividerLine()

Group {
if viewModel.selectedTab == .fitnessCenter {
Expand All @@ -81,14 +82,16 @@ struct GymDetailView: View {
@MainActor
private var heroSection: some View {
ZStack(alignment: .center) {
KFImage(gym.imageUrl)
.placeholder {
Constants.Colors.gray01
}
.resizable()
.scaledToFill()
.frame(height: 330)
.clipped()
GeometryReader { geometryProxy in
KFImage(gym.imageUrl)
.placeholder {
Constants.Colors.gray01
}
.resizable()
.aspectRatio(contentMode: .fill)
.stretchy(geometryProxy)
}
.frame(height: 330)

if viewModel.showHours {
hoursView
Expand Down
10 changes: 5 additions & 5 deletions Uplift/Views/Supporting/SlidingTabBarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ struct SlidingTabBarView<T: Hashable>: View {
private func tab(for item: Item) -> some View {
VStack(alignment: .center, spacing: 16) {
Text(item.title)
.font(selectedTab == item.tab ? config.selectedFont : config.unselectedFont)
.foregroundStyle(config.color)
.font(config.font)
.foregroundStyle(selectedTab == item.tab ? config.selectedFontColor : config.unselectedFontColor)
.padding(.top)

if selectedTab == item.tab {
Expand Down Expand Up @@ -68,10 +68,10 @@ extension SlidingTabBarView {

/// Configuration for a tab bar.
struct TabBarConfig {
var color: Color = Constants.Colors.black
var selectedFont: Font = Constants.Fonts.labelBold
var font: Font = Constants.Fonts.labelBold
var selectedFontColor: Color = Constants.Colors.black
var selectedUnderlineColor: Color = Constants.Colors.yellow
var unselectedFont: Font = Constants.Fonts.labelMedium
var unselectedFontColor: Color = Constants.Colors.gray04
var unselectedUnderlineColor: Color = Constants.Colors.white
}

Expand Down