1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-15 14:50:32 +05:30
yattee/Shared/Constants.swift

78 lines
1.5 KiB
Swift
Raw Normal View History

2022-12-19 16:38:27 +05:30
import Defaults
2022-08-25 22:39:55 +05:30
import Foundation
import SwiftUI
struct Constants {
2022-12-04 17:51:50 +05:30
static let yatteeProtocol = "yattee://"
2022-08-25 22:39:55 +05:30
static let overlayAnimation = Animation.linear(duration: 0.2)
2023-02-25 21:12:45 +05:30
static var isIPhone: Bool {
#if os(iOS)
UIDevice.current.userInterfaceIdiom == .phone
#else
false
#endif
}
2023-04-22 22:52:13 +05:30
static var isIPad: Bool {
#if os(iOS)
UIDevice.current.userInterfaceIdiom == .pad
#else
false
#endif
}
2022-12-10 07:31:59 +05:30
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-16 03:11:42 +05:30
static var sidebarChannelThumbnailSize: Double {
2022-12-15 16:39:16 +05:30
#if os(macOS)
20
#else
30
#endif
}
static var channelDetailsStackSpacing: Double {
#if os(tvOS)
12
#else
6
#endif
}
2022-12-18 17:41:06 +05:30
static var detailsVisibility: Bool {
2022-12-18 17:41:06 +05:30
#if os(iOS)
false
#else
true
#endif
}
2022-12-19 00:09:03 +05:30
2022-12-19 16:38:27 +05:30
static func seekIcon(_ type: String, _ interval: TimeInterval) -> String {
let interval = Int(interval)
2023-07-01 22:08:11 +05:30
let allVersions = [5, 10, 15, 30, 45, 60, 75, 90]
2022-12-19 16:38:27 +05:30
let iconName = "go\(type).\(interval)"
if allVersions.contains(interval) {
return iconName
}
let sign = type == "forward" ? "plus" : "minus"
return "go\(type).\(sign)"
}
2022-08-25 22:39:55 +05:30
}