Skip to content

Commit

Permalink
Merge pull request #613 from HackIllinois/scanner-menu-update
Browse files Browse the repository at this point in the history
Attendee and Staff Scanner menu update
  • Loading branch information
anushkasankaran authored Feb 12, 2025
2 parents a592a08 + 92a2b37 commit 6438edf
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 73 deletions.
23 changes: 23 additions & 0 deletions HackIllinois/Assets.xcassets/scanner-menu.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Group 902.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group [email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group [email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 22 additions & 19 deletions HackIllinois/UI/HIAppearance.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ struct HIAppearance: Equatable {
let countdownTextColor: UIColor
let countdownBackground: UIColor
let bannerBackground: UIColor
let scannerButtonPink: UIColor
let scannerButtonTeal: UIColor
let scannerButtonYellow: UIColor
let scannerButtonYellowOrange: UIColor
let scannerButtonTealBlue: UIColor
let scannerButtonOrangeBrown: UIColor
let scannerButtonBorder: UIColor
let scannerButtonShadow: UIColor
let proBackground: UIColor
Expand Down Expand Up @@ -127,7 +127,6 @@ struct HIAppearance: Equatable {
private static let lightPurple = #colorLiteral(red: 0.662745098, green: 0.4666666667, blue: 0.6705882353, alpha: 1)
private static let indigo = #colorLiteral(red: 0.3568627451, green: 0.3803921569, blue: 0.6078431373, alpha: 1)
private static let darknavy = #colorLiteral(red: 0.1137254902, green: 0.1490196078, blue: 0.2666666667, alpha: 1)
private static let transparent = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 0)
private static let white = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)
private static let black = #colorLiteral(red: 0, green: 0, blue: 0, alpha: 1)
private static let buttonPink = #colorLiteral(red: 0.862745098, green: 0.5411764706, blue: 0.662745098, alpha: 1)
Expand All @@ -136,15 +135,19 @@ struct HIAppearance: Equatable {
private static let offWhite = #colorLiteral(red: 1, green: 0.9725490196, blue: 0.9607843137, alpha: 1)
private static let transparent2 = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 0)
// Hack 2025 color palette (color name + hex code)
private static let rawSienna = #colorLiteral(red: 0.8705882353, green: 0.5568627451, blue: 0.2705882353, alpha: 1) // #DE8E45
private static let neptune = #colorLiteral(red: 0.5176470588, green: 0.737254902, blue: 0.7254901961, alpha: 1) // #84BCB9
private static let lightningYellow = #colorLiteral(red: 0.9764705882, green: 0.7568627451, blue: 0.1490196078, alpha: 1) // #F9C126
private static let copper = #colorLiteral(red: 0.7725490196, green: 0.4039215686, blue: 0.2470588235, alpha: 1) // #C5673F
private static let metallicCopper = #colorLiteral(red: 0.4274509804, green: 0.1607843137, blue: 0.1019607843, alpha: 1) // #6D291A
private static let yellowOrange = #colorLiteral(red: 1.0, green: 0.6980392157, blue: 0.2431372549, alpha: 1) // #FFB23E
private static let muleFawn = #colorLiteral(red: 0.537254902, green: 0.2470588235, blue: 0.1843137255, alpha: 1) // #893F2F
private static let elephant = #colorLiteral(red: 0.05098039216, green: 0.2470588235, blue: 0.2549019608, alpha: 1) // #0D3F41
private static let doveGray = #colorLiteral(red: 0.4235294118, green: 0.4235294118, blue: 0.4235294118, alpha: 1) // #6C6C6C
public static let rawSienna = #colorLiteral(red: 0.8705882353, green: 0.5568627451, blue: 0.2705882353, alpha: 1) // #DE8E45
public static let neptune = #colorLiteral(red: 0.5176470588, green: 0.737254902, blue: 0.7254901961, alpha: 1) // #84BCB9
public static let lightningYellow = #colorLiteral(red: 0.9764705882, green: 0.7568627451, blue: 0.1490196078, alpha: 1) // #F9C126
public static let copper = #colorLiteral(red: 0.7725490196, green: 0.4039215686, blue: 0.2470588235, alpha: 1) // #C5673F
public static let metallicCopper = #colorLiteral(red: 0.4274509804, green: 0.1607843137, blue: 0.1019607843, alpha: 1) // #6D291A
public static let yellowOrange = #colorLiteral(red: 1.0, green: 0.6980392157, blue: 0.2431372549, alpha: 1) // #FFB23E
public static let muleFawn = #colorLiteral(red: 0.537254902, green: 0.2470588235, blue: 0.1843137255, alpha: 1) // #893F2F
public static let elephant = #colorLiteral(red: 0.05098039216, green: 0.2470588235, blue: 0.2549019608, alpha: 1) // #0D3F41
public static let transparent = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 0)
public static let doveGray = #colorLiteral(red: 0.4235294118, green: 0.4235294118, blue: 0.4235294118, alpha: 1) // #6C6C6C
public static let buttonYellowOrange = #colorLiteral(red: 0.8902, green: 0.6549, blue: 0.2824, alpha: 1) // #E3A748
public static let buttonTealBlue = #colorLiteral(red: 0.3686, green: 0.7098, blue: 0.7294, alpha: 1) // #5EB5BA
public static let buttonOrangeBrown = #colorLiteral(red: 0.7725, green: 0.4039, blue: 0.2471, alpha: 1) // #C5673F
private static let navBarYellow = #colorLiteral(red: 0.9603472352, green: 0.9405072331, blue: 0.8672463298, alpha: 1)
private static var statusBarWhite: UIStatusBarStyle {
return .lightContent
Expand Down Expand Up @@ -226,9 +229,9 @@ struct HIAppearance: Equatable {
countdownTextColor: brown,
countdownBackground: orange,
bannerBackground: lightYellow,
scannerButtonPink: buttonPink,
scannerButtonTeal: buttonTeal,
scannerButtonYellow: buttonYellow,
scannerButtonYellowOrange: buttonYellowOrange,
scannerButtonTealBlue: buttonTealBlue,
scannerButtonOrangeBrown: buttonOrangeBrown,
scannerButtonBorder: medBrown,
scannerButtonShadow: darkBrown,
proBackground: medTeal,
Expand Down Expand Up @@ -307,9 +310,9 @@ struct HIAppearance: Equatable {
countdownTextColor: brown,
countdownBackground: orange,
bannerBackground: lightYellow,
scannerButtonPink: buttonPink,
scannerButtonTeal: buttonTeal,
scannerButtonYellow: buttonYellow,
scannerButtonYellowOrange: yellowOrange,
scannerButtonTealBlue: buttonTealBlue,
scannerButtonOrangeBrown: buttonOrangeBrown,
scannerButtonBorder: medBrown,
scannerButtonShadow: darkBrown,
proBackground: medTeal,
Expand Down
2 changes: 1 addition & 1 deletion HackIllinois/UI/HILabel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ class HILabel: UILabel {
font = HIAppearance.Font.locationText

case .QRSelection:
textHIColor = \.viewTitleBrown
textHIColor = \.whiteText
backgroundHIColor = \.clear
font = HIAppearance.Font.QRSelection
}
Expand Down
53 changes: 10 additions & 43 deletions HackIllinois/ViewControllers/HIQRAttendeeScannerSelection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,46 +35,34 @@ class HIQRAttendeeScannerSelection: HIBaseViewController {
}
private let eventCheckInButton = HIButton {
$0.tintHIColor = \.action
$0.backgroundHIColor = \.scannerButtonPink
$0.backgroundHIColor = \.scannerButtonYellowOrange
$0.layer.borderWidth = 4.0
$0.layer.borderColor = #colorLiteral(red: 0.4588235294, green: 0.1960784314, blue: 0.07843137255, alpha: 1)
$0.layer.borderColor = #colorLiteral(red: 0.5294, green: 0.3373, blue: 0.0314, alpha: 1) // #875608
// 3D Effect
$0.layer.masksToBounds = false
$0.layer.shadowColor = #colorLiteral(red: 0.337254902, green: 0.1411764706, blue: 0.06666666667, alpha: 1)
$0.layer.shadowColor = #colorLiteral(red: 0.5294, green: 0.3373, blue: 0.0314, alpha: 1)
$0.layer.shadowOpacity = 1
$0.layer.shadowOffset = CGSize(width: 0, height: 12)
$0.layer.shadowOffset = CGSize(width: 0, height: 5)
$0.layer.shadowRadius = 0
}
private let mentorCheckInButton = HIButton {
$0.tintHIColor = \.action
$0.backgroundHIColor = \.scannerButtonTeal
$0.backgroundHIColor = \.scannerButtonTealBlue
$0.layer.borderWidth = 4.0
$0.layer.borderColor = #colorLiteral(red: 0.4588235294, green: 0.1960784314, blue: 0.07843137255, alpha: 1)
$0.layer.borderColor = #colorLiteral(red: 0.0549, green: 0.2471, blue: 0.2549, alpha: 1) // #0E3F41
// 3D Effect
$0.layer.masksToBounds = false
$0.layer.shadowColor = #colorLiteral(red: 0.337254902, green: 0.1411764706, blue: 0.06666666667, alpha: 1)
$0.layer.shadowColor = #colorLiteral(red: 0.0549, green: 0.2471, blue: 0.2549, alpha: 1)
$0.layer.shadowOpacity = 1
$0.layer.shadowOffset = CGSize(width: 0, height: 12)
$0.layer.shadowRadius = 0
}
private let pointShopScanButton = HIButton {
$0.tintHIColor = \.action
$0.backgroundHIColor = \.scannerButtonYellow
$0.layer.borderWidth = 4.0
$0.layer.borderColor = #colorLiteral(red: 0.4588235294, green: 0.1960784314, blue: 0.07843137255, alpha: 1)
// 3D Effect
$0.layer.masksToBounds = false
$0.layer.shadowColor = #colorLiteral(red: 0.337254902, green: 0.1411764706, blue: 0.06666666667, alpha: 1)
$0.layer.shadowOpacity = 1
$0.layer.shadowOffset = CGSize(width: 0, height: 10)
$0.layer.shadowOffset = CGSize(width: 0, height: 5)
$0.layer.shadowRadius = 0
}
@objc dynamic override func setUpBackgroundView() {
super.setUpBackgroundView()
if UIDevice.current.userInterfaceIdiom == .pad {
backgroundView.image = UIImage(named: "BackgroundPad")
} else {
backgroundView.image = #imageLiteral(resourceName: "Attendee")
backgroundView.image = #imageLiteral(resourceName: "scanner-menu")
}
}
}
Expand All @@ -94,7 +82,6 @@ extension HIQRAttendeeScannerSelection {
} else if !user.roles.contains(.STAFF) {
view.addSubview(eventCheckInButton)
view.addSubview(mentorCheckInButton)
view.addSubview(pointShopScanButton)
view.addSubview(closeButton)
view.addSubview(label)

Expand All @@ -112,12 +99,6 @@ extension HIQRAttendeeScannerSelection {
mentorCheckInButton.layer.cornerRadius = (UIDevice.current.userInterfaceIdiom == .pad) ? 30 : 15
mentorCheckInButton.constrain(width: (UIDevice.current.userInterfaceIdiom == .pad) ? 500 : 290, height: (UIDevice.current.userInterfaceIdiom == .pad) ? 150 : 80)

pointShopScanButton.topAnchor.constraint(equalTo: mentorCheckInButton.bottomAnchor, constant: (UIDevice.current.userInterfaceIdiom == .pad) ? 100 : 50).isActive = true
pointShopScanButton.centerXAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerXAnchor).isActive = true
pointShopScanButton.addTarget(self, action: #selector(didSelectPointsShopButton(_:)), for: .touchUpInside)
pointShopScanButton.layer.cornerRadius = (UIDevice.current.userInterfaceIdiom == .pad) ? 30 : 15
pointShopScanButton.constrain(width: (UIDevice.current.userInterfaceIdiom == .pad) ? 500 : 290, height: (UIDevice.current.userInterfaceIdiom == .pad) ? 150 : 80)

let eventCheckInLabel = HILabel(style: .QRSelection)
eventCheckInLabel.text = "Event Check In"
eventCheckInButton.addSubview(eventCheckInLabel)
Expand All @@ -129,12 +110,6 @@ extension HIQRAttendeeScannerSelection {
mentorCheckInButton.addSubview(mentorCheckInLabel)
mentorCheckInLabel.centerYAnchor.constraint(equalTo: mentorCheckInButton.centerYAnchor).isActive = true
mentorCheckInLabel.centerXAnchor.constraint(equalTo: mentorCheckInButton.centerXAnchor).isActive = true

let pointsShopLabel = HILabel(style: .QRSelection)
pointsShopLabel.text = "Points Shop"
pointShopScanButton.addSubview(pointsShopLabel)
pointsShopLabel.centerYAnchor.constraint(equalTo: pointShopScanButton.centerYAnchor).isActive = true
pointsShopLabel.centerXAnchor.constraint(equalTo: pointShopScanButton.centerXAnchor).isActive = true
}
closeButton.addTarget(self, action: #selector(didSelectCloseButton(_:)), for: .touchUpInside)
closeButton.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 10).isActive = true
Expand All @@ -143,6 +118,7 @@ extension HIQRAttendeeScannerSelection {
closeButton.imageView?.contentMode = .scaleToFill
let label = HILabel(style: .viewTitle)
label.text = "SCANNER"
label.textHIColor = \.whiteText
view.addSubview(label)
label.centerYAnchor.constraint(equalTo: closeButton.centerYAnchor).isActive = true
label.leadingAnchor.constraint(equalTo: closeButton.trailingAnchor, constant: 3).isActive = true
Expand Down Expand Up @@ -208,12 +184,3 @@ extension HIQRAttendeeScannerSelection {
self.present(scanQRCodePopup, animated: true, completion: nil)
}
}

extension HIQRAttendeeScannerSelection {
@objc func didSelectPointsShopButton(_ sender: HIButton) {
let scanQRCodePopup = HIScanPointsShopViewController()
scanQRCodePopup.modalPresentationStyle = .overFullScreen
scanQRCodePopup.modalTransitionStyle = .crossDissolve
self.present(scanQRCodePopup, animated: true, completion: nil)
}
}
57 changes: 47 additions & 10 deletions HackIllinois/ViewControllers/HIQRScannerSelection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,45 @@ class HIQRScannerSelection: HIBaseViewController {
}
private let meetingButton = HIButton {
$0.tintHIColor = \.action
$0.backgroundHIColor = \.scannerButtonPink
$0.backgroundHIColor = \.scannerButtonYellowOrange
$0.layer.borderWidth = 4.0
$0.layer.borderColor = #colorLiteral(red: 0.4588235294, green: 0.1960784314, blue: 0.07843137255, alpha: 1)
$0.layer.borderColor = #colorLiteral(red: 0.5294, green: 0.3373, blue: 0.0314, alpha: 1)
// 3D Effect
$0.layer.masksToBounds = false
$0.layer.shadowColor = #colorLiteral(red: 0.337254902, green: 0.1411764706, blue: 0.06666666667, alpha: 1)
$0.layer.shadowColor = #colorLiteral(red: 0.5294, green: 0.3373, blue: 0.0314, alpha: 1)
$0.layer.shadowOpacity = 1
$0.layer.shadowOffset = CGSize(width: 0, height: 12)
$0.layer.shadowOffset = CGSize(width: 0, height: 5)
$0.layer.shadowRadius = 0
}
private let attendeeButton = HIButton {
$0.tintHIColor = \.action
$0.backgroundHIColor = \.scannerButtonTeal
$0.backgroundHIColor = \.scannerButtonTealBlue
$0.layer.borderWidth = 4.0
$0.layer.borderColor = #colorLiteral(red: 0.4588235294, green: 0.1960784314, blue: 0.07843137255, alpha: 1)
$0.layer.borderColor = #colorLiteral(red: 0.0549, green: 0.2471, blue: 0.2549, alpha: 1)
$0.layer.masksToBounds = false
$0.layer.shadowColor = #colorLiteral(red: 0.337254902, green: 0.1411764706, blue: 0.06666666667, alpha: 1)
$0.layer.shadowColor = #colorLiteral(red: 0.0549, green: 0.2471, blue: 0.2549, alpha: 1)
$0.layer.shadowOpacity = 1
$0.layer.shadowOffset = CGSize(width: 0, height: 12)
$0.layer.shadowOffset = CGSize(width: 0, height: 5)
$0.layer.shadowRadius = 0
}
private let pointShopScanButton = HIButton {
$0.tintHIColor = \.action
$0.backgroundHIColor = \.scannerButtonOrangeBrown
$0.layer.borderWidth = 4.0
$0.layer.borderColor = #colorLiteral(red: 0.5490, green: 0.2157, blue: 0.0745, alpha: 1) // #8C3713
// 3D Effect
$0.layer.masksToBounds = false
$0.layer.shadowColor = #colorLiteral(red: 0.5490, green: 0.2157, blue: 0.0745, alpha: 1)
$0.layer.shadowOpacity = 1
$0.layer.shadowOffset = CGSize(width: 0, height: 5)
$0.layer.shadowRadius = 0
}
@objc dynamic override func setUpBackgroundView() {
super.setUpBackgroundView()
if UIDevice.current.userInterfaceIdiom == .pad {
backgroundView.image = #imageLiteral(resourceName: "BackgroundShifts")
} else {
backgroundView.image = #imageLiteral(resourceName: "Staff")
backgroundView.image = #imageLiteral(resourceName: "scanner-menu")
}
}
}
Expand All @@ -86,6 +98,7 @@ extension HIQRScannerSelection {
} else if user.roles.contains(.STAFF) {
view.addSubview(meetingButton)
view.addSubview(attendeeButton)
view.addSubview(pointShopScanButton)
view.addSubview(closeButton)
view.addSubview(label)
// Add constraints for meetingButton and attendeeButton here
Expand All @@ -100,6 +113,13 @@ extension HIQRScannerSelection {
attendeeButton.addTarget(self, action: #selector(didSelectAttendeeButton(_:)), for: .touchUpInside)
attendeeButton.layer.cornerRadius = (UIDevice.current.userInterfaceIdiom == .pad) ? 30 : 15
attendeeButton.constrain(width: (UIDevice.current.userInterfaceIdiom == .pad) ? 500 : 290, height: (UIDevice.current.userInterfaceIdiom == .pad) ? 150 : 80)

pointShopScanButton.topAnchor.constraint(equalTo: attendeeButton.bottomAnchor, constant: (UIDevice.current.userInterfaceIdiom == .pad) ? 100 : 50).isActive = true
pointShopScanButton.centerXAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerXAnchor).isActive = true
pointShopScanButton.addTarget(self, action: #selector(didSelectPointsShopButton(_:)), for: .touchUpInside)
pointShopScanButton.layer.cornerRadius = (UIDevice.current.userInterfaceIdiom == .pad) ? 30 : 15
pointShopScanButton.constrain(width: (UIDevice.current.userInterfaceIdiom == .pad) ? 500 : 290, height: (UIDevice.current.userInterfaceIdiom == .pad) ? 150 : 80)

let meetingLabel = HILabel(style: .QRSelection)
meetingLabel.text = "Meeting Attendance"
meetingButton.addSubview(meetingLabel)
Expand All @@ -110,14 +130,21 @@ extension HIQRScannerSelection {
attendeeButton.addSubview(attendanceLabel)
attendanceLabel.centerYAnchor.constraint(equalTo: attendeeButton.centerYAnchor).isActive = true
attendanceLabel.centerXAnchor.constraint(equalTo: attendeeButton.centerXAnchor).isActive = true

let pointsShopLabel = HILabel(style: .QRSelection)
pointsShopLabel.text = "Points Shop"
pointShopScanButton.addSubview(pointsShopLabel)
pointsShopLabel.centerYAnchor.constraint(equalTo: pointShopScanButton.centerYAnchor).isActive = true
pointsShopLabel.centerXAnchor.constraint(equalTo: pointShopScanButton.centerXAnchor).isActive = true
}
closeButton.addTarget(self, action: #selector(didSelectCloseButton(_:)), for: .touchUpInside)
closeButton.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 10).isActive = true
closeButton.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: 8).isActive = true
closeButton.constrain(width: 60, height: 60)
closeButton.imageView?.contentMode = .scaleToFill
let label = HILabel(style: (UIDevice.current.userInterfaceIdiom == .pad) ? .viewTitleBrown : .viewTitleBrown)
let label = HILabel(style: (UIDevice.current.userInterfaceIdiom == .pad) ? .viewTitle : .viewTitle)
label.text = "SCANNER"
label.textHIColor = \.whiteText
view.addSubview(label)
label.centerYAnchor.constraint(equalTo: closeButton.centerYAnchor).isActive = true
label.leadingAnchor.constraint(equalTo: closeButton.trailingAnchor, constant: 3).isActive = true
Expand Down Expand Up @@ -183,3 +210,13 @@ extension HIQRScannerSelection {
self.present(scanQRCodePopup, animated: true, completion: nil)
}
}

extension HIQRScannerSelection {
@objc func didSelectPointsShopButton(_ sender: HIButton) {
let scanQRCodePopup = HIScanPointsShopViewController()
scanQRCodePopup.modalPresentationStyle = .overFullScreen
scanQRCodePopup.modalTransitionStyle = .crossDissolve
self.present(scanQRCodePopup, animated: true, completion: nil)
}
}

0 comments on commit 6438edf

Please sign in to comment.