Skip to content
Merged
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
26 changes: 23 additions & 3 deletions brainwallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,9 @@
C312D4BB2D7DC27700BB97A4 /* coinflip.aiff in Resources */ = {isa = PBXBuildFile; fileRef = C312D0AF2D7DC27700BB97A4 /* coinflip.aiff */; };
C3236A012D7DE355007039A1 /* URLController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3236A002D7DE34D007039A1 /* URLController.swift */; };
C35C122A293D48340009022D /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = C35C1229293D48340009022D /* KeychainAccess */; };
C3FACF6C2F9E023700886FAD /* GameHubCarouselBentoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3FACF6B2F9E023700886FAD /* GameHubCarouselBentoView.swift */; };
C3FACF6E2F9E025300886FAD /* MoonPayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3FACF6D2F9E025300886FAD /* MoonPayView.swift */; };
C3FACF702F9E026500886FAD /* SocialsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3FACF6F2F9E026500886FAD /* SocialsView.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -979,6 +982,9 @@
C312D2C92D7DC27700BB97A4 /* WalletManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletManager.swift; sourceTree = "<group>"; };
C312D2CA2D7DC27700BB97A4 /* WalletManager+Auth.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WalletManager+Auth.swift"; sourceTree = "<group>"; };
C3236A002D7DE34D007039A1 /* URLController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLController.swift; sourceTree = "<group>"; };
C3FACF6B2F9E023700886FAD /* GameHubCarouselBentoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameHubCarouselBentoView.swift; sourceTree = "<group>"; };
C3FACF6D2F9E025300886FAD /* MoonPayView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoonPayView.swift; sourceTree = "<group>"; };
C3FACF6F2F9E026500886FAD /* SocialsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SocialsView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
Expand Down Expand Up @@ -1334,10 +1340,10 @@
247A7D022E950443000DF8C0 /* Bento Views */ = {
isa = PBXGroup;
children = (
C3FACF652F9E021900886FAD /* Game Hub Bentos */,
24289A3F2EB0D3E600F0F11F /* Transaction Bentos */,
24691D132EAE4D1C003CDC7C /* SyncSubBentoView.swift */,
247A7D062E951653000DF8C0 /* BalanceBentoView.swift */,
247A7D122E952864000DF8C0 /* GameHubBentoView.swift */,
247A7D0C2E951CD7000DF8C0 /* TutorialsBentoView.swift */,
247A7D0E2E951D10000DF8C0 /* LTCPriceBentoView.swift */,
247A7D102E951D3F000DF8C0 /* FavouritesBentoView.swift */,
Expand Down Expand Up @@ -2116,6 +2122,17 @@
path = brainwallet;
sourceTree = "<group>";
};
C3FACF652F9E021900886FAD /* Game Hub Bentos */ = {
isa = PBXGroup;
children = (
247A7D122E952864000DF8C0 /* GameHubBentoView.swift */,
C3FACF6D2F9E025300886FAD /* MoonPayView.swift */,
C3FACF6F2F9E026500886FAD /* SocialsView.swift */,
C3FACF6B2F9E023700886FAD /* GameHubCarouselBentoView.swift */,
);
path = "Game Hub Bentos";
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXLegacyTarget section */
Expand Down Expand Up @@ -2701,6 +2718,7 @@
C312D36C2D7DC27700BB97A4 /* UIView+BRWAdditions.swift in Sources */,
2416CE6A2DA90D0D00FFBD10 /* BRMasterKeyExtension.swift in Sources */,
240850F62F40E3A30097706A /* BackgroundRectangle.swift in Sources */,
C3FACF6E2F9E025300886FAD /* MoonPayView.swift in Sources */,
24691D142EAE4D30003CDC7C /* SyncSubBentoView.swift in Sources */,
2416CE6B2DA90D0D00FFBD10 /* BRSocketHelpers.c in Sources */,
2416CE6C2DA90D0D00FFBD10 /* BWAPIClient.swift in Sources */,
Expand Down Expand Up @@ -2734,6 +2752,7 @@
24F5BD502E0460C90010D340 /* SecurityListView.swift in Sources */,
243136FD2E0B251D00BCBED1 /* SettingsActionToggleView.swift in Sources */,
C312D3762D7DC27700BB97A4 /* AddressFieldView.swift in Sources */,
C3FACF702F9E026500886FAD /* SocialsView.swift in Sources */,
C312D3772D7DC27700BB97A4 /* UserDefaults+Additions.swift in Sources */,
C312D3782D7DC27700BB97A4 /* PinTransitioningDelegate.swift in Sources */,
244520342DE7031F003AFFDF /* LockScreenHostingController.swift in Sources */,
Expand Down Expand Up @@ -2765,6 +2784,7 @@
241B7CDF2E68CA3F00B18679 /* ExportButtonViewModel.swift in Sources */,
C312D3A72D7DC27700BB97A4 /* UnsafeMutablePointerExtension.swift in Sources */,
24C639CE2DC6D5F60014E6DD /* TransactionRowView.swift in Sources */,
C3FACF6C2F9E023700886FAD /* GameHubCarouselBentoView.swift in Sources */,
242C43F32F253A3E00CF6EA4 /* TutorialWalkthroughBentoView.swift in Sources */,
C312D3B52D7DC27700BB97A4 /* UpdatePinViewController.swift in Sources */,
C312D3B62D7DC27700BB97A4 /* PaymentProtocol.swift in Sources */,
Expand Down Expand Up @@ -3154,7 +3174,7 @@
CODE_SIGN_ENTITLEMENTS = brainwallet/brainwallet.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2602275;
CURRENT_PROJECT_VERSION = 2602276;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEPLOYMENT_POSTPROCESSING = NO;
DEVELOPMENT_TEAM = U8WDVUDC2P;
Expand Down Expand Up @@ -3346,7 +3366,7 @@
CODE_SIGN_ENTITLEMENTS = brainwallet/brainwallet.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2602275;
CURRENT_PROJECT_VERSION = 2602276;
DEPLOYMENT_POSTPROCESSING = YES;
DEVELOPMENT_TEAM = U8WDVUDC2P;
DOCC_EXTRACT_SWIFT_INFO_FOR_OBJC_SYMBOLS = YES;
Expand Down
44 changes: 43 additions & 1 deletion brainwallet/Bento Effects /BentoBackgroundHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ import UIKit
var maskGradientStops: [Color] {
switch self {
case .darkStyle:
return [.black,.black,.black,.black,.clear]
return [BrainwalletColor.midnight, BentoColor.purple3, BentoColor.purple4,.black]
case .lightStyle:
return [.black,.black,.clear,.clear,.clear]
}
}
}



struct BentoSurface: ViewModifier {

@Binding
Expand Down Expand Up @@ -185,3 +187,43 @@ struct GameBackgroundView: View {
}
}
}

