Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4b79388
Overflow bug found
jimlo7760 Oct 8, 2024
70dacad
Update View in MenuView to the latest swift specification
jimlo7760 Oct 11, 2024
c3fb0e3
Define a GeometryReader to wrap the whole interface
jimlo7760 Oct 15, 2024
22c03ba
Make the title becomes adaptive
jimlo7760 Oct 15, 2024
e59f489
Make all images adaptive to the screen size
jimlo7760 Oct 18, 2024
a049edb
fix typo
jimlo7760 Oct 18, 2024
6acd776
Add suitable paddings to the gap
jimlo7760 Oct 21, 2024
99294ef
Make images adaptive with a min scale to avoid over narrowing
jimlo7760 Oct 22, 2024
70b95f3
Overflow bug fixed, remove the relevant to-do list
jimlo7760 Oct 22, 2024
fdb2a24
Add comments on FourInARowView.swift
jimlo7760 Oct 25, 2024
aa8289f
Update to latest swift specification
jimlo7760 Oct 31, 2024
e7bd207
Merge pull request #1 from henryrobbinss/main
jimlo7760 Nov 1, 2024
8538235
Update Adjustable UI
jimlo7760 Nov 1, 2024
b5efa88
Merge branch 'main' into OptimizeCodebase
jimlo7760 Nov 2, 2024
fe2646d
Bug fix on ScrambleBoardView.swift
jimlo7760 Nov 2, 2024
c05fb86
update the specification on the new button style
jimlo7760 Nov 8, 2024
c09e92b
update specification on FourInARowMenuView and revert the comments
jimlo7760 Nov 8, 2024
c23b52d
add adjustable UI on new button specification
jimlo7760 Nov 9, 2024
463a072
Update swift specification + wiki on WordScrambleMenuView.swift
jimlo7760 Nov 12, 2024
4ee3a5b
Make WordScrambleMenuView.swift adaptive
jimlo7760 Nov 14, 2024
d9b6e4c
Update wiki & purified code on AboutView.swift
jimlo7760 Nov 16, 2024
d9c6723
Make AboutView.swift adaptive & purified code
jimlo7760 Nov 18, 2024
ad9c9d2
Feature the dark mode UI
jimlo7760 Nov 20, 2024
a9f3d89
Make FourInARowMenuView.swift adaptive to device
jimlo7760 Nov 21, 2024
695a4d4
Introduce new logo to the launch screen
jimlo7760 Nov 23, 2024
1166dd0
Introduce new logo to the menu view
jimlo7760 Nov 23, 2024
ae43141
Introduce the 2x and 3x logos as well to avoid burry
jimlo7760 Nov 23, 2024
6a85134
Add ipad to native running list
jimlo7760 Nov 23, 2024
3e6545b
Update SolverView to make it adaptive. Now all pages should be adapti…
jimlo7760 Nov 25, 2024
da0e215
fine tune the padding of the buttons in SolverView.swift to avoid ove…
jimlo7760 Dec 2, 2024
73ea8b1
Optimize iPad native display on launch screen
jimlo7760 Dec 2, 2024
6c6a6f8
Introduce dark mode to the whole app
jimlo7760 Dec 6, 2024
a2a3b5d
Merge branch 'main' into OptimizeCodebase
jimlo7760 Dec 7, 2024
ed2bcb6
Merge pull request #4 from jimlo7760/OptimizeCodebase
jimlo7760 Dec 7, 2024
f7872e4
Reverted some accidently delete the original comments
jimlo7760 Dec 7, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ xcuserdata
# Carthage/Checkouts

Carthage/Build
Board Solver/.DS_Store
8 changes: 4 additions & 4 deletions Board Solver.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -569,10 +569,10 @@
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
Expand Down Expand Up @@ -605,10 +605,10 @@
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
Expand Down
34 changes: 14 additions & 20 deletions Board Solver/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Y6W-OH-hqX">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Y6W-OH-hqX">
<device id="retina6_72" orientation="portrait" appearance="dark"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand All @@ -13,33 +13,27 @@
<objects>
<viewController id="Y6W-OH-hqX" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="5EZ-qb-Rvc">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<rect key="frame" x="0.0" y="0.0" width="430" height="932"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" fixedFrame="YES" image="image1" translatesAutoresizingMaskIntoConstraints="NO" id="dbk-af-OVh">
<rect key="frame" x="47" y="281" width="300" height="250"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<rect key="contentStretch" x="1" y="0.0" width="1" height="1"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" fixedFrame="YES" image="name" translatesAutoresizingMaskIntoConstraints="NO" id="Nnf-Yk-nEJ">
<rect key="frame" x="18" y="539" width="356" height="30"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" insetsLayoutMarginsFromSafeArea="NO" image="LaunchScreenLogo" translatesAutoresizingMaskIntoConstraints="NO" id="nal-wj-yGN">
<rect key="frame" x="0.0" y="0.0" width="430" height="932"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/>
<color key="backgroundColor" name="white-bg"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="35.877862595419849" y="3.5211267605633805"/>
<point key="canvasLocation" x="35.206611570247937" y="2.877697841726619"/>
</scene>
</scenes>
<resources>
<image name="image1" width="357" height="287"/>
<image name="name" width="391" height="30"/>
<namedColor name="white-bg">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<image name="LaunchScreenLogo" width="394" height="852"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Asset 1 7.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Asset 1 7 (1).png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Asset 1 7 (2).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Asset 1 8.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Asset 1 8 (1).png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Asset 1 8 (2).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
107 changes: 67 additions & 40 deletions Board Solver/Views/AboutView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,58 +8,85 @@
import SwiftUI

