Skip to content

Commit

Permalink
2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ZzzM committed Dec 9, 2022
1 parent 67a8a31 commit d80d6cd
Show file tree
Hide file tree
Showing 43 changed files with 489 additions and 264 deletions.
12 changes: 12 additions & 0 deletions CalendarX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
988A82E0279FEC9D000899B5 /* Theme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 988A82DC279FEC9D000899B5 /* Theme.swift */; };
988A82E1279FEC9D000899B5 /* AppInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 988A82DD279FEC9D000899B5 /* AppInfo.swift */; };
988A82E3279FFB8A000899B5 /* Preference.swift in Sources */ = {isa = PBXBuildFile; fileRef = 988A82E2279FFB8A000899B5 /* Preference.swift */; };
98B5B6C929427A8A00114483 /* TitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98B5B6C829427A8A00114483 /* TitleView.swift */; };
98B5B6CB294289F900114483 /* RecommendationsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98B5B6CA294289F900114483 /* RecommendationsView.swift */; };
98B5B6CD2942A6D800114483 /* apps.json in Resources */ = {isa = PBXBuildFile; fileRef = 98B5B6CC2942A6D800114483 /* apps.json */; };
98BE991427A0E08500306061 /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = 98BE991327A0E08500306061 /* Sparkle */; };
98BE991627A0F6AB00306061 /* RootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98BE991527A0F6AB00306061 /* RootView.swift */; };
98BE991827A0F75900306061 /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98BE991727A0F75900306061 /* MainView.swift */; };
Expand Down Expand Up @@ -75,6 +78,9 @@
988A82DC279FEC9D000899B5 /* Theme.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Theme.swift; sourceTree = "<group>"; };
988A82DD279FEC9D000899B5 /* AppInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppInfo.swift; sourceTree = "<group>"; };
988A82E2279FFB8A000899B5 /* Preference.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Preference.swift; sourceTree = "<group>"; };
98B5B6C829427A8A00114483 /* TitleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleView.swift; sourceTree = "<group>"; };
98B5B6CA294289F900114483 /* RecommendationsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecommendationsView.swift; sourceTree = "<group>"; };
98B5B6CC2942A6D800114483 /* apps.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = apps.json; sourceTree = "<group>"; };
98BE991527A0F6AB00306061 /* RootView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootView.swift; sourceTree = "<group>"; };
98BE991727A0F75900306061 /* MainView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = "<group>"; };
98BE991B27A1397500306061 /* Calendar+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Calendar+.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -177,13 +183,15 @@
children = (
98BE991D27A1415F00306061 /* SettingsView.swift */,
98C9BD09290999F600F645AD /* MenuBarSettingsView.swift */,
98B5B6CA294289F900114483 /* RecommendationsView.swift */,
);
path = Settings;
sourceTree = "<group>";
};
98CE8BDC27BBABF2009E5674 /* Resource */ = {
isa = PBXGroup;
children = (
98B5B6CC2942A6D800114483 /* apps.json */,
988530272818DB8A00FD98BC /* palette.json */,
98CE8BE327BDFA12009E5674 /* terms.json */,
98CE8BDA27BBAA93009E5674 /* tiaoxiu.json */,
Expand Down Expand Up @@ -280,6 +288,7 @@
98F4347627A24297009F18CC /* ScacleButton.swift */,
98ED365827A354CC00AF578A /* ScacleButtonPicker.swift */,
98CED54A27F3057100E0F758 /* RotationArrow.swift */,
98B5B6C829427A8A00114483 /* TitleView.swift */,
);
path = Component;
sourceTree = "<group>";
Expand Down Expand Up @@ -363,6 +372,7 @@
98CED54E27F43CF100E0F758 /* InfoPlist.strings in Resources */,
98CE8BE827BF43EB009E5674 /* solarPF.json in Resources */,
98CE8BEE27BF5105009E5674 /* solarAF.json in Resources */,
98B5B6CD2942A6D800114483 /* apps.json in Resources */,
982DABC027C32FC9002891A3 /* weekSF.json in Resources */,
98D573D627571EB6001C2D8C /* Assets.xcassets in Resources */,
98CE8BE027BDEF1D009E5674 /* chuxi.json in Resources */,
Expand Down Expand Up @@ -407,6 +417,7 @@
98BE991627A0F6AB00306061 /* RootView.swift in Sources */,
982DABC627C33343002891A3 /* Bundle+.swift in Sources */,
98F4347727A24297009F18CC /* ScacleButton.swift in Sources */,
98B5B6C929427A8A00114483 /* TitleView.swift in Sources */,
98BE991E27A1415F00306061 /* SettingsView.swift in Sources */,
98C9BD0A290999F600F645AD /* MenuBarSettingsView.swift in Sources */,
982DABC427C332E1002891A3 /* Date+.swift in Sources */,
Expand All @@ -431,6 +442,7 @@
98FEAB9F27F6F0EA0034EC1F /* MenuBarStyle.swift in Sources */,
98D247962784324700F2B278 /* MenuBarPopover.swift in Sources */,
98F4347427A23ABE009F18CC /* MainViewModel.swift in Sources */,
98B5B6CB294289F900114483 /* RecommendationsView.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
12 changes: 12 additions & 0 deletions CalendarX/Assets.xcassets/GitHub.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "GitHub.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
1 change: 1 addition & 0 deletions CalendarX/Assets.xcassets/GitHub.imageset/GitHub.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions CalendarX/Assets.xcassets/Recommendations/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"images" : [
{
"idiom" : "mac",
"scale" : "1x"
},
{
"filename" : "HostsX.png",
"idiom" : "mac",
"scale" : "2x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"images" : [
{
"idiom" : "mac",
"scale" : "1x"
},
{
"filename" : "OnlySwitch.png",
"idiom" : "mac",
"scale" : "2x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 8 additions & 11 deletions CalendarX/Component/ScacleButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SwiftUI

struct ScacleButton<Label: View>: View {
let action: VoidClosure

@ViewBuilder
let label: () -> Label

Expand Down Expand Up @@ -46,18 +46,15 @@ struct ScacleCapsuleButton: View {
foregroundColor: Color,
backgroundColor: Color,
action: VoidClosure

var body: some View {
ScacleButton(action: action) {
HStack {
Spacer()
Text(title)
Spacer()
}
.padding(.vertical, 5)
.foregroundColor(foregroundColor)
.background(backgroundColor)
.clipShape(Capsule())
Text(title)
.frame(maxWidth: .infinity)
.padding(.vertical, 5)
.foregroundColor(foregroundColor)
.background(backgroundColor)
.clipShape(Capsule())
}
}
}
Expand Down
26 changes: 26 additions & 0 deletions CalendarX/Component/TitleView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// TitleView.swift
// CalendarX
//
// Created by zm on 2022/12/9.
//

import SwiftUI

struct TitleView<Title: View, Content: View>: View {

let title: () -> Title

@ViewBuilder
let actions: () -> Content

var body: some View {
ZStack {
title().font(.title2)
HStack(content: actions)
.frame(maxWidth: .infinity, alignment: .trailing)
}
}
}


5 changes: 3 additions & 2 deletions CalendarX/Constant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,13 @@ extension Image {
static let success = Image(systemName: "checkmark.circle.fill")
static let download = Image(systemName: "arrow.down")
static let close = Image(systemName: "xmark")
static let appLogo = Image("AppLogo", bundle: .main)
static let leftArrow = Image(systemName: "chevron.left")
static let rightArrow = Image(systemName: "chevron.right")
static let circle = Image(systemName: "circle")
static let link = Image(systemName: "link")
static let calendar = Image(nsImage: .menubarIcon!)
static let recommend = Image(systemName: "hand.thumbsup.fill")
static let gitHub = Image("GitHub").renderingMode(.template).resizable()
static let menubarIcon = Image("MenubarIcon").renderingMode(.template).resizable()
}


Expand Down
10 changes: 10 additions & 0 deletions CalendarX/Extension/View+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,20 @@ extension View {
modifier(ColorSchemeModifier(colorScheme: colorScheme))
}


func fullScreenCover(_ backgroudColor: Color = .background) -> some View {
background(backgroudColor)
.transition(.move(edge: .bottom))
.zIndex(1)
}


var hoverEffect: some View {
modifier(HoverModifier())
}



}


35 changes: 10 additions & 25 deletions CalendarX/Module/Calender/DateView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,21 @@ import WrappingHStack

struct DateView: View {

@Binding
var isShown: Bool

let day: XDay

var body: some View {
VStack(spacing: 10) {
titleView()
TitleView {
Text(day.date, style: .date)
} actions: {
ScacleImageButton(image: .close, action: Router.backMain)
}
Text(day.lunarDate).font(.footnote).foregroundColor(.secondary)
FestivalsView(festivals: day.festivals)
SchedulesView(events: day.events)
}
}

@ViewBuilder
func titleView() -> some View {
HStack {
ScacleImageButton(image: .close, action: {}).hidden()
Spacer()
Text(day.date, style: .date).font(.title2)
Spacer()
ScacleImageButton(image: .close) {
withAnimation { isShown.toggle() }
}
}

Text(day.lunarDate).font(.footnote).foregroundColor(.secondary)
}



}

Expand Down Expand Up @@ -134,11 +121,9 @@ struct SchedulesView: View {
struct GroupEmptyRow: View {
let title: LocalizedStringKey
var body: some View {
HStack {
Text(title)
Spacer()
}
.foregroundColor(.secondary)
Text(title)
.frame(maxWidth: .infinity, alignment: .leading)
.foregroundColor(.secondary)
}
}

Expand Down
Loading

0 comments on commit d80d6cd

Please sign in to comment.