Skip to content

Commit 450f3f6

Browse files
committed
Begin adding colors to Infineat watch face
1 parent e69f0ec commit 450f3f6

10 files changed

Lines changed: 245 additions & 6 deletions

File tree

.DS_Store

0 Bytes
Binary file not shown.

InfiniLink/.DS_Store

-2 KB
Binary file not shown.
0 Bytes
Binary file not shown.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"colors" : [
3+
{
4+
"color" : {
5+
"color-space" : "srgb",
6+
"components" : {
7+
"alpha" : "1.000",
8+
"blue" : "0.000",
9+
"green" : "0.088",
10+
"red" : "0.448"
11+
}
12+
},
13+
"idiom" : "universal"
14+
},
15+
{
16+
"appearances" : [
17+
{
18+
"appearance" : "luminosity",
19+
"value" : "dark"
20+
}
21+
],
22+
"color" : {
23+
"color-space" : "srgb",
24+
"components" : {
25+
"alpha" : "1.000",
26+
"blue" : "0.000",
27+
"green" : "0.088",
28+
"red" : "0.448"
29+
}
30+
},
31+
"idiom" : "universal"
32+
}
33+
],
34+
"info" : {
35+
"author" : "xcode",
36+
"version" : 1
37+
}
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"colors" : [
3+
{
4+
"color" : {
5+
"color-space" : "srgb",
6+
"components" : {
7+
"alpha" : "1.000",
8+
"blue" : "0.000",
9+
"green" : "0.305",
10+
"red" : "1.000"
11+
}
12+
},
13+
"idiom" : "universal"
14+
},
15+
{
16+
"appearances" : [
17+
{
18+
"appearance" : "luminosity",
19+
"value" : "dark"
20+
}
21+
],
22+
"color" : {
23+
"color-space" : "srgb",
24+
"components" : {
25+
"alpha" : "1.000",
26+
"blue" : "0.000",
27+
"green" : "0.305",
28+
"red" : "1.000"
29+
}
30+
},
31+
"idiom" : "universal"
32+
}
33+
],
34+
"info" : {
35+
"author" : "xcode",
36+
"version" : 1
37+
}
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"colors" : [
3+
{
4+
"color" : {
5+
"color-space" : "srgb",
6+
"components" : {
7+
"alpha" : "1.000",
8+
"blue" : "0.000",
9+
"green" : "0.149",
10+
"red" : "1.000"
11+
}
12+
},
13+
"idiom" : "universal"
14+
},
15+
{
16+
"appearances" : [
17+
{
18+
"appearance" : "luminosity",
19+
"value" : "dark"
20+
}
21+
],
22+
"color" : {
23+
"color-space" : "srgb",
24+
"components" : {
25+
"alpha" : "1.000",
26+
"blue" : "0.000",
27+
"green" : "0.149",
28+
"red" : "1.000"
29+
}
30+
},
31+
"idiom" : "universal"
32+
}
33+
],
34+
"info" : {
35+
"author" : "xcode",
36+
"version" : 1
37+
}
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"colors" : [
3+
{
4+
"color" : {
5+
"color-space" : "srgb",
6+
"components" : {
7+
"alpha" : "1.000",
8+
"blue" : "0.000",
9+
"green" : "0.578",
10+
"red" : "1.000"
11+
}
12+
},
13+
"idiom" : "universal"
14+
},
15+
{
16+
"appearances" : [
17+
{
18+
"appearance" : "luminosity",
19+
"value" : "dark"
20+
}
21+
],
22+
"color" : {
23+
"color-space" : "srgb",
24+
"components" : {
25+
"alpha" : "1.000",
26+
"blue" : "0.000",
27+
"green" : "0.578",
28+
"red" : "1.000"
29+
}
30+
},
31+
"idiom" : "universal"
32+
}
33+
],
34+
"info" : {
35+
"author" : "xcode",
36+
"version" : 1
37+
}
38+
}

