style: update layout and improve accessibility
Some checks are pending
Docker Dev / docker (push) Waiting to run

- Adjust footer components for better spacing
- Move language switcher to navbar for easier access
- Simplify language switcher links using iteration
- Enhance copyright text to dynamically reflect the current year
This commit is contained in:
songtianlun 2025-02-22 01:03:40 +08:00
parent 80ceac5d94
commit 5b996bb64a
3 changed files with 23 additions and 28 deletions

View File

@ -1,13 +1,18 @@
<!-- 页脚 -->
<footer class="footer footer-center p-8 bg-base-200 text-base-content">
<div class="container mx-auto flex flex-col gap-2">
<%= link_to rss_feed_path(format: :rss), class: "btn btn-ghost", title: "RSS Feed" do %>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 5c7.18 0 13 5.82 13 13M6 11a7 7 0 017 7m-6 0a1 1 0 11-2 0 1 1 0 012 0z" />
</svg>
<!-- <span class="ml-2">RSS Feed</span>-->
<% end %>
<div class="container mx-auto flex flex-col gap-4">
<!-- 第一行:功能按钮 -->
<div class="flex items-center justify-center space-x-4">
<%= link_to rss_feed_path(format: :rss), class: "btn btn-ghost btn-sm", title: "RSS Feed" do %>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 5c7.18 0 13 5.82 13 13M6 11a7 7 0 017 7m-6 0a1 1 0 11-2 0 1 1 0 012 0z" />
</svg>
<% end %>
<%= render 'shared/language_switcher' %>
</div>
<!-- 第二行:统计信息 -->
<div id="busuanzi_container" class="text-xs opacity-70">
<div class="space-x-2">
<span>Page: </span>
@ -17,13 +22,14 @@
<span>PV <span id="busuanzi_site_pv"></span></span>
<span>UV <span id="busuanzi_site_uv"></span></span>
<span data-controller="page-load-time">
Page Load Time: <span data-page-load-time-target="timer">x</span> ms
Load Time: <span data-page-load-time-target="timer">x</span> ms
</span>
</div>
</div>
<p class="font-display opacity-80">
Copyright © 2024 - All rights reserved by AI Weather Art
<!-- 第三行:版权信息 -->
<p class="font-display opacity-80 text-sm">
Copyright © <%= Time.current.year %> - All rights reserved by AI Weather Art
</p>
</div>
</footer>
</footer>

View File

@ -37,8 +37,6 @@
<span><%= t("title.sign_in") %></span>
<% end %>
<% end %>
<%= render 'shared/language_switcher' %>
</div>
<!-- Mobile Menu -->

View File

@ -1,5 +1,5 @@
<%# app/views/shared/_language_switcher.html.erb %>
<div class="dropdown dropdown-end">
<div class="dropdown dropdown-top">
<label tabindex="0" class="btn btn-ghost btn-sm">
<%= t("language.#{I18n.locale}") %>
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 ml-1" viewBox="0 0 20 20" fill="currentColor">
@ -7,20 +7,11 @@
</svg>
</label>
<ul tabindex="0" class="dropdown-content menu p-2 shadow bg-base-100 rounded-box w-32">
<%= link_to url_for(locale: :en), class: "px-4 py-2 hover:bg-base-200 rounded-lg #{I18n.locale == :en ? 'bg-base-200' : ''}" do %>
<%= t("language.en") %>
<% end %>
<%= link_to url_for(locale: :'zh-CN'), class: "px-4 py-2 hover:bg-base-200 rounded-lg #{I18n.locale == :'zh-CN' ? 'bg-base-200' : ''}" do %>
<%= t("language.zh-CN") %>
<% end %>
<%= link_to url_for(locale: :ja), class: "px-4 py-2 hover:bg-base-200 rounded-lg #{I18n.locale == :ja ? 'bg-base-200' : ''}" do %>
<%= t("language.ja") %>
<% end %>
<%= link_to url_for(locale: :ko), class: "px-4 py-2 hover:bg-base-200 rounded-lg #{I18n.locale == :ko ? 'bg-base-200' : ''}" do %>
<%= t("language.ko") %>
<% [:en, :'zh-CN', :ja, :ko].each do |locale| %>
<%= link_to url_for(locale: locale),
class: "px-4 py-2 hover:bg-base-200 rounded-lg #{I18n.locale == locale ? 'bg-base-200' : ''}" do %>
<%= t("language.#{locale}") %>
<% end %>
<% end %>
</ul>
</div>