yattee/Shared/Constants.swift

77 lines
1.6 KiB
Swift
Raw Normal View History

2022-12-19 11:08:27 +00:00
import Defaults
2022-08-25 17:09:55 +00:00
import Foundation
import SwiftUI
struct Constants {
2022-12-04 12:21:50 +00:00
static let yatteeProtocol = "yattee://"
2022-08-25 17:09:55 +00:00
static let overlayAnimation = Animation.linear(duration: 0.2)
2022-12-10 02:01:59 +00:00
static var progressViewScale: Double {
#if os(macOS)
0.4
#else
0.6
#endif
}
static var channelThumbnailSize: Double {
#if os(tvOS)
50
#else
30
#endif
}
2022-12-15 21:41:42 +00:00
static var sidebarChannelThumbnailSize: Double {
2022-12-15 11:09:16 +00:00
#if os(macOS)
20
#else
30
#endif
}
static var channelDetailsStackSpacing: Double {
#if os(tvOS)
12
#else
6
#endif
}
2022-12-18 12:11:06 +00:00
static var detailsVisibility: Bool {
2022-12-18 12:11:06 +00:00
#if os(iOS)
false
#else
true
#endif
}
2022-12-18 18:39:03 +00:00
static var nextSystemImage: String {
if #available(iOS 16, macOS 13, tvOS 16, *) {
return "film.stack"
} else {
return "list.and.film"
}
}
2022-12-19 11:08:27 +00:00
static func seekIcon(_ type: String, _ interval: TimeInterval) -> String {
let interval = Int(interval)
let allVersions = [10, 15, 30, 45, 60, 75, 90]
let iOS15 = [5]
let iconName = "go\(type).\(interval)"
if #available(iOS 15, macOS 12, *) {
if iOS15.contains(interval) {
return iconName
}
}
if allVersions.contains(interval) {
return iconName
}
let sign = type == "forward" ? "plus" : "minus"
return "go\(type).\(sign)"
}
2022-08-25 17:09:55 +00:00
}