From 3a5b3383ebac1611dcc5417ea008524a3c67c26e Mon Sep 17 00:00:00 2001 From: ken Date: Sun, 20 Sep 2026 17:31:19 +0800 Subject: [PATCH] up --- assets/javascripts/app.js | 205 +++++++++--------- assets/stylesheets/template/base/_global.scss | 3 +- .../template/modules/ad_banner.scss | 5 +- .../template/modules/archives.scss | 4 +- .../template/modules/event_news.scss | 1 - .../stylesheets/template/modules/gallery.scss | 12 + .../stylesheets/template/modules/member.scss | 19 +- .../stylesheets/template/widget/sitemenu.scss | 1 + modules/ad_banner/_ad_banner_widget0.html.erb | 57 +---- modules/announcement/_annc_widget19.html.erb | 131 +---------- modules/gallery/_gallery_widget3.html.erb | 4 - modules/gallery/show.html.erb | 1 + 12 files changed, 141 insertions(+), 302 deletions(-) diff --git a/assets/javascripts/app.js b/assets/javascripts/app.js index 7bda678..42a5af9 100644 --- a/assets/javascripts/app.js +++ b/assets/javascripts/app.js @@ -2489,6 +2489,7 @@ $(function() { $('.i-annc__page-title').after($('.sitemenu-wrap2')); $('.i-archive-title').after($('.sitemenu-wrap2')); $('.page-module-title').after($('.sitemenu-wrap2')); + $('.show-member').before($('.sitemenu-wrap2')); $('.box-social-share').before($('.sitemenu-wrap3')); $('.box-social-share').before($('.sitemenu-wrap3')); $('.box-social-share').before($('.sitemenu-wrap3')); @@ -4156,128 +4157,128 @@ $(function() { }); }, 500); }); -//header選單太長 -$(function() { - function adjustMenuPosition() { - var headerHeight = ($('.layout-header').outerHeight() || 140) + ($('#orbit-bar').outerHeight() || 0); - var windowHeight = $(window).height(); - var windowWidth = $(window).width(); +// //header選單太長 +// $(function() { +// function adjustMenuPosition() { +// var headerHeight = ($('.layout-header').outerHeight() || 140) + ($('#orbit-bar').outerHeight() || 0); +// var windowHeight = $(window).height(); +// var windowWidth = $(window).width(); - // 處理 level-1 - $('.modules-menu-level-0 > li').on('mouseenter', function() { - var $level1 = $(this).find('> .modules-menu-level-1'); - if (!$level1.length) return; +// // 處理 level-1 +// $('.modules-menu-level-0 > li').on('mouseenter', function() { +// var $level1 = $(this).find('> .modules-menu-level-1'); +// if (!$level1.length) return; - $level1.css({ 'top': '', 'max-height': '', 'overflow-y': '', 'overflow-x': '' }); +// $level1.css({ 'top': '', 'max-height': '', 'overflow-y': '', 'overflow-x': '' }); - var menuTop = $level1.offset().top; - var menuHeight = $level1.outerHeight(); - var available = windowHeight - menuTop; +// var menuTop = $level1.offset().top; +// var menuHeight = $level1.outerHeight(); +// var available = windowHeight - menuTop; - if (menuHeight > available) { - var maxH = windowHeight - headerHeight; - $level1.css({ - 'top' : 'auto', - 'max-height': maxH + 'px', - 'overflow-y': 'auto', - 'overflow-x': 'visible' - }); +// if (menuHeight > available) { +// var maxH = windowHeight - headerHeight; +// $level1.css({ +// 'top' : 'auto', +// 'max-height': maxH + 'px', +// 'overflow-y': 'auto', +// 'overflow-x': 'visible' +// }); - // 判斷是否是最後一個 li(level-2 往左展開) - var $parentLi = $level1.closest('.modules-menu-level-0 > li'); - var isLastChild = $parentLi.is(':last-child') && windowWidth >= 769; +// // 判斷是否是最後一個 li(level-2 往左展開) +// var $parentLi = $level1.closest('.modules-menu-level-0 > li'); +// var isLastChild = $parentLi.is(':last-child') && windowWidth >= 769; - $level1.find('> li').on('mouseenter.level2fix', function() { - var $li = $(this); - var $level2 = $li.find('> .modules-menu-level-2'); - if (!$level2.length) return; +// $level1.find('> li').on('mouseenter.level2fix', function() { +// var $li = $(this); +// var $level2 = $li.find('> .modules-menu-level-2'); +// if (!$level2.length) return; - function updateLevel2Position() { - var liRect = $li[0].getBoundingClientRect(); - var orbitHeight = $('#orbit-bar').outerHeight() || 0; - var leftPos, rightPos; +// function updateLevel2Position() { +// var liRect = $li[0].getBoundingClientRect(); +// var orbitHeight = $('#orbit-bar').outerHeight() || 0; +// var leftPos, rightPos; - if (isLastChild) { - leftPos = 'auto'; - rightPos = (windowWidth - liRect.left) + 'px'; - } else { - leftPos = liRect.right + 'px'; - rightPos = 'auto'; - } +// if (isLastChild) { +// leftPos = 'auto'; +// rightPos = (windowWidth - liRect.left) + 'px'; +// } else { +// leftPos = liRect.right + 'px'; +// rightPos = 'auto'; +// } - $level2.css({ - 'position' : 'fixed', - 'top' : (liRect.top - orbitHeight) + 'px', // 減去 orbit-bar 高度 - 'left' : leftPos, - 'right' : rightPos, - 'max-height': (windowHeight - headerHeight) + 'px', - 'overflow-y': 'auto', - 'z-index' : 9999 - }); - } +// $level2.css({ +// 'position' : 'fixed', +// 'top' : (liRect.top - orbitHeight) + 'px', // 減去 orbit-bar 高度 +// 'left' : leftPos, +// 'right' : rightPos, +// 'max-height': (windowHeight - headerHeight) + 'px', +// 'overflow-y': 'auto', +// 'z-index' : 9999 +// }); +// } - // 初始定位 - updateLevel2Position(); +// // 初始定位 +// updateLevel2Position(); - // 監聽 level-1 捲動,即時更新 top - $level1.on('scroll.level2pos', function() { - updateLevel2Position(); - }); +// // 監聽 level-1 捲動,即時更新 top +// $level1.on('scroll.level2pos', function() { +// updateLevel2Position(); +// }); - }).on('mouseleave.level2fix', function() { - $(this).find('> .modules-menu-level-2').css({ - 'position' : '', - 'top' : '', - 'left' : '', - 'right' : '', - 'max-height': '', - 'overflow-y': '' - }); - $level1.off('scroll.level2pos'); - }); - } - }); +// }).on('mouseleave.level2fix', function() { +// $(this).find('> .modules-menu-level-2').css({ +// 'position' : '', +// 'top' : '', +// 'left' : '', +// 'right' : '', +// 'max-height': '', +// 'overflow-y': '' +// }); +// $level1.off('scroll.level2pos'); +// }); +// } +// }); - // 處理 level-2(level-1 不需要捲動時的一般情況) - $('.modules-menu-level-1 > li').on('mouseenter', function() { - var $li = $(this); - var $level2 = $li.find('> .modules-menu-level-2'); - if (!$level2.length) return; +// // 處理 level-2(level-1 不需要捲動時的一般情況) +// $('.modules-menu-level-1 > li').on('mouseenter', function() { +// var $li = $(this); +// var $level2 = $li.find('> .modules-menu-level-2'); +// if (!$level2.length) return; - var $level1 = $li.closest('.modules-menu-level-1'); - if ($level1.css('overflow-y') === 'auto') return; +// var $level1 = $li.closest('.modules-menu-level-1'); +// if ($level1.css('overflow-y') === 'auto') return; - // 重置 - $level2.css({ 'top': '', 'max-height': '', 'overflow-y': '' }); +// // 重置 +// $level2.css({ 'top': '', 'max-height': '', 'overflow-y': '' }); - // 加上 li 的 padding-top,讓 level-2 頂端對齊 li 文字 - var liPaddingTop = parseInt($li.css('padding-top')) || 0; - $level2.css('top', liPaddingTop + 'px'); +// // 加上 li 的 padding-top,讓 level-2 頂端對齊 li 文字 +// var liPaddingTop = parseInt($li.css('padding-top')) || 0; +// $level2.css('top', liPaddingTop + 'px'); - var menuTop = $level2.offset().top; - var menuHeight = $level2.outerHeight(); - var available = windowHeight - menuTop; +// var menuTop = $level2.offset().top; +// var menuHeight = $level2.outerHeight(); +// var available = windowHeight - menuTop; - if (menuHeight > available) { - var overflowAmount = menuHeight - available; - $level2.css({ - 'top' : (liPaddingTop - overflowAmount) + 'px', - 'max-height': (windowHeight - headerHeight) + 'px', - 'overflow-y': 'auto' - }); - } - }); - } +// if (menuHeight > available) { +// var overflowAmount = menuHeight - available; +// $level2.css({ +// 'top' : (liPaddingTop - overflowAmount) + 'px', +// 'max-height': (windowHeight - headerHeight) + 'px', +// 'overflow-y': 'auto' +// }); +// } +// }); +// } - adjustMenuPosition(); +// adjustMenuPosition(); - $(window).on('resize', function() { - $('.modules-menu-level-0 > li').off('mouseenter'); - $('.modules-menu-level-1 > li').off('mouseenter.level2fix mouseleave.level2fix'); - $('.modules-menu-level-1').off('scroll.level2pos'); - adjustMenuPosition(); - }); -}); +// $(window).on('resize', function() { +// $('.modules-menu-level-0 > li').off('mouseenter'); +// $('.modules-menu-level-1 > li').off('mouseenter.level2fix mouseleave.level2fix'); +// $('.modules-menu-level-1').off('scroll.level2pos'); +// adjustMenuPosition(); +// }); +// }); //ai須新增的function diff --git a/assets/stylesheets/template/base/_global.scss b/assets/stylesheets/template/base/_global.scss index bb5c617..812fed1 100644 --- a/assets/stylesheets/template/base/_global.scss +++ b/assets/stylesheets/template/base/_global.scss @@ -87,7 +87,7 @@ a[href="/en/sitemap"]{ margin: 0; font-size: unset; border-left: 0; - @media(min-width:769px){ + @media(min-width:768px){ float: left; .movelanguage{ float: right; @@ -277,6 +277,7 @@ td { img { max-width: 100%; height: auto; + width: 100%; } input[type=checkbox]:focus { outline: 0.3125em auto -webkit-focus-ring-color; diff --git a/assets/stylesheets/template/modules/ad_banner.scss b/assets/stylesheets/template/modules/ad_banner.scss index 23378ed..efaf2d3 100644 --- a/assets/stylesheets/template/modules/ad_banner.scss +++ b/assets/stylesheets/template/modules/ad_banner.scss @@ -38,8 +38,11 @@ .w-ba-banner .controlplay .resume-slide.active i { color: $theme-color-second!important; } -.w-ba-banner__caption h3 { + .w-ba-banner__caption h3 { font-size: 2em; + @media(max-width:768px){ + font-size: 1.8em; + } } ul.button-mid{ .prev-button{ diff --git a/assets/stylesheets/template/modules/archives.scss b/assets/stylesheets/template/modules/archives.scss index a4fc8b9..dae93f2 100644 --- a/assets/stylesheets/template/modules/archives.scss +++ b/assets/stylesheets/template/modules/archives.scss @@ -112,7 +112,7 @@ -webkit-transition: all 0.5s; -o-transition: all 0.5s; &:hover { - background-color: darken($color: #f5f5f5, $amount: 10); + background: rgba(180, 180, 180, 0.1); } } .panel { @@ -256,7 +256,7 @@ -webkit-transition: all 0.5s; -o-transition: all 0.5s; &:hover { - background-color: darken($color: #f5f5f5, $amount: 10); + background: rgba(180, 180, 180, 0.1); } } .panel { diff --git a/assets/stylesheets/template/modules/event_news.scss b/assets/stylesheets/template/modules/event_news.scss index 5ee46c3..7c4ddc8 100644 --- a/assets/stylesheets/template/modules/event_news.scss +++ b/assets/stylesheets/template/modules/event_news.scss @@ -560,7 +560,6 @@ .i-annc__list { display: flex; flex-wrap: wrap; - justify-content: center; } .i-annc__title { font-family: $main-font; diff --git a/assets/stylesheets/template/modules/gallery.scss b/assets/stylesheets/template/modules/gallery.scss index b58af48..d07c5c9 100644 --- a/assets/stylesheets/template/modules/gallery.scss +++ b/assets/stylesheets/template/modules/gallery.scss @@ -30,6 +30,7 @@ padding: 0; .img-thumbnail{ width: 100%; + padding: 0; } &:hover{ img{ @@ -42,6 +43,9 @@ } } } +.gallery.card-group .card.card-flip.h-100{ + height: auto !important; +} // Gallery MODULES .widget-gallery { .widget-title { @@ -564,6 +568,14 @@ } } &.index8{ + .index-content-inner{ + background-color: rgba($theme-color-second, 0.1); + margin-bottom: 1em; + border-radius: 1em; + } + h4.index-content-title { + padding: 0 1em; + } .index-content-inner img{ padding: 0; border: 0; diff --git a/assets/stylesheets/template/modules/member.scss b/assets/stylesheets/template/modules/member.scss index 1da6692..cb238e1 100644 --- a/assets/stylesheets/template/modules/member.scss +++ b/assets/stylesheets/template/modules/member.scss @@ -72,14 +72,17 @@ th.sorting_disabled { // } .i-member-item{ &:hover{ - // img{ - // transform: scale(1.1) !important; - // -webkit-transition: .3s ease-out; - // -moz-transition: .3s ease-out; - // -ms-transition: .3s ease-out; - // -o-transition: .3s ease-out; - // transition: .3s ease-out; - // } + .i-member-pic-wrap{ + overflow: hidden; + .i-member-pic{ + transform: scale(1.05) !important; + -webkit-transition: .3s ease-out; + -moz-transition: .3s ease-out; + -ms-transition: .3s ease-out; + -o-transition: .3s ease-out; + transition: .3s ease-out; + } + } } } .search-member{ diff --git a/assets/stylesheets/template/widget/sitemenu.scss b/assets/stylesheets/template/widget/sitemenu.scss index 290a692..1b2a071 100644 --- a/assets/stylesheets/template/widget/sitemenu.scss +++ b/assets/stylesheets/template/widget/sitemenu.scss @@ -90,6 +90,7 @@ border: 1px solid #6868688f; padding: 1em; background-color: #fff; + margin-bottom: 1em; .sitemenu-list { position: relative; float: none; diff --git a/modules/ad_banner/_ad_banner_widget0.html.erb b/modules/ad_banner/_ad_banner_widget0.html.erb index 70620a6..5a2d7f1 100644 --- a/modules/ad_banner/_ad_banner_widget0.html.erb +++ b/modules/ad_banner/_ad_banner_widget0.html.erb @@ -63,62 +63,7 @@ $('[data-subpart-id="{{subpart-id}}"] .prev-button').click(function(){ $(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle("prev"); }); - $(function() { - function updateBannerClip() { - $('.ba-banner-widget-0').each(function() { - var $banner = $(this); - var vpWidth = $(window).width(); - var vpHeight = $(window).height(); - - // --- 寬度:找比 viewport 窄的父層容器 --- - var $container = null; - $banner.parents().each(function() { - var $el = $(this); - if ($el.outerWidth() < vpWidth - 10) { - $container = $el; - return false; - } - }); - - var clipLeft = 0; - var clipRight = 0; - if ($container && $container.length > 0) { - clipLeft = Math.max(0, $container.offset().left); - clipRight = Math.max(0, vpWidth - $container.offset().left - $container.outerWidth()); - } - - // --- 高度:依 .w-ad-banner 自己區塊的上下邊界裁切 --- - var bannerTop = $banner.offset().top - $(window).scrollTop(); - var bannerBottom = vpHeight - bannerTop - $banner.outerHeight(); - - var clipTop = Math.max(0, bannerTop); - var clipBottom = Math.max(0, bannerBottom); - - var clipValue = 'inset(' - + clipTop + 'px ' - + clipRight + 'px ' - + clipBottom + 'px ' - + clipLeft + 'px)'; - - $banner.find('img.w-ba-banner__image').css('clip-path', clipValue); - }); - } - - // 初始執行 - setTimeout(updateBannerClip, 300); - - // 視窗縮放時重新計算 - var resizeTimer; - $(window).on('resize', function() { - clearTimeout(resizeTimer); - resizeTimer = setTimeout(updateBannerClip, 100); - }); - - // ✅ 滾動時也要更新,因為 bannerTop 會隨捲動改變 - $(window).on('scroll', function() { - updateBannerClip(); - }); - }); +