InfiniLink/BLE/BLEManagerVariables.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class BLEManagerVal: NSObject, ObservableObject {
3636

3737
@Published var watchFace: Int = -1
3838
@Published var pineTimeStyleData: PineTimeStyleData?
39+
@Published var infineatWatchface: WatchFaceInfineat?
3940
@Published var timeFormat: ClockType?
4041

4142
@Published var weatherInformation = WeatherInformation()

InfiniLink/Core/Home/DeviceView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ struct CustomScrollView<Content: View>: View {
427427
self.bleManagerVal.watchFace = Int(settings.watchFace)
428428
self.bleManagerVal.pineTimeStyleData = settings.pineTimeStyle
429429
self.bleManagerVal.timeFormat = settings.clockType
430+
self.bleManagerVal.infineatWatchface = settings.watchFaceInfineat
430431
switch settings.weatherFormat {
431432
case .Metric:
432433
self.deviceDataForSettings.chosenWeatherMode = "Metric"

InfiniLink/Core/Home/WatchFace.swift

Lines changed: 91 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ struct WatchFaceView: View {
2626
.aspectRatio(contentMode: .fit)
2727
.shadow(color: colorScheme == .dark ? Color.black : Color.secondary, radius: 16, x: 0, y: 0)
2828
.brightness(colorScheme == .dark ? -0.03 : 0.015)
29-
ZStack() {
29+
ZStack {
3030
ZStack {
3131
switch watchface == -1 ? bleManagerVal.watchFace : watchface {
3232
case 0:
@@ -330,6 +330,46 @@ struct InfineatWF: View {
330330
return true
331331
}
332332
}
333+
func infineatColor(from color: Colors) -> Color {
334+
switch color {
335+
case .White:
336+
return Color.white
337+
case .Silver:
338+
return Color.gray
339+
case .Gray:
340+
return Color.gray
341+
case .Black:
342+
return Color.black
343+
case .Red:
344+
return Color("Red")
345+
case .Maroon:
346+
return Color("Maroon")
347+
case .Yellow:
348+
return Color("Yellow")
349+
case .Olive:
350+
return Color.green
351+
case .Green:
352+
return Color.green
353+
case .Cyan:
354+
return Color.cyan
355+
case .Teal:
356+
return Color.teal
357+
case .Blue:
358+
return Color.blue
359+
case .Navy:
360+
return Color.blue
361+
case .Magenta:
362+
return Color.purple
363+
case .Purple:
364+
return Color.purple
365+
case .Orange:
366+
return Color("Orange")
367+
case .Pink:
368+
return Color.pink
369+
default:
370+
return Color.red
371+
}
372+
}
333373

334374
var body: some View {
335375
ZStack {
@@ -373,10 +413,6 @@ struct InfineatWF: View {
373413
.resizable()
374414
.frame(width: 18, height: 20)
375415
.frame(width: geometry.size.width / 1.14, height: geometry.size.height / 2.8, alignment: .bottomTrailing)
376-
Image("pine_logo")
377-
.resizable()
378-
.frame(width: 20, height: 26)
379-
.frame(width: geometry.size.width / 1.15, height: geometry.size.height, alignment: .leading)
380416
HStack(spacing: 4) {
381417
Image(systemName: "shoeprints.fill")
382418
.rotationEffect(Angle(degrees: 90))
@@ -386,6 +422,55 @@ struct InfineatWF: View {
386422
.foregroundColor(.gray)
387423
.frame(width: geometry.size.width, height: geometry.size.height, alignment: .bottom)
388424
.padding(.bottom, -16)
425+
if bleManagerVal.infineatWatchface?.showSideCover ?? true {
426+
ZStack {
427+
Rectangle()
428+
.frame(width: 19)
429+
.frame(height: geometry.size.height / 1.5, alignment: .topLeading)
430+
.frame(maxHeight: .infinity, alignment: .topLeading)
431+
.foregroundColor(infineatColor(from: .Yellow))
432+
.rotationEffect(Angle(degrees: 49))
433+
.offset(x: -36, y: -44)
434+
Rectangle()
435+
.frame(width: 19)
436+
.frame(height: geometry.size.height / 1.5, alignment: .bottomLeading)
437+
.frame(maxHeight: .infinity, alignment: .bottomLeading)
438+
.foregroundColor(infineatColor(from: .Orange))
439+
.opacity(0.8)
440+
.rotationEffect(Angle(degrees: -16))
441+
.offset(x: -6, y: 12)
442+
Rectangle()
443+
.frame(width: 26, alignment: .leading)
444+
.offset(x: -5)
445+
.foregroundColor(infineatColor(from: .Maroon))
446+
Rectangle()
447+
.frame(width: 26)
448+
.frame(height: geometry.size.height / 1.5, alignment: .topLeading)
449+
.frame(maxHeight: .infinity, alignment: .bottomLeading)
450+
.foregroundColor(infineatColor(from: .Yellow))
451+
.rotationEffect(Angle(degrees: -38))
452+
.offset(x: -26, y: 30)
453+
Rectangle()
454+
.frame(width: 38)
455+
.frame(height: geometry.size.height / 1.3, alignment: .topLeading)
456+
.frame(maxHeight: .infinity, alignment: .topLeading)
457+
.foregroundColor(infineatColor(from: .Orange))
458+
.rotationEffect(Angle(degrees: 18))
459+
.offset(x: -28, y: -16)
460+
Rectangle()
461+
.frame(width: 38)
462+
.frame(height: geometry.size.height / 1.3, alignment: .topLeading)
463+
.frame(maxHeight: .infinity, alignment: .bottomLeading)
464+
.foregroundColor(infineatColor(from: .Red))
465+
.rotationEffect(Angle(degrees: -18))
466+
.offset(x: -28, y: 16)
467+
}
468+
.frame(width: geometry.size.width, height: geometry.size.height, alignment: .leading)
469+
}
470+
Image("pine_logo")
471+
.resizable()
472+
.frame(width: 20, height: 26)
473+
.frame(width: geometry.size.width / 1.15, height: geometry.size.height, alignment: .leading)
389474
}
390475
.frame(width: geometry.size.width, height: geometry.size.height, alignment: .center)
391476
}
@@ -599,7 +684,7 @@ struct CustomTextView: View {
599684
#Preview {
600685
NavigationView {
601686
GeometryReader { geometry in
602-
WatchFaceView(watchface: .constant(5))
687+
WatchFaceView(watchface: .constant(4))
603688
.padding(22)
604689
.frame(width: geometry.size.width / 1.65, height: geometry.size.width / 1.65, alignment: .center)
605690
.clipped(antialiased: true)

0 commit comments

Comments
 (0)