This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
-
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.
Merge pull request #130 from mytiki/feat/Present-the-offer-in-Offer-View
Feat/present the offer in offer view
- Loading branch information
Showing
7 changed files
with
273 additions
and
11 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,84 @@ | ||
// | ||
// OfferView.swift | ||
// TikiClient | ||
// | ||
// Created by Jesse Monteiro Ferreira on 21/05/24. | ||
// | ||
|
||
import SwiftUI | ||
|
||
public struct OfferAllowTrackView: View { | ||
public init() {} | ||
public var body: some View { | ||
LinearGradient(gradient: Gradient(colors: [Color(hex: "#01CB82"), Color(hex: "#00B272"), Color(hex: "#026A44")]), startPoint: .top, endPoint: .bottom) | ||
.ignoresSafeArea() // Ignore just for the color | ||
.background() | ||
.overlay( | ||
VStack(alignment: .leading) { | ||
Spacer() | ||
Text("Allow tracking on the next screen for:") | ||
.font(.system(size: 30)) | ||
.fontWeight(.semibold) | ||
.foregroundColor(.white) | ||
.padding(.horizontal, 40) | ||
.padding(.top, -35) | ||
|
||
VStack(alignment: .leading, spacing: 45){ | ||
HStack(){ | ||
Image(systemName: "gift.circle.fill") | ||
.resizable() | ||
.frame(width: 40, height: 40) | ||
.padding(.trailing, 10) | ||
.foregroundColor(.white) | ||
Text("Data offers and promotions just for you") | ||
.fontWeight(.semibold) | ||
.font(.system(size: 21)) | ||
.foregroundColor(.white) | ||
} | ||
HStack(){ | ||
Image(systemName: "hand.tap.fill") | ||
.resizable() | ||
.frame(width: 40, height: 40) | ||
.padding(.trailing, 10) | ||
.foregroundColor(.white) | ||
|
||
Text("Advertisements that match your interests") | ||
.fontWeight(.semibold) | ||
.font(.system(size: 21)) | ||
.foregroundColor(.white) | ||
} | ||
HStack() { | ||
Image(systemName: "person.badge.shield.checkmark.fill") | ||
.resizable() | ||
.frame(width: 40, height: 40) | ||
.padding(.trailing, 10) | ||
.foregroundColor(.white) | ||
Text("An improved personalized experience over time") | ||
.fontWeight(.semibold) | ||
.font(.system(size: 21)) | ||
.foregroundColor(.white) } | ||
Text("You can change this option later in the Settings app.") | ||
.fontWeight(.semibold) | ||
.font(.system(size: 22)) | ||
.foregroundColor(.white) | ||
}.padding(.horizontal, 40).padding(.vertical, 30) | ||
|
||
VStack(){ | ||
Button() { | ||
print("Continue") | ||
} label: { | ||
Text("Continue") | ||
.font(.system(size: 23)) | ||
.fontWeight(.regular) | ||
.frame(maxWidth: .infinity) | ||
.foregroundColor(Color(hex: "#026A44")) | ||
.padding() | ||
.background(Color(.secondarySystemBackground)) | ||
.cornerRadius(50) | ||
}.buttonStyle(.plain).padding(.bottom, 10) | ||
}.padding(.horizontal, 40) | ||
Spacer() | ||
} | ||
) | ||
} | ||
} |
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,150 @@ | ||
// | ||
// OfferView.swift | ||
// TikiClient | ||
// | ||
// Created by Jesse Monteiro Ferreira on 21/05/24. | ||
// | ||
|
||
import SwiftUI | ||
|
||
public struct OfferLinkCardView: View { | ||
public init() {} | ||
let a = Image("tikilogo.png") | ||
public var body: some View { | ||
LinearGradient(gradient: Gradient(colors: [Color(hex: "#01CB82"), Color(hex: "#00B272"), Color(hex: "#026A44")]), startPoint: .top, endPoint: .bottom) | ||
.ignoresSafeArea() // Ignore just for the color | ||
.background() | ||
.overlay( | ||
VStack(alignment: .leading) { | ||
image("tikilogo") | ||
Text("Share your purchase") | ||
.font(.title) | ||
.fontWeight(.medium) | ||
.foregroundColor(.white) | ||
.padding(.horizontal, 40) | ||
Text("history:") | ||
.font(.title) | ||
.fontWeight(.medium) | ||
.foregroundColor(.white) | ||
.padding(.horizontal, 40) | ||
.padding(.top, -30) | ||
|
||
HStack(){ | ||
Spacer() | ||
ZStack(){ | ||
Circle() | ||
.fill(Color.white.opacity(0)) | ||
.frame(width: 150, height: 150) | ||
.overlay( | ||
RoundedRectangle(cornerRadius: 100) | ||
.stroke(Color.white, lineWidth: 7) | ||
) | ||
VStack(alignment: .center){ | ||
HStack(alignment: .bottom) { | ||
Spacer() | ||
Text("100") | ||
.fontWeight(.medium) | ||
.font(.system(size: 50)) | ||
.foregroundColor(.white) | ||
.padding(.trailing, -8) | ||
.padding(.top, 10) | ||
Text("pts") | ||
.fontWeight(.medium) | ||
.font(.system(size: 22)) | ||
.foregroundColor(.white) | ||
.padding(.top, -35) | ||
Spacer() | ||
} | ||
HStack(){ | ||
Text("each month") | ||
.fontWeight(.medium) | ||
.font(.system(size: 16)) | ||
.foregroundColor(.white) | ||
} | ||
} | ||
} | ||
|
||
Spacer() | ||
}.padding(.top, 5) | ||
|
||
VStack(alignment: .leading, spacing: 10){ | ||
Text("We use your data for:") | ||
.font(.system(size: 20)) | ||
.fontWeight(.medium) | ||
.foregroundColor(.white) | ||
.padding(.top, 35) | ||
HStack(){ | ||
Image(systemName: "slider.vertical.3") | ||
.foregroundColor(.white) | ||
Text("Aggregate market insights") | ||
.fontWeight(.medium) | ||
.font(.system(size: 21)) | ||
.foregroundColor(.white) | ||
} | ||
HStack(){ | ||
Image(systemName: "percent") | ||
.foregroundColor(.white) | ||
Text("Exclusive offers just for you") | ||
.fontWeight(.medium) | ||
.font(.system(size: 21)) | ||
.foregroundColor(.white) | ||
} | ||
HStack() { | ||
Image(systemName: "pencil.circle") | ||
.foregroundColor(.white) | ||
Text("Improving systems like AI") | ||
.fontWeight(.medium) | ||
.font(.system(size: 21)) | ||
.foregroundColor(.white) } | ||
Text("Learn more or change your mind any time in settings.") | ||
.fontWeight(.medium) | ||
.font(.system(size: 21)) | ||
.foregroundColor(.white) | ||
}.padding(.horizontal, 40).padding(.bottom, 40) | ||
|
||
VStack(){ | ||
Button() { | ||
print("Linked card") | ||
} label: { | ||
Text("Link Card") | ||
.font(.system(size: 21)) | ||
.fontWeight(.medium) | ||
.frame(maxWidth: .infinity) | ||
.foregroundColor(Color(hex: "#026A44")) | ||
.padding() | ||
.background(Color(.secondarySystemBackground)) | ||
.cornerRadius(50) | ||
}.buttonStyle(.plain).padding(.bottom, 10) | ||
Button() { | ||
print("No Thanks") | ||
} label: { | ||
Text("No Thanks") | ||
.font(.system(size: 21)) | ||
.fontWeight(.medium) | ||
.frame(maxWidth: .infinity) | ||
.foregroundColor(Color.white) | ||
.padding() | ||
.background(Color(.green).opacity(0)) | ||
.overlay( | ||
RoundedRectangle(cornerRadius: 50) | ||
.stroke(Color.white, lineWidth: 4) | ||
) | ||
|
||
|
||
}.buttonStyle(.plain) | ||
}.padding(.horizontal, 40) | ||
} | ||
) | ||
} | ||
} | ||
|
||
func image(_ name: String) -> Image? { | ||
let bundle = Bundle(for: TikiClient.self) | ||
guard let path = bundle.path(forResource: "Assets/\(name)", ofType: "png") else { | ||
print("image not found") | ||
return nil | ||
} | ||
let image = Image("tikilogo.png", bundle: bundle) | ||
return Image(path) | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
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,36 @@ | ||
// | ||
// Color.swift | ||
// TikiClient | ||
// | ||
// Created by Jesse Monteiro Ferreira on 22/05/24. | ||
// | ||
|
||
import Foundation | ||
import SwiftUI | ||
|
||
extension Color { | ||
init(hex: String) { | ||
let hex = hex.trimmingCharacters(in: CharacterSet.alphanumerics.inverted) | ||
var int: UInt64 = 0 | ||
Scanner(string: hex).scanHexInt64(&int) | ||
let a, r, g, b: UInt64 | ||
switch hex.count { | ||
case 3: // RGB (12-bit) | ||
(a, r, g, b) = (255, (int >> 8) * 17, (int >> 4 & 0xF) * 17, (int & 0xF) * 17) | ||
case 6: // RGB (24-bit) | ||
(a, r, g, b) = (255, int >> 16, int >> 8 & 0xFF, int & 0xFF) | ||
case 8: // ARGB (32-bit) | ||
(a, r, g, b) = (int >> 24, int >> 16 & 0xFF, int >> 8 & 0xFF, int & 0xFF) | ||
default: | ||
(a, r, g, b) = (1, 1, 1, 0) | ||
} | ||
|
||
self.init( | ||
.sRGB, | ||
red: Double(r) / 255, | ||
green: Double(g) / 255, | ||
blue: Double(b) / 255, | ||
opacity: Double(a) / 255 | ||
) | ||
} | ||
} |