struct StaticBackgroundView: View {

@Binding
var userPrefersDarkTheme: Bool
var imageName: String = "game-hub-stars"

var body: some View {

GeometryReader { geometry in

let width = geometry.size.width
ZStack {
Group {
RoundedRectangle(cornerRadius: bentoCornerRadius)
.fill(LinearGradient(
colors: [BentoColor.purple4,
BentoColor.purple3],
startPoint: .bottom,
endPoint: .top
))
.edgesIgnoringSafeArea(.all)
GeometryReader { geometry in
Image(imageName)
.resizable()
.aspectRatio(contentMode: .fill)
.offset(y: -5)
.frame(width: geometry.size.width,
height: geometry.size.height)
.clipped()
}
RoundedRectangle(cornerRadius: bentoCornerRadius)
.stroke(BentoColor.grayBorder,
lineWidth: 1.5)
}
.opacity(userPrefersDarkTheme ? 0.0 : 1.0)
}
}
}
}
2 changes: 1 addition & 1 deletion brainwallet/Bento Views/FavouritesBentoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct FavouritesBentoView: View {
let width = geometry.size.width
let height = geometry.size.height

let favoriteTileSize: CGFloat = height * 0.4
let favoriteTileSize: CGFloat = height * 0.2

let labelBackground = userPrefersDarkTheme ? BrainwalletColor.content.opacity(0.1) :
BentoColor.tutorialGreen1
Expand Down
138 changes: 138 additions & 0 deletions brainwallet/Bento Views/Game Hub Bentos/GameHubBentoView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
//
// GameHubBentoView.swift
// brainwallet
//
// Created by Kerry Washington on 07/10/2025.
// Copyright Β© 2025 Grunt Software, LTD. All rights reserved.
//

import SwiftUI

struct GameHubBentoView: View {

@ObservedObject
var newMainViewModel: NewMainViewModel

@Binding
var userPrefersDarkTheme: Bool

@Binding
var selectedStep: Int

@State
private var mainGradientStyle: MainGradientStyle = .lightStyle

@State
private var shouldShowGameMode: Bool = false

private let buttonSize: CGFloat = 20.0

private let buttonPlatformFactor: CGFloat = 2.1

private let tagLabelWidth: CGFloat = 80.0

init(viewModel: NewMainViewModel,
userPrefersDarkTheme: Binding<Bool>,
selectedStep: Binding<Int>) {
_userPrefersDarkTheme = userPrefersDarkTheme
_selectedStep = selectedStep
newMainViewModel = viewModel
}
var body: some View {
GeometryReader { geometry in

let width = geometry.size.width
let height = geometry.size.height

let labelBackground = Color.white.opacity(0.1)
let labelForeground = Color.white

ZStack {
GameBackgroundView(userPrefersDarkTheme: $userPrefersDarkTheme)
.edgesIgnoringSafeArea(.all)
VStack(alignment: .center) {
HStack {
ZStack {
RoundedRectangle(cornerRadius: 6)
.frame(width: tagLabelWidth, height: 18, alignment: .center)
.foregroundColor(labelBackground)
.padding(8)
Text("GAME HUB")
.modifier(BWIPSRegular(size: 10.0))
.lineLimit(1)
.minimumScaleFactor(0.5)
.padding([.leading, .trailing], 4)
.frame(maxWidth: width * 0.25, maxHeight: 20, alignment: .center)
.foregroundColor(labelForeground)
}
Spacer()
}
Spacer()
}

VStack(alignment: .center) {
HStack {

Button(action: {
newMainViewModel.shouldShowGameMode.toggle()
}) {

HStack {
VStack {
Text("FALLINMOJI")
.font(.boldenVan(size: 100))
.lineLimit(1)
.minimumScaleFactor(0.3)
.padding(.leading, 16)
.frame(alignment: .leading)
.foregroundStyle(
LinearGradient(
colors: [.white,.white, BentoColor.gameBlue1.opacity(0.2)],
startPoint: .top,
endPoint: .bottom
)
)

Text("ARE YOU GOOD ENOUGH TO BE #1?")
.modifier(BWIPSMedium(size: 16.0))
.padding(.leading, 16)
.frame(alignment: .leading)
.foregroundStyle(
LinearGradient(
colors: [.white,.white,.white,BentoColor.gameBlue1.opacity(0.1)],
startPoint: .top,
endPoint: .bottom
)
)
}
.frame(width: width * 0.6)
.fixedSize(horizontal: true, vertical: false)
.padding(.top, 5)
Spacer()
}
}
.accessibilityIdentifier("enterGamesModeButton")
}
}

HStack {
Spacer()
FallinMojiDemoView(width: width * 0.8,
height: height,
shouldPlay: $shouldShowGameMode)
.frame(width: width * 0.8, alignment: .trailing)
.clipped()
}
}
.cornerRadius(bentoCornerRadius)
.frame(minHeight: gameBentoHeight * 0.9, idealHeight: gameBentoHeight * 1.4, maxHeight: gameBentoHeight * 2, alignment: .center)
.frame(maxWidth: .infinity, alignment: .init(horizontal: .center, vertical: .center))
.onAppear {
mainGradientStyle = userPrefersDarkTheme ? .darkStyle : .lightStyle
}
.onTapGesture {
newMainViewModel.shouldShowGameMode.toggle()
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
//
// GameHubCarouselBentoView.swift
// brainwallet
//
// Created by Kerry Washington on 07/10/2025.
// Copyright Β© 2025 Grunt Software, LTD. All rights reserved.
//

import SwiftUI

struct GameHubCarouselBentoView: View {

@ObservedObject
var newMainViewModel: NewMainViewModel

@Binding
var userPrefersDarkTheme: Bool

@State
private var selectedStep: Int = 0

@State
private var carouselDirection: Int = 1

@State
private var mainGradientStyle: MainGradientStyle = .lightStyle

@State
private var shouldShowGameMode: Bool = false

@State
private var carouselTimer: Timer?

init(viewModel: NewMainViewModel, userPrefersDarkTheme: Binding<Bool>) {
_userPrefersDarkTheme = userPrefersDarkTheme
newMainViewModel = viewModel
}
var body: some View {
GeometryReader { geometry in

ZStack {
VStack(alignment: .center) {

TabView(selection: $selectedStep) {
GameHubBentoView(viewModel: newMainViewModel,
userPrefersDarkTheme: $userPrefersDarkTheme,
selectedStep: $selectedStep)
.tag(0)
MoonPayView(viewModel: newMainViewModel,
selectedStep: $selectedStep)
.tag(1)
SocialsBentoView(viewModel: newMainViewModel,
selectedStep: $selectedStep)
.tag(2)
}
.tabViewStyle(.page(indexDisplayMode: .never))

}
.frame(maxWidth: .infinity, alignment: .init(horizontal: .center, vertical: .center))

}
.cornerRadius(bentoCornerRadius)
.frame(minHeight: gameBentoHeight * 0.9, idealHeight: gameBentoHeight * 1.4, maxHeight: gameBentoHeight * 2, alignment: .center)
.onAppear {
mainGradientStyle = userPrefersDarkTheme ? .darkStyle : .lightStyle
startCarousel()
}
.onDisappear {
stopCarousel()
}
}
}

private func startCarousel() {
stopCarousel()
carouselTimer = Timer.scheduledTimer(withTimeInterval: 15.0,
repeats: true) { _ in
advanceCarousel()
}
RunLoop.main.add(carouselTimer!, forMode: .common)
}

private func stopCarousel() {
carouselTimer?.invalidate()
carouselTimer = nil
}

private func advanceCarousel() {
withAnimation {
selectedStep += carouselDirection
if selectedStep >= 2 {
carouselDirection = -1
} else if selectedStep <= 0 {
carouselDirection = 1
}
}
}
}
Loading