diff --git a/TapeDeck.xcodeproj/project.pbxproj b/TapeDeck.xcodeproj/project.pbxproj index 7bd7254..26b0784 100644 --- a/TapeDeck.xcodeproj/project.pbxproj +++ b/TapeDeck.xcodeproj/project.pbxproj @@ -21,6 +21,12 @@ BDA061132447F3F3009C72CE /* grandfatherrockTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDA061122447F3F3009C72CE /* grandfatherrockTests.swift */; }; BDA0611E2447F3F3009C72CE /* grandfatherrockUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDA0611D2447F3F3009C72CE /* grandfatherrockUITests.swift */; }; BDB53FCE250765A2004E9788 /* FinkHeavy.ttf in Resources */ = {isa = PBXBuildFile; fileRef = BDB53FCC250765A1004E9788 /* FinkHeavy.ttf */; }; + BDE56CB925186B0500A47239 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BDE579F52514894600248E86 /* WidgetKit.framework */; platformFilter = ios; }; + BDE56CBA25186B0500A47239 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BD58E8C325145778008D1E8E /* SwiftUI.framework */; }; + BDE56CBD25186B0500A47239 /* hsscene.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDE56CBC25186B0500A47239 /* hsscene.swift */; }; + BDE56CBF25186B0C00A47239 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BDE56CBE25186B0C00A47239 /* Assets.xcassets */; }; + BDE56CC325186B0C00A47239 /* hssceneExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = BDE56CB825186B0500A47239 /* hssceneExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + BDE56CCB25186C4100A47239 /* FinkHeavy.ttf in Resources */ = {isa = PBXBuildFile; fileRef = BDB53FCC250765A1004E9788 /* FinkHeavy.ttf */; }; BDE8138F2507422100371570 /* ThirdViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDE8138E2507422100371570 /* ThirdViewController.swift */; }; /* End PBXBuildFile section */ @@ -39,6 +45,13 @@ remoteGlobalIDString = BDA060F52447F3E6009C72CE; remoteInfo = grandfatherrock; }; + BDE56CC125186B0C00A47239 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BDA060EE2447F3E5009C72CE /* Project object */; + proxyType = 1; + remoteGlobalIDString = BDE56CB725186B0500A47239; + remoteInfo = hssceneExtension; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -48,6 +61,7 @@ dstPath = ""; dstSubfolderSpec = 13; files = ( + BDE56CC325186B0C00A47239 /* hssceneExtension.appex in Embed App Extensions */, ); name = "Embed App Extensions"; runOnlyForDeploymentPostprocessing = 0; @@ -59,6 +73,7 @@ BD7A5E332510173A003E992C /* day.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = day.gif; sourceTree = ""; }; BD7A5E38251034D7003E992C /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; }; BD7D35D52510042D00A61B6B /* night.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = night.gif; sourceTree = ""; }; + BD8D804625188B2200389258 /* hssceneExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = hssceneExtension.entitlements; sourceTree = ""; }; BDA060F62447F3E6009C72CE /* Nook Music.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Nook Music.app"; sourceTree = BUILT_PRODUCTS_DIR; }; BDA060F92447F3E6009C72CE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; BDA060FB2447F3E6009C72CE /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; @@ -76,6 +91,10 @@ BDA0611F2447F3F3009C72CE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; BDA0618A244826DB009C72CE /* grandfatherrock.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = grandfatherrock.entitlements; sourceTree = ""; }; BDB53FCC250765A1004E9788 /* FinkHeavy.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = FinkHeavy.ttf; sourceTree = ""; }; + BDE56CB825186B0500A47239 /* hssceneExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = hssceneExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + BDE56CBC25186B0500A47239 /* hsscene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = hsscene.swift; sourceTree = ""; }; + BDE56CBE25186B0C00A47239 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + BDE56CC025186B0C00A47239 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; BDE579F52514894600248E86 /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; }; BDE8138E2507422100371570 /* ThirdViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ThirdViewController.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -104,6 +123,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + BDE56CB525186B0500A47239 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + BDE56CBA25186B0500A47239 /* SwiftUI.framework in Frameworks */, + BDE56CB925186B0500A47239 /* WidgetKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -129,9 +157,11 @@ BDA060ED2447F3E5009C72CE = { isa = PBXGroup; children = ( + BD8D804625188B2200389258 /* hssceneExtension.entitlements */, BDA060F82447F3E6009C72CE /* grandfatherrock */, BDA061112447F3F3009C72CE /* grandfatherrockTests */, BDA0611C2447F3F3009C72CE /* grandfatherrockUITests */, + BDE56CBB25186B0500A47239 /* hsscene */, BDA060F72447F3E6009C72CE /* Products */, BD7A5E37251034D7003E992C /* Frameworks */, ); @@ -143,6 +173,7 @@ BDA060F62447F3E6009C72CE /* Nook Music.app */, BDA0610E2447F3F3009C72CE /* grandfatherrockTests.xctest */, BDA061192447F3F3009C72CE /* grandfatherrockUITests.xctest */, + BDE56CB825186B0500A47239 /* hssceneExtension.appex */, ); name = Products; sourceTree = ""; @@ -192,6 +223,16 @@ path = fonts; sourceTree = ""; }; + BDE56CBB25186B0500A47239 /* hsscene */ = { + isa = PBXGroup; + children = ( + BDE56CBC25186B0500A47239 /* hsscene.swift */, + BDE56CBE25186B0C00A47239 /* Assets.xcassets */, + BDE56CC025186B0C00A47239 /* Info.plist */, + ); + path = hsscene; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -207,6 +248,7 @@ buildRules = ( ); dependencies = ( + BDE56CC225186B0C00A47239 /* PBXTargetDependency */, ); name = grandfatherrock; packageProductDependencies = ( @@ -252,6 +294,23 @@ productReference = BDA061192447F3F3009C72CE /* grandfatherrockUITests.xctest */; productType = "com.apple.product-type.bundle.ui-testing"; }; + BDE56CB725186B0500A47239 /* hssceneExtension */ = { + isa = PBXNativeTarget; + buildConfigurationList = BDE56CC425186B0C00A47239 /* Build configuration list for PBXNativeTarget "hssceneExtension" */; + buildPhases = ( + BDE56CB425186B0500A47239 /* Sources */, + BDE56CB525186B0500A47239 /* Frameworks */, + BDE56CB625186B0500A47239 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = hssceneExtension; + productName = hssceneExtension; + productReference = BDE56CB825186B0500A47239 /* hssceneExtension.appex */; + productType = "com.apple.product-type.app-extension"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -273,6 +332,9 @@ CreatedOnToolsVersion = 11.4.1; TestTargetID = BDA060F52447F3E6009C72CE; }; + BDE56CB725186B0500A47239 = { + CreatedOnToolsVersion = 12.0; + }; }; }; buildConfigurationList = BDA060F12447F3E5009C72CE /* Build configuration list for PBXProject "TapeDeck" */; @@ -294,6 +356,7 @@ BDA060F52447F3E6009C72CE /* grandfatherrock */, BDA0610D2447F3F3009C72CE /* grandfatherrockTests */, BDA061182447F3F3009C72CE /* grandfatherrockUITests */, + BDE56CB725186B0500A47239 /* hssceneExtension */, ); }; /* End PBXProject section */ @@ -326,6 +389,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + BDE56CB625186B0500A47239 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BDE56CCB25186C4100A47239 /* FinkHeavy.ttf in Resources */, + BDE56CBF25186B0C00A47239 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -357,6 +429,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + BDE56CB425186B0500A47239 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BDE56CBD25186B0500A47239 /* hsscene.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -370,6 +450,11 @@ target = BDA060F52447F3E6009C72CE /* grandfatherrock */; targetProxy = BDA0611A2447F3F3009C72CE /* PBXContainerItemProxy */; }; + BDE56CC225186B0C00A47239 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = BDE56CB725186B0500A47239 /* hssceneExtension */; + targetProxy = BDE56CC125186B0C00A47239 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ @@ -644,6 +729,58 @@ }; name = Release; }; + BDE56CC525186B0C00A47239 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CODE_SIGN_ENTITLEMENTS = hssceneExtension.entitlements; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = PRBH2T6668; + INFOPLIST_FILE = hsscene/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = dev.mpg13.grandfatherrock.hsscene; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + BDE56CC625186B0C00A47239 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CODE_SIGN_ENTITLEMENTS = hssceneExtension.entitlements; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = PRBH2T6668; + INFOPLIST_FILE = hsscene/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = dev.mpg13.grandfatherrock.hsscene; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -683,6 +820,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + BDE56CC425186B0C00A47239 /* Build configuration list for PBXNativeTarget "hssceneExtension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BDE56CC525186B0C00A47239 /* Debug */, + BDE56CC625186B0C00A47239 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ diff --git a/TapeDeck.xcodeproj/project.xcworkspace/xcuserdata/micahgomez.xcuserdatad/UserInterfaceState.xcuserstate b/TapeDeck.xcodeproj/project.xcworkspace/xcuserdata/micahgomez.xcuserdatad/UserInterfaceState.xcuserstate index fac2c63..28434af 100644 Binary files a/TapeDeck.xcodeproj/project.xcworkspace/xcuserdata/micahgomez.xcuserdatad/UserInterfaceState.xcuserstate and b/TapeDeck.xcodeproj/project.xcworkspace/xcuserdata/micahgomez.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/TapeDeck.xcodeproj/xcuserdata/micahgomez.xcuserdatad/xcschemes/xcschememanagement.plist b/TapeDeck.xcodeproj/xcuserdata/micahgomez.xcuserdatad/xcschemes/xcschememanagement.plist index 9723a7a..c427644 100644 --- a/TapeDeck.xcodeproj/xcuserdata/micahgomez.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/TapeDeck.xcodeproj/xcuserdata/micahgomez.xcuserdatad/xcschemes/xcschememanagement.plist @@ -9,6 +9,11 @@ orderHint 0 + hssceneExtension.xcscheme_^#shared#^_ + + orderHint + 1 + hswidgetExtension.xcscheme_^#shared#^_ orderHint diff --git a/hsscene/Assets.xcassets/ACBackgroundDay.imageset/ACBackgroundNightLarge-1.png b/hsscene/Assets.xcassets/ACBackgroundDay.imageset/ACBackgroundNightLarge-1.png new file mode 100644 index 0000000..b97d971 Binary files /dev/null and b/hsscene/Assets.xcassets/ACBackgroundDay.imageset/ACBackgroundNightLarge-1.png differ diff --git a/hsscene/Assets.xcassets/ACBackgroundDay.imageset/ACBackgroundNightLarge-2.png b/hsscene/Assets.xcassets/ACBackgroundDay.imageset/ACBackgroundNightLarge-2.png new file mode 100644 index 0000000..b97d971 Binary files /dev/null and b/hsscene/Assets.xcassets/ACBackgroundDay.imageset/ACBackgroundNightLarge-2.png differ diff --git a/hsscene/Assets.xcassets/ACBackgroundDay.imageset/ACBackgroundNightLarge.png b/hsscene/Assets.xcassets/ACBackgroundDay.imageset/ACBackgroundNightLarge.png new file mode 100644 index 0000000..b97d971 Binary files /dev/null and b/hsscene/Assets.xcassets/ACBackgroundDay.imageset/ACBackgroundNightLarge.png differ diff --git a/hsscene/Assets.xcassets/ACBackgroundDay.imageset/Contents.json b/hsscene/Assets.xcassets/ACBackgroundDay.imageset/Contents.json new file mode 100644 index 0000000..497da18 --- /dev/null +++ b/hsscene/Assets.xcassets/ACBackgroundDay.imageset/Contents.json @@ -0,0 +1,26 @@ +{ + "images" : [ + { + "filename" : "ACBackgroundNightLarge.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ACBackgroundNightLarge-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ACBackgroundNightLarge-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "compression-type" : "gpu-optimized-smallest" + } +} diff --git a/hsscene/Assets.xcassets/ACBackgroundNight.imageset/ACBackgroundDayLarge-1.png b/hsscene/Assets.xcassets/ACBackgroundNight.imageset/ACBackgroundDayLarge-1.png new file mode 100644 index 0000000..914fbe2 Binary files /dev/null and b/hsscene/Assets.xcassets/ACBackgroundNight.imageset/ACBackgroundDayLarge-1.png differ diff --git a/hsscene/Assets.xcassets/ACBackgroundNight.imageset/ACBackgroundDayLarge-2.png b/hsscene/Assets.xcassets/ACBackgroundNight.imageset/ACBackgroundDayLarge-2.png new file mode 100644 index 0000000..914fbe2 Binary files /dev/null and b/hsscene/Assets.xcassets/ACBackgroundNight.imageset/ACBackgroundDayLarge-2.png differ diff --git a/hsscene/Assets.xcassets/ACBackgroundNight.imageset/ACBackgroundDayLarge.png b/hsscene/Assets.xcassets/ACBackgroundNight.imageset/ACBackgroundDayLarge.png new file mode 100644 index 0000000..914fbe2 Binary files /dev/null and b/hsscene/Assets.xcassets/ACBackgroundNight.imageset/ACBackgroundDayLarge.png differ diff --git a/hsscene/Assets.xcassets/ACBackgroundNight.imageset/Contents.json b/hsscene/Assets.xcassets/ACBackgroundNight.imageset/Contents.json new file mode 100644 index 0000000..dfcf68d --- /dev/null +++ b/hsscene/Assets.xcassets/ACBackgroundNight.imageset/Contents.json @@ -0,0 +1,26 @@ +{ + "images" : [ + { + "filename" : "ACBackgroundDayLarge.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ACBackgroundDayLarge-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ACBackgroundDayLarge-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "compression-type" : "gpu-optimized-smallest" + } +} diff --git a/hsscene/Assets.xcassets/AccentColor.colorset/Contents.json b/hsscene/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/hsscene/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/hsscene/Assets.xcassets/AppIcon.appiconset/Contents.json b/hsscene/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..9221b9b --- /dev/null +++ b/hsscene/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/hsscene/Assets.xcassets/Contents.json b/hsscene/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/hsscene/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/hsscene/Assets.xcassets/WidgetBackground.colorset/Contents.json b/hsscene/Assets.xcassets/WidgetBackground.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/hsscene/Assets.xcassets/WidgetBackground.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/hsscene/Assets.xcassets/grass.imageset/Contents.json b/hsscene/Assets.xcassets/grass.imageset/Contents.json new file mode 100644 index 0000000..7c9f71a --- /dev/null +++ b/hsscene/Assets.xcassets/grass.imageset/Contents.json @@ -0,0 +1,26 @@ +{ + "images" : [ + { + "filename" : "Screen Shot 2020-09-13 at 6.28.42 PM.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Screen Shot 2020-09-13 at 6.28.42 PM-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Screen Shot 2020-09-13 at 6.28.42 PM-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "compression-type" : "gpu-optimized-smallest" + } +} diff --git a/hsscene/Assets.xcassets/grass.imageset/Screen Shot 2020-09-13 at 6.28.42 PM-1.png b/hsscene/Assets.xcassets/grass.imageset/Screen Shot 2020-09-13 at 6.28.42 PM-1.png new file mode 100644 index 0000000..99df79c Binary files /dev/null and b/hsscene/Assets.xcassets/grass.imageset/Screen Shot 2020-09-13 at 6.28.42 PM-1.png differ diff --git a/hsscene/Assets.xcassets/grass.imageset/Screen Shot 2020-09-13 at 6.28.42 PM-2.png b/hsscene/Assets.xcassets/grass.imageset/Screen Shot 2020-09-13 at 6.28.42 PM-2.png new file mode 100644 index 0000000..99df79c Binary files /dev/null and b/hsscene/Assets.xcassets/grass.imageset/Screen Shot 2020-09-13 at 6.28.42 PM-2.png differ diff --git a/hsscene/Assets.xcassets/grass.imageset/Screen Shot 2020-09-13 at 6.28.42 PM.png b/hsscene/Assets.xcassets/grass.imageset/Screen Shot 2020-09-13 at 6.28.42 PM.png new file mode 100644 index 0000000..99df79c Binary files /dev/null and b/hsscene/Assets.xcassets/grass.imageset/Screen Shot 2020-09-13 at 6.28.42 PM.png differ diff --git a/hsscene/Info.plist b/hsscene/Info.plist new file mode 100644 index 0000000..b16b835 --- /dev/null +++ b/hsscene/Info.plist @@ -0,0 +1,33 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + hsscene + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + NSExtension + + NSExtensionPointIdentifier + com.apple.widgetkit-extension + + UIAppFonts + + FinkHeavy.ttf + + + diff --git a/hsscene/hsscene.swift b/hsscene/hsscene.swift new file mode 100644 index 0000000..a5e42a5 --- /dev/null +++ b/hsscene/hsscene.swift @@ -0,0 +1,269 @@ +// +// hswidget.swift +// hswidget +// +// Created by Micah Gomez on 9/17/20. +// Copyright © 2020 Micah Gomez. All rights reserved. +// + +import WidgetKit +import SwiftUI + +struct Provider: TimelineProvider { + func placeholder(in context: Context) -> SimpleEntry { + return SimpleEntry(date: Date(), hour: hourString(), c1: getC1(), c2: getC2(), sceneAsset: getSceneAsset()) + } + + func getSnapshot(in context: Context, completion: @escaping (SimpleEntry) -> ()) { + let entry = SimpleEntry(date: Date(), hour: hourString(), c1: getC1(), c2: getC2(), sceneAsset: getSceneAsset()) + completion(entry) + } + + func getTimeline(in context: Context, completion: @escaping (Timeline) -> ()) { + var entries: [SimpleEntry] = [] + + // Generate a timeline consisting of five entries an hour apart, starting from the current date. + let currentDate = Date() + for hourOffset in 0 ..< 5 { + let entryDate = Calendar.current.date(byAdding: .minute, value: hourOffset*5, to: currentDate)! + let entry = SimpleEntry(date: entryDate, hour: hourString(), c1: getC1(), c2: getC2(), sceneAsset: getSceneAsset()) + entries.append(entry) + } + + let timeline = Timeline(entries: entries, policy: .atEnd) + completion(timeline) + } + + func hourString() -> String { + let currentHour = Calendar.current.component(.hour, from: Date()) + var rowHour:Int = 12 + var hourString = String(rowHour) + hourString.append(" AM") + + if (currentHour < 12) && (currentHour > 0) { + rowHour = currentHour + hourString = String(rowHour) + hourString.append(" AM") + } else if (currentHour > 11) { + rowHour = currentHour + if (currentHour > 12){ + rowHour = rowHour - 12 + } + hourString = String(rowHour) + hourString.append(" PM") + } + return hourString + } + + func getC1() -> Color { + var c1:Color = Color.white + if((Calendar.current.component(.hour, from: Date()) >= 8) && (Calendar.current.component(.hour, from: Date()) <= 19)){ //Daytime + print("day") + c1 = Color(red: 0.39, green: 0.69, blue: 1.00) + } else if((Calendar.current.component(.hour, from: Date()) >= 20) && (Calendar.current.component(.hour, from: Date()) <= 21)){//Sunset + print("sunset") + c1 = Color(red: 0.00, green: 0.31, blue: 0.59) + } else if((Calendar.current.component(.hour, from: Date()) >= 22) || (Calendar.current.component(.hour, from: Date()) <= 5)){//Night + print("night") + c1 = Color(red: 0.08, green: 0.27, blue: 0.59) + } else if((Calendar.current.component(.hour, from: Date()) >= 6) && (Calendar.current.component(.hour, from: Date()) <= 7)){//Sunrise + print("sunrise") + c1 = Color(red: 0.02, green: 0.26, blue: 0.49) + } + return c1 + } + + func getC2() -> Color { + var c2:Color = Color.white + if((Calendar.current.component(.hour, from: Date()) >= 8) && (Calendar.current.component(.hour, from: Date()) <= 19)){ //Daytime + print("day") + c2 = Color(red: 0.07, green: 0.45, blue: 0.87) + } else if((Calendar.current.component(.hour, from: Date()) >= 20) && (Calendar.current.component(.hour, from: Date()) <= 21)){//Sunset + print("sunset") + c2 = Color(red: 1.00, green: 0.78, blue: 0.88) + } else if((Calendar.current.component(.hour, from: Date()) >= 22) || (Calendar.current.component(.hour, from: Date()) <= 5)){//Night + print("night") + c2 = Color(red: 0.00, green: 0.20, blue: 0.29) + } else if((Calendar.current.component(.hour, from: Date()) >= 6) && (Calendar.current.component(.hour, from: Date()) <= 7)){//Sunrise + print("sunrise") + c2 = Color(red: 0.89, green: 0.68, blue: 0.60) + } + return c2 + } + + func getSceneAsset() -> String { + var sceneAsset:String = "ACBackgroundDay" + if((Calendar.current.component(.hour, from: Date()) >= 8) && (Calendar.current.component(.hour, from: Date()) <= 19)){ //Daytime + print("day") + sceneAsset = "ACBackgroundDay" + } else if((Calendar.current.component(.hour, from: Date()) >= 20) && (Calendar.current.component(.hour, from: Date()) <= 21)){//Sunset + print("sunset") + sceneAsset = "ACBackgroundDay" + } else if((Calendar.current.component(.hour, from: Date()) >= 22) || (Calendar.current.component(.hour, from: Date()) <= 5)){//Night + print("night") + sceneAsset = "ACBackgroundNight" + } else if((Calendar.current.component(.hour, from: Date()) >= 6) && (Calendar.current.component(.hour, from: Date()) <= 7)){//Sunrise + print("sunrise") + sceneAsset = "ACBackgroundDay" + } + return sceneAsset + } +} + +struct SimpleEntry: TimelineEntry { + let date: Date + let hour: String + //let hourInt: Int + let c1:Color + let c2:Color + let sceneAsset:String +} + +struct cardSmallView : View { + var entry: Provider.Entry + + var body: some View { + GeometryReader { geometry in + VStack(alignment:.center){ + Spacer() + Text(String(entry.hour)) + .font(Font.custom("FinkHeavy", size: 32)) + .foregroundColor(Color(red: 0.84, green: 0.69, blue: 0.33)) + Spacer() + Image(entry.sceneAsset) + .resizable() + .scaledToFit() + Spacer() + .frame(height: 0) + Image("grass") + .resizable() + .scaledToFit() + } + .background(LinearGradient(gradient: Gradient(colors: [entry.c1, entry.c2]), startPoint: .top, endPoint: .bottom)) + //.frame(width: geometry.size.width, height: geometry.size.height) + .padding(.leading, -20) + .padding(.trailing, -20) + } + } +} + +struct cardMediumView : View { + var entry: Provider.Entry + + var body: some View { + GeometryReader { geometry in + VStack(alignment:.center){ + HStack(){ + Spacer() + VStack(){ + + Spacer() + Text(String(entry.hour)) + .font(Font.custom("FinkHeavy", size: 32)) + .foregroundColor(Color(red: 0.84, green: 0.69, blue: 0.33)) + Spacer() + } + Spacer() + VStack(){ + Spacer() + Image(entry.sceneAsset) + .resizable() + .scaledToFit() + .frame(maxWidth: geometry.size.width/2) + } + Spacer() + } + Spacer() + .frame(height: 0) + Image("grass") + .resizable() + .scaledToFit() + } + .background(LinearGradient(gradient: Gradient(colors: [entry.c1, entry.c2]), startPoint: .top, endPoint: .bottom)) + //.frame(width: geometry.size.width, height: geometry.size.height) + .padding(.leading, -20) + .padding(.trailing, -20) + } + } +} + +struct cardLargeView : View { + var entry: Provider.Entry + + var body: some View { + GeometryReader { geometry in + VStack(alignment:.center){ + Spacer() + Text(String(entry.hour)) + .font(Font.custom("FinkHeavy", size: 72)) + .foregroundColor(Color(red: 0.84, green: 0.69, blue: 0.33)) + Spacer() + Image(entry.sceneAsset) + .resizable() + .scaledToFit() + Spacer() + .frame(height: 0) + Image("grass") + .resizable() + .scaledToFit() + } + .background(LinearGradient(gradient: Gradient(colors: [entry.c1, entry.c2]), startPoint: .top, endPoint: .bottom)) + //.frame(width: geometry.size.width, height: geometry.size.height) + .padding(.leading, -20) + .padding(.trailing, -20) + } + } +} + +struct detailsNotAvailable : View { + var entry: Provider.Entry + + var body: some View{ + VStack{ + Text("Nothing Available") + } + } +} + + + +struct hswidgetEntryView : View { + var entry: Provider.Entry + @Environment(\.widgetFamily) var family: WidgetFamily + + let dateFormatter = DateFormatter() + + var body: some View { + ZStack + { + Group{ + switch family { + case .systemSmall: cardSmallView(entry: entry) + case .systemMedium: cardMediumView(entry: entry) + case .systemLarge: cardLargeView(entry: entry) + default: detailsNotAvailable(entry: entry) + } + }.padding(.horizontal) + } + } +} + +@main +struct hswidget: Widget { + let kind: String = "hswidget" + + var body: some WidgetConfiguration { + StaticConfiguration(kind: kind, provider: Provider()) { entry in + hswidgetEntryView(entry: entry) + } + .configurationDisplayName("AC Clock Widget") + .description("Takes the hour and main screen view from AC Tape Deck and condences it to fit on your home screen.") + } +} + +struct hswidget_Previews: PreviewProvider { + static var previews: some View { + hswidgetEntryView(entry: SimpleEntry(date: Date(), hour: "3 PM", c1: Color(red: 0.39, green: 0.69, blue: 1.00), c2: Color(red: 0.07, green: 0.45, blue: 0.87), sceneAsset: "ACBackgroundDay")) + .previewContext(WidgetPreviewContext(family: .systemSmall)) + } +} diff --git a/hssceneExtension.entitlements b/hssceneExtension.entitlements new file mode 100644 index 0000000..ee95ab7 --- /dev/null +++ b/hssceneExtension.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.network.client + + +