-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce initial UI for connecting to networks
- Loading branch information
Showing
33 changed files
with
1,453 additions
and
316 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
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
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
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,20 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"color" : { | ||
"color-space" : "srgb", | ||
"components" : { | ||
"alpha" : "1.000", | ||
"blue" : "0x50", | ||
"green" : "0x37", | ||
"red" : "0xEC" | ||
} | ||
}, | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
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,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "flag-standalone-wtransparent.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+3.42 KB
Apple/App/Assets.xcassets/HackClub.imageset/flag-standalone-wtransparent.pdf
Binary file not shown.
20 changes: 20 additions & 0 deletions
20
Apple/App/Assets.xcassets/WireGuard.colorset/Contents.json
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,20 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"color" : { | ||
"color-space" : "srgb", | ||
"components" : { | ||
"alpha" : "1.000", | ||
"blue" : "0x1A", | ||
"green" : "0x17", | ||
"red" : "0x88" | ||
} | ||
}, | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
Apple/App/Assets.xcassets/WireGuard.imageset/Contents.json
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,15 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "WireGuard.svg", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
}, | ||
"properties" : { | ||
"preserves-vector-representation" : true | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
Apple/App/Assets.xcassets/WireGuardTitle.imageset/Contents.json
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,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "WireGuardTitle.svg", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
Apple/App/Assets.xcassets/WireGuardTitle.imageset/WireGuardTitle.svg
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 |
---|---|---|
@@ -1,21 +1,13 @@ | ||
import SwiftUI | ||
|
||
@main | ||
#if !os(macOS) | ||
@MainActor | ||
@main | ||
struct BurrowApp: App { | ||
static let tunnel = Tunnel { manager, proto in | ||
proto.serverAddress = "hackclub.com" | ||
manager.localizedDescription = "Burrow" | ||
} | ||
|
||
#if os(macOS) | ||
@NSApplicationDelegateAdaptor(AppDelegate.self) | ||
var delegate | ||
#endif | ||
|
||
var body: some Scene { | ||
WindowGroup { | ||
TunnelView(tunnel: Self.tunnel) | ||
BurrowView() | ||
} | ||
} | ||
} | ||
#endif |
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,26 @@ | ||
import SwiftUI | ||
|
||
struct BurrowView: View { | ||
var body: some View { | ||
NavigationStack { | ||
VStack { | ||
NetworkCarouselView() | ||
Spacer() | ||
TunnelStatusView() | ||
TunnelButton() | ||
.padding(.bottom) | ||
} | ||
.padding() | ||
.navigationTitle("Networks") | ||
} | ||
} | ||
} | ||
|
||
#if DEBUG | ||
struct NetworkView_Previews: PreviewProvider { | ||
static var previews: some View { | ||
BurrowView() | ||
.environment(\.tunnel, PreviewTunnel()) | ||
} | ||
} | ||
#endif |
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,50 @@ | ||
import SwiftUI | ||
|
||
struct FloatingButtonStyle: ButtonStyle { | ||
static let duration = 0.08 | ||
|
||
var color: Color | ||
var cornerRadius: CGFloat | ||
|
||
func makeBody(configuration: Configuration) -> some View { | ||
configuration.label | ||
.font(.headline) | ||
.foregroundColor(.white) | ||
.frame(minHeight: 48) | ||
.padding(.horizontal) | ||
.background( | ||
RoundedRectangle(cornerRadius: cornerRadius) | ||
.fill( | ||
LinearGradient( | ||
colors: [ | ||
configuration.isPressed ? color.opacity(0.9) : color.opacity(0.9), | ||
configuration.isPressed ? color.opacity(0.9) : color | ||
], | ||
startPoint: .init(x: 0.2, y: 0), | ||
endPoint: .init(x: 0.8, y: 1) | ||
) | ||
) | ||
.background( | ||
RoundedRectangle(cornerRadius: cornerRadius) | ||
.fill(configuration.isPressed ? .black : .white) | ||
) | ||
) | ||
.shadow(color: .black.opacity(configuration.isPressed ? 0.0 : 0.1), radius: 2.5, x: 0, y: 2) | ||
.scaleEffect(configuration.isPressed ? 0.975 : 1.0) | ||
.padding(.bottom, 2) | ||
.animation( | ||
configuration.isPressed ? .easeOut(duration: Self.duration) : .easeIn(duration: Self.duration), | ||
value: configuration.isPressed | ||
) | ||
} | ||
} | ||
|
||
extension ButtonStyle where Self == FloatingButtonStyle { | ||
static var floating: FloatingButtonStyle { | ||
floating() | ||
} | ||
|
||
static func floating(color: Color = .accentColor, cornerRadius: CGFloat = 10) -> FloatingButtonStyle { | ||
FloatingButtonStyle(color: color, cornerRadius: cornerRadius) | ||
} | ||
} |
Oops, something went wrong.