Merge remote-tracking branch 'refs/remotes/origin/main'

This commit is contained in:
Nihaal Sharma committed 2026-03-21 11:06:03 +00:00
commit 668382cbfd
4 files changed
+124 -25

No files matched your search

+102 -8
View File
@@ -21,9 +21,9 @@ struct Gif: StickerProtocol {
}
var remoteImageURL: URL
// enum CodingKeys: String, CodingKey {
//
// }
// enum CodingKeys: String, CodingKey {
//
// }
init(
name: String,
@@ -45,7 +45,7 @@ struct Gif: StickerProtocol {
if let uiImage = UIImage(data: data),
let cgImage = uiImage.cgImage,
!self.localImageURLString.contains(".gif"),
!self.localImageURLString.contains(".gif"),
cgImage.width < 300 || cgImage.height < 300 {
data = resize(image: uiImage, to: CGSize(width: 300, height: 300)).pngData()!
}
@@ -54,8 +54,102 @@ struct Gif: StickerProtocol {
return
}
static var test: Gif = Gif(
name: "doesheknow",
url: URL(string: "https://media1.tenor.com/m/FN9udnZmQU8AAAAd/does-he-know-batman.gif")!
)
static var test: Gif = GifObject(
type: "gif",
id: "XAeEGyCbp8UehBPkSA",
slug: "know-does-he-XAeEGyCbp8UehBPkSA",
url: "https://giphy.com/gifs/know-does-he-XAeEGyCbp8UehBPkSA",
bitly_url: "https://gph.is/g/4AKMQlV",
embed_url: "https://giphy.com/embed/XAeEGyCbp8UehBPkSA",
username: "Ommarbisafool",
source: "",
rating: "g",
source_tld: "",
source_post_url: "",
import_datetime: "2025-11-06 15:48:02",
images: GiphyImages(
fixed_height: .init(
url: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/200.gif?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=200.gif&ct=g",
width: "270",
height: "200",
size: "74672",
mp4: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/200.mp4?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=200.mp4&ct=g",
mp4_size: "11433",
webp: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/200.webp?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=200.webp&ct=g",
webp_size: "10962"
),
fixed_height_still: nil,
fixed_height_downsampled: .init(
url: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/200_d.gif?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=200_d.gif&ct=g",
width: "270",
height: "200",
size: "51332",
webp: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/200_d.webp?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=200_d.webp&ct=g",
webp_size: "44850"
),
fixed_height_small: .init(
url: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/100.gif?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=100.gif&ct=g",
width: "134",
height: "100",
size: "16461",
mp4: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/100.mp4?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=100.mp4&ct=g",
mp4_size: "5340",
webp: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/100.webp?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=100.webp&ct=g",
webp_size: "3142"
),
fixed_height_small_still: nil,
fixed_width: .init(
url: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/200w.gif?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=200w.gif&ct=g",
width: "200",
height: "148",
size: "42579",
mp4: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/200w.mp4?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=200w.mp4&ct=g",
mp4_size: "8158",
webp: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/200w.webp?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=200w.webp&ct=g",
webp_size: "4458"
),
fixed_width_still: nil,
fixed_width_downsampled: .init(
url: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/200w_d.gif?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=200w_d.gif&ct=g",
width: "200",
height: "148",
size: "23483",
webp: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/200w_d.webp?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=200w_d.webp&ct=g",
webp_size: "22586"
),
fixed_width_small: .init(
url: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/100w.gif?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=100w.gif&ct=g",
width: "100",
height: "74",
size: "8150",
mp4: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/100w.mp4?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=100w.mp4&ct=g",
mp4_size: "4103",
webp: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/100w.webp?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=100w.webp&ct=g",
webp_size: "1814"
),
fixed_width_small_still: nil,
downsized: nil,
downsized_still: nil,
downsized_large: nil,
downsized_medium: nil,
downsized_small: nil,
original: .init(
url: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/giphy.gif?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=giphy.gif&ct=g",
width: "480",
height: "356",
size: "245829",
mp4: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/giphy.mp4?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=giphy.mp4&ct=g",
mp4_size: "23259",
webp: "https://media2.giphy.com/media/XAeEGyCbp8UehBPkSA/giphy.webp?cid=acd65332fv0sn3gzwa5vi4jw834l2hhwmfm6d90329p1590n&ep=v1_gifs_search&rid=giphy.webp&ct=g",
webp_size: "26984"
),
original_still: nil,
// looping: nil,
preview: nil,
preview_gif: nil
),
title: "Know GIF",
alt_text: "",
is_low_contrast: false
).toGif
}
+13 -13
View File
@@ -11,47 +11,47 @@ struct GiphyImages: Codable {
//fixed height of 200px
var fixed_height: motion
//fixed height of 200px still
var fixed_height_still: still
var fixed_height_still: still?
//fixed height 200px with 6 frames
var fixed_height_downsampled: downsampled
//fixed height of 100px
var fixed_height_small: motion
//fixed height of 100px still
var fixed_height_small_still: still
var fixed_height_small_still: still?
//fixed width of 200px
var fixed_width: motion
//fixed width of 200px
var fixed_width_still: still
var fixed_width_still: still?
//fixed width 200px with 6 frames
var fixed_width_downsampled: downsampled
//fixed width of 100px
var fixed_width_small: motion
//fixed width of 100px still
var fixed_width_small_still: still
var fixed_width_small_still: still?
//under 2mb
var downsized: downsized
var downsized: downsized?
//downsized still
var downsized_still: still
var downsized_still: still?
//under 8mb
var downsized_large: downsized
var downsized_large: downsized?
//under 5mb
var downsized_medium: downsized
var downsized_medium: downsized?
//under 200kb
var downsized_small: video
var downsized_small: video?
var original: motion
var original_still: still
var original_still: still?
//15s looping version
// var looping: looping
// var looping: looping?
//mp4 format 50kb, first 1-2s of the gif
var preview: video
var preview: video?
//50kb first 1-2s of the gif
var preview_gif: still
var preview_gif: still?
struct motion: Codable {
+1
View File
@@ -29,6 +29,7 @@ struct BrowseView: View {
case .giphyGifs:
ForEach(gifHoarder.trendingGifs) { gif in
StickerRow(hoarder: emojiHoarder, emoji: gif)
.listRowSeparator(.hidden)
}
}
}
+8 -4
View File
@@ -34,10 +34,14 @@ struct StickerRow<T: Hoarder>: View {
Button {
showTooltip.toggle()
} label: {
Image("slack.logo")
.resizable().scaledToFit()
.frame(width: 20, height: 20)
.foregroundStyle(.gray)
if type(of: emoji) == Emoji.self {
Image("slack.logo")
.resizable().scaledToFit()
.frame(width: 20, height: 20)
.foregroundStyle(.gray)
} else if type(of: emoji) == Gif.self {
Text("G")
}
}
.buttonStyle(.borderless)
.alert("From Slack", isPresented: $showTooltip) {
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.