feat: add about page
This commit is contained in:
@@ -17,6 +17,9 @@
|
|||||||
F13839722C51BABD00B4814F /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F13839712C51BABD00B4814F /* ContentView.swift */; };
|
F13839722C51BABD00B4814F /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F13839712C51BABD00B4814F /* ContentView.swift */; };
|
||||||
F13839742C51BABE00B4814F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F13839732C51BABE00B4814F /* Assets.xcassets */; };
|
F13839742C51BABE00B4814F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F13839732C51BABE00B4814F /* Assets.xcassets */; };
|
||||||
F13839772C51BABE00B4814F /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F13839762C51BABE00B4814F /* Preview Assets.xcassets */; };
|
F13839772C51BABE00B4814F /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F13839762C51BABE00B4814F /* Preview Assets.xcassets */; };
|
||||||
|
F167F80E2C5964AD002958B9 /* TitleBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = F167F80D2C5964AD002958B9 /* TitleBar.swift */; };
|
||||||
|
F167F8102C5984CC002958B9 /* AboutPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = F167F80F2C5984CC002958B9 /* AboutPage.swift */; };
|
||||||
|
F167F8122C59908E002958B9 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = F167F8112C59908E002958B9 /* Constants.swift */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
@@ -32,6 +35,9 @@
|
|||||||
F13839712C51BABD00B4814F /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
|
F13839712C51BABD00B4814F /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
|
||||||
F13839732C51BABE00B4814F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
F13839732C51BABE00B4814F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||||
F13839762C51BABE00B4814F /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
|
F13839762C51BABE00B4814F /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
|
||||||
|
F167F80D2C5964AD002958B9 /* TitleBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleBar.swift; sourceTree = "<group>"; };
|
||||||
|
F167F80F2C5984CC002958B9 /* AboutPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutPage.swift; sourceTree = "<group>"; };
|
||||||
|
F167F8112C59908E002958B9 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
@@ -75,6 +81,9 @@
|
|||||||
F12B734A2C56AEB00064A230 /* LiveStatusManager.swift */,
|
F12B734A2C56AEB00064A230 /* LiveStatusManager.swift */,
|
||||||
F12B734C2C5702EC0064A230 /* LiveListenerCounter.swift */,
|
F12B734C2C5702EC0064A230 /* LiveListenerCounter.swift */,
|
||||||
F12B734F2C57BDD90064A230 /* DottedBackground.swift */,
|
F12B734F2C57BDD90064A230 /* DottedBackground.swift */,
|
||||||
|
F167F80D2C5964AD002958B9 /* TitleBar.swift */,
|
||||||
|
F167F80F2C5984CC002958B9 /* AboutPage.swift */,
|
||||||
|
F167F8112C59908E002958B9 /* Constants.swift */,
|
||||||
);
|
);
|
||||||
path = InfinifiIOS;
|
path = InfinifiIOS;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -158,9 +167,12 @@
|
|||||||
isa = PBXSourcesBuildPhase;
|
isa = PBXSourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
F167F8102C5984CC002958B9 /* AboutPage.swift in Sources */,
|
||||||
|
F167F80E2C5964AD002958B9 /* TitleBar.swift in Sources */,
|
||||||
F12B734B2C56AEB00064A230 /* LiveStatusManager.swift in Sources */,
|
F12B734B2C56AEB00064A230 /* LiveStatusManager.swift in Sources */,
|
||||||
F12B73452C55505E0064A230 /* NeuButton.swift in Sources */,
|
F12B73452C55505E0064A230 /* NeuButton.swift in Sources */,
|
||||||
F12B734D2C5702EC0064A230 /* LiveListenerCounter.swift in Sources */,
|
F12B734D2C5702EC0064A230 /* LiveListenerCounter.swift in Sources */,
|
||||||
|
F167F8122C59908E002958B9 /* Constants.swift in Sources */,
|
||||||
F13839722C51BABD00B4814F /* ContentView.swift in Sources */,
|
F13839722C51BABD00B4814F /* ContentView.swift in Sources */,
|
||||||
F12B73472C55AC6B0064A230 /* PlaybackManager.swift in Sources */,
|
F12B73472C55AC6B0064A230 /* PlaybackManager.swift in Sources */,
|
||||||
F12B73502C57BDD90064A230 /* DottedBackground.swift in Sources */,
|
F12B73502C57BDD90064A230 /* DottedBackground.swift in Sources */,
|
||||||
|
75
InfinifiIOS/AboutPage.swift
Normal file
75
InfinifiIOS/AboutPage.swift
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
import Foundation
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct AboutPage: View {
|
||||||
|
private func openLink(string: String) {
|
||||||
|
guard let url = URL(string: string),
|
||||||
|
UIApplication.shared.canOpenURL(url)
|
||||||
|
else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
UIApplication.shared.open(url)
|
||||||
|
}
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
VStack {
|
||||||
|
Text("about infinifi")
|
||||||
|
.font(.system(.title3, design: .monospaced))
|
||||||
|
.fontWeight(.bold)
|
||||||
|
.padding()
|
||||||
|
|
||||||
|
Spacer()
|
||||||
|
|
||||||
|
VStack(spacing: 24) {
|
||||||
|
NeuButton(action: {
|
||||||
|
openLink(string: sourceCodeURL)
|
||||||
|
}) {
|
||||||
|
Text("source code")
|
||||||
|
.font(.system(.body, design: .monospaced))
|
||||||
|
}
|
||||||
|
.frame(maxWidth: .infinity, maxHeight: 40)
|
||||||
|
|
||||||
|
NeuButton(action: {
|
||||||
|
openLink(string: xURL)
|
||||||
|
}) {
|
||||||
|
Text("my twitter")
|
||||||
|
.font(.system(.body, design: .monospaced))
|
||||||
|
}
|
||||||
|
.frame(maxWidth: .infinity, maxHeight: 40)
|
||||||
|
|
||||||
|
NeuButton(action: {
|
||||||
|
openLink(string: githubURL)
|
||||||
|
}) {
|
||||||
|
Text("my github")
|
||||||
|
.font(.system(.body, design: .monospaced))
|
||||||
|
}
|
||||||
|
.frame(maxWidth: .infinity, maxHeight: 40)
|
||||||
|
|
||||||
|
NeuButton(action: {
|
||||||
|
openLink(string: emailURL)
|
||||||
|
}) {
|
||||||
|
Text("my email")
|
||||||
|
.font(.system(.body, design: .monospaced))
|
||||||
|
}
|
||||||
|
.frame(maxWidth: .infinity, maxHeight: 40)
|
||||||
|
}
|
||||||
|
.padding()
|
||||||
|
|
||||||
|
Spacer()
|
||||||
|
|
||||||
|
HStack {
|
||||||
|
Spacer()
|
||||||
|
Image(uiImage: UIImage(named: "EepingCat")!)
|
||||||
|
.resizable()
|
||||||
|
.frame(width: 36, height: 18, alignment: .trailing)
|
||||||
|
.padding(.trailing)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||||
|
.background(.base)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Preview {
|
||||||
|
AboutPage()
|
||||||
|
}
|
23
InfinifiIOS/Assets.xcassets/EepingCat.imageset/Contents.json
vendored
Normal file
23
InfinifiIOS/Assets.xcassets/EepingCat.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "EepingCat.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "EepingCat@2x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "EepingCat@3x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
BIN
InfinifiIOS/Assets.xcassets/EepingCat.imageset/EepingCat.png
vendored
Normal file
BIN
InfinifiIOS/Assets.xcassets/EepingCat.imageset/EepingCat.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 644 B |
BIN
InfinifiIOS/Assets.xcassets/EepingCat.imageset/EepingCat@2x.png
vendored
Normal file
BIN
InfinifiIOS/Assets.xcassets/EepingCat.imageset/EepingCat@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 717 B |
BIN
InfinifiIOS/Assets.xcassets/EepingCat.imageset/EepingCat@3x.png
vendored
Normal file
BIN
InfinifiIOS/Assets.xcassets/EepingCat.imageset/EepingCat@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 778 B |
13
InfinifiIOS/Constants.swift
Normal file
13
InfinifiIOS/Constants.swift
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
//
|
||||||
|
// Constants.swift
|
||||||
|
// InfinifiIOS
|
||||||
|
//
|
||||||
|
// Created by Kenneth on 30/07/2024.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
let sourceCodeURL = "https://github.com/kennethnym/infinifi"
|
||||||
|
let xURL = "https://x.com/kennethnym"
|
||||||
|
let githubURL = "https://github.com/kennethnym"
|
||||||
|
let emailURL = "mailto:kennethnym@outlook.com"
|
@@ -37,10 +37,7 @@ struct ContentView: View {
|
|||||||
.ignoresSafeArea()
|
.ignoresSafeArea()
|
||||||
|
|
||||||
VStack(alignment: .center) {
|
VStack(alignment: .center) {
|
||||||
Text("infinifi")
|
TitleBar()
|
||||||
.font(.system(.title3, design: .monospaced))
|
|
||||||
.fontWeight(.bold)
|
|
||||||
.padding()
|
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
@@ -52,6 +49,7 @@ struct ContentView: View {
|
|||||||
.font(.system(size: 24))
|
.font(.system(size: 24))
|
||||||
.tint(.text)
|
.tint(.text)
|
||||||
}
|
}
|
||||||
|
.frame(width: 64, height: 64)
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
|
@@ -37,8 +37,8 @@ struct NeuButton<Content>: View where Content: View {
|
|||||||
Rectangle()
|
Rectangle()
|
||||||
.fill(isPressed ? .base : .text)
|
.fill(isPressed ? .base : .text)
|
||||||
.offset(
|
.offset(
|
||||||
x: isPressed ? 0 : 4,
|
x: isPressed ? 0 : 3,
|
||||||
y: isPressed ? 0 : 4
|
y: isPressed ? 0 : 3
|
||||||
)
|
)
|
||||||
.overlay {
|
.overlay {
|
||||||
ZStack {
|
ZStack {
|
||||||
@@ -51,10 +51,9 @@ struct NeuButton<Content>: View where Content: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.border(.text, width: 2)
|
.border(.text, width: 2)
|
||||||
.frame(width: 64, height: 64)
|
|
||||||
.offset(
|
.offset(
|
||||||
x: isPressed ? 6 : 0,
|
x: isPressed ? 5 : 0,
|
||||||
y: isPressed ? 6 : 0
|
y: isPressed ? 5 : 0
|
||||||
)
|
)
|
||||||
.buttonStyle(NeuButtonStyle { isPressed in
|
.buttonStyle(NeuButtonStyle { isPressed in
|
||||||
self.isPressed = isPressed
|
self.isPressed = isPressed
|
||||||
|
33
InfinifiIOS/TitleBar.swift
Normal file
33
InfinifiIOS/TitleBar.swift
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import Foundation
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct TitleBar: View {
|
||||||
|
@State private var isSettingsOpen = false
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
HStack(alignment: .center) {
|
||||||
|
Spacer()
|
||||||
|
|
||||||
|
Text("infinifi")
|
||||||
|
.font(.system(.title3, design: .monospaced))
|
||||||
|
.fontWeight(.bold)
|
||||||
|
.padding()
|
||||||
|
// offset the title down vertically by a bit to optically align with the settings button
|
||||||
|
.offset(x: 0, y: 4)
|
||||||
|
|
||||||
|
Spacer().overlay {
|
||||||
|
NeuButton(action: {
|
||||||
|
isSettingsOpen.toggle()
|
||||||
|
}) {
|
||||||
|
Image(systemName: "info.square.fill")
|
||||||
|
.font(.system(size: 16))
|
||||||
|
.tint(.text)
|
||||||
|
}
|
||||||
|
.frame(width: 32, height: 32)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.sheet(isPresented: $isSettingsOpen, content: {
|
||||||
|
AboutPage()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user