Change brand color and logotypes (#18592)
- Add rake task for generating Apple/Android icons and favicons from SVG - Add rake task for generating PNG icons and logos for e-mails from SVG - Remove obsolete Microsoft icons and configuration - Remove PWA shortcut icons
This commit is contained in:
parent
a2871cd747
commit
45aa5781ce
112 changed files with 257 additions and 152 deletions
|
@ -4,7 +4,19 @@ class ManifestSerializer < ActiveModel::Serializer
|
|||
include RoutingHelper
|
||||
include ActionView::Helpers::TextHelper
|
||||
|
||||
attributes :name, :short_name, :description,
|
||||
ICON_SIZES = %w(
|
||||
36
|
||||
48
|
||||
72
|
||||
96
|
||||
144
|
||||
192
|
||||
256
|
||||
384
|
||||
512
|
||||
).freeze
|
||||
|
||||
attributes :name, :short_name,
|
||||
:icons, :theme_color, :background_color,
|
||||
:display, :start_url, :scope,
|
||||
:share_target, :shortcuts
|
||||
|
@ -17,22 +29,18 @@ class ManifestSerializer < ActiveModel::Serializer
|
|||
object.site_title
|
||||
end
|
||||
|
||||
def description
|
||||
strip_tags(object.site_short_description.presence || I18n.t('about.about_mastodon_html'))
|
||||
end
|
||||
|
||||
def icons
|
||||
[
|
||||
ICON_SIZES.map do |size|
|
||||
{
|
||||
src: '/android-chrome-192x192.png',
|
||||
sizes: '192x192',
|
||||
src: full_pack_url("media/icons/android-chrome-#{size}x#{size}.png"),
|
||||
sizes: "#{size}x#{size}",
|
||||
type: 'image/png',
|
||||
},
|
||||
]
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
def theme_color
|
||||
'#282c37'
|
||||
'#6364FF'
|
||||
end
|
||||
|
||||
def background_color
|
||||
|
@ -68,37 +76,12 @@ class ManifestSerializer < ActiveModel::Serializer
|
|||
def shortcuts
|
||||
[
|
||||
{
|
||||
name: 'New toot',
|
||||
name: 'Compose new post',
|
||||
url: '/web/publish',
|
||||
icons: [
|
||||
{
|
||||
src: '/shortcuts/new-status.png',
|
||||
type: 'image/png',
|
||||
sizes: '192x192',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Notifications',
|
||||
url: '/web/notifications',
|
||||
icons: [
|
||||
{
|
||||
src: '/shortcuts/notifications.png',
|
||||
type: 'image/png',
|
||||
sizes: '192x192',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Direct messages',
|
||||
url: '/web/conversations',
|
||||
icons: [
|
||||
{
|
||||
src: '/shortcuts/direct.png',
|
||||
type: 'image/png',
|
||||
sizes: '192x192',
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue