metatext-app-ios-iphone-ipad/Views/ViewConstants.swift

43 lines
1.3 KiB
Swift
Raw Normal View History

2020-09-29 03:14:43 +02:00
// Copyright © 2020 Metabolist. All rights reserved.
import SwiftUI
extension CGFloat {
static let defaultSpacing: Self = 8
static let compactSpacing: Self = 4
2020-10-29 07:03:45 +01:00
static let ultraCompactSpacing: Self = 1
2020-09-29 03:14:43 +02:00
static let defaultCornerRadius: Self = 8
2020-10-12 07:37:34 +02:00
static let avatarDimension: Self = 50
2020-10-04 10:39:54 +02:00
static let hairline = 1 / UIScreen.main.scale
2020-10-12 07:37:34 +02:00
static let minimumButtonDimension: Self = 44
2020-12-10 03:44:06 +01:00
static let barButtonItemDimension: Self = 28
2021-01-21 09:45:09 +01:00
static let newStatusButtonDimension: Self = 58
2021-01-21 00:33:53 +01:00
static let defaultShadowRadius: Self = 2
static let systemMenuWidth: Self = 250
static let systemMenuInset: Self = 15
2020-09-29 03:14:43 +02:00
}
2021-01-31 15:52:20 +01:00
extension Float {
static let defaultShadowOpacity: Self = 0.25
}
2021-01-04 08:17:38 +01:00
extension CGRect {
static let defaultContentsRect = Self(origin: .zero, size: .init(width: 1, height: 1))
}
2020-09-29 03:32:28 +02:00
extension TimeInterval {
static let defaultAnimationDuration: Self = 0.5
2020-10-21 10:07:13 +02:00
static let shortAnimationDuration = defaultAnimationDuration / 2
2021-01-27 21:31:32 +01:00
static let longAnimationDuration: Self = 1
2021-01-19 20:59:20 +01:00
static func zeroIfReduceMotion(_ duration: Self) -> Self { UIAccessibility.isReduceMotionEnabled ? 0 : duration }
2020-09-29 03:32:28 +02:00
}
2020-09-29 03:14:43 +02:00
extension UIImage {
static let highlightedButtonBackground = UIColor(white: 0, alpha: 0.5).image()
}
2020-10-12 07:37:34 +02:00
extension UILayoutPriority {
static let justBelowMax: Self = .init(999)
}