generated from StanfordSpezi/SpeziTemplateApplication
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BAL-175-GP-BodySensations-Coins-Rewards
- Loading branch information
1 parent
2f39135
commit 4586216
Showing
3 changed files
with
75 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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 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,67 @@ | ||
// | ||
// This source file is part of the CS342 2023 Balance Team Application project | ||
// | ||
// SPDX-FileCopyrightText: 2023 Stanford University | ||
// | ||
// SPDX-License-Identifier: MIT | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct ChillCellView: View { | ||
var image: String | ||
var text: String | ||
var pointVal: String | ||
|
||
var body: some View { | ||
HStack { | ||
Image(image) | ||
.resizable() | ||
.scaledToFit() | ||
.accessibility(hidden: true) | ||
.frame(width: 80, height: 80) | ||
Spacer() | ||
Text(text) | ||
.padding(.leading, 20.0) | ||
.minimumScaleFactor(0.5) | ||
.font(.custom("Nunito-Bold", size: 25)) | ||
.lineLimit(2) | ||
.multilineTextAlignment(.leading) | ||
.frame(maxWidth: .infinity, alignment: .leading) | ||
.frame(height: 80) | ||
Spacer() | ||
VStack { | ||
pointValueView | ||
Spacer() | ||
} | ||
} | ||
.padding(EdgeInsets(top: 24, leading: 24, bottom: 24, trailing: 0)) | ||
.frame(maxWidth: 311, maxHeight: 114) | ||
.foregroundColor(darkBlueColor) | ||
.background(RoundedRectangle(cornerRadius: 20).fill(.white)) | ||
.clipped() | ||
.shadow(color: Color.black.opacity(0.10), radius: 7, x: 2, y: 2) | ||
.padding(EdgeInsets(top: 0, leading: 24, bottom: 0, trailing: 24)) | ||
} | ||
|
||
var pointValueView: some View { | ||
ZStack { | ||
Text(pointVal) | ||
.font(.custom("Nunito-Bold", size: 14)) | ||
.frame(width: 30, height: 20) | ||
.padding(.trailing, 25.0) | ||
.padding(.vertical, 3.0) | ||
.background(primaryColor .opacity(0.4)) | ||
.cornerRadius(5) | ||
.offset(x: -10) | ||
Image("pointsStarIcon") | ||
.accessibility(hidden: true) | ||
}.offset(y: -15) | ||
} | ||
} | ||
|
||
struct ChillCellViewPreview: PreviewProvider { | ||
static var previews: some View { | ||
ChillCellView(image: "BalanceLogo", text: "diary", pointVal: "5") | ||
} | ||
} |
This file contains 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