blob: beba39ce5b38786473ffa762a19be6115241ac21 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
import SwiftUI
import WidgetKit
struct LargeWidgetView: View {
let entry: SolvervEntry
var body: some View {
VStack(spacing: 12) {
// Top: Emoji
Text(entry.emoji)
.font(.system(size: 80))
.frame(height: 100)
// Bottom: Info
VStack(alignment: .leading, spacing: 10) {
// Event name and countdown
VStack(alignment: .leading, spacing: 4) {
Text("Season Event")
.font(.headline)
Text("\(entry.def.daysUntilNext()) days")
.font(.system(.title2, design: .default).weight(.bold))
}
// Progress bar
ProgressView(value: Double(entry.def.progressRatio()))
Divider()
// Event info
VStack(alignment: .leading, spacing: 6) {
Text("Upcoming")
.font(.caption)
.foregroundColor(.secondary)
Text("More events coming soon")
.font(.caption)
}
Spacer()
}
.padding(.horizontal)
.padding(.vertical, 8)
}
}
}
#Preview {
let entry = SolvervEntry(def: SolvervDef(utcString: "2026-12-21 20:50:00"))
LargeWidgetView(entry: entry)
}
|