- Complete CSS for category page

This commit is contained in:
Warren Chen 2026-01-21 16:34:57 +09:00
parent 21df14bc2c
commit 4e642872b9
13 changed files with 732 additions and 379 deletions

View File

@ -19,8 +19,8 @@ def _get_env_int(name, default):
return default return default
NEWS_SIZE = _get_env_int("HOMEPAGE_NEWS_SIZE", 8) # Default to 8 articles in news layouts NEWS_SIZE = _get_env_int("HOMEPAGE_NEWS_SIZE", 8) # Default to 8 articles in news layouts
BLOCK_SIZE = _get_env_int("HOMEPAGE_BLOCK_SIZE", 5) # Default to 5 articles in block layout BLOCK_SIZE = _get_env_int("HOMEPAGE_BLOCK_SIZE", 7) # Default to 7 articles in block layout
HORIZON_SIZE = _get_env_int("HOMEPAGE_HORIZON_SIZE", 4) # Default to 8 articles in horizon layout HORIZON_SIZE = _get_env_int("HOMEPAGE_HORIZON_SIZE", 4) # Default to 4 articles in horizon layout
PAGE_SIZE = _get_env_int("HOMEPAGE_PAGE_SIZE", 10) # Default to 10 articles per page for pagination PAGE_SIZE = _get_env_int("HOMEPAGE_PAGE_SIZE", 10) # Default to 10 articles per page for pagination
# Mixin for Category-related functionality # Mixin for Category-related functionality
@ -37,9 +37,9 @@ class CategoryMixin:
"title": category.title, "title": category.title,
"items": ArticlePage.objects.child_of(category) "items": ArticlePage.objects.child_of(category)
.live() .live()
.order_by("-date", "-id")[:HORIZON_SIZE], .order_by("-date", "-id")[:BLOCK_SIZE],
"url": category.url, "url": category.url,
"layout": "horizon", "layout": "block",
} }
) )
else: else:
@ -224,9 +224,9 @@ class CategoryPage(Page, CategoryMixin):
def get_context(self, request): def get_context(self, request):
context = super().get_context(request) context = super().get_context(request)
context["category_sections"] = self.build_category_blocks(request) context["category_sections"] = self.build_category_blocks(request)
breadcrumbs, site_root = self.build_breadcrumbs() # breadcrumbs, site_root = self.build_breadcrumbs()
context["breadcrumbs"] = breadcrumbs # context["breadcrumbs"] = breadcrumbs
context["breadcrumb_root"] = site_root # context["breadcrumb_root"] = site_root
return context return context

View File

