This repository has been archived on 2024-06-09. You can view files and clone it, but cannot push or open issues/pull-requests.
2022-06-09 22:25:23 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module BrandingHelper
|
|
|
|
def logo_as_symbol(version = :icon)
|
|
|
|
case version
|
|
|
|
when :icon
|
|
|
|
_logo_as_symbol_icon
|
|
|
|
when :wordmark
|
|
|
|
_logo_as_symbol_wordmark
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def _logo_as_symbol_wordmark
|
2022-11-14 04:38:24 +01:00
|
|
|
content_tag(:svg, tag(:use, href: '#logo-symbol-wordmark'), viewBox: '0 0 112 30', class: 'logo logo--wordmark')
|
2022-06-09 22:25:23 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def _logo_as_symbol_icon
|
2022-06-11 20:32:02 +02:00
|
|
|
content_tag(:svg, tag(:use, href: '#logo-symbol-icon'), viewBox: '0 0 79 79', class: 'logo logo--icon')
|
2022-06-09 22:25:23 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def render_logo
|
|
|
|
image_pack_tag('logo.svg', alt: 'Mastodon', class: 'logo logo--icon')
|
|
|
|
end
|
|
|
|
|
|
|
|
def render_symbol(version = :icon)
|
|
|
|
path = begin
|
|
|
|
case version
|
|
|
|
when :icon
|
|
|
|
'logo-symbol-icon.svg'
|
|
|
|
when :wordmark
|
|
|
|
'logo-symbol-wordmark.svg'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
render(file: Rails.root.join('app', 'javascript', 'images', path)).html_safe # rubocop:disable Rails/OutputSafety
|
|
|
|
end
|
|
|
|
end
|