struct AboutView: View {

// Environment variable to handle view dismissal
@Environment(\.dismiss) private var dismiss
@Environment(\.colorScheme) var colorScheme

var body: some View {
ZStack {
//Background
Color.white.ignoresSafeArea(.all)
GeometryReader { geometry in
// Calculate scaling factors based on iPhone 13 Pro Max dimensions
let baseWidth: CGFloat = 428
let baseHeight: CGFloat = 926
let scaleFactor = min(geometry.size.width / baseWidth, geometry.size.height / baseHeight)

VStack {
ZStack {
// Set background color to white and ignore safe area
Color.white.ignoresSafeArea(.all)

HStack {
Button {
dismiss()
} label: {
Rectangle()
.fill(.gray)
.frame(width: 80, height: 40)
.cornerRadius(15)
.overlay(Group{
Text("BACK")
.font(.custom("PatrickHandSC-Regular", size: 25))
.foregroundStyle(.white)
RoundedRectangle(cornerRadius: 15)
.stroke(Color.black, lineWidth: 2.5)
VStack {
HStack {
// Back button to dismiss the view
Button {
dismiss()
} label: {
Rectangle()
.fill(.gray)
.frame(width: 80 * scaleFactor, height: 40 * scaleFactor)
.cornerRadius(15 * scaleFactor)
.overlay(Group {
Text("BACK")
.font(.custom("PatrickHandSC-Regular", size: 25 * scaleFactor))
.foregroundStyle(.white)
RoundedRectangle(cornerRadius: 15 * scaleFactor)
.stroke(Color.black, lineWidth: 2.5 * scaleFactor)
})
}
.padding(.leading, 15 * scaleFactor)
.padding(.top, 63 * scaleFactor)
.padding(.bottom, 20 * scaleFactor)

Spacer()
}
.padding()

Spacer()
}

Text("About The BOARD SOLVER Project")
.font(.custom("PatrickHandSC-Regular", size: 40))
.foregroundColor(Color.black)
.multilineTextAlignment(.center)
.monospacedDigit()
ScrollView {
Text("Do you ever get stuck trying to decide on your next move in a board game? Board Solver Mobile (BSM), aims to be your assistant for strategic board games. Leveraging the power of computer vision, BSM analyzes game states through your iOS device's camera and suggests the next optimal move based on pre-trained algorithms.\n\tBSM currently supports the popular game of Connect4, with hopes to support more games in the future. For each game, BSM considers various factors like piece placement, potential threats, and strategic goals to recommend the move with the highest chance of success. The difficulty level of the solver currently only returns the best move, but we plan to make the diffculty of the opponent be adjustable, allowing you to test your skills against a range of challenges.\n\tThis project is a great tool for both casual and experienced board game players. Whether you're looking for a helping hand to improve your game or simply want to explore different strategic options, BSM can be your guide to becoming a board game champion!")
.font(.custom("PatrickHandSC-Regular", size: 20))
.foregroundColor(Color.black)
.monospacedDigit()
}.padding()

HStack{
Image("github-mark")
.resizable()
.frame(width: 20, height: 20)
.scaledToFit()
// Title text for the About page
Text("About The BOARD SOLVER Project")
.font(.custom("PatrickHandSC-Regular", size: 40 * scaleFactor))
.foregroundColor(colorScheme == .dark ? .white : .black)
.multilineTextAlignment(.center)
.monospacedDigit()
.padding(.horizontal, 20 * scaleFactor)

Link("Visit our GitHub!", destination: URL(string: "https://github.com/henryrobbinss/BoardSolverMobile")!)
// Scrollable text containing the project description
ScrollView {
Text("Do you ever get stuck trying to decide on your next move in a board game? Board Solver Mobile (BSM), aims to be your assistant for strategic board games. Leveraging the power of computer vision, BSM analyzes game states through your iOS device's camera and suggests the next optimal move based on pre-trained algorithms.\n\tBSM currently supports the popular game of Connect4, with hopes to support more games in the future. For each game, BSM considers various factors like piece placement, potential threats, and strategic goals to recommend the move with the highest chance of success. The difficulty level of the solver currently only returns the best move, but we plan to make the difficulty of the opponent adjustable, allowing you to test your skills against a range of challenges.\n\tThis project is a great tool for both casual and experienced board game players. Whether you're looking for a helping hand to improve your game or simply want to explore different strategic options, BSM can be your guide to becoming a board game champion!")
.font(.custom("PatrickHandSC-Regular", size: 20 * scaleFactor))
.foregroundColor(colorScheme == .dark ? .white : .black)
.monospacedDigit()
.padding(.horizontal, 20 * scaleFactor)
}
.padding(.vertical, 20 * scaleFactor)

// HStack containing the GitHub link
HStack {
Image("github-mark")
.resizable()
.frame(width: 20 * scaleFactor, height: 20 * scaleFactor)
.scaledToFit()

Link("Visit our GitHub!",
destination: URL(string: "https://github.com/henryrobbinss/BoardSolverMobile")!)
.font(.custom("PatrickHandSC-Regular", size: 18 * scaleFactor))
}
.padding(.bottom, 35 * scaleFactor)
}
.background(colorScheme == .dark ? Color.black : Color.white)
// Center the VStack within the GeometryReader
.frame(width: geometry.size.width, height: geometry.size.height)
.position(x: geometry.size.width / 2, y: geometry.size.height / 2)
}
}
.ignoresSafeArea()
}
}

Expand Down
Binary file added Board Solver/Views/BoardSolverMobile (1).fig
Binary file not shown.
Loading