feat: more icons for source urls (#218)

This commit is contained in:
mdashlw 2024-04-02 19:40:41 +03:00 committed by GitHub
parent 1f440475ed
commit 9e3db6b882
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -318,14 +318,20 @@ defmodule PhilomenaWeb.ImageView do
"fab fa-twitter" "fab fa-twitter"
u u
when u in ["deviantart.com", "sta.sh", "www.sta.sh"] -> when u in [
"deviantart.com",
"sta.sh",
"www.sta.sh",
"images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com",
"wixmp-ed30a86b8c4ca887773594c2.wixmp.com"
] ->
"fab fa-deviantart" "fab fa-deviantart"
u u
when u in ["cdn.discordapp.com", "discordapp.com", "discord.com", "media.discordapp.net"] -> when u in ["cdn.discordapp.com", "discordapp.com", "discord.com", "media.discordapp.net"] ->
"fab fa-discord" "fab fa-discord"
u when u in ["youtube.com", "www.youtube.com"] -> u when u in ["youtube.com", "www.youtube.com", "youtu.be"] ->
"fab fa-youtube" "fab fa-youtube"
u when u in ["pillowfort.social", "www.pillowfort.social"] -> u when u in ["pillowfort.social", "www.pillowfort.social"] ->
@ -343,6 +349,7 @@ defmodule PhilomenaWeb.ImageView do
u u
when u in [ when u in [
"ych.art", "ych.art",
"cdn.ych.art",
"ych.commishes.com", "ych.commishes.com",
"commishes.com", "commishes.com",
"portfolio.commishes.com", "portfolio.commishes.com",
@ -350,13 +357,29 @@ defmodule PhilomenaWeb.ImageView do
] -> ] ->
"fa fa-palette" "fa fa-palette"
u
when u in ["ko-fi.com", "storage.ko-fi.com", "buymeacoffee.com", "www.buymeacoffee.com"] ->
"fa fa-coffee"
u when u in ["artstation.com", "www.artstation.com"] -> u when u in ["artstation.com", "www.artstation.com"] ->
"fab fa-artstation" "fab fa-artstation"
u when u in ["instagram.com", "www.instagram.com"] -> u when u in ["instagram.com", "www.instagram.com"] ->
"fab fa-instagram" "fab fa-instagram"
u when u in ["reddit.com", "www.reddit.com"] -> u when u in ["t.me"] ->
"fab fa-telegram"
u
when u in [
"reddit.com",
"www.reddit.com",
"old.reddit.com",
"redd.it",
"i.redd.it",
"v.redd.it",
"preview.redd.it"
] ->
"fab fa-reddit" "fab fa-reddit"
u when u in ["facebook.com", "www.facebook.com", "fb.me", "www.fb.me"] -> u when u in ["facebook.com", "www.facebook.com", "fb.me", "www.fb.me"] ->
@ -405,12 +428,26 @@ defmodule PhilomenaWeb.ImageView do
link -> link ->
cond do cond do
Enum.member?(site_domains, link) -> "favicon-home" Enum.member?(site_domains, link) ->
String.ends_with?(link, ".tumblr.com") -> "fab fa-tumblr" "favicon-home"
String.ends_with?(link, ".deviantart.com") -> "fab fa-deviantart"
String.ends_with?(link, ".sofurry.com") -> "fa fa-paw" String.ends_with?(link, ".tumblr.com") ->
String.ends_with?(link, ".userapi.com") -> "fab fa-vk" "fab fa-tumblr"
true -> "fa fa-link"
String.ends_with?(link, ".deviantart.com") ->
"fab fa-deviantart"
String.ends_with?(link, ".sofurry.com") ->
"fa fa-paw"
String.ends_with?(link, ".userapi.com") ->
"fab fa-vk"
String.ends_with?(link, ".patreonusercontent.com") ->
"fab fa-patreon"
true ->
"fa fa-link"
end end
end end
end end