This commit is contained in:
Trey t
2025-12-09 23:36:57 -06:00
parent 316513e516
commit 3a10b4b8d6
1586 changed files with 0 additions and 7710 deletions

View File

@@ -1,95 +0,0 @@
//
// Shapes.swift
// Feels
//
// Created by Trey Tartt on 3/20/22.
//
import SwiftUI
enum BGShape: Int, CaseIterable {
case circle
case diamond
case rectangle
case roundedRectangle
func view(withText text: Text, bgColor: Color, textColor: Color) -> some View{
return AnyView(
ZStack {
switch self {
case .circle:
Circle()
.fill(bgColor)
.frame(minWidth: 5,
maxWidth: 500,
minHeight: 5,
maxHeight: 500,
alignment: .center)
.overlay(
text
.font(.title2)
.fontWeight(.bold)
.lineLimit(1)
.foregroundColor(textColor)
.minimumScaleFactor(0.2)
.padding(10)
.frame(maxWidth: .infinity, alignment: .center)
)
case .diamond:
Diamond()
.fill(bgColor)
.frame(minWidth: 5,
maxWidth: 500,
minHeight: 5,
maxHeight: 500)
.aspectRatio(contentMode: .fit)
.overlay(
text
.font(.title2)
.fontWeight(.bold)
.lineLimit(1)
.foregroundColor(textColor)
.minimumScaleFactor(0.2)
.padding(10)
.frame(maxWidth: .infinity, alignment: .center)
)
case .rectangle:
Rectangle()
.fill(bgColor)
.frame(minWidth: 5,
maxWidth: 500,
minHeight: 5,
maxHeight: 500,
alignment: .center)
.overlay(
text
.font(.title2)
.fontWeight(.bold)
.lineLimit(1)
.foregroundColor(textColor)
.minimumScaleFactor(0.2)
.padding(10)
.frame(maxWidth: .infinity, alignment: .center)
)
case .roundedRectangle:
RoundedRectangle(cornerRadius: 8, style: .continuous)
.fill(bgColor)
.frame(minWidth: 5,
maxWidth: 500,
minHeight: 5,
maxHeight: 500,
alignment: .center)
.overlay(
text
.font(.title2)
.fontWeight(.bold)
.lineLimit(1)
.foregroundColor(textColor)
.minimumScaleFactor(0.2)
.padding(10)
.frame(maxWidth: .infinity, alignment: .center)
)
}
})
}
}