@ -2,78 +2,299 @@
position: relative; position: relative;
} }
.block-list-arrow { .block-first-article {
display: grid;
grid-template-columns: 480px 1fr;
grid-template-areas:
"image content";
gap: 16px 40px;
align-items: start;
}
.block-first-article .first-article-image {
grid-area: image;
position: relative;
border-radius: 10px;
overflow: hidden;
width: 480px;
}
.block-first-article .first-article-image img{
display: block;
width:480px;
height:293px;
object-fit:cover;
border-radius: 10px;
}
.block-first-article .first-article-content {
grid-area: content;
display: flex;
flex-direction: column;
gap: 16px;
max-height: 293px;
overflow: hidden;
position: relative;
}
.block-first-article .first-article-title {
font-size: 40px;
font-weight: 400;
color: #000000;
margin: 0;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
flex: 0 0 auto;
}
.block-first-article .first-article-date {
color: #0e1b4266;
flex: 0 0 auto;
}
.block-first-article .first-article-intro {
font-size: 20px;
flex: 0 1 auto;
min-height: 0;
overflow: hidden;
}
.block-first-article .first-article-body {
flex: 1 2 auto;
min-height: 0;
overflow: hidden;
position: relative;
}
.block-first-article .first-article-content::after {
content: "";
position: absolute; position: absolute;
top: 50%;
transform: translateY(-50%);
width: 36px;
height: 36px;
border: 0;
border-radius: 8px;
background: rgba(255, 255, 255, 0.85);
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
cursor: pointer;
}
.block-list-arrow[data-dir="left"] {
left: 0; left: 0;
}
.block-list-arrow[data-dir="right"] {
right: 0; right: 0;
} bottom: 0;
height: 100px;
.block-list-arrow.is-hidden { background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #ffffff);
opacity: 0;
pointer-events: none; pointer-events: none;
} }
.block-list { .block-list-lower {
display: flex;
align-items: stretch;
gap: 20px;
overflow-x: auto;
scroll-snap-type: x mandatory;
list-style: none;
margin: 24px 0; margin: 24px 0;
padding: 12px 48px; display: flex;
flex-wrap: wrap;
align-items: stretch;
gap: 28px;
} }
.block-list li { .block-list-items {
flex: 0 0 200px; display: contents;
overflow: hidden;
scroll-snap-align: start;
} }
.block-list li a { .block-list-items a {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 12px; gap: 12px;
color: inherit; width: 200px;
text-decoration: none; text-decoration: none;
padding: 16px;
} }
.block-list li img { .block-list-thumb {
width: 100%; position: relative;
height: 200px; width: 194px;
/* object-fit: contain; */ height: 133px;
border-radius: 10px;
overflow: hidden;
}
.block-list-thumb img {
display: block; display: block;
/* background: #f5f5f5; */ width: 100%;
/* border-radius: 8px; */ height: 100%;
object-fit: cover;
} }
.block-list li a:hover, .block-list-items a span{
.block-list li a:focus { display: -webkit-box;
transform: translateY(-2px); -webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
} }
.block-list .empty { .block-list-items .article-title {
flex: 1 0 auto; font-size: 20px;
}
.block-list-items .article-date {
color: #0e1b4266;
}
.block-list-more-article {
max-width: 430px;
min-width: 200px;
flex: 1 1 0;
display: flex;
align-items: center;
justify-content: center;
align-self: stretch;
margin-left: auto;
text-align: center; text-align: center;
padding: 24px; }
color: #666;
background: #fafafa; .block-list-more-article a {
border: 1px dashed #ddd; display: flex;
border-radius: 12px; align-items: center;
gap: 12px;
justify-content: center;
}
.block-list-more-article span {
font-size: 18px;
font-weight: 700;
color: #0e1b42;
text-decoration: underline;
}
.block-list-more-article .right-arrow {
background: none;
width: 52px;
height: 52px;
border: none;
padding: 0;
cursor: pointer;
box-shadow: #0e1b4266 1px 2px 1px 1px;
}
.block-list-more-article .right-arrow .right-arrow-icon {
width: 16px;
height: 32px;
transform: rotate(180deg);
}
@media (min-width: 768px) and (max-width: 1023px) {
.block-first-article {
grid-template-columns: 318px 1fr;
}
.block-first-article .first-article-image {
width: 318px;
}
.block-first-article .first-article-image img{
width:318px;
height:290px;
}
.block-first-article .first-article-title {
font-size: 36px;
}
.block-list-lower {
gap: 20px;
}
.block-list-more-article {
max-width: 200px;
flex: 1 1 200px;
}
}
@media (max-width: 767px) {
.block-first-article {
grid-template-columns: 1fr;
grid-template-areas:
"image"
"content";
}
}
@media (min-width: 575px) and (max-width: 767px) {
.block-first-article .first-article-image {
width: 426px;
}
.block-first-article .first-article-image img{
width:426px;
height:260px;
}
.block-first-article .first-article-title {
font-size: 36px;
}
.block-list-items a {
display: grid;
grid-template-columns: 194px 1fr;
column-gap: 16px;
row-gap: 8px;
width: 100%;
}
.block-list-items a > div:nth-of-type(1) {
grid-row: 1 / span 2;
}
.block-list-items a > div:nth-of-type(2),
.block-list-items a > div:nth-of-type(3) {
grid-column: 2;
min-width: 0;
}
.block-list-more-article {
max-width: 100%;
}
}
@media (max-width: 574px) {
.block-first-article .first-article-image {
width: 300px;
}
.block-first-article .first-article-image img{
width: 300px;
height: 220px;
}
.block-first-article .first-article-title {
font-size: 24px;
}
.block-first-article .first-article-intro {
font-size: 16px;
}
.block-list-lower {
gap: 16px;
}
.block-list-items a {
width: 142px;
}
.block-list-thumb {
width: 139px;
height: 110px;
}
.block-list-items .article-title {
font-size: 16px;
}
.block-list-items .article-date {
font-size: 12px;
}
.block-list-more-article span {
font-size: 16px;
}
.block-list-more-article .right-arrow {
width: 40px;
height: 40px;
}
.block-list-more-article .right-arrow .right-arrow-icon {
width: 12px;
height: 24px;
}
} }

