Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements and Updates #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "themeplate",
"version": "3.1.1",
"version": "3.2.0",
"description": "Gulp and Tailwindcss boilerplate for creating HTML templates",
"author": "Zeon Studio",
"license": "MIT",
Expand Down Expand Up @@ -31,7 +31,7 @@
"jshint-stylish": "^2.2.1",
"postcss": "^8.4.38",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.13",
"prettier-plugin-tailwindcss": "^0.6.5",
"sass": "^1.75.0",
"tailwind-bootstrap-grid": "^5.1.0",
"tailwindcss": "^3.4.3"
Expand Down
14 changes: 8 additions & 6 deletions src/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,16 @@
<li class="nav-item nav-dropdown group relative">
<span class="nav-link inline-flex items-center">
Pages
<svg class="h-4 w-4 fill-current" viewBox="0 0 20 20">
<path
d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"
/>
</svg>
<span class="arrow-icon">
<svg class="h-4 w-4 fill-current" viewBox="0 0 20 20">
<path
d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"
/>
</svg>
</span>
</span>
<ul
class="nav-dropdown-list hidden group-hover:block lg:invisible lg:absolute lg:block lg:opacity-0 lg:group-hover:visible lg:group-hover:opacity-100"
class="nav-dropdown-list hidden lg:invisible lg:absolute lg:block lg:opacity-0 lg:group-hover:visible lg:group-hover:opacity-100 translate-y-1 lg:group-hover:translate-y-0 lg:transition-all lg:duration-300"
>
<li class="nav-dropdown-item">
<a href="contact.html" class="nav-dropdown-link">Contact</a>
Expand Down
11 changes: 11 additions & 0 deletions src/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@
// document.querySelector(".preloader").style.display = "none";
// });

// ##################### Dropdown Menu Toggler For Mobile ###################
const dropdownMenuToggler =
document.querySelectorAll(".nav-dropdown > .nav-link");

dropdownMenuToggler.forEach((toggler) => {
toggler?.addEventListener("click", (e) => {
const target = e.target;
target && target.parentElement?.classList.toggle("active");
});
});

// ########################## Theme switcher ##########################
var darkMode = false;
var themeSwitch = document.querySelectorAll("[data-theme-switcher]");
Expand Down
2 changes: 1 addition & 1 deletion src/styles/buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
}

.btn-sm {
@apply rounded-sm px-4 py-1.5 text-sm;
@apply rounded-sm px-4 py-1.5 text-base-sm md:text-sm;
}

.btn-primary {
Expand Down
35 changes: 33 additions & 2 deletions src/styles/navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ input#nav-toggle:checked + label #hide-button {
}

input#nav-toggle:checked ~ #nav-menu {
@apply block;
@apply max-lg:block;
}

.header {
Expand Down Expand Up @@ -37,14 +37,45 @@ input#nav-toggle:checked ~ #nav-menu {

.nav-link {
@apply text-dark hover:text-primary dark:text-darkmode-dark dark:hover:text-darkmode-primary block p-3 font-semibold transition lg:px-2 lg:py-3;

.arrow-icon {
@apply relative -z-10 inline-block align-[-2px] ml-1.5 text-xs/snug transition-transform duration-300;
}
}

.nav-dropdown {
@apply mr-0;

// For Large Devices (Dropdown Arrow Icon)
&:hover .nav-link .arrow-icon {
@apply lg:rotate-180 lg:transform;
}

// For Small Devices
&.active {
// Dropdown Arrow Icon
.nav-link {
.arrow-icon {
@apply max-lg:rotate-180 max-lg:transform;
}
.icon {
@apply max-lg:rotate-180;
}
}

// Show Dropdown Menu On Click
.nav-dropdown-list {
@apply max-lg:block;
}
}
}

.nav-dropdown-list {
@apply z-10 min-w-[180px] rounded bg-body p-4 shadow dark:bg-darkmode-body;
@apply mx-auto min-w-[180px] max-w-[200px] rounded bg-body dark:bg-dark p-3 shadow lg:border dark:lg:border-transparent;

.nav-dropdown-link {
@apply block rounded px-3 py-1.5 font-medium text-dark/70 transition hover:bg-primary/5 dark:hover:bg-white/10 dark:hover:text-light hover:text-primary;
}
}

.nav-dropdown-item {
Expand Down