|
@@ -30,6 +30,8 @@ final class DashboardView: NSView, NSTextFieldDelegate {
|
|
30
|
static let border = NSColor(srgbRed: 212 / 255, green: 210 / 255, blue: 208 / 255, alpha: 1)
|
30
|
static let border = NSColor(srgbRed: 212 / 255, green: 210 / 255, blue: 208 / 255, alpha: 1)
|
|
31
|
/// Job search bar outer stroke (charcoal).
|
31
|
/// Job search bar outer stroke (charcoal).
|
|
32
|
static let searchBarBorder = NSColor(srgbRed: 58 / 255, green: 58 / 255, blue: 58 / 255, alpha: 1)
|
32
|
static let searchBarBorder = NSColor(srgbRed: 58 / 255, green: 58 / 255, blue: 58 / 255, alpha: 1)
|
|
|
|
33
|
+ /// Search bar border on hover (brand-tinted, matches focus affordance elsewhere).
|
|
|
|
34
|
+ static let searchBarBorderHover = NSColor(srgbRed: 37 / 255, green: 87 / 255, blue: 167 / 255, alpha: 0.45)
|
|
33
|
static let proCardFill = NSColor(srgbRed: 239 / 255, green: 244 / 255, blue: 252 / 255, alpha: 1)
|
35
|
static let proCardFill = NSColor(srgbRed: 239 / 255, green: 244 / 255, blue: 252 / 255, alpha: 1)
|
|
34
|
static let proCardBorder = NSColor(srgbRed: 212 / 255, green: 210 / 255, blue: 208 / 255, alpha: 1)
|
36
|
static let proCardBorder = NSColor(srgbRed: 212 / 255, green: 210 / 255, blue: 208 / 255, alpha: 1)
|
|
35
|
static let proAccent = NSColor(srgbRed: 37 / 255, green: 87 / 255, blue: 167 / 255, alpha: 1)
|
37
|
static let proAccent = NSColor(srgbRed: 37 / 255, green: 87 / 255, blue: 167 / 255, alpha: 1)
|
|
@@ -67,7 +69,7 @@ final class DashboardView: NSView, NSTextFieldDelegate {
|
|
67
|
private let greetingLabel = NSTextField(labelWithString: "")
|
69
|
private let greetingLabel = NSTextField(labelWithString: "")
|
|
68
|
private let subtitleLabel = NSTextField(labelWithString: "")
|
70
|
private let subtitleLabel = NSTextField(labelWithString: "")
|
|
69
|
private let searchBarShadowHost = NSView()
|
71
|
private let searchBarShadowHost = NSView()
|
|
70
|
- private let searchCard = NSView()
|
|
|
|
|
|
72
|
+ private let searchCard = HoverableView()
|
|
71
|
private let jobSearchIcon = NSImageView()
|
73
|
private let jobSearchIcon = NSImageView()
|
|
72
|
private let jobKeywordsField = NSTextField()
|
74
|
private let jobKeywordsField = NSTextField()
|
|
73
|
private let findJobsButton = HoverableButton()
|
75
|
private let findJobsButton = HoverableButton()
|
|
@@ -593,6 +595,17 @@ final class DashboardView: NSView, NSTextFieldDelegate {
|
|
593
|
searchCard.layer?.borderColor = Theme.searchBarBorder.cgColor
|
595
|
searchCard.layer?.borderColor = Theme.searchBarBorder.cgColor
|
|
594
|
searchCard.layer?.masksToBounds = true
|
596
|
searchCard.layer?.masksToBounds = true
|
|
595
|
|
597
|
|
|
|
|
598
|
+ searchCard.hoverHandler = { [weak self] hovering in
|
|
|
|
599
|
+ guard let self else { return }
|
|
|
|
600
|
+ CATransaction.begin()
|
|
|
|
601
|
+ CATransaction.setAnimationDuration(0.15)
|
|
|
|
602
|
+ self.searchCard.layer?.backgroundColor = (hovering ? Theme.neutralHoverFill : Theme.cardBackground).cgColor
|
|
|
|
603
|
+ self.searchCard.layer?.borderColor = (hovering ? Theme.searchBarBorderHover : Theme.searchBarBorder).cgColor
|
|
|
|
604
|
+ self.searchBarShadowHost.layer?.shadowColor = NSColor.black.withAlphaComponent(hovering ? 0.24 : 0.18).cgColor
|
|
|
|
605
|
+ self.searchBarShadowHost.layer?.shadowRadius = hovering ? 12 : 10
|
|
|
|
606
|
+ CATransaction.commit()
|
|
|
|
607
|
+ }
|
|
|
|
608
|
+
|
|
596
|
searchBarShadowHost.addSubview(searchCard)
|
609
|
searchBarShadowHost.addSubview(searchCard)
|
|
597
|
|
610
|
|
|
598
|
func configureField(_ field: NSTextField, placeholder: String) {
|
611
|
func configureField(_ field: NSTextField, placeholder: String) {
|