Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
Binary file not shown.
2 changes: 1 addition & 1 deletion Features/APICallsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct APICallsView: View {
Button(action: {
sendRequests()
}) {
Text("Send 25 GET Requests")
Text("Generate Network Traffic")
.padding()
.background(isRequesting ? Color.gray : Color.blue)
.foregroundColor(.white)
Expand Down
7 changes: 7 additions & 0 deletions Features/PromotionBanner.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//
// PromotionBanner.swift
// Features
//
// Created by Stuart Minchington on 2/4/26.
//

90 changes: 75 additions & 15 deletions Features/TextFieldView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,92 @@ import SwiftUI

struct TextFieldView: View {
@State private var inputText = ""
@State private var showBanner = false
@Environment(\.presentationMode) var presentationMode

var body: some View {
VStack {
TextField("Enter your text here", text: $inputText)
.textFieldStyle(.roundedBorder)
ZStack(alignment: .bottom) {
VStack {
TextField("Enter your text here", text: $inputText)
.textFieldStyle(.roundedBorder)
.padding()

Button("Submit") {
// Handle the submitted text here
print("Submitted text: \(inputText)")
}
.padding()
.background(Color(red: 0, green: 0, blue: 0.5))
.foregroundStyle(.white)
.clipShape(Capsule())

Button("Submit") {
// Handle the submitted text here
print("Submitted text: \(inputText)")
Button("Back") {
presentationMode.wrappedValue.dismiss()
}
.padding()
.background(Color(red: 0.5, green: 0, blue: 0))
.foregroundStyle(.white)
.clipShape(Capsule())
}
.padding()
.background(Color(red: 0, green: 0, blue: 0.5))
.foregroundStyle(.white)
.clipShape(Capsule())

Button("Back") {
presentationMode.wrappedValue.dismiss()
if showBanner {
PromotionalBannerView()
.transition(.move(edge: .bottom))
}
.padding()
.background(Color(red: 0.5, green: 0, blue: 0))
.foregroundStyle(.white)
}
.onAppear {
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
withAnimation(.easeInOut(duration: 0.6)) {
showBanner = true
}
}
}
}
}

struct PromotionalBannerView: View {
var body: some View {
VStack(spacing: 20) {
Text("Special Offer!")
.font(.title2)
.fontWeight(.bold)
.foregroundStyle(.white)

Text("Unlock exclusive features and save big today!")
.font(.body)
.multilineTextAlignment(.center)
.foregroundStyle(.white.opacity(0.9))

Button("Claim Now") {
// Handle offer claim
}
.padding(.horizontal, 32)
.padding(.vertical, 12)
.background(Color.white)
.foregroundStyle(Color(red: 0, green: 0.55, blue: 0.2))
.clipShape(Capsule())
.fontWeight(.bold)
}
.padding()
.padding(.horizontal, 24)
.padding(.top, 32)
.padding(.bottom, 48)
.frame(maxWidth: .infinity)
.background(
UnevenRoundedRectangle(
topLeadingRadius: 24,
bottomLeadingRadius: 0,
bottomTrailingRadius: 0,
topTrailingRadius: 24
)
.fill(
LinearGradient(
colors: [Color(red: 0, green: 0.7, blue: 0.3), Color(red: 0, green: 0.45, blue: 0.2)],
startPoint: .top,
endPoint: .bottom
)
)
)
}
}

Expand Down
Loading