Compare commits

..

2 commits

Author SHA1 Message Date
7a1239ae5a Strip spaces from thumbnail URLs for colors like Usukiboy 2024-01-24 07:27:07 -08:00
fd729916d7 Specify width/height for alt style thumbnail image
to avoid reflows!
2024-01-24 07:26:44 -08:00
2 changed files with 5 additions and 1 deletions

View file

@ -9,3 +9,7 @@ body.alt_styles-index
.alt-style .alt-style
text-align: center text-align: center
width: 80px width: 80px
.alt-style-thumbnail
width: 80px
height: 80px

View file

@ -15,7 +15,7 @@ class AltStyle < ApplicationRecord
# HACK: Just assume this is a Nostalgic Alt Style, and that the thumbnail # HACK: Just assume this is a Nostalgic Alt Style, and that the thumbnail
# is named reliably! # is named reliably!
"https://images.neopets.com/items/nostalgic_" + "https://images.neopets.com/items/nostalgic_" +
"#{color.name.downcase}_#{species.name.downcase}.gif" "#{color.name.gsub(/\s+/, '').downcase}_#{species.name.downcase}.gif"
end end
MANIFEST_PATTERN = %r{^https://images.neopets.com/(?<prefix>.+)/(?<id>[0-9]+)(?<hash_part>_[^/]+)?/manifest\.json} MANIFEST_PATTERN = %r{^https://images.neopets.com/(?<prefix>.+)/(?<id>[0-9]+)(?<hash_part>_[^/]+)?/manifest\.json}