View File

@ -0,0 +1,70 @@
.block-title {
display: inline-block;
width: 197px;
height: 87px;
vertical-align: middle;
font-size: 20px;
font-weight: 700;
}
.block-title span {
padding-left: 21px;
line-height: 87px;
}
.category-title {
background-color: #00abf5;
color: #ffffff;
}
.subcategory-title {
display: flex;
align-items: center;
margin: 24px 0;
color: #0e1b42;
font-size: 18px;
font-weight: 700;
}
.subcategory-title::before,
.subcategory-title::after {
content: "";
flex: 1 1 auto;
height: 1px;
background: #0e1b42;
}
.subcategory-title span {
display: inline-block;
width: 190px;
height: 40px;
line-height: 40px;
text-align: center;
border: 1px solid #0e1b42;
background: #ffffff;
}
@media (max-width: 767px) {
.subcategory-title::after {
display: none;
}
}
@media (max-width: 574px) {
.block-title {
width: 139px;
height: 55px;
font-size: 16px;
}
.block-title span {
padding-left: 14px;
line-height: 55px;
}
.subcategory-title span {
width: 139px;
height: 55px;
line-height: 55px;
}
}

View File

@ -8,41 +8,12 @@
color: #ffffff; color: #ffffff;
} }
.template-homepage .site-header {
background-color: #0e1b42;
color: #ffffff;
}
.template-homepage .main-menu-link {
color: #ffffff;
}
.template-homepage .header-search .search-input {
/* border-color: #ffffff; */
background-color: rgba(255, 255, 255, 0.4);
}
.template-homepage .header-search .search-icon {
color: #ffffff;
}
.template-homepage .header-search input[type="search"] {
color: #ffffff;
}
.home-banner img { .home-banner img {
width: 100%; width: 100%;
height: auto; height: auto;
display: block; display: block;
} }
@media (max-width: 767px) {
.home-banner {
width: 100vw;
margin-left: calc(50% - 50vw);
}
}
.list-title { .list-title {
align-items: center; align-items: center;
margin: 10px 0; margin: 10px 0;
@ -78,7 +49,7 @@
color: #00abf5; color: #00abf5;
} }
.section-b .list-title .category_title { .section-b .list-title .category-title {
background-color: #00abf5; background-color: #00abf5;
color: #ffffff; color: #ffffff;
} }
@ -91,7 +62,7 @@
color: #f4a41c; color: #f4a41c;
} }
.section-o .list-title .category_title { .section-o .list-title .category-title {
background-color: #f4a41c; background-color: #f4a41c;
color: #ffffff; color: #ffffff;
} }
@ -101,11 +72,18 @@
} }
@media (min-width: 768px) and (max-width: 1023px) { @media (min-width: 768px) and (max-width: 1023px) {
.list-title .category_title { .list-title .category-title {
width: 142px; width: 142px;
} }
} }
@media (max-width: 767px) {
.home-banner {
width: 100vw;
margin-left: calc(50% - 50vw);
}
}
@media (max-width: 574px) { @media (max-width: 574px) {
.block-title { .block-title {
width: 139px; width: 139px;

View File

@ -150,7 +150,7 @@
.horizontal-list-thumb { .horizontal-list-thumb {
width: 139px; width: 139px;
height: 114px; height: 110px;
} }
.section-b .horizontal-list-thumb::after { .section-b .horizontal-list-thumb::after {
@ -222,10 +222,6 @@
flex: 0 0 142px; flex: 0 0 142px;
} }
/* .horizontal-list .article-title {
width: 142px;
} */
.horizontal-list .article-title { .horizontal-list .article-title {
font-size: 16px; font-size: 16px;
} }

View File

@ -188,7 +188,42 @@
overflow: hidden; overflow: hidden;
} }
@media (min-width: 768px) and (max-width: 1023px) {
.news-hero {
grid-template-columns: 318px 1fr;
}
.news-hero .fist-news-title {
max-width: 320px;
}
.news-hero .first-news-image {
width: 318px;
}
.news-hero .first-news-image::after {
background-size: 318px 25px;
}
.news-hero .first-news-image img {
width: 318px;
height: 290px;
}
.news-hero .first-news-content {
height: 290px;
}
.news-list-lower {
gap: 16px;
}
}
@media (min-width: 575px) and (max-width: 1023px) { @media (min-width: 575px) and (max-width: 1023px) {
.news-hero .fist-news-title {
font-size: 36px;
}
.more-news { .more-news {
display: grid; display: grid;
grid-template-columns: 200px 1fr 1fr; grid-template-columns: 200px 1fr 1fr;
@ -314,43 +349,6 @@
} }
} }
@media (min-width: 768px) and (max-width: 1023px) {
.news-hero {
grid-template-columns: 318px 1fr;
}
.news-hero .fist-news-title {
max-width: 320px;
}
.news-hero .first-news-image {
width: 318px;
}
.news-hero .first-news-image::after {
background-size: 318px 25px;
}
.news-hero .first-news-image img {
width: 318px;
height: 290px;
}
.news-hero .first-news-content {
height: 290px;
}
.news-list-lower {
gap: 16px;
}
}
@media (min-width: 575px) and (max-width: 1023px) {
.news-hero .fist-news-title {
font-size: 36px;
}
}
@media (max-width: 574px) { @media (max-width: 574px) {
.news-hero .first-news-image { .news-hero .first-news-image {
width: 300px; width: 300px;
@ -368,9 +366,6 @@
height: 220px; height: 220px;
} }
/* .news-hero .first-news-content {
height: 220px;
} */
.news-hero .fist-news-title { .news-hero .fist-news-title {
font-size: 24px; font-size: 24px;
@ -388,9 +383,6 @@
width: 142px; width: 142px;
} }
/* .news-list-lower {
justify-content: center;
} */
.news-list-thumb { .news-list-thumb {
width: 139px; width: 139px;
height: 110px; height: 110px;

View File

@ -1,6 +1,10 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load wagtailcore_tags %} {% load wagtailcore_tags static %}
{% block extra_css %}
<link rel="stylesheet" type="text/css" href="{% static 'css/category.css' %}">
{% endblock %}
{% block content %} {% block content %}
{# Breadcrumbs navigation may not used anymore #}
{% if breadcrumbs %} {% if breadcrumbs %}
<nav class="breadcrumbs" aria-label="breadcrumb"> <nav class="breadcrumbs" aria-label="breadcrumb">
<ol> <ol>
@ -21,9 +25,11 @@
</ol> </ol>
</nav> </nav>
{% endif %} {% endif %}
<div class="block-title category-title"><span>{{ self.title}}</span></div>
{% if page.has_subcategories %} {% if page.has_subcategories %}
{% for section in category_sections %} {% for section in category_sections %}
{% include "home/includes/category_session.html" with section=section %} <div class="subcategory-title"><span>{{ section.title }}</span></div>
{% include "home/includes/block_list.html" with items=section.items %}
{% endfor %} {% endfor %}
{% else %} {% else %}
{% include "home/includes/page-article-list.html" with category=category_sections.0 %} {% include "home/includes/page-article-list.html" with category=category_sections.0 %}

View File

@ -1,6 +1,6 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load static %} {% load static %}
{% block body_class %}template-homepage{% endblock %} {% block body_class %}template-darkbackground{% endblock %}
{% block extra_css %} {% block extra_css %}
<link rel="stylesheet" type="text/css" href="{% static 'css/home.css' %}"> <link rel="stylesheet" type="text/css" href="{% static 'css/home.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'css/news_list.css' %}"> <link rel="stylesheet" type="text/css" href="{% static 'css/news_list.css' %}">

View File

@ -1,23 +1,74 @@
{% load wagtailimages_tags static %} {% load wagtailimages_tags static %}
{% block extra_css %}
<link rel="stylesheet" type="text/css" href="{% static 'css/block_list.css' %}">
{% endblock %}
<div class="block-list-wrap" data-block-list> <div class="block-list-wrap" data-block-list>
<button class="block-list-arrow" type="button" data-dir="left" aria-label="上一頁"></button> {% with first_article=items|first %}
<ul class="block-list"> {% if first_article %}
{% for article in items %} <div class="block-first-article">
<li> <div class="first-article-image">
<a href="{{ article.url }}"> <a href="{{ first_article.url }}">
{% if article.cover_image %} {% if first_article.cover_image %}
{% image article.cover_image max-200x200 as cover %} {% image first_article.cover_image max-480x293 as cover %}
<img src="{{ cover.url }}" alt="{{ article.title }}" height="200" width="200" style="width:200px;height:200px;object-fit:contain;display:block;"/> <img src="{{ cover.url }}" alt="{{ first_article.title }}"/>
{% else %} {% else %}
<img src="{% static 'img/default_cover.jpg' %}" alt="{{ article.title }}" height="200" width="200" style="width:200px;height:200px;object-fit:contain;display:block;"/> <img src="{% static 'img/default_cover.jpg' %}" alt="{{ first_article.title }}"/>
{% endif %} {% endif %}
{{ article.title }}
</a> </a>
</li> </div>
{% empty %} <div class="first-article-content">
<li class="empty">目前沒有文章</li> <div class="first-article-title">
{% endfor %} <span>{{ first_article.title }}</span>
</ul> </div>
<button class="block-list-arrow" type="button" data-dir="right" aria-label="下一頁"></button> <div class="first-article-date">
<span>{{ first_article.date|date:"Y.m.d" }}</span>
</div>
{% if first_article.intro %}
<div class="first-article-intro">
<span>{{ first_article.intro }}</span>
</div>
{% endif %}
<div class="first-article-body">
<span>{{ first_article.body_search_text|truncatechars:200 }}</span>
</div>
</div>
</div>
{% else %}
<span class="empty">目前沒有文章</span>
{% endif %}
{% endwith %}
{% if items|length >= 2 %}
<!-- <div class="list-title">
<span class="more-link"><a href="{{ items.0.get_parent.url }}">查看全部</a></span> -->
<div class="block-list-lower">
<div class="block-list-items">
{% for article in items|slice:"1:7" %}
<a href="{{ article.url }}">
<div class="block-list-thumb">
{% if article.cover_image %}
{% image article.cover_image max-194x133 as cover %}
<img src="{{ cover.url }}" alt="{{ article.title }}"/>
{% else %}
<img src="{% static 'img/default_cover.jpg' %}" alt="{{ article.title }}"/>
{% endif %}
</div>
<div><span class="article-title">{{ article.title }}</span></div>
<div><span class="article-date">{{ article.date|date:"Y.m.d" }}</span></div>
</a>
{% endfor %}
</div>
<div class="block-list-more-article">
<a href="{{ items.0.get_parent.url }}">
<span>更多文章</span>
<button class="right-arrow" type="button" data-dir="right" aria-label="更多文章">
<svg class="right-arrow-icon" xmlns="http://www.w3.org/2000/svg" fill="none" overflow="visible" preserveAspectRatio="none" viewBox="0 0 18.1213 33.4142">
<path d="M17.4142 0.707107L1.41421 16.7071L17.4142 32.7071" id="Vector 3" stroke="var(--stroke-0, #0E1B42)" stroke-width="2"/>
</svg>
</button>
</a>
</div>
</div>
{% endif %}
</div> </div>

View File

@ -2,7 +2,7 @@
<section class="article-section article-section--{{ section.layout }} {{ section_color }}"> <section class="article-section article-section--{{ section.layout }} {{ section_color }}">
<div class="list-title {{ title_variant }}"> <div class="list-title {{ title_variant }}">
<div class="block-title category_title"><span>{{ section.title }}</span></div> <div class="block-title category-title"><span>{{ section.title }}</span></div>
<span class="block-title-divider" aria-hidden="true"> <span class="block-title-divider" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" height="100%" overflow="visible" preserveAspectRatio="none" viewBox="0 0 28 1" width="100%"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" height="100%" overflow="visible" preserveAspectRatio="none" viewBox="0 0 28 1" width="100%">
<line stroke="currentColor" x2="28" y1="0.5" y2="0.5"/> <line stroke="currentColor" x2="28" y1="0.5" y2="0.5"/>

View File

@ -25,7 +25,7 @@
<div class="first-news-image"> <div class="first-news-image">
<a href="{{ first_article.url }}"> <a href="{{ first_article.url }}">
{% if first_article.cover_image %} {% if first_article.cover_image %}
{% image first_article.cover_image max-480x320 as cover %} {% image first_article.cover_image max-480x293 as cover %}
<img src="{{ cover.url }}" alt="{{ first_article.title }}" height="293" width="480"/> <img src="{{ cover.url }}" alt="{{ first_article.title }}" height="293" width="480"/>
{% else %} {% else %}
<img src="{% static 'img/default_cover.jpg' %}" alt="{{ first_article.title }}" height="293" width="480"/> <img src="{% static 'img/default_cover.jpg' %}" alt="{{ first_article.title }}" height="293" width="480"/>

View File

@ -231,9 +231,11 @@ WAGTAILADMIN_BASE_URL = "http://example.com"
WAGTAILDOCS_EXTENSIONS = ['csv', 'docx', 'key', 'odt', 'pdf', 'pptx', 'rtf', 'txt', 'xlsx', 'zip'] WAGTAILDOCS_EXTENSIONS = ['csv', 'docx', 'key', 'odt', 'pdf', 'pptx', 'rtf', 'txt', 'xlsx', 'zip']
CSRF_TRUSTED_ORIGINS = env_list( CSRF_TRUSTED_ORIGINS = env_list(
"CSRF_TRUSTED_ORIGINS" "CSRF_TRUSTED_ORIGINS",
default=[]
) )
ALLOWED_HOSTS = env_list( ALLOWED_HOSTS = env_list(
"ALLOWED_HOSTS" "ALLOWED_HOSTS",
default=[]
) )

View File

@ -18,6 +18,11 @@ a {
z-index: 10; z-index: 10;
} }
.template-darkbackground .site-header {
background-color: #0e1b42;
color: #ffffff;
}
.header-inner { .header-inner {
display: flex; display: flex;
align-items: center; align-items: center;
@ -38,11 +43,11 @@ a {
display: inline-flex; display: inline-flex;
} }
.template-homepage .logo--light { .template-darkbackground .logo--light {
display: inline-flex; display: inline-flex;
} }
.template-homepage .logo--dark { .template-darkbackground .logo--dark {
display: none; display: none;
} }
@ -159,6 +164,10 @@ a {
--letter-spacing: 0px; --letter-spacing: 0px;
} }
.template-darkbackground .main-menu-link {
color: #ffffff;
}
.submenu { .submenu {
position: absolute; position: absolute;
top: 100%; top: 100%;
@ -166,14 +175,9 @@ a {
transform: translateX(-50%); transform: translateX(-50%);
margin-top: -2px; margin-top: -2px;
margin-left: 20px; margin-left: 20px;
/* min-width: 220px; */
list-style: none; list-style: none;
padding-inline-start: 0; padding-inline-start: 0;
/* padding: 14px 0; */ border-bottom: #0e1b42;
/* background: #fff; */
/* border-radius: 16px; */
/* box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18); */
border-bottom: #ffffff;
border-style: solid; border-style: solid;
border-width: 0 0 1px 0; border-width: 0 0 1px 0;
opacity: 0; opacity: 0;
@ -182,6 +186,10 @@ a {
transition: opacity 160ms ease, transform 160ms ease; transition: opacity 160ms ease, transform 160ms ease;
} }
.template-darkbackground .submenu {
border-bottom: #ffffff;
}
.menu-item:hover .submenu, .menu-item:hover .submenu,
.menu-item:focus-within .submenu { .menu-item:focus-within .submenu {
opacity: 1; opacity: 1;
@ -193,20 +201,23 @@ a {
.submenu-item { .submenu-item {
min-width: 94px; min-width: 94px;
height: 36px; height: 36px;
/* padding: 8px 16px; */ border: #0e1b42;
border-style: solid;
border-width: 1px 1px 0 1px;
background-color: #ffffff;
}
.template-darkbackground .submenu-item {
border: #ffffff; border: #ffffff;
border-style: solid; border-style: solid;
border-width: 1px 1px 0 1px; border-width: 1px 1px 0 1px;
background-color: #0e1b42; background-color: #0e1b42;
/* line-height: 36px; */
/* vertical-align: middle; */
/* align-items: center; */
} }
.submenu-item a { .submenu-item a {
display: block; display: block;
font-variation-settings: normal; font-variation-settings: normal;
color: #ffffff; color: #0e1b42;
font-family: "Inter:Regular", "Noto Sans JP:Regular", sans-serif; font-family: "Inter:Regular", "Noto Sans JP:Regular", sans-serif;
word-break: break-word; word-break: break-word;
font-weight: 400; font-weight: 400;
@ -218,6 +229,10 @@ a {
padding: 8px 16px; padding: 8px 16px;
} }
.template-darkbackground .submenu-item a {
color: #ffffff;
}
.submenu-item a:hover, .submenu-item a:hover,
.submenu-item a:focus { .submenu-item a:focus {
background: rgba(0, 0, 0, 0.05); background: rgba(0, 0, 0, 0.05);
@ -227,9 +242,6 @@ a {
.header-search .search-input { .header-search .search-input {
display: flex; display: flex;
align-items: center; align-items: center;
/* border-style: solid; */
/* border-color: #0e1b42; */
/* border-width: 1px; */
} }
.header-search { .header-search {
@ -246,7 +258,11 @@ a {
border: 0; border: 0;
padding: 0; padding: 0;
cursor: pointer; cursor: pointer;
color: #1b2140; /* icon 顏色 */ color: #1b2140;
}
.template-darkbackground .header-search .search-icon {
color: #ffffff;
} }
.header-search .search-icon svg { .header-search .search-icon svg {
@ -254,212 +270,27 @@ a {
height: 28px; height: 28px;
} }
.header-search .search-input {
background-color: rgba(0, 0, 0, 0.2);
}
.template-darkbackground .header-search .search-input {
background-color: rgba(255, 255, 255, 0.4);
}
.header-search input[type="search"] { .header-search input[type="search"] {
border: 0; border: 0;
background: transparent; background: transparent;
outline: none; outline: none;
/* color: rgba(0, 0, 0, 0.3); */ width: 181px;
width: 181px; /* 依需要調 */
} }
@media (max-width: 1023px) { .template-darkbackground .header-search input[type="search"] {
.site-container {
max-width: 640px;
}
.header-search input[type="search"] {
width: 90px;
}
}
@media (min-width: 575px) and (max-width: 767px) {
.site-container {
max-width: 426px;
}
.site-header .site-container {
padding: 0 44px;
margin: 0;
}
.main-menu {
justify-content: flex-end;
}
.header-search input[type="search"] {
width: 163px;
}
.main-nav {
right: -28px;
}
}
@media (max-width: 767px) {
.site-header .site-container {
position: relative;
}
.header-inner {
width: 100%;
}
.main-nav {
position: absolute;
/* top: 100%; */
width: 220px;
display: none;
padding: 16px 0;
background: #0e1b42;
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
z-index: 5;
}
.main-nav.is-open {
display: block;
}
.main-menu {
flex-direction: column;
align-items: flex-start;
gap: 12px;
width: 220px;
padding: 0 16px;
}
.menu-item {
flex: 0 0 auto;
width: 100%;
text-align: left;
}
.menu-item-header {
width: 192px;
}
.menu-toggle {
display: flex;
margin-left: 12px;
color: #ffffff; color: #ffffff;
} }
.template-homepage .menu-toggle { .template-darkbackground .header-search input[type="search"]::placeholder {
color: #ffffff; color: #ffffff88;
}
.template-homepage .main-nav {
background: #0e1b42;
}
.main-menu-link {
color: #ffffff;
font-size: 14px;
}
.submenu-toggle {
display: inline-flex;
color: #ffffff;
}
.menu-divider {
margin-left: 0;
margin-right: 0;
width: 92px;
}
.menu-item.is-open .menu-divider {
display: block;
}
.submenu {
position: static;
/* transform: none; */
margin: 8px 0 0;
opacity: 1;
visibility: visible;
pointer-events: auto;
display: none;
border: 0;
}
/* .menu-item:focus-within .submenu {
opacity: 1;
visibility: visible;
pointer-events: auto;
transform: translateX(-50%) translateY(2px);
} */
.menu-item.is-open .submenu {
display: block;
transform: none;
}
.submenu-item {
background: none;
border: 0;
height: auto;
}
.submenu-item a {
padding: 6px 0 6px 18px;
color: #ffffff;
font-size: 14px;
}
}
@media (max-width: 574px) {
.site-container {
max-width: 300px;
}
/* .header-inner {
padding: 16px 0;
} */
.header-inner {
flex-wrap: wrap;
}
.header-search {
width: 100%;
order: 3;
margin-left: 0;
margin-top: 12px;
}
.header-search input[type="search"] {
width: 195px;
}
.main-nav {
right: 16px;
}
}
@layer figreset {
:root {
font-family: var( --default-font-family,ui-sans-serif,system-ui,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol','Noto Color Emoji' )
}
html {
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: transparent;
-webkit-font-smoothing: antialiased;
width: 100%
}
body {
margin: 0;
width: 100%
}
body: has([data-page-overflowx='hidden']) {
overflow-x:hidden
}
body: has([data-page-overflowx='auto']) {
overflow-x:auto
}
} }
footer { footer {
@ -497,7 +328,6 @@ footer .copyright p {
.footer-socials { .footer-socials {
display: flex; display: flex;
/* justify-content: center; */
gap: 12px; gap: 12px;
margin: 16px 0; margin: 16px 0;
flex-wrap: wrap; flex-wrap: wrap;
@ -546,6 +376,16 @@ footer .footer-sections {
flex-wrap: wrap; flex-wrap: wrap;
} }
@media (max-width: 1023px) {
.site-container {
max-width: 640px;
}
.header-search input[type="search"] {
width: 90px;
}
}
@media (max-width: 768px) { @media (max-width: 768px) {
.footer-inner { .footer-inner {
flex-direction: column; flex-direction: column;
@ -577,3 +417,200 @@ footer .footer-sections {
text-align: center; text-align: center;
} }
} }
@media (min-width: 575px) and (max-width: 767px) {
.site-container {
max-width: 426px;
}
.site-header .site-container {
padding: 0 44px;
margin: 0;
}
.main-menu {
justify-content: flex-end;
}
.header-search input[type="search"] {
width: 163px;
}
.main-nav {
right: -28px;
}
}
@media (max-width: 767px) {
.site-header .site-container {
position: relative;
}
.header-inner {
width: 100%;
}
.main-nav {
position: absolute;
width: 220px;
display: none;
padding: 16px 0;
background: #0e1b42;
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
z-index: 5;
}
.main-nav.is-open {
display: block;
}
.main-menu {
flex-direction: column;
align-items: flex-start;
gap: 12px;
width: 220px;
padding: 0 16px;
}
.menu-item {
flex: 0 0 auto;
width: 100%;
text-align: left;
}
.menu-item-header {
width: 192px;
}
.menu-toggle {
display: flex;
margin-left: 12px;
}
.template-darkbackground .menu-toggle {
color: #ffffff;
}
.main-nav {
background: #ffffff;
}
.template-darkbackground .main-nav {
background: #0e1b42;
}
.main-menu-link {
color: #0e1b42;
}
.template-darkbackground .main-menu-link {
color: #ffffff;
font-size: 14px;
}
.submenu-toggle {
display: inline-flex;
color: #0e1b42;
}
.template-darkbackground .submenu-toggle {
color: #ffffff;
}
.menu-divider {
margin-left: 0;
margin-right: 0;
width: 92px;
}
.menu-item.is-open .menu-divider {
display: block;
}
.submenu {
position: static;
margin: 8px 0 0;
opacity: 1;
visibility: visible;
pointer-events: auto;
display: none;
border: 0;
}
.menu-item.is-open .submenu {
display: block;
transform: none;
}
.submenu-item {
background: none;
border: 0;
height: auto;
}
.template-darkbackground .submenu-item {
border: 0;
height: auto;
}
.submenu-item a {
padding: 6px 0 6px 18px;
color: #0e1b42;
font-size: 14px;
}
.template-darkbackground .submenu-item a {
color: #ffffff;
}
}
@media (max-width: 574px) {
.site-container {
max-width: 300px;
}
.header-inner {
flex-wrap: wrap;
}
.header-search {
width: 100%;
order: 3;
margin-left: 0;
margin-top: 12px;
}
.header-search input[type="search"] {
width: 195px;
}
.main-nav {
right: 16px;
}
}
@layer figreset {
:root {
font-family: var( --default-font-family,ui-sans-serif,system-ui,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol','Noto Color Emoji' )
}
html {
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: transparent;
-webkit-font-smoothing: antialiased;
width: 100%
}
body {
margin: 0;
width: 100%
}
body: has([data-page-overflowx='hidden']) {
overflow-x:hidden
}
body: has([data-page-overflowx='auto']) {
overflow-x:auto
}
}