Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: more icons for source urls #218

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 46 additions & 9 deletions lib/philomena_web/views/image_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,20 @@ defmodule PhilomenaWeb.ImageView do
"fab fa-twitter"

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"

u
when u in ["cdn.discordapp.com", "discordapp.com", "discord.com", "media.discordapp.net"] ->
"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"

u when u in ["pillowfort.social", "www.pillowfort.social"] ->
Expand All @@ -343,20 +349,37 @@ defmodule PhilomenaWeb.ImageView do
u
when u in [
"ych.art",
"cdn.ych.art",
"ych.commishes.com",
"commishes.com",
"portfolio.commishes.com",
"commishes.io"
] ->
"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"] ->
"fab fa-artstation"

u when u in ["instagram.com", "www.instagram.com"] ->
"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"

u when u in ["facebook.com", "www.facebook.com", "fb.me", "www.fb.me"] ->
Expand Down Expand Up @@ -405,12 +428,26 @@ defmodule PhilomenaWeb.ImageView do

link ->
cond do
Enum.member?(site_domains, link) -> "favicon-home"
String.ends_with?(link, ".tumblr.com") -> "fab fa-tumblr"
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"
true -> "fa fa-link"
Enum.member?(site_domains, link) ->
"favicon-home"

String.ends_with?(link, ".tumblr.com") ->
"fab fa-tumblr"

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
Expand Down
Loading