mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 20:54:51 +00:00
wiggle mode!!
This commit is contained in:
1 file changed
+13
-5
@@ -15,6 +15,7 @@ struct EmojiPackDetailView: View {
|
|||||||
@State var editDescription: Bool = false
|
@State var editDescription: Bool = false
|
||||||
@State var showAdder: Bool = false
|
@State var showAdder: Bool = false
|
||||||
@State var searchTerm: String = ""
|
@State var searchTerm: String = ""
|
||||||
|
@State var initDate: Date = .now
|
||||||
|
|
||||||
var minColWidth: CGFloat { 75 }
|
var minColWidth: CGFloat { 75 }
|
||||||
var spacing: CGFloat { 10 }
|
var spacing: CGFloat { 10 }
|
||||||
@@ -36,7 +37,7 @@ struct EmojiPackDetailView: View {
|
|||||||
} label: {
|
} label: {
|
||||||
Text(pack.name.isEmpty ? "Name" : pack.name)
|
Text(pack.name.isEmpty ? "Name" : pack.name)
|
||||||
.bold()
|
.bold()
|
||||||
.foregroundStyle(edit ? .blue : .primary)
|
.foregroundStyle(edit ? Color.accentColor : .primary)
|
||||||
.font(.title)
|
.font(.title)
|
||||||
}
|
}
|
||||||
.disabled(!edit)
|
.disabled(!edit)
|
||||||
@@ -48,7 +49,7 @@ struct EmojiPackDetailView: View {
|
|||||||
editDescription.toggle()
|
editDescription.toggle()
|
||||||
} label: {
|
} label: {
|
||||||
Text(pack.description.isEmpty ? "Description" : pack.description)
|
Text(pack.description.isEmpty ? "Description" : pack.description)
|
||||||
.foregroundStyle(edit ? .blue : .primary)
|
.foregroundStyle(edit ? Color.accentColor : .primary)
|
||||||
}
|
}
|
||||||
.disabled(!edit)
|
.disabled(!edit)
|
||||||
.alert("Edit Description", isPresented: $editDescription) {
|
.alert("Edit Description", isPresented: $editDescription) {
|
||||||
@@ -88,6 +89,7 @@ struct EmojiPackDetailView: View {
|
|||||||
let layout = Array(repeating: col, count: columns)
|
let layout = Array(repeating: col, count: columns)
|
||||||
LazyVGrid(columns: layout, spacing: spacing) {
|
LazyVGrid(columns: layout, spacing: spacing) {
|
||||||
ForEach(pack.items, id: \.self) { name in
|
ForEach(pack.items, id: \.self) { name in
|
||||||
|
TimelineView(.animation) { tl in
|
||||||
let emoji = hoarder.trie.dict[name] ?? .test
|
let emoji = hoarder.trie.dict[name] ?? .test
|
||||||
VStack {
|
VStack {
|
||||||
StickerPreview(sticker: emoji)
|
StickerPreview(sticker: emoji)
|
||||||
@@ -108,6 +110,12 @@ struct EmojiPackDetailView: View {
|
|||||||
.padding(-10)
|
.padding(-10)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.rotationEffect(
|
||||||
|
.degrees(
|
||||||
|
edit ? sin(initDate.timeIntervalSinceNow*20)*4 : 0
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if edit {
|
if edit {
|
||||||
Button() {
|
Button() {
|
||||||
@@ -153,7 +161,7 @@ struct EmojiPackDetailView: View {
|
|||||||
.navigationTitle(edit ? "Editing" : "Pack Details")
|
.navigationTitle(edit ? "Editing" : "Pack Details")
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
.toolbar {
|
.toolbar {
|
||||||
ToolbarItem(placement: .topBarLeading) {
|
ToolbarItem {
|
||||||
Button(
|
Button(
|
||||||
"",
|
"",
|
||||||
systemImage: edit ? "checkmark" : "pencil"
|
systemImage: edit ? "checkmark" : "pencil"
|
||||||
@@ -161,12 +169,12 @@ struct EmojiPackDetailView: View {
|
|||||||
withAnimation { edit.toggle() }
|
withAnimation { edit.toggle() }
|
||||||
}
|
}
|
||||||
.modifier(glassButtonIfAv(edit))
|
.modifier(glassButtonIfAv(edit))
|
||||||
.tint(edit ? .blue : .primary)
|
.tint(edit ? Color.accentColor : .primary)
|
||||||
}
|
}
|
||||||
if #available(iOS 19, *) {
|
if #available(iOS 19, *) {
|
||||||
ToolbarSpacer()
|
ToolbarSpacer()
|
||||||
}
|
}
|
||||||
ToolbarItem(placement: .topBarTrailing) {
|
ToolbarItem {
|
||||||
ShareLink(item: pack.shareLink()) {
|
ShareLink(item: pack.shareLink()) {
|
||||||
Image(systemName: "square.and.arrow.up")
|
Image(systemName: "square.and.arrow.up")
|
||||||
}
|
}
|
||||||
|
|||||||