diff --git a/app/assets/fonts/noto-ikea-400.latin-ext.edd421f4.woff2 b/app/assets/fonts/noto-ikea-400.latin-ext.edd421f4.woff2 new file mode 100644 index 0000000..ec0b6ef Binary files /dev/null and b/app/assets/fonts/noto-ikea-400.latin-ext.edd421f4.woff2 differ diff --git a/app/assets/fonts/noto-ikea-400.latin.647e877d.woff2 b/app/assets/fonts/noto-ikea-400.latin.647e877d.woff2 new file mode 100644 index 0000000..40b6241 Binary files /dev/null and b/app/assets/fonts/noto-ikea-400.latin.647e877d.woff2 differ diff --git a/app/assets/fonts/noto-ikea-400i.latin-ext.5f8f91ea.woff2 b/app/assets/fonts/noto-ikea-400i.latin-ext.5f8f91ea.woff2 new file mode 100644 index 0000000..23c8726 Binary files /dev/null and b/app/assets/fonts/noto-ikea-400i.latin-ext.5f8f91ea.woff2 differ diff --git a/app/assets/fonts/noto-ikea-400i.latin.10395910.woff2 b/app/assets/fonts/noto-ikea-400i.latin.10395910.woff2 new file mode 100644 index 0000000..280c4c9 Binary files /dev/null and b/app/assets/fonts/noto-ikea-400i.latin.10395910.woff2 differ diff --git a/app/assets/fonts/noto-ikea-700.latin-ext.97f0d455.woff2 b/app/assets/fonts/noto-ikea-700.latin-ext.97f0d455.woff2 new file mode 100644 index 0000000..f01b08e Binary files /dev/null and b/app/assets/fonts/noto-ikea-700.latin-ext.97f0d455.woff2 differ diff --git a/app/assets/fonts/noto-ikea-700.latin.d7277c39.woff2 b/app/assets/fonts/noto-ikea-700.latin.d7277c39.woff2 new file mode 100644 index 0000000..bd13a84 Binary files /dev/null and b/app/assets/fonts/noto-ikea-700.latin.d7277c39.woff2 differ diff --git a/app/assets/fonts/noto-ikea-700i.latin-ext.3637155a.woff2 b/app/assets/fonts/noto-ikea-700i.latin-ext.3637155a.woff2 new file mode 100644 index 0000000..cad9a82 Binary files /dev/null and b/app/assets/fonts/noto-ikea-700i.latin-ext.3637155a.woff2 differ diff --git a/app/assets/fonts/noto-ikea-700i.latin.29eb18bb.woff2 b/app/assets/fonts/noto-ikea-700i.latin.29eb18bb.woff2 new file mode 100644 index 0000000..2f10db7 Binary files /dev/null and b/app/assets/fonts/noto-ikea-700i.latin.29eb18bb.woff2 differ diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index cc3f3e6..bbe285a 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1,33 +1,73 @@ @font-face { - font-family: 'Noto IKEA Latin'; - font-weight: 400; - font-style: normal; font-display: swap; - src: url('NotoIKEALatin-Regular.ttf') format('truetype'); + font-family: 'Noto IKEA'; + font-style: italic; + font-weight: 400; + src: url(noto-ikea-400i.latin-ext.5f8f91ea.woff2) format("woff2"); + unicode-range:u + 0100-024f, u + 0259, u + 1e??, u + 2020, u + 20a0-20ab, u + 20ad-20cf, u + 2113, u + 2c60-2c7f, u + a720-a7ff } @font-face { - font-family: 'Noto IKEA Latin'; - font-weight: 400; + font-display: swap; + font-family: 'Noto IKEA'; font-style: italic; + font-weight: 400; + src: url(noto-ikea-400i.latin.10395910.woff2) format("woff2"); + unicode-range:u + 00??, u + 0131, u + 0152-0153, u + 02bb-02bc, u + 02c6, u + 02da, u + 02dc, u + 2000-206f, u + 2074, u + 20ac, u + 2122, u + 2191, u + 2193, u + 2212, u + 2215, u + feff, u + fffd +} + +@font-face { font-display: swap; - src: url('NotoIKEALatin-Italic.ttf') format('truetype'); + font-family: 'Noto IKEA'; + font-style: italic; + font-weight: 700; + src: url(noto-ikea-700i.latin-ext.3637155a.woff2) format("woff2"); + unicode-range:u + 0100-024f, u + 0259, u + 1e??, u + 2020, u + 20a0-20ab, u + 20ad-20cf, u + 2113, u + 2c60-2c7f, u + a720-a7ff } @font-face { - font-family: 'Noto IKEA Latin'; + font-display: swap; + font-family: 'Noto IKEA'; + font-style: italic; font-weight: 700; - font-style: normal; + src: url(noto-ikea-700i.latin.29eb18bb.woff2) format("woff2"); + unicode-range:u + 00??, u + 0131, u + 0152-0153, u + 02bb-02bc, u + 02c6, u + 02da, u + 02dc, u + 2000-206f, u + 2074, u + 20ac, u + 2122, u + 2191, u + 2193, u + 2212, u + 2215, u + feff, u + fffd +} + +@font-face { font-display: swap; - src: url('NotoIKEALatin-Bold.ttf') format('truetype'); + font-family: 'Noto IKEA'; + font-style: normal; + font-weight: 400; + src: url(noto-ikea-400.latin-ext.edd421f4.woff2) format("woff2"); + unicode-range:u + 0100-024f, u + 0259, u + 1e??, u + 2020, u + 20a0-20ab, u + 20ad-20cf, u + 2113, u + 2c60-2c7f, u + a720-a7ff } @font-face { - font-family: 'Noto IKEA Latin'; + font-display: swap; + font-family: 'Noto IKEA'; + font-style: normal; + font-weight: 400; + src: url(noto-ikea-400.latin.647e877d.woff2) format("woff2"); + unicode-range:u + 00??, u + 0131, u + 0152-0153, u + 02bb-02bc, u + 02c6, u + 02da, u + 02dc, u + 2000-206f, u + 2074, u + 20ac, u + 2122, u + 2191, u + 2193, u + 2212, u + 2215, u + feff, u + fffd +} + +@font-face { + font-display: swap; + font-family: 'Noto IKEA'; + font-style: normal; font-weight: 700; - font-style: italic; + src: url(noto-ikea-700.latin-ext.97f0d455.woff2) format("woff2"); + unicode-range:u + 0100-024f, u + 0259, u + 1e??, u + 2020, u + 20a0-20ab, u + 20ad-20cf, u + 2113, u + 2c60-2c7f, u + a720-a7ff +} + +@font-face { font-display: swap; - src: url('NotoIKEALatin-BoldItalic.ttf') format('truetype'); + font-family: 'Noto IKEA'; + font-style: normal; + font-weight: 700; + src: url(noto-ikea-700.latin.d7277c39.woff2) format("woff2"); + unicode-range:u + 00??, u + 0131, u + 0152-0153, u + 02bb-02bc, u + 02c6, u + 02da, u + 02dc, u + 2000-206f, u + 2074, u + 20ac, u + 2122, u + 2191, u + 2193, u + 2212, u + 2215, u + feff, u + fffd } :root { @@ -35,8 +75,8 @@ --clr-black: #000; --clr-bumblebee: #F0B902; - --ff-base: 'Noto IKEA Latin', sans-serif; - + --ff-ikea: "Noto IKEA", "Noto Sans", "Roboto", "Open Sans", system-ui, sans-serif; + --shadow: 0px 0px 10px 2px rgba(0,0,0,0.1); --fs-base: 1.6rem; @@ -45,7 +85,7 @@ --fs-2xl: 4.0rem; --fs-3xl: 6.4rem; - font: 10px/1.3 var(--ff-base); + font: 10px/1.3 var(--ff-ikea); } body { @@ -56,4 +96,45 @@ body { flex-direction: column; gap: 0; min-height: 100svh; -} \ No newline at end of file +} + +header { + display: flex; + justify-content: space-between; + align-items: center; + margin: 1rem; + + & svg { + width: 59px; + height: auto; + } + + & div { + line-height: 1.3; + font-size: 1.6rem; + text-align: right; + } + + & span { + font-weight: 700; + font-style: italic; + } +} + +main { + margin: 0 1rem; +} + +.start__title { + margin: 0 0 0.4375em 0; + line-height: 1.1; + font-size: var(--fs-3xl); + font-weight: 700; +} + +.start__msg { + margin: 0; + line-height: 1.2; + font-size: var(--fs-lg); + font-weight: 400; +} diff --git a/app/controllers/languages_controller.rb b/app/controllers/languages_controller.rb new file mode 100644 index 0000000..9fa7265 --- /dev/null +++ b/app/controllers/languages_controller.rb @@ -0,0 +1,19 @@ +class LanguagesController < ApplicationController + + def index + language = parse_accept_language() + + + end + + +private + + def parse_accept_language(header=request.env['HTTP_ACCEPT_LANGUAGE']) + header.to_s.split(',').map { |l| + lang, q_factor = l.split(';q=') + [lang, (q_factor || '1').to_f] + }.sort_by { |_, q| -q }.map(&:first).first + end + +end diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb index 3972cd1..ec423fa 100644 --- a/app/controllers/site_controller.rb +++ b/app/controllers/site_controller.rb @@ -1,19 +1,6 @@ class SiteController < ApplicationController def index - language = parse_accept_language(request.env['HTTP_ACCEPT_LANGUAGE']) - render plain: "Language preference: #{language}" end - - -private - - def parse_accept_language(header) - header.to_s.split(',').map { |l| - lang, q_factor = l.split(';q=') - [lang, (q_factor || '1').to_f] - }.sort_by { |_, q| -q }.map(&:first).first - end - end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de6be79..9f1e2f5 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,2 +1,14 @@ module ApplicationHelper + + def svg(name) + file_path = "#{Rails.root}/app/assets/images/#{name}.svg" + if File.exist?(file_path) + Rails.cache.fetch(['svg', name]) do + File.read(file_path).html_safe + end + else + '(not found)' + end + end + end diff --git a/app/helpers/languages_helper.rb b/app/helpers/languages_helper.rb new file mode 100644 index 0000000..2468668 --- /dev/null +++ b/app/helpers/languages_helper.rb @@ -0,0 +1,2 @@ +module LanguagesHelper +end diff --git a/app/helpers/site_helper.rb b/app/helpers/site_helper.rb index c879486..38b4e48 100644 --- a/app/helpers/site_helper.rb +++ b/app/helpers/site_helper.rb @@ -1,2 +1,13 @@ module SiteHelper + + def frontend_javascript_importmap_tags + only_use = %w"application" + importmap_json = JSON.parse(Rails.application.importmap.to_json(resolver: self))['imports'].select{ |k,v| only_use.include?(k)} + safe_join [ + javascript_inline_importmap_tag(JSON.pretty_generate({ "imports" => importmap_json})), + javascript_module_preload_tag(*importmap_json.map{|v| v[1]}), + javascript_import_module_tag('application') + ], "\n" + end + end diff --git a/app/javascript/application.js b/app/javascript/application.js index 0d7b494..e69de29 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -1,3 +0,0 @@ -// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails -import "@hotwired/turbo-rails" -import "controllers" diff --git a/app/views/languages/index.html.erb b/app/views/languages/index.html.erb new file mode 100644 index 0000000..e3a3308 --- /dev/null +++ b/app/views/languages/index.html.erb @@ -0,0 +1,2 @@ +<%= tag.h1 t('start.hello'), class: 'start__title' %> +<%= tag.p t('start.please_select_a_language_to_get_started'), class: 'start__msg' %> \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index cab8e62..966e51b 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,16 +1,29 @@ - +">
-