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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div align="center">
<img width="225" height="225" src="/assets/StikJIT_Rounded_Corners.png" alt="Logo">
<img width="217" height="217" src="/assets/StikJIT_Rounded_Corners.png" alt="Logo">
</div>


Expand Down
30 changes: 17 additions & 13 deletions StikJIT/Views/Custom Error View.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ struct CustomErrorView: View {
var showSecondaryButton: Bool = false
var messageType: MessageType = .error

@Environment(\.colorScheme) private var colorScheme

enum MessageType {
case error
case success
Expand Down Expand Up @@ -56,19 +58,19 @@ struct CustomErrorView: View {
// Title - slightly smaller
Text(title)
.font(.system(size: 18, weight: .bold, design: .rounded))
.foregroundColor(.white)
.foregroundColor(colorScheme == .dark ? .white : .black)
.multilineTextAlignment(.center)

// Divider
Rectangle()
.frame(height: 1)
.foregroundColor(.white.opacity(0.2))
.foregroundColor(colorScheme == .dark ? .white.opacity(0.2) : .black.opacity(0.2))
.padding(.horizontal, 12)

// Message
Text(message)
.font(.system(size: 15, design: .rounded))
.foregroundColor(.white.opacity(0.9))
.foregroundColor(colorScheme == .dark ? .white.opacity(0.9) : .black.opacity(0.9))
.multilineTextAlignment(.center)
.fixedSize(horizontal: false, vertical: true)
.padding(.horizontal, 12)
Expand All @@ -83,12 +85,12 @@ struct CustomErrorView: View {
}) {
Text(primaryButtonText)
.font(.system(size: 16, weight: .semibold, design: .rounded))
.foregroundColor(.black)
.foregroundColor(colorScheme == .dark ? .black : .white)
.frame(height: 38)
.frame(maxWidth: .infinity)
.background(
RoundedRectangle(cornerRadius: 10)
.fill(Color.white)
.fill(colorScheme == .dark ? Color.white : Color.blue)
)
}

Expand All @@ -99,12 +101,12 @@ struct CustomErrorView: View {
}) {
Text(secondaryButtonText)
.font(.system(size: 16, weight: .medium, design: .rounded))
.foregroundColor(.white)
.foregroundColor(colorScheme == .dark ? .white : .gray)
.frame(height: 38)
.frame(maxWidth: .infinity)
.background(
RoundedRectangle(cornerRadius: 10)
.fill(Color.gray.opacity(0.3))
.fill(colorScheme == .dark ? Color.gray.opacity(0.3) : Color.gray.opacity(0.15))
)
}
}
Expand All @@ -121,18 +123,22 @@ struct CustomErrorView: View {
.frame(width: min(UIScreen.main.bounds.width - 80, 300))
.background(
RoundedRectangle(cornerRadius: 16)
.fill(Color(UIColor.systemGray6).opacity(0.95))
.fill(colorScheme == .dark ?
Color(UIColor.systemGray6).opacity(0.95) :
Color(UIColor.systemGray6).opacity(0.95))
.overlay(
RoundedRectangle(cornerRadius: 16)
.stroke(Color.white.opacity(0.2), lineWidth: 1)
.stroke(colorScheme == .dark ?
Color.white.opacity(0.2) :
Color.black.opacity(0.1),
lineWidth: 1)
)
)
.shadow(color: Color.black.opacity(0.25), radius: 16, x: 0, y: 8)
.shadow(color: Color.black.opacity(colorScheme == .dark ? 0.25 : 0.15), radius: 16, x: 0, y: 8)
.scaleEffect(scale)
.opacity(opacity)
}
.onAppear {

withAnimation(.spring(response: 0.25, dampingFraction: 0.7)) {
opacity = 1
scale = 1
Expand All @@ -141,13 +147,11 @@ struct CustomErrorView: View {
}

private func dismissWithAnimation() {

withAnimation(.easeOut(duration: 0.15)) {
opacity = 0
scale = 0.8
}


DispatchQueue.main.asyncAfter(deadline: .now() + 0.15) {
onDismiss()
}
Expand Down
41 changes: 8 additions & 33 deletions StikJIT/Views/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ struct SettingsView: View {

@State private var showingConsoleLogsView = false

@State private var remoteVersion: String = "-"

private var appVersion: String {
let marketingVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "1.0"
return marketingVersion
}

// Developer profile image URLs
private let developerProfiles: [String: String] = [
"Stephen": "https://github.com/0-Blu.png",
Expand Down Expand Up @@ -438,18 +441,9 @@ struct SettingsView: View {
HStack {
Spacer()

if remoteVersion == "-" {
Text("Checking version...")
.font(.footnote)
.foregroundColor(.secondary.opacity(0.8))
.onAppear {
fetchVersionFromGitHub()
}
} else {
Text("Version \(remoteVersion) • iOS \(UIDevice.current.systemVersion)")
.font(.footnote)
.foregroundColor(.secondary.opacity(0.8))
}
Text("Version \(appVersion) • iOS \(UIDevice.current.systemVersion)")
.font(.footnote)
.foregroundColor(.secondary.opacity(0.8))

Spacer()
}
Expand Down Expand Up @@ -576,25 +570,6 @@ struct SettingsView: View {
}
.padding(.horizontal)
}

private func fetchVersionFromGitHub() {
let versionURL = "https://raw.githubusercontent.com/0-Blu/StikJIT/refs/heads/main/version.txt"

guard let url = URL(string: versionURL) else { return }

URLSession.shared.dataTask(with: url) { data, response, error in
guard let data = data, error == nil else {
print("Failed to fetch version: \(error?.localizedDescription ?? "Unknown error")")
return
}

if let versionString = String(data: data, encoding: .utf8)?.trimmingCharacters(in: .whitespacesAndNewlines) {
DispatchQueue.main.async {
self.remoteVersion = versionString
}
}
}.resume()
}
}

// Helper components
Expand Down