Merge pull request #46 from gurusabarish/dropdown-v3

dropdown v3 #44
This commit is contained in:
Guru Sabarish
2022-01-31 18:46:14 +05:30
committed by GitHub
9 changed files with 107 additions and 23 deletions
+2
View File
@@ -67,6 +67,7 @@
$("nav").toggleClass("navbar-light"); $("nav").toggleClass("navbar-light");
$('.text-dark').toggleClass('darkmode-text-dark'); $('.text-dark').toggleClass('darkmode-text-dark');
$('.text-muted').toggleClass('darkmode-text-muted'); $('.text-muted').toggleClass('darkmode-text-muted');
$(".dropdown-menu").toggleClass('darkmode-dropdown-menu');
}; };
</script> </script>
<script src="/js/auto_darkmode.js"></script> <script src="/js/auto_darkmode.js"></script>
@@ -79,6 +80,7 @@
$("nav").toggleClass("navbar-light"); $("nav").toggleClass("navbar-light");
$('.text-dark').toggleClass('darkmode-text-dark'); $('.text-dark').toggleClass('darkmode-text-dark');
$('.text-muted').toggleClass('darkmode-text-muted'); $('.text-muted').toggleClass('darkmode-text-muted');
$(".dropdown-menu").toggleClass('darkmode-dropdown-menu');
switchDarkmodeSetting(); switchDarkmodeSetting();
}); });
+2
View File
@@ -129,6 +129,7 @@
$(".about-backdark").toggleClass("about-back"); $(".about-backdark").toggleClass("about-back");
$(".education-backdark").toggleClass("education-back"); $(".education-backdark").toggleClass("education-back");
$(".achievements-backdark").toggleClass("achievements-back"); $(".achievements-backdark").toggleClass("achievements-back");
$(".dropdown-menu").toggleClass('darkmode-dropdown-menu');
} }
</script> </script>
<script src="/js/auto_darkmode.js"></script> <script src="/js/auto_darkmode.js"></script>
@@ -160,6 +161,7 @@
$("nav").toggleClass("navbar-light"); $("nav").toggleClass("navbar-light");
$(".text-dark").toggleClass("darkmode-text-dark"); $(".text-dark").toggleClass("darkmode-text-dark");
$(".text-muted").toggleClass("darkmode-text-muted") $(".text-muted").toggleClass("darkmode-text-muted")
$(".dropdown-menu").toggleClass('darkmode-dropdown-menu');
switchDarkmodeSetting(); switchDarkmodeSetting();
}); });
+40 -4
View File
@@ -64,11 +64,47 @@
</li> </li>
{{ end }} {{ end }}
{{ range site.Params.customMenus }} {{ range .Site.Menus.main }}
<li class="nav-item navbar-text"> {{ if .HasChildren }}
<a class="nav-link text-dark" href="{{.Url}}" aria-label="{{ .name }}">{{ .name }}</a> <!-- Dropdown menu -->
<li class="nav-item dropdown navbar-text">
<a class="nav-link text-dark dropdown-toggle" href="#" title="{{ .Title }}" id="navbarDropdownMenuLink"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ .Name }}
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
{{ range .Children }}
<a class="dropdown-item text-dark" href="{{ .URL }}" title="{{ .Title }}">
{{ .Name }}
</a>
{{ end }}
</div>
</li> </li>
{{ end }}
{{/*
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="{{ .URL }}" id="navbarDropdown" role="button"
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="{{ .Title }}">
{{ .Name }}
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
{{ range .Children }}
<a class="dropdown-item" href="{{ .URL }}" title="{{ .Title }}">
{{ .Name }}</a>
{{ end }}
</div>
</li> */}}
{{else}}
<!-- Single menu item -->
<li class="nav-item navbar-text">
<a class="nav-link text-dark" href="{{.URL}}" title="{{ .Title }}">
{{ .Pre }}
<span>{{ .Name }}</span>
</a>
</li>
{{end}}
{{end}}
<li class="nav-item navbar-text"> <li class="nav-item navbar-text">
<div class="custom-control custom-switch"> <div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="customSwitch1" autocomplete="on"> <input type="checkbox" class="custom-control-input" id="customSwitch1" autocomplete="on">
+3 -2
View File
@@ -10,5 +10,6 @@
color: #b0b3b8 !important; color: #b0b3b8 !important;
} }
.darkmode-dropdown-menu {
background-color: #212121 !important;
}
+3
View File
@@ -9,6 +9,9 @@
.navbar-text { .navbar-text {
font-size: 16px !important; font-size: 16px !important;
} }
li> .dropdown-toggle:focus{
color: #007bff !important;
}
/* v2 and v3 footer */ /* v2 and v3 footer */
footer { footer {
-6
View File
@@ -205,13 +205,9 @@ a:hover {
} }
/* v3 experience */ /* v3 experience */
#experience {
}
#nav-pills-out { #nav-pills-out {
border-left: 1px solid #007bff; border-left: 1px solid #007bff;
} }
.nav-pills .nav-link {
}
.nav-pills .active { .nav-pills .active {
padding-left: 20%; padding-left: 20%;
color: #818181 !important; color: #818181 !important;
@@ -224,8 +220,6 @@ a:hover {
left: 0px; left: 0px;
color: #007bff; color: #007bff;
} }
.tab-pane {
}
.ex { .ex {
list-style-type: none; list-style-type: none;
} }
+1 -1
View File
@@ -7,6 +7,7 @@ function setCookie(name,value,days) {
} }
document.cookie = name + "=" + (value || "") + expires + "; path=/"; document.cookie = name + "=" + (value || "") + expires + "; path=/";
} }
function getCookie(name) { function getCookie(name) {
var nameEQ = name + "="; var nameEQ = name + "=";
var ca = document.cookie.split(';'); var ca = document.cookie.split(';');
@@ -52,7 +53,6 @@ function switchDarkmodeSetting() {
} }
} }
const check_darkmode = getDarkmodeSetting(); const check_darkmode = getDarkmodeSetting();
const darkmode_prefer = window.matchMedia('(prefers-color-scheme: dark)').matches; const darkmode_prefer = window.matchMedia('(prefers-color-scheme: dark)').matches;
if (darkmode_prefer && check_darkmode === null) { if (darkmode_prefer && check_darkmode === null) {
+28 -5
View File
@@ -17,6 +17,34 @@ taxonomies:
category: "categories" category: "categories"
enableEmoji: true enableEmoji: true
# menus
Menus:
main:
- identifier: blog
name: Blog
title: Blog posts
url: /blog
weight: 1
#Dropdown menu
# - identifier: dropdown
# title: Example dropdown menu
# name: Dropdown
# weight: 3
# - identifier: dropdown1
# title: example dropdown 1
# name: example 1
# url: /ew
# parent: dropdown
# weight: 1
# - identifier: dropdown2
# title: example dropdown 2
# name: example 2
# url: /34545
# parent: dropdown
# weight: 2
params: params:
version: 3 version: 3
customCSS: false customCSS: false
@@ -24,11 +52,6 @@ params:
favicon: "/images/fav.png" favicon: "/images/fav.png"
description: "A high performance hugo theme for personal portfolio and blog." description: "A high performance hugo theme for personal portfolio and blog."
# Navbar Menus
customMenus:
- name: "Blog"
Url: "/blog"
# home # home
disable_home: false disable_home: false
profile_image: "/images/profile.png" profile_image: "/images/profile.png"
+28 -5
View File
@@ -17,6 +17,34 @@ taxonomies:
category: "categories" category: "categories"
enableEmoji: true enableEmoji: true
# menus
Menus:
main:
- identifier: blog
name: Blog
title: Blog posts
url: /blog
weight: 1
#Dropdown menu
# - identifier: dropdown
# title: Example dropdown menu
# name: Dropdown
# weight: 3
# - identifier: dropdown1
# title: example dropdown 1
# name: example 1
# url: /ew
# parent: dropdown
# weight: 1
# - identifier: dropdown2
# title: example dropdown 2
# name: example 2
# url: /34545
# parent: dropdown
# weight: 2
params: params:
version: 3 version: 3
customCSS: false customCSS: false
@@ -24,11 +52,6 @@ params:
favicon: "/images/fav.png" favicon: "/images/fav.png"
description: "A high performance hugo theme for personal portfolio and blog." description: "A high performance hugo theme for personal portfolio and blog."
# Navbar Menus
customMenus:
- name: "Blog"
Url: "/blog"
# home # home
disable_home: false disable_home: false
profile_image: "/images/profile.png" profile_image: "/images/profile.png"