From 7b2ce780a98a5f1d3b0202eb95adaf3f74b79279 Mon Sep 17 00:00:00 2001 From: kenlee Date: Tue, 31 Dec 2024 15:06:28 +0800 Subject: [PATCH] 'menu' --- assets/javascripts/app.js | 34 ++-- .../stylesheets/template/modules/gallery.scss | 9 +- assets/stylesheets/template/modules/menu.scss | 155 +++++++++--------- 3 files changed, 104 insertions(+), 94 deletions(-) diff --git a/assets/javascripts/app.js b/assets/javascripts/app.js index cf46154..f9155c8 100644 --- a/assets/javascripts/app.js +++ b/assets/javascripts/app.js @@ -851,23 +851,23 @@ extendPanelWidget(); // }); // });// //選單 -//選單樣式2 -$(document).ready(function() { - "use strict"; - $(".menu > ul > li").hover(function(e) { - if ($(window).width() > 943) { - $(this).children("ul").stop(true, false).fadeToggle(150); - e.preventDefault(); - } - }); - $('.modules-menu-level-1').css('left','-'+$('.outdropdowns .dropdowns').offset().left+'px'); -}); -$(document).resize(function() { - $('.modules-menu-level-1').css('left','-'+$('.outdropdowns .dropdowns').offset().left+'px'); - if ($(window).width() < 769){ - $('.modules-menu-level-1').css('left','') - } -}); +// //選單樣式2 +// $(document).ready(function() { +// "use strict"; +// $(".menu > ul > li").hover(function(e) { +// if ($(window).width() > 943) { +// $(this).children("ul").stop(true, false).fadeToggle(150); +// e.preventDefault(); +// } +// }); +// $('.modules-menu-level-1').css('left','-'+$('.outdropdowns .dropdowns').offset().left+'px'); +// }); +// $(document).resize(function() { +// $('.modules-menu-level-1').css('left','-'+$('.outdropdowns .dropdowns').offset().left+'px'); +// if ($(window).width() < 769){ +// $('.modules-menu-level-1').css('left','') +// } +// }); $(window).load(function(){ $("iframe[src*='google']").attr('title','googleOauth'); diff --git a/assets/stylesheets/template/modules/gallery.scss b/assets/stylesheets/template/modules/gallery.scss index 7b46125..4303853 100644 --- a/assets/stylesheets/template/modules/gallery.scss +++ b/assets/stylesheets/template/modules/gallery.scss @@ -1,7 +1,11 @@ @charset "utf-8"; @import "../initial"; - +.index-pic{ + .img-thumbnail{ + width: 100%; + } +} // Gallery MODULES .widget-gallery { .widget-title { @@ -116,6 +120,9 @@ &.index1 { .index-content { + @media(max-width: $screen-xs){ + width: 100%; + } &:nth-child(4n+1) { clear: both; } diff --git a/assets/stylesheets/template/modules/menu.scss b/assets/stylesheets/template/modules/menu.scss index b8d54d3..1907ba0 100644 --- a/assets/stylesheets/template/modules/menu.scss +++ b/assets/stylesheets/template/modules/menu.scss @@ -2,74 +2,74 @@ @import "../initial"; -// 選單樣式2 -.modules-menu{ - @media (min-width: $screen-sm){ - li{ - padding-left: 0!important; - } - .modules-menu-level-1 > li > a{ - color: $theme-color-second!important; - } - } - .modules-menu-level-0 > li{ - @media (min-width: $screen-sm){ - position: static!important; - } - } - - .modules-menu-level-1{ - - @media (min-width: $screen-sm){ - min-width:unset; - flex-wrap: wrap; - justify-content: flex-start; - left:0!important; - display: flex!important; - visibility: hidden; - opacity: 0; - width: 100vw!important; - box-shadow: 2px 2px 5px #00000033; - margin:0; - padding:1em 13% 3em!important; - transition-duration: 0.5s; - background: #f0f0f0; - } - } - .modules-menu-level-0 > li:hover .modules-menu-level-1, .modules-menu .modules-menu-level-0 > li.hover-class .modules-menu-level-1{ - visibility: visible!important; - opacity: 1!important; - } - - .modules-menu-level-2 { - right:auto!important; - display: block; - top: auto!important; - left: auto!important; - background-color: transparent!important; - position: relative!important; - } - .modules-menu-level-1{ - @media (min-width: $screen-sm) { - & > li { - width: 25%; - & > a { - padding-left: 1em; - padding: 5px 0; - } - - &:hover { - .modules-menu-level-2 { - display: block; - } - } - } - .modules-menu-level-2{ - display: block; - } - } - } -} +// // 選單樣式2 +// .modules-menu{ +// @media (min-width: $screen-sm){ +// li{ +// padding-left: 0!important; +// } +// .modules-menu-level-1 > li > a{ +// color: $theme-color-second!important; +// } +// } +// .modules-menu-level-0 > li{ +// @media (min-width: $screen-sm){ +// position: static!important; +// } +// } +// +// .modules-menu-level-1{ +// +// @media (min-width: $screen-sm){ +// min-width:unset; +// flex-wrap: wrap; +// justify-content: flex-start; +// left:0!important; +// display: flex!important; +// visibility: hidden; +// opacity: 0; +// width: 100vw!important; +// box-shadow: 2px 2px 5px #00000033; +// margin:0; +// padding:1em 13% 3em!important; +// transition-duration: 0.5s; +// background: #f0f0f0; +// } +// } +// .modules-menu-level-0 > li:hover .modules-menu-level-1, .modules-menu .modules-menu-level-0 > li.hover-class .modules-menu-level-1{ +// visibility: visible!important; +// opacity: 1!important; +// } +// +// .modules-menu-level-2 { +// right:auto!important; +// display: block; +// top: auto!important; +// left: auto!important; +// background-color: transparent!important; +// position: relative!important; +// } +// .modules-menu-level-1{ +// @media (min-width: $screen-sm) { +// & > li { +// width: 25%; +// & > a { +// padding-left: 1em; +// padding: 5px 0; +// } +// +// &:hover { +// .modules-menu-level-2 { +// display: block; +// } +// } +// } +// .modules-menu-level-2{ +// display: block; +// } +// } +// } +// } //固定選單 .navFixed { @@ -310,13 +310,12 @@ } } @media (min-width: $screen-sm)and(max-width: 1439px){ - .modules-menu-level-1 { - right: 0; + &:last-child{ + .modules-menu-level-1 { + right: 0; + } } - .modules-menu-level-1 { - right: 0; - } } @media (min-width: $screen-sm) { margin: 0; @@ -326,7 +325,12 @@ &:first-child { margin-left: 0; } - + &:nth-last-child(2){ + .modules-menu-level-2 { + right: 100%; + left: auto; + } + } &:last-child { margin-right: 0; @@ -406,9 +410,8 @@ } &:hover { - + background-color: $theme-color-second; @media(max-width: 769px){ - background-color: $theme-color-second; a,i { color: #fff; }