diff --git a/HIAPI/Models/Time.swift b/HIAPI/Models/Time.swift index b51e8ed8..515f8c34 100644 --- a/HIAPI/Models/Time.swift +++ b/HIAPI/Models/Time.swift @@ -30,6 +30,18 @@ public struct TimeContainer: Decodable, APIReturnable { } public struct EventTimes: Codable { + + public let checkInStart: Date + public let checkInEnd: Date + public let scavengerHuntStart: Date + public let scavengerHuntEnd: Date + public let openingCeremonyStart: Date + public let openingCeremonyEnd: Date + public let projectShowcaseStart: Date + public let projectShowcaseEnd: Date + public let closingCeremonyStart: Date + public let closingCeremonyEnd: Date + public let eventStart: Date public let eventEnd: Date public let hackStart: Date @@ -41,8 +53,20 @@ public struct EventTimes: Codable { public let sundayStart: Date public let sundayEnd: Date - public init(eventStart: Date, eventEnd: Date, hackStart: Date, hackEnd: Date, fridayStart: Date, fridayEnd: Date, + public init(checkInStart: Date, checkInEnd: Date, scavengerHuntStart: Date, scavengerHuntEnd: Date, openingCeremonyStart: Date, openingCeremonyEnd: Date,projectShowcaseStart: Date, projectShowcaseEnd: Date, closingCeremonyStart: Date, closingCeremonyEnd: Date, + eventStart: Date, eventEnd: Date, hackStart: Date, hackEnd: Date, fridayStart: Date, fridayEnd: Date, saturdayStart: Date, saturdayEnd: Date, sundayStart: Date, sundayEnd: Date) { + self.checkInStart = checkInStart + self.checkInEnd = checkInEnd + self.scavengerHuntStart = scavengerHuntStart + self.scavengerHuntEnd = scavengerHuntEnd + self.openingCeremonyStart = openingCeremonyStart + self.openingCeremonyEnd = openingCeremonyEnd + self.projectShowcaseStart = projectShowcaseStart + self.projectShowcaseEnd = projectShowcaseEnd + self.closingCeremonyStart = closingCeremonyStart + self.closingCeremonyEnd = closingCeremonyEnd + self.eventStart = eventStart self.eventEnd = eventEnd self.hackStart = hackStart diff --git a/HackIllinois/Assets.xcassets/Home/Contents.json b/HackIllinois/Assets.xcassets/Home/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/HackIllinois/Assets.xcassets/Home/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/HackIllinois/Assets.xcassets/Home/Home_1.imageset/Contents.json b/HackIllinois/Assets.xcassets/Home/Home_1.imageset/Contents.json new file mode 100644 index 00000000..8e52b977 --- /dev/null +++ b/HackIllinois/Assets.xcassets/Home/Home_1.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Home_1.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Home_1@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Home_1@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/HackIllinois/Assets.xcassets/Home/Home_1.imageset/Home_1.png b/HackIllinois/Assets.xcassets/Home/Home_1.imageset/Home_1.png new file mode 100644 index 00000000..0802927d Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_1.imageset/Home_1.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_1.imageset/Home_1@2x.png b/HackIllinois/Assets.xcassets/Home/Home_1.imageset/Home_1@2x.png new file mode 100644 index 00000000..132b6a8f Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_1.imageset/Home_1@2x.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_1.imageset/Home_1@3x.png b/HackIllinois/Assets.xcassets/Home/Home_1.imageset/Home_1@3x.png new file mode 100644 index 00000000..ad1e9c74 Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_1.imageset/Home_1@3x.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_2.imageset/Contents.json b/HackIllinois/Assets.xcassets/Home/Home_2.imageset/Contents.json new file mode 100644 index 00000000..5e368df9 --- /dev/null +++ b/HackIllinois/Assets.xcassets/Home/Home_2.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Home_2.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Home_2@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Home_2@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/HackIllinois/Assets.xcassets/Home/Home_2.imageset/Home_2.png b/HackIllinois/Assets.xcassets/Home/Home_2.imageset/Home_2.png new file mode 100644 index 00000000..833f7603 Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_2.imageset/Home_2.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_2.imageset/Home_2@2x.png b/HackIllinois/Assets.xcassets/Home/Home_2.imageset/Home_2@2x.png new file mode 100644 index 00000000..962fef41 Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_2.imageset/Home_2@2x.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_2.imageset/Home_2@3x.png b/HackIllinois/Assets.xcassets/Home/Home_2.imageset/Home_2@3x.png new file mode 100644 index 00000000..ff0c33b5 Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_2.imageset/Home_2@3x.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_3.imageset/Contents.json b/HackIllinois/Assets.xcassets/Home/Home_3.imageset/Contents.json new file mode 100644 index 00000000..fc3db00a --- /dev/null +++ b/HackIllinois/Assets.xcassets/Home/Home_3.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Home_3.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Home_3@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Home_3@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/HackIllinois/Assets.xcassets/Home/Home_3.imageset/Home_3.png b/HackIllinois/Assets.xcassets/Home/Home_3.imageset/Home_3.png new file mode 100644 index 00000000..7216e366 Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_3.imageset/Home_3.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_3.imageset/Home_3@2x.png b/HackIllinois/Assets.xcassets/Home/Home_3.imageset/Home_3@2x.png new file mode 100644 index 00000000..dbeedb75 Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_3.imageset/Home_3@2x.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_3.imageset/Home_3@3x.png b/HackIllinois/Assets.xcassets/Home/Home_3.imageset/Home_3@3x.png new file mode 100644 index 00000000..3b656f91 Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_3.imageset/Home_3@3x.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_4.imageset/Contents.json b/HackIllinois/Assets.xcassets/Home/Home_4.imageset/Contents.json new file mode 100644 index 00000000..f041199d --- /dev/null +++ b/HackIllinois/Assets.xcassets/Home/Home_4.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Home_4.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Home_4@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Home_4@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/HackIllinois/Assets.xcassets/Home/Home_4.imageset/Home_4.png b/HackIllinois/Assets.xcassets/Home/Home_4.imageset/Home_4.png new file mode 100644 index 00000000..184930fb Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_4.imageset/Home_4.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_4.imageset/Home_4@2x.png b/HackIllinois/Assets.xcassets/Home/Home_4.imageset/Home_4@2x.png new file mode 100644 index 00000000..8e81c89f Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_4.imageset/Home_4@2x.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_4.imageset/Home_4@3x.png b/HackIllinois/Assets.xcassets/Home/Home_4.imageset/Home_4@3x.png new file mode 100644 index 00000000..290e5486 Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_4.imageset/Home_4@3x.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_5.imageset/Contents.json b/HackIllinois/Assets.xcassets/Home/Home_5.imageset/Contents.json new file mode 100644 index 00000000..28fa97c7 --- /dev/null +++ b/HackIllinois/Assets.xcassets/Home/Home_5.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Home_5.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Home_5@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Home_5@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/HackIllinois/Assets.xcassets/Home/Home_5.imageset/Home_5.png b/HackIllinois/Assets.xcassets/Home/Home_5.imageset/Home_5.png new file mode 100644 index 00000000..452d77f9 Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_5.imageset/Home_5.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_5.imageset/Home_5@2x.png b/HackIllinois/Assets.xcassets/Home/Home_5.imageset/Home_5@2x.png new file mode 100644 index 00000000..12ce7316 Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_5.imageset/Home_5@2x.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_5.imageset/Home_5@3x.png b/HackIllinois/Assets.xcassets/Home/Home_5.imageset/Home_5@3x.png new file mode 100644 index 00000000..207ba1c6 Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_5.imageset/Home_5@3x.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_6.imageset/Contents.json b/HackIllinois/Assets.xcassets/Home/Home_6.imageset/Contents.json new file mode 100644 index 00000000..c28be4a1 --- /dev/null +++ b/HackIllinois/Assets.xcassets/Home/Home_6.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Home_6.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Home_6@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Home_6@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/HackIllinois/Assets.xcassets/Home/Home_6.imageset/Home_6.png b/HackIllinois/Assets.xcassets/Home/Home_6.imageset/Home_6.png new file mode 100644 index 00000000..9633bf0e Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_6.imageset/Home_6.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_6.imageset/Home_6@2x.png b/HackIllinois/Assets.xcassets/Home/Home_6.imageset/Home_6@2x.png new file mode 100644 index 00000000..f49f0644 Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_6.imageset/Home_6@2x.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_6.imageset/Home_6@3x.png b/HackIllinois/Assets.xcassets/Home/Home_6.imageset/Home_6@3x.png new file mode 100644 index 00000000..3d7dd134 Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_6.imageset/Home_6@3x.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_Final.imageset/Contents.json b/HackIllinois/Assets.xcassets/Home/Home_Final.imageset/Contents.json new file mode 100644 index 00000000..3f6bd337 --- /dev/null +++ b/HackIllinois/Assets.xcassets/Home/Home_Final.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Home_Final.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Home_Final@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Home_Final@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/HackIllinois/Assets.xcassets/Home/Home_Final.imageset/Home_Final.png b/HackIllinois/Assets.xcassets/Home/Home_Final.imageset/Home_Final.png new file mode 100644 index 00000000..0267f7bd Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_Final.imageset/Home_Final.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_Final.imageset/Home_Final@2x.png b/HackIllinois/Assets.xcassets/Home/Home_Final.imageset/Home_Final@2x.png new file mode 100644 index 00000000..93e5f2b7 Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_Final.imageset/Home_Final@2x.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_Final.imageset/Home_Final@3x.png b/HackIllinois/Assets.xcassets/Home/Home_Final.imageset/Home_Final@3x.png new file mode 100644 index 00000000..2f150b00 Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_Final.imageset/Home_Final@3x.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_Start.imageset/Contents.json b/HackIllinois/Assets.xcassets/Home/Home_Start.imageset/Contents.json new file mode 100644 index 00000000..4c0d7acd --- /dev/null +++ b/HackIllinois/Assets.xcassets/Home/Home_Start.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Home_Start.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Home_Start@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Home_Start@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/HackIllinois/Assets.xcassets/Home/Home_Start.imageset/Home_Start.png b/HackIllinois/Assets.xcassets/Home/Home_Start.imageset/Home_Start.png new file mode 100644 index 00000000..bf6b7dad Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_Start.imageset/Home_Start.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_Start.imageset/Home_Start@2x.png b/HackIllinois/Assets.xcassets/Home/Home_Start.imageset/Home_Start@2x.png new file mode 100644 index 00000000..c926615c Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_Start.imageset/Home_Start@2x.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_Start.imageset/Home_Start@3x.png b/HackIllinois/Assets.xcassets/Home/Home_Start.imageset/Home_Start@3x.png new file mode 100644 index 00000000..7bd0ceea Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_Start.imageset/Home_Start@3x.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_Tags_Transparent.imageset/Contents.json b/HackIllinois/Assets.xcassets/Home/Home_Tags_Transparent.imageset/Contents.json new file mode 100644 index 00000000..2dcf126b --- /dev/null +++ b/HackIllinois/Assets.xcassets/Home/Home_Tags_Transparent.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Home_Tags_Transparent.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Home_Tags_Transparent@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Home_Tags_Transparent@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/HackIllinois/Assets.xcassets/Home/Home_Tags_Transparent.imageset/Home_Tags_Transparent.png b/HackIllinois/Assets.xcassets/Home/Home_Tags_Transparent.imageset/Home_Tags_Transparent.png new file mode 100644 index 00000000..80fed6e3 Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_Tags_Transparent.imageset/Home_Tags_Transparent.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_Tags_Transparent.imageset/Home_Tags_Transparent@2x.png b/HackIllinois/Assets.xcassets/Home/Home_Tags_Transparent.imageset/Home_Tags_Transparent@2x.png new file mode 100644 index 00000000..7ce25a2e Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_Tags_Transparent.imageset/Home_Tags_Transparent@2x.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Home_Tags_Transparent.imageset/Home_Tags_Transparent@3x.png b/HackIllinois/Assets.xcassets/Home/Home_Tags_Transparent.imageset/Home_Tags_Transparent@3x.png new file mode 100644 index 00000000..d91007ff Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Home_Tags_Transparent.imageset/Home_Tags_Transparent@3x.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Question Mark Toggled.imageset/Contents.json b/HackIllinois/Assets.xcassets/Home/Question Mark Toggled.imageset/Contents.json new file mode 100644 index 00000000..9387b0ea --- /dev/null +++ b/HackIllinois/Assets.xcassets/Home/Question Mark Toggled.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Question Mark Toggled.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Question Mark Toggled@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Question Mark Toggled@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/HackIllinois/Assets.xcassets/Home/Question Mark Toggled.imageset/Question Mark Toggled.png b/HackIllinois/Assets.xcassets/Home/Question Mark Toggled.imageset/Question Mark Toggled.png new file mode 100644 index 00000000..e3e0eb66 Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Question Mark Toggled.imageset/Question Mark Toggled.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Question Mark Toggled.imageset/Question Mark Toggled@2x.png b/HackIllinois/Assets.xcassets/Home/Question Mark Toggled.imageset/Question Mark Toggled@2x.png new file mode 100644 index 00000000..228d2ea1 Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Question Mark Toggled.imageset/Question Mark Toggled@2x.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Question Mark Toggled.imageset/Question Mark Toggled@3x.png b/HackIllinois/Assets.xcassets/Home/Question Mark Toggled.imageset/Question Mark Toggled@3x.png new file mode 100644 index 00000000..ef029352 Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Question Mark Toggled.imageset/Question Mark Toggled@3x.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Question Mark.imageset/Contents.json b/HackIllinois/Assets.xcassets/Home/Question Mark.imageset/Contents.json new file mode 100644 index 00000000..20e5554a --- /dev/null +++ b/HackIllinois/Assets.xcassets/Home/Question Mark.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Question Mark.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Question Mark@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Question Mark@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/HackIllinois/Assets.xcassets/Home/Question Mark.imageset/Question Mark.png b/HackIllinois/Assets.xcassets/Home/Question Mark.imageset/Question Mark.png new file mode 100644 index 00000000..a0803ff2 Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Question Mark.imageset/Question Mark.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Question Mark.imageset/Question Mark@2x.png b/HackIllinois/Assets.xcassets/Home/Question Mark.imageset/Question Mark@2x.png new file mode 100644 index 00000000..2d9a494c Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Question Mark.imageset/Question Mark@2x.png differ diff --git a/HackIllinois/Assets.xcassets/Home/Question Mark.imageset/Question Mark@3x.png b/HackIllinois/Assets.xcassets/Home/Question Mark.imageset/Question Mark@3x.png new file mode 100644 index 00000000..5f51ee0e Binary files /dev/null and b/HackIllinois/Assets.xcassets/Home/Question Mark.imageset/Question Mark@3x.png differ diff --git a/HackIllinois/DataSources/HITimeDataSource.swift b/HackIllinois/DataSources/HITimeDataSource.swift index a6e0111f..6ecd8f75 100644 --- a/HackIllinois/DataSources/HITimeDataSource.swift +++ b/HackIllinois/DataSources/HITimeDataSource.swift @@ -18,6 +18,17 @@ final class HITimeDataSource { static var shared = HITimeDataSource() public static let defaultTimes = EventTimes( + checkInStart: Date(timeIntervalSince1970: 1708723800), // Friday, February 23, 2024 3:30:00 PM CST + checkInEnd: Date(timeIntervalSince1970: 1708725600), // Friday, February 23, 2024 4:00:00 PM CST + scavengerHuntStart: Date(timeIntervalSince1970: 1708725600), // Friday, February 23, 2024 4:00:00 PM CST + scavengerHuntEnd: Date(timeIntervalSince1970: 1708732800), // Friday, February 23, 2024 6:00:00 PM CST + openingCeremonyStart: Date(timeIntervalSince1970: 1708732800), // Friday, February 23, 2024 6:00:00 PM CST + openingCeremonyEnd: Date(timeIntervalSince1970: 1708736400), // Friday, February 23, 2024 7:00:00 PM CST + projectShowcaseStart: Date(timeIntervalSince1970: 1708880400), // Sunday, February 25, 2024 11:00:00 AM CST + projectShowcaseEnd: Date(timeIntervalSince1970: 1708894800), // Sunday, February 25, 2024 3:00:00 PM CST + closingCeremonyStart: Date(timeIntervalSince1970: 1708894800), // Sunday, February 25, 2024 3:00:00 PM CST + closingCeremonyEnd: Date(timeIntervalSince1970: 1708898400), // Sunday, February 25, 2024 4:00:00 PM CST + eventStart: Date(timeIntervalSince1970: 1708732800), // Friday, February 23, 2024 6:00:00 PM CST eventEnd: Date(timeIntervalSince1970: 1708898400), // Sunday, February 25, 2024 4:00:00 PM CST hackStart: Date(timeIntervalSince1970: 1708736400), // Friday, February 23, 2024 7:00:00 PM CST diff --git a/HackIllinois/UI/HIAppearance.swift b/HackIllinois/UI/HIAppearance.swift index 250a22fa..cc7242eb 100644 --- a/HackIllinois/UI/HIAppearance.swift +++ b/HackIllinois/UI/HIAppearance.swift @@ -77,6 +77,10 @@ struct HIAppearance: Equatable { let profileCardNone: UIColor let profileBaseText: UIColor + + let countdownTextColor: UIColor + let countdownBackground: UIColor + let bannerBackground: UIColor let clear: UIColor = .clear let black: UIColor = .black @@ -200,7 +204,10 @@ struct HIAppearance: Equatable { profileCardLactoseIntolerant: lactoseintolerant, profileCardOther: other, profileCardNone: none, - profileBaseText: profileBaseText + profileBaseText: profileBaseText, + countdownTextColor: brown, + countdownBackground: orange, + bannerBackground: lightYellow ) fileprivate static let night = HIAppearance( @@ -264,7 +271,10 @@ struct HIAppearance: Equatable { profileCardLactoseIntolerant: lactoseintolerant, profileCardOther: other, profileCardNone: none, - profileBaseText: profileBaseText + profileBaseText: profileBaseText, + countdownTextColor: brown, + countdownBackground: orange, + bannerBackground: lightYellow ) fileprivate static var current = day @@ -342,7 +352,8 @@ struct HIAppearance: Equatable { static let QRCheckInFont = UIFont(name: "MontserratRoman-SemiBold", size: 14) // Home page countdown fonts - static let newCountdownText = UIFont(name: "MontserratRoman-Bold", size: 48) // Hack 2023 +// static let newCountdownText = UIFont(name: "MontserratRoman-Bold", size: 48) // Hack 2023 + static let newCountdownText = UIFont(name: "MontserratRoman-Bold", size: 42) // Hack 2024 static let countdownText = UIFont(name: "MontserratRoman-Bold", size: 25) // Onboarding fonts diff --git a/HackIllinois/UI/HILabel.swift b/HackIllinois/UI/HILabel.swift index ba4bc2e7..2c992aa0 100644 --- a/HackIllinois/UI/HILabel.swift +++ b/HackIllinois/UI/HILabel.swift @@ -52,7 +52,7 @@ class HILabel: UILabel { case leaderboardRank case leaderboardName case leaderboardPoints - case neonCountdown + case newCountdown // Cases used on bubble event cell case newLocation case time @@ -77,9 +77,9 @@ class HILabel: UILabel { translatesAutoresizingMaskIntoConstraints = false if let style = style { switch style { - case .neonCountdown: - textHIColor = \.neonCountdownText - backgroundHIColor = \.clear + case .newCountdown: + textHIColor = \.countdownTextColor + backgroundHIColor = \.countdownBackground font = HIAppearance.Font.newCountdownText case .location: diff --git a/HackIllinois/ViewControllers/HIBannerViewController.swift b/HackIllinois/ViewControllers/HIBannerViewController.swift index 5ea5af77..66f069dd 100644 --- a/HackIllinois/ViewControllers/HIBannerViewController.swift +++ b/HackIllinois/ViewControllers/HIBannerViewController.swift @@ -15,8 +15,9 @@ import UIKit class HIBannerViewController: UIViewController { private let backgroundHIColor: HIColor = \.clear + private let bannerBackground: HIColor = \.bannerBackground private let label = HILabel { - $0.textHIColor = \.whiteText + $0.textHIColor = \.countdownTextColor $0.backgroundHIColor = \.clear $0.textAlignment = .center $0.font = HIAppearance.Font.glyph @@ -41,9 +42,13 @@ extension HIBannerViewController { func bannerView(with label: HILabel) -> UIView { let bannerView = UIView() bannerView.addSubview(label) - label.constrain(to: bannerView, topInset: 0, trailingInset: 0, leadingInset: 0) - bannerView.constrain(to: bannerView, trailingInset: 0, bottomInset: 0, leadingInset: 0) - bannerView.bottomAnchor.constraint(equalTo: label.topAnchor).isActive = true + label.constrain(to: bannerView, topInset: 0, trailingInset: 0, bottomInset: 0, leadingInset: 0) + label.widthAnchor.constraint(equalTo: bannerView.widthAnchor).isActive = true + + bannerView.layer.cornerRadius = 7.5 + bannerView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] + bannerView.backgroundColor = bannerBackground.value + return bannerView } public func updateLabel(with text: String) { diff --git a/HackIllinois/ViewControllers/HIBaseViewController.swift b/HackIllinois/ViewControllers/HIBaseViewController.swift index dba1b560..0f3aba91 100644 --- a/HackIllinois/ViewControllers/HIBaseViewController.swift +++ b/HackIllinois/ViewControllers/HIBaseViewController.swift @@ -52,7 +52,7 @@ extension HIBaseViewController { extension HIBaseViewController { @objc dynamic func setUpBackgroundView() { view.layer.backgroundColor = UIColor.clear.cgColor - backgroundView.image = #imageLiteral(resourceName: "PurpleBackground") + backgroundView.image = #imageLiteral(resourceName: "Home_Start") backgroundView.translatesAutoresizingMaskIntoConstraints = false backgroundView.isUserInteractionEnabled = true backgroundView.contentMode = .scaleAspectFill diff --git a/HackIllinois/ViewControllers/HICountdownViewController.swift b/HackIllinois/ViewControllers/HICountdownViewController.swift index b8864179..76550ce0 100644 --- a/HackIllinois/ViewControllers/HICountdownViewController.swift +++ b/HackIllinois/ViewControllers/HICountdownViewController.swift @@ -25,11 +25,12 @@ class HICountdownViewController: UIViewController { private let FRAMES_PER_TICK = 8 // MARK: - Properties - private let days = HILabel(style: .neonCountdown) - private let hours = HILabel(style: .neonCountdown) - private let minutes = HILabel(style: .neonCountdown) - private let seconds = HILabel(style: .neonCountdown) + private let days = HILabel(style: .newCountdown) + private let hours = HILabel(style: .newCountdown) + private let minutes = HILabel(style: .newCountdown) + private let seconds = HILabel(style: .newCountdown) private let backgroundHIColor: HIColor = \.clear + private let countdownBackground: HIColor = \.countdownBackground private var countdownDate: Date? private var dayFrame = 0 @@ -39,7 +40,7 @@ class HICountdownViewController: UIViewController { private var timer: Timer? private var timeDifference: TimeInterval = 0.0 - private var daysRemaining: Int { return max(0, Int(timeDifference / Date.DAY_IN_SECONDS) % 60) } + private var daysRemaining: Int { return max(0, Int(timeDifference / Date.DAY_IN_SECONDS) % 365) } private var hoursRemaining: Int { return max(0, Int(timeDifference / Date.HOUR_IN_SECONDS) % 24) } private var minutesRemaining: Int { return max(0, Int(timeDifference / Date.MINUTE_IN_SECONDS) % 60) } private var secondsRemaining: Int { return max(0, Int(timeDifference) % 60) } @@ -104,9 +105,9 @@ extension HICountdownViewController { countdownStackView.addArrangedSubview(hoursContent) let minutesContent = containerView(with: "MINUTES", and: minutes) countdownStackView.addArrangedSubview(minutesContent) - var countdownSpacingConstant: CGFloat = 30 + var countdownSpacingConstant: CGFloat = 8 if UIDevice.current.userInterfaceIdiom == .pad { - countdownSpacingConstant = 60 + countdownSpacingConstant = 16 } countdownStackView.setCustomSpacing(countdownSpacingConstant, after: daysContent) countdownStackView.setCustomSpacing(countdownSpacingConstant, after: hoursContent) @@ -117,7 +118,7 @@ extension HICountdownViewController { countDownView.translatesAutoresizingMaskIntoConstraints = false let label = HILabel { - $0.textHIColor = \.whiteText + $0.textHIColor = \.countdownTextColor $0.backgroundHIColor = \.clear $0.textAlignment = .center if UIDevice.current.userInterfaceIdiom == .pad { @@ -126,39 +127,21 @@ extension HICountdownViewController { $0.font = HIAppearance.Font.glyph } $0.text = labelString + $0.text } - let yellowish = #colorLiteral(red: 0.9882352941, green: 0.862745098, blue: 0.5607843137, alpha: 1) - let strokeTextAttributes = [ - NSAttributedString.Key.strokeColor: yellowish, - NSAttributedString.Key.foregroundColor: UIColor.clear, - NSAttributedString.Key.strokeWidth: 5.0, - NSAttributedString.Key.font: UIFont.systemFont(ofSize: 48, weight: UIFont.Weight(rawValue: 900) )] - as [NSAttributedString.Key: Any] - let iPadStrokeTextAttributes = [ - NSAttributedString.Key.strokeColor: yellowish, - NSAttributedString.Key.foregroundColor: UIColor.clear, - NSAttributedString.Key.strokeWidth: 5.0, - NSAttributedString.Key.font: UIFont.systemFont(ofSize: 90, weight: UIFont.Weight(rawValue: 900) )] - as [NSAttributedString.Key: Any] - if UIDevice.current.userInterfaceIdiom == .pad { - countDownView.attributedText = NSMutableAttributedString(string: "Test", attributes: iPadStrokeTextAttributes) - } else { - countDownView.attributedText = NSMutableAttributedString(string: "Test", attributes: strokeTextAttributes) - } - countDownView.layer.shadowColor = yellowish.cgColor - countDownView.layer.shadowRadius = 3.0 - countDownView.layer.shadowOpacity = 100.0 - countDownView.layer.masksToBounds = false - countDownView.layer.shouldRasterize = true - countDownView.layer.shadowOffset = .zero let containerView = UIView() - containerView.addSubview(label) containerView.addSubview(countDownView) - label.constrain(to: containerView, topInset: 0, trailingInset: 0, leadingInset: 0) + containerView.addSubview(label) countDownView.centerXAnchor.constraint(equalTo: containerView.centerXAnchor).isActive = true - countDownView.bottomAnchor.constraint(equalTo: label.topAnchor, constant: -4).isActive = true - + countDownView.topAnchor.constraint(equalTo: containerView.topAnchor, constant: 4).isActive = true + countDownView.bottomAnchor.constraint(equalTo: label.topAnchor, constant: 4).isActive = true + countDownView.widthAnchor.constraint(equalTo: containerView.widthAnchor, constant: -8).isActive = true + label.widthAnchor.constraint(equalTo: containerView.widthAnchor, constant: -8).isActive = true + label.centerXAnchor.constraint(equalTo: containerView.centerXAnchor).isActive = true + containerView.layer.cornerRadius = 7.5 + containerView.backgroundColor = countdownBackground.value + return containerView } diff --git a/HackIllinois/ViewControllers/HIHomeViewController.swift b/HackIllinois/ViewControllers/HIHomeViewController.swift index 99047ac8..8eaeb16d 100644 --- a/HackIllinois/ViewControllers/HIHomeViewController.swift +++ b/HackIllinois/ViewControllers/HIHomeViewController.swift @@ -19,32 +19,6 @@ import HIAPI class HIHomeViewController: HIEventListViewController { // MARK: - Properties - lazy var fetchedResultsController: NSFetchedResultsController = { - let fetchRequest: NSFetchRequest = Event.fetchRequest() - - fetchRequest.sortDescriptors = [ - NSSortDescriptor(key: "startTime", ascending: true), - NSSortDescriptor(key: "name", ascending: true) - ] - - fetchRequest.predicate = currentPredicate() - - let fetchedResultsController = NSFetchedResultsController( - fetchRequest: fetchRequest, - managedObjectContext: HICoreDataController.shared.viewContext, - sectionNameKeyPath: nil, - cacheName: nil - ) - - fetchedResultsController.delegate = self - - return fetchedResultsController - }() - - private var currentTab = 0 - - private var dataStore: [String] = ["CURRENT", "UPCOMING"] - private lazy var countdownViewController = HICountdownViewController(delegate: self) private lazy var bannerViewController = HIBannerViewController() private let countdownFrameView = HIView { @@ -53,17 +27,19 @@ class HIHomeViewController: HIEventListViewController { private let bannerFrameView = HIView { $0.translatesAutoresizingMaskIntoConstraints = false - if UIDevice.current.userInterfaceIdiom == .pad { - let bannerImage = #imageLiteral(resourceName: "BannerPad") - $0.layer.contents = bannerImage.cgImage - } else { - let bannerImage = #imageLiteral(resourceName: "Banner") - $0.layer.contents = bannerImage.cgImage - } } + + private var isLegendButtonSelected = false + private let legendButton = HIButton { + $0.tintHIColor = \.baseText + $0.backgroundHIColor = \.clear + $0.baseImage = #imageLiteral(resourceName: "Question Mark") + $0.activeImage = #imageLiteral(resourceName: "Question Mark Toggled") + } + + private var timer: Timer? private var countdownDataStoreIndex = 0 - // changed to upper case for 2023 designs private var staticDataStore: [(date: Date, displayText: String)] = [ (HITimeDataSource.shared.eventTimes.eventStart, "HACKILLINOIS BEGINS IN"), (HITimeDataSource.shared.eventTimes.hackStart, "HACKING BEGINS IN"), @@ -71,42 +47,7 @@ class HIHomeViewController: HIEventListViewController { (HITimeDataSource.shared.eventTimes.eventEnd, "HACKILLINOIS ENDS IN") ] - private var timer: Timer? -} - -// MARK: - Actions -extension HIHomeViewController { - - @objc func didSelectTab(_ sender: HISegmentedControl) { - currentTab = sender.selectedIndex - updatePredicate() - animateReload() - } - - func updatePredicate() { - fetchedResultsController.fetchRequest.predicate = currentPredicate() - } - - func currentPredicate() -> NSPredicate { - if currentTab == 0 { - return NSPredicate(format: "(startTime < now()) AND (endTime > now())") - } else if currentTab == 1 { - let inTwoHours = Date(timeIntervalSinceNow: 7200) - let upcomingPredicate = NSPredicate(format: "(startTime < %@) AND (startTime > now())", inTwoHours as NSDate) - return upcomingPredicate - } else { - let upcomingPredicate = NSPredicate(format: "isAsync == %@", NSNumber(value: true)) - return upcomingPredicate - } - } - - func animateReload() { - try? fetchedResultsController.performFetch() - animateTableViewReload() - if let tableView = tableView, !tableView.visibleCells.isEmpty { - tableView.scrollToRow(at: IndexPath(row: 0, section: 0), at: .top, animated: false) - } - } + var transparentImageView: UIImageView! } // MARK: - UIViewController @@ -115,56 +56,41 @@ extension HIHomeViewController { super.loadView() setUpBanner() setUpCountdown() - let items = dataStore.map { $0 } - let segmentedControl = HIHomeSegmentedControl(status: items) - view.addSubview(segmentedControl) - segmentedControl.addTarget(self, action: #selector(didSelectTab(_:)), for: .valueChanged) - segmentedControl.translatesAutoresizingMaskIntoConstraints = false - var segmentedControlConstant = 1.0 - if UIDevice.current.userInterfaceIdiom == .pad { - segmentedControlConstant = 2.0 - } else if UIScreen.main.bounds.width < 375.0 { - segmentedControlConstant = 0.9 - } - segmentedControl.topAnchor.constraint(equalTo: bannerFrameView.bottomAnchor, constant: 124 * segmentedControlConstant).isActive = true - segmentedControl.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: -30).isActive = true - segmentedControl.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: 20).isActive = true - //segmentedControl.centerXAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerXAnchor).isActive = true - segmentedControl.heightAnchor.constraint(equalToConstant: 44).isActive = true - - let separator = UIView() - self.view.addSubview(separator) - separator.translatesAutoresizingMaskIntoConstraints = false - separator.backgroundColor <- \.clear - separator.constrain(height: 1 / (UIScreen.main.scale)) - separator.constrain(to: view, trailingInset: 0, leadingInset: 0) - separator.topAnchor.constraint(equalTo: segmentedControl.bottomAnchor, constant: 10).isActive = true - - let tableView = HITableView() - view.addSubview(tableView) - tableView.topAnchor.constraint(equalTo: separator.bottomAnchor, constant: 10).isActive = true - tableView.constrain(to: view.safeAreaLayoutGuide, trailingInset: 0, leadingInset: 0) - tableView.constrain(to: view, bottomInset: 0) - self.tableView = tableView - - tableView.addLeftAndRightSwipeGestureRecognizers( - target: segmentedControl, - selector: #selector(segmentedControl.handleSwipeGesture(_:)) - ) } override func viewDidLoad() { - _fetchedResultsController = fetchedResultsController as? NSFetchedResultsController super.viewDidLoad() setupRefreshControl() + + // Initialize the UIImageView + transparentImageView = UIImageView(frame: view.bounds) + transparentImageView.contentMode = .scaleAspectFill + transparentImageView.alpha = 0 + transparentImageView.image = UIImage(named: "Home_Tags_Transparent") + + // Add the UIImageView to your view hierarchy + view.addSubview(transparentImageView) + view.bringSubviewToFront(transparentImageView) } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) countdownViewController.startUpCountdown() + layoutLegendButton() setupPredicateRefreshTimer() setupPass() } + + func layoutLegendButton() { + view.addSubview(legendButton) + + legendButton.constrain(width: 25, height: 25) + legendButton.addTarget(self, action: #selector(didSelectLegendButton(_:)), for: .touchUpInside) + + legendButton.topAnchor.constraint(equalTo: bannerFrameView.topAnchor).isActive = true + legendButton.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: -15).isActive = true + } + func setUpCountdown() { view.addSubview(countdownFrameView) countdownFrameView.translatesAutoresizingMaskIntoConstraints = false @@ -174,10 +100,10 @@ extension HIHomeViewController { } else if UIScreen.main.bounds.width < 375.0 { countdownFrameConstant = 0.9 } - countdownFrameView.topAnchor.constraint(equalTo: bannerFrameView.bottomAnchor, constant: 77 * countdownFrameConstant).isActive = true + countdownFrameView.topAnchor.constraint(equalTo: bannerFrameView.bottomAnchor, constant: 7.5).isActive = true countdownFrameView.centerXAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerXAnchor).isActive = true let widthConstant: CGFloat = 329 * countdownFrameConstant - let heightConstant: CGFloat = 283 * countdownFrameConstant + let heightConstant: CGFloat = 263 * countdownFrameConstant countdownFrameView.widthAnchor.constraint(equalToConstant: widthConstant).isActive = true countdownFrameView.heightAnchor.constraint(equalToConstant: heightConstant).isActive = true countdownFrameView.addSubview(countdownViewController.view) @@ -186,6 +112,8 @@ extension HIHomeViewController { countdownViewController.view.heightAnchor.constraint(equalTo: countdownFrameView.heightAnchor, multiplier: 0.3).isActive = true countdownViewController.view.centerXAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerXAnchor).isActive = true countdownViewController.didMove(toParent: self) + + bannerViewController.view.widthAnchor.constraint(equalTo: countdownViewController.view.widthAnchor).isActive = true } func setUpBanner() { view.addSubview(bannerFrameView) @@ -205,16 +133,15 @@ extension HIHomeViewController { bannerFrameTopAnchorConstant = 0.9 bannerFrameHeightConstant = 0.9 } - bannerFrameView.topAnchor.constraint(equalTo: view.topAnchor, constant: 31.5 * bannerFrameTopAnchorConstant).isActive = true + bannerFrameView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: -50 * bannerFrameTopAnchorConstant).isActive = true //let widthConstant: CGFloat = 290 - let heightConstant: CGFloat = 84 * bannerFrameHeightConstant + let heightConstant: CGFloat = 20 * bannerFrameHeightConstant //bannerFrameView.widthAnchor.constraint(equalToConstant: widthConstant).isActive = true bannerFrameView.heightAnchor.constraint(equalToConstant: heightConstant).isActive = true bannerFrameView.addSubview(bannerViewController.view) bannerViewController.view.translatesAutoresizingMaskIntoConstraints = false - bannerViewController.view.topAnchor.constraint(equalTo: bannerFrameView.centerYAnchor, constant: 10.0 * bannerFrameConstant).isActive = true - //bannerViewController.view.heightAnchor.constraint(equalTo: bannerFrameView.heightAnchor).isActive = true - //bannerViewController.view.heightAnchor.constraint(equalTo: bannerFrameView.heightAnchor, multiplier: 0.3).isActive = true + bannerViewController.view.topAnchor.constraint(equalTo: bannerFrameView.topAnchor).isActive = true + bannerViewController.view.heightAnchor.constraint(equalTo: bannerFrameView.heightAnchor).isActive = true bannerViewController.view.centerXAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerXAnchor).isActive = true bannerViewController.didMove(toParent: self) } @@ -229,9 +156,56 @@ extension HIHomeViewController { extension HIHomeViewController { @objc dynamic override func setUpBackgroundView() { super.setUpBackgroundView() - backgroundView.image = #imageLiteral(resourceName: "HomeBackground") - if UIDevice.current.userInterfaceIdiom == .pad { - backgroundView.image = #imageLiteral(resourceName: "BackgroundPad") + + let now = Date() + let checkInStart = HITimeDataSource.shared.eventTimes.checkInStart + let checkInEnd = HITimeDataSource.shared.eventTimes.checkInEnd + let scavengerHuntEnd = HITimeDataSource.shared.eventTimes.scavengerHuntEnd + let openingCeremonyEnd = HITimeDataSource.shared.eventTimes.openingCeremonyEnd + let hackEnd = HITimeDataSource.shared.eventTimes.hackEnd + let projectShowcaseEnd = HITimeDataSource.shared.eventTimes.projectShowcaseEnd + let closingCeremonyEnd = HITimeDataSource.shared.eventTimes.closingCeremonyEnd + + if now < checkInStart { + backgroundView.image = #imageLiteral(resourceName: "Home_Start") + if UIDevice.current.userInterfaceIdiom == .pad { + backgroundView.image = #imageLiteral(resourceName: "Home_Start") + } + } else if now < checkInEnd { + backgroundView.image = #imageLiteral(resourceName: "Home_1") + if UIDevice.current.userInterfaceIdiom == .pad { + backgroundView.image = #imageLiteral(resourceName: "Home_1") + } + } else if now < scavengerHuntEnd { + backgroundView.image = #imageLiteral(resourceName: "Home_2") + if UIDevice.current.userInterfaceIdiom == .pad { + backgroundView.image = #imageLiteral(resourceName: "Home_2") + } + } else if now < openingCeremonyEnd { + backgroundView.image = #imageLiteral(resourceName: "Home_3") + if UIDevice.current.userInterfaceIdiom == .pad { + backgroundView.image = #imageLiteral(resourceName: "Home_3") + } + } else if now < hackEnd { + backgroundView.image = #imageLiteral(resourceName: "Home_4") + if UIDevice.current.userInterfaceIdiom == .pad { + backgroundView.image = #imageLiteral(resourceName: "Home_4") + } + } else if now < projectShowcaseEnd { + backgroundView.image = #imageLiteral(resourceName: "Home_5") + if UIDevice.current.userInterfaceIdiom == .pad { + backgroundView.image = #imageLiteral(resourceName: "Home_5") + } + } else if now < closingCeremonyEnd { + backgroundView.image = #imageLiteral(resourceName: "Home_6") + if UIDevice.current.userInterfaceIdiom == .pad { + backgroundView.image = #imageLiteral(resourceName: "Home_6") + } + } else { + backgroundView.image = #imageLiteral(resourceName: "Home_Final") + if UIDevice.current.userInterfaceIdiom == .pad { + backgroundView.image = #imageLiteral(resourceName: "Home_Final") + } } } } @@ -266,6 +240,23 @@ extension HIHomeViewController: HICountdownViewControllerDelegate { } } +extension HIHomeViewController { + @objc func didSelectLegendButton(_ sender: UIButton) { + isLegendButtonSelected.toggle() + + if isLegendButtonSelected { + legendButton.isActive = true + } else { + legendButton.isActive = false + } + + + UIView.animate(withDuration: 0.5) { + self.transparentImageView.alpha = self.transparentImageView.alpha == 0 ? 1 : 0 + } + } +} + // MARK: - Pass/Wallet setup extension HIHomeViewController { func setupPass() { @@ -304,7 +295,7 @@ extension HIHomeViewController { extension HIHomeViewController { func setupPredicateRefreshTimer() { timer = Timer.scheduledTimer( - timeInterval: 30, + timeInterval: 60, // Updates every minute target: self, selector: #selector(refreshPredicate), userInfo: nil, @@ -313,9 +304,7 @@ extension HIHomeViewController { } @objc func refreshPredicate() { - updatePredicate() - try? fetchedResultsController.performFetch() - animateTableViewReload() + setUpBackgroundView() } func teardownPredicateRefreshTimer() {