Update menu layout.

This commit is contained in:
rulingcom 2022-10-12 09:11:40 +08:00
parent be17e78244
commit 7b3b4b752b
12 changed files with 475 additions and 277 deletions

View File

@ -447,46 +447,47 @@
orbit.setColumn('.left-column', '.right-column');
// 自適應網頁使用當網頁載入時如果視窗寬度小於769就執行orbit.nav.setDropdown函數
if ($(window).outerWidth() < 769) {
if ($(window).outerWidth() >200) {
// orbit.nav.setDropdown();
orbit.MobileMenu();
$('.mobile-menu').append($('.modules-menu'));
$('.header-buttom').appendTo($('.modules-menu'));
$('.dropdowns').append($('.modules-menus'));
$('.mobile-menu').append($('.modules-menus'));
$('.header-buttom').appendTo($('.modules-menus'));
$('.outdropdowns').before($('.header-nav'));
orbit.ClickMenuHandler();
}else{
$('.outdropdowns').before($('.header-nav'));
$('.navbar-header').after($('.modules-menu'));
$('.navbar-header').after($('.modules-menus'));
}
// 自適應網頁使用當使用者改變瀏覽器寬度時呼叫orbit.nav.setDropdown函數
$(window).resize(function() {
var navFixed = $('.kenjohn.navFixed');
window.top_barrier_height = (navFixed.length ? navFixed.height() : 0) + $('#orbit-bar').height();
if ($(window).outerWidth() < 769) {
if ($(window).outerWidth() >200) {
if (resizeTimer) clearTimeout(resizeTimer);
$('.outdropdowns').before($('.header-nav'));
resizeTimer = setTimeout(function() {
if ( $('.modules-menu i').length == 0 ) {
if ( $('.modules-menus i').length == 0 ) {
orbit.MobileMenu();
}
if( $('.mobile-menu .modules-menu').length == 0 ) {
$('.mobile-menu').append($('.modules-menu'));
if( $('.mobile-menu .modules-menus').length == 0 ) {
$('.mobile-menu').append($('.modules-menus'));
$('.navbar-toggle').bind(orbit.ClickMenuHandler());
}
},500 )} else {
resizeTimer = setTimeout(function(){
if( $('.mobile-menu .modules-menu').length > 0 ) {
$('.navbar-header').after($('.modules-menu'));
if( $('.mobile-menu .modules-menus').length > 0 ) {
$('.navbar-header').after($('.modules-menus'));
}
orbit.removeDropdown();
}, 500);
$('.outdropdowns').before($('.header-nav'));
$('.navbar-header').after($('.modules-menu'));
$('.navbar-header').after($('.modules-menus'));
}
});
// if($(window).width()<769){
// $('.header-buttom').appendTo($('.modules-menu'));
// $('.header-buttom').appendTo($('.modules-menus'));
// }else{
// $('.header-buttom').appendTo($('.dropdowns'));
// }
@ -836,10 +837,10 @@ function transdate(){
//
// //drop down menu
// $(".dropdown-toggle").hover(function() {
// $('.modules-menu-level-1').addClass('display-on');
// $('.modules-menus-level-1').addClass('display-on');
// });
// $(".dropdown-toggle").mouseleave(function() {
// $('.modules-menu-level-1').removeClass('display-on');
// $('.modules-menus-level-1').removeClass('display-on');
// });
//
// });
@ -887,7 +888,7 @@ function transdate(){
e.preventDefault();
}
});
//$('.modules-menu-level-1').css('left','-'+$('.outdropdowns .dropdowns').offset().left+'px');
//$('.modules-menus-level-1').css('left','-'+$('.outdropdowns .dropdowns').offset().left+'px');
$(".downIcon").click(function() {
var move_to_target=function (stop) {
var theTop;
@ -922,23 +923,23 @@ function transdate(){
function calc_menu_pos(){
if ($(window).outerWidth() < 769){
calc_menu_flag = false;
$('.outdropdowns .modules-menu-level-1').css('right','')
$('.outdropdowns .modules-menu-level-1').css('width','')
$('.outdropdowns .modules-menus-level-1').css('right','')
$('.outdropdowns .modules-menus-level-1').css('width','')
}else{
try{
var width = $('header #main-nav').outerWidth();
var right = $(window).width() - $('header #main-nav').offset().left - width;
if (width>50){
calc_menu_flag = true;
$('.outdropdowns .modules-menu-level-1').css('right',right);
$('.outdropdowns .modules-menu-level-1').css('width',width);
$('.outdropdowns .modules-menus-level-1').css('right',right);
$('.outdropdowns .modules-menus-level-1').css('width',width);
}
}catch(e){};
}
}
$(window).resize(function() {
//$('.modules-menu-level-1').css('calc_menu_flagleft','-'+$('.outdropdowns .dropdowns').offset().left+'px');
//$('.modules-menus-level-1').css('calc_menu_flagleft','-'+$('.outdropdowns .dropdowns').offset().left+'px');
calc_menu_pos();
window.has_hover = false;

File diff suppressed because one or more lines are too long

View File

@ -21,8 +21,8 @@ $theme-color-third: #ed4c43;
$theme-color-green: #288E8E;
// Font stacks
$main-font: "IndustryW00-Medium","Barlow", "Roboto", "微軟正黑體", "Helvetica Neue", Helvetica, sans-serif;
$sub-font: "Barlow","Roboto", "微軟正黑體", "Helvetica Neue", Helvetica, sans-serif;
$main-font: "Calibri","Barlow", "Roboto", "微軟正黑體", "Helvetica Neue", Helvetica, sans-serif;
$sub-font: "Calibri","Roboto", "微軟正黑體", "Helvetica Neue", Helvetica, sans-serif;
@font-face {font-family: "IndustryW00-Medium"; src: url("//db.onlinewebfonts.com/t/b8e20323f8f36e06f87745c93c45afcd.eot"); src: url("//db.onlinewebfonts.com/t/b8e20323f8f36e06f87745c93c45afcd.eot?#iefix") format("embedded-opentype"), url("//db.onlinewebfonts.com/t/b8e20323f8f36e06f87745c93c45afcd.woff2") format("woff2"), url("//db.onlinewebfonts.com/t/b8e20323f8f36e06f87745c93c45afcd.woff") format("woff"), url("//db.onlinewebfonts.com/t/b8e20323f8f36e06f87745c93c45afcd.ttf") format("truetype"), url("//db.onlinewebfonts.com/t/b8e20323f8f36e06f87745c93c45afcd.svg#IndustryW00-Medium") format("svg"); }

View File

@ -517,6 +517,15 @@ body{
}
.internal-page{
background-color: #fff;
.site-trigger__text{
color: #333;
top: -0.4em;
right: 1em;
text-shadow:none;
}
.dropdowns{
justify-content: center;
}
.kenjohn {
//flex-wrap:wrap-reverse;
display: flex;
@ -575,6 +584,9 @@ body{
color: $theme-color-main;
font-size: 0.6em;
font-family: $main-font;
@media(min-width:769px){
display: block!important;
}
@media (max-width: $screen-sm) {
height: 5em;
display: none;
@ -640,6 +652,7 @@ body{
}
.navbar-toggle .icon-bar{
background-color: #333;
box-shadow: none;
}
.navbar-header .navbar-brand{
@media(max-width: 769px){

View File

@ -6,9 +6,7 @@
z-index: 1;
}
.kenjohn{
@media (min-width: 769px) {
display: none;
}
position: absolute;
width: 100%;
}
@ -222,9 +220,7 @@ a#content{
padding: 0;
margin: 0;
height: 75px;
@media (min-width: 769px){
display: none!important;
}
@media (max-width: 768px) {
position:relative!important;
}
@ -247,7 +243,9 @@ a#content{
height: 5em;
display: none;
}
@media (min-width: 769px){
display: none;
}
@media (max-width: 480px) {
margin: 0;
}
@ -303,10 +301,9 @@ a#content{
.navbar-toggle {
padding: 0.875em 0.625em;
margin-top: 1em;
// border-radius: 0.125em;
// border-width: 0.125em;
// border-color: lighten($theme-color-main, 30%);
@media(min-width: 769px){
margin-top: 1.8em;
}
.icon-bar {
background-color: #fff;
}
@ -350,14 +347,42 @@ a#content{
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
}
@media(max-width: 769px){
position: absolute;
right: 0;
}
}
.outdropdowns{
width:100%;
}
.navFixed{
.site-trigger__text{
text-shadow: none!important;
}
.navbar-toggle .icon-bar{
box-shadow:none!important;
}
.home-menu{
@media(min-width: 769px){
display: block!important;
}
}
position: fixed!important;
top: auto;
//top:2.5em;
.dropdowns{
@media (min-width: 769px) {
justify-content:center!important;
}
}
.navbar-brand{
display: block!important;
}
.site-trigger__text{
color: #333;
top: -0.32em;
right: 1em;
}
}
.internal-page .kenjohn.navRel,.navRel {
position: relative!important;
@ -405,15 +430,15 @@ a#content{
.navbar-header{
@media screen and (min-width:769px) {
height: 78px;
margin-bottom: 1em;
width: 35%;
justify-content: center;
margin-bottom: 1em;
}
@media (min-width: 1900px){
height: 90px;
}
}
@media screen and (max-width:768px) {
@media screen and (max-width:820px) {
.navbar-header{
height: 75px;
margin-bottom: 1em;
@ -463,12 +488,14 @@ a#content{
}
}
@media (width: 768px) {
.navbar-toggle{
display: block!important;
@media(min-width: 769px){
margin-right: 2em;
width: 150px;
}
}
}
.header-nav{
}
.outdropdowns{
@ -510,3 +537,28 @@ a#content{
display: inline-block;
left: 5px;
}
.mobile-menu .collapse.navbar-collapse.modules-menu{
@media(min-width: 769px){
overflow-y: scroll!important;
height: 100%!important;
padding: 0;
}
}
.navbar-toggle .icon-bar{
@media(min-width: 769px){
right:-1em;
}
}
.site-trigger__text{
font-weight: bold;
@media(min-width: 769px){
position: absolute;
top: 1em;
right: 1em;
text-shadow: 2px 2px 4px #00000080;
font-size: 1.5em;
}
@media(max-width: 768px){
display: none;
}
}

View File

@ -8,7 +8,13 @@
// Widget
// ## gerenral styles
.jarallax-video-audio, .jarallax-video-control-play{
bottom: 2%!important;
top: auto!important;
}
.jarallax-video-control-play{
margin-bottom: 66px!important;
}
.w-ba-banner {
position: relative;
z-index: 0;

View File

@ -143,10 +143,7 @@
.card:before{
height:100%;
}
.w-annc__subtitle{
max-height: 100px;
opacity: 1;
}
}
padding: 0;
flex: 0 0 25%;

View File

@ -38,10 +38,28 @@
float: left !important;
padding-top: 10px;
display: flex;
width: 100%;
justify-content:start;
padding-left: 0;
padding-left: 6em;
padding-right: 3em;
.mobile-menu1{
width: 30%;
.dropdown-toggle{
border-bottom: 2px solid #288E8E;
margin-right: 1em;
font-weight:bold;
}
}
.modules-menu-level-1{
display: flex!important;
width: 100%;
flex-wrap: wrap;
}
}
.has-dropdown.level-1.active {
.modules-menu-level-1 {
display: block;
display: block!important;
}
}
@ -66,7 +84,7 @@
.menu-drop {
position: absolute;
right: 0.3em;
right: 1.3em;
width: 2.5em;
height: 2.5em;
cursor: pointer;
@ -74,7 +92,15 @@
font-size: 0.5em;
text-align: center;
border-radius: 0.13em;
top: 0.5em;
@media(min-width: 769px){
right: 0.3em;
cursor: pointer;
text-align: center;
border-radius: 0.13em;
top: 2em;
display: none;
}
}
// .dropdown-toggle-icon.level-1 {
@ -126,7 +152,6 @@
margin-right: 0;
.modules-menu-level-1 {
left: auto;
&:before {
right: 0.625em;
@ -172,40 +197,24 @@
}
.modules-menu-level-1 {
background-color:#ffffff;
list-style: none;
z-index: 1;
padding:1em;
@media(min-width:769px){
flex-wrap: wrap;
justify-content: flex-start;
right: 0;
display: flex;
visibility: hidden;
position: fixed!important;
opacity: 0;
width: 60vw;
box-shadow: 2px 2px 10px #000000ab;
margin: 0.8em 0;
padding: 0;
max-height: 0;
overflow: hidden;
transition-duration: 0.5s;
}
& > li {
position: relative;
// & + li {
// border-top: 0.0625em solid lighten($theme-gray, 5%);
// }
& > a {
display: block;
padding: 1em 1.5em;
font-family: $main-font;
font-size: 16px;
font-weight: 600;
color: #333;
font-weight: 500;
color: #fff;
}
// &:hover {
@ -215,16 +224,18 @@
// }
// }
}
@media(max-width: 1024px){
& > li{
width: 100%!important;
}
}
@media (min-width: $screen-sm) {
position: absolute;
& > li {
padding-right: 2em;
flex: 0 0 33.3%;
width: 50%;
& > a {
padding-left: 1em;
border-bottom: 2px solid #288E8E;
padding: 5px 0;
}
@ -312,13 +323,12 @@
width: 100%;
position: absolute;
right: 0;
background: #ffffff;
background:#222222a6;
height: 100%;
top: 40px;
padding-top: 0;
overflow-y: scroll;
}
.modules-menu .modules-menu-level-0 > li > a, .modules-menu .modules-menu-level-0 ,.modules-menu .modules-menu-level-0 > li {color: #000;
.modules-menu .modules-menu-level-0 > li > a, .modules-menu .modules-menu-level-0 ,.modules-menu .modules-menu-level-0 > li {color: #fff;
font-size: 18px ;
font-weight: 500; }
.menu-drop{
@ -326,15 +336,23 @@
}
.navbar-toggle {
position: absolute;
left: 0;
right: 2.8em;
background: transparent;
top: 0;
z-index: 1;
top: 6.5em;
z-index: 11111;
height: 40px;
margin: 0;
width: 100%;
border: 0;
-webkit-transition: -webkit-transform 0.3s;
transition: -webkit-transform 0.3s;
transition: transform 0.3s;
transition: transform 0.3s, -webkit-transform 0.3s;
@media(max-width:768px){
left: 3em;
top:0;
}
}
.cover {
position: fixed;
top: 0;
@ -377,6 +395,7 @@
.mobile-menu .collapse.navbar-collapse.modules-menu {
//overflow-y: scroll;
transform: translateX(0%);
}
.display-on{
display:block!important;
@ -412,3 +431,109 @@
font-size: 3px;
font-weight: 100!important;
}
.home-menu{
display: none;
position: relative;
height: 100px!important;
width: 80%;
z-index: -1;
.dropdown-toggle{
border-bottom: 0!important;
}
.modules-menu-level-0{
padding: 0;
}
@media(max-width: 768px){
display: none;
}
.modules-menu-level-1{
overflow-y: scroll !important;
}
.modules-menu-level-0 .mobile-menu1{
@media (min-width: 769px){
width: auto!important;
}
}
.modules-menu-level-1 {
list-style: none;
z-index: 1;
padding:1em;
@media(min-width:769px){
flex-wrap: wrap;
justify-content: flex-start;
left:0;
display: flex;
visibility: hidden;
position: fixed!important;
opacity: 0;
width: 100vw;
box-shadow: 2px 2px 5px #00000033;
margin: 0.8em 0;
padding: 0;
max-height: 0;
overflow: hidden;
transition-duration: 0.5s;
}
& > li {
position: relative;
// & + li {
// border-top: 0.0625em solid lighten($theme-gray, 5%);
// }
& > a {
display: block;
padding: 1em 1.5em;
font-family: $main-font;
font-size: 16px;
font-weight: 600;
color: #333;
}
}
@media (min-width: $screen-sm) {
position: absolute;
& > li {
padding-right: 2em;
flex: 0 0 33.3%;
& > a {
padding-left: 1em;
border-bottom: 2px solid #288E8E;
padding: 5px 0;
}
&:hover {
.modules-menu-level-2 {
display: block;
}
}
}
}
}
}
.modules-menus{
.mobile-menu2{
.menu-drop{
@media(min-width: 769px){
display: none;
}
}
}
}
.navbar-toggle .icon-bar{
width: 1.75em;
box-shadow: 2px 2px 4px #00000080;
}
.active{
.navbar-toggle .icon-bar{
right:-2em;
margin-top: 0.25em!important;
}
}
.navbar-toggle .icon-bar+.icon-bar{
margin-top: 0.35em;
}
.navbar-toggle .icon-bar{
height: 0.15em;
}

View File

@ -101,17 +101,15 @@ div.extra-box:empty {
}
}
.dropdowns{
@media (min-width: $screen-md) {
@media (min-width:769px) {
display: flex;
margin: auto;
flex-wrap: wrap;
justify-content: center;
justify-content:end;
top: 0;
right: 0;
left: 0;
}
}
.header-buttom{
@media (min-width: $screen-md) {

View File

@ -31,15 +31,18 @@
<span class="icon-bar icon-bar-top"></span>
<span class="icon-bar icon-bar-middle"></span>
<span class="icon-bar icon-bar-bottom"></span>
<span class="site-trigger__text">
MENU </span>
</button>
<a title="{{site_title_1}}" class="navbar-brand" href="{{home_link_1}}"><img class="site-logo" src="{{logo_url_1}}" alt="site-logo"></a>
<script>$(document).ready(function(){var url =$('.site-logo').eq(0).attr('src');if(url == "/assets/default-site-logo.png"){$('.navbar-brand').eq(0).remove();};if($('.navbar-brand').length == 2){$('.site-logo').css('height','auto')};$('.site-logo').eq(0).css('margin-right',0);$('.navbar-brand').css('padding-right',0)})</script>
<a title="{{site_title}}" class="navbar-brand" href="{{home_link}}"><img class="site-logo" src="{{logo_url}}" alt="site-logo"> {{site_name}}</a>
</div>
<div class="collapse navbar-collapse modules-menu" id="layout-navigation">
<div class="collapse navbar-collapse modules-menu modules-menus" id="layout-navigation">
<a id="accesskey_menu" title="accesskey menu" accesskey="M" href="#" title="Main menu">:::</a>
<%= render_menu %>
</div>
</div>
</div>
</div>

View File

@ -171,7 +171,7 @@
$("*[data-yt-binded=0]").each(function(){
init_yt_banner(this);
})
if (typeof onYouTubeIframeAPIReady !== 'function'){
if (typeof onYouTubeIframeAPIReady !== 'function'){
$(document).ready(function() {
$(document).on('touchstart click mousedown',".jarallax-video-audio",function(){
$(this).trigger('click');
@ -357,7 +357,7 @@ if (typeof onYouTubeIframeAPIReady !== 'function'){
}
{{extra_state_chnage_script}}
}
}
}
$(document).ready(function(){
window.onYouTubePlayerAPIReady = function() {
onYouTubeIframeAPIReady.apply(this,arguments);

View File

@ -46,6 +46,9 @@
padding: 1em 0 0 0;
text-align: center;
}
.ask-question .controls > input[type="radio"]:not(:first-child) {
margin-left: 0.5em;
}
</style>
<link href="/assets/custom_field.css" media="screen" rel="stylesheet">
<script src="/assets/validator"></script>