Skip to content

Commit 85cbc05

Browse files
committed
Backup Commit
1 parent 5eba825 commit 85cbc05

45 files changed

Lines changed: 1919 additions & 1134 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.vscode/extensions.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

.vscode/launch.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

.vscode/tasks.json

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,62 @@
11
export class Menubar {
22
private root: HTMLElement;
3-
private trigger: HTMLElement | null;
3+
private triggerBtn: HTMLButtonElement | null;
4+
private triggerIcon: HTMLElement | null;
45
private menu: HTMLElement | null;
6+
private links: NodeListOf<HTMLElement>;
57
private isOpen = false;
68

79
constructor(root: HTMLElement) {
810
this.root = root;
9-
this.trigger = this.root.querySelector(".menubar-trigger");
10-
this.menu = this.root.querySelector(".menubar-set-02");
11+
this.triggerBtn = this.root.querySelector('.menubar-trigger-btn');
12+
this.triggerIcon = this.root.querySelector('.menubar-trigger');
13+
this.menu = this.root.querySelector('.menubar-set-02');
14+
this.links = this.root.querySelectorAll('.menubar-link');
1115

1216
this.init();
1317
}
1418

1519
private init() {
16-
if (!this.trigger || !this.menu) return;
20+
if (!this.triggerBtn || !this.triggerIcon || !this.menu) return;
1721

1822
// ✅ start closed
1923
this.close();
2024

21-
// ✅ toggle on click
22-
this.trigger.addEventListener("click", () => {
25+
// ✅ toggle on click (button)
26+
this.triggerBtn.addEventListener('click', () => {
2327
this.isOpen ? this.close() : this.open();
2428
});
29+
30+
// ✅ close when clicking any link
31+
this.links.forEach((link) => {
32+
link.addEventListener('click', () => {
33+
this.close();
34+
});
35+
});
2536
}
2637

2738
private open() {
2839
this.isOpen = true;
29-
this.root.classList.add("menubar-open");
40+
this.root.classList.add('menubar-open');
3041

3142
// ✅ change icon
32-
this.trigger!.textContent = "close";
43+
this.triggerIcon!.textContent = 'close';
3344
}
3445

3546
private close() {
47+
if (!this.menu) return;
48+
49+
// ✅ add closing animation class
50+
this.root.classList.add('menubar-closing');
51+
52+
// ✅ change icon instantly
3653
this.isOpen = false;
37-
this.root.classList.remove("menubar-open");
54+
this.triggerIcon!.textContent = 'menu';
3855

39-
// ✅ change icon
40-
this.trigger!.textContent = "menu";
56+
// ✅ wait for animation to finish then hide
57+
setTimeout(() => {
58+
this.root.classList.remove('menubar-open');
59+
this.root.classList.remove('menubar-closing');
60+
}, 180); // must match animation time
4161
}
42-
}
62+
}

projects/css-fusion-g/src/lib/scss/_button.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
transition: all 0.1s;
2727

2828
.btn-icon {
29+
flex-shrink: 0;
2930
display: flex;
3031
align-items: center;
3132
justify-content: center;
@@ -83,6 +84,7 @@
8384
transition: all 0.1s;
8485

8586
.btn-icon {
87+
flex-shrink: 0;
8688
display: flex;
8789
align-items: center;
8890
justify-content: center;

projects/css-fusion-g/src/lib/scss/_menubar.scss

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
justify-content: center;
157157
}
158158

159-
.menubar-trigger {
159+
.menubar-trigger-btn {
160160
display: none !important;
161161
}
162162

@@ -165,8 +165,23 @@
165165
}
166166

167167
@media only screen and (max-width: 800px) {
168-
.menubar-trigger {
169-
display: block !important;
168+
.menubar-trigger-btn {
169+
display: flex !important;
170+
border: 1px solid #e2e2e2;
171+
border-radius: 8px;
172+
background-color: #fafafa;
173+
flex-direction: row;
174+
align-items: center;
175+
justify-content: center;
176+
gap: 10px;
177+
padding: 6px 10px;
178+
179+
.menubar-trigger {
180+
flex-shrink: 0;
181+
display: flex;
182+
align-items: center;
183+
justify-content: center;
184+
}
170185
}
171186

172187
.menubar-box {
@@ -190,6 +205,7 @@
190205
left: 0;
191206
padding: 20px;
192207
margin: unset;
208+
animation: menubarDropIn 220ms ease;
193209

194210
.menubar-link-center {
195211
height: fit-content;
@@ -217,4 +233,34 @@
217233
}
218234
}
219235
}
236+
237+
// ✅ CLOSE animation state
238+
.menubar-closing {
239+
.menubar-set-02 {
240+
display: block !important;
241+
animation: menubarDropOut 180ms ease forwards;
242+
}
243+
}
244+
}
245+
246+
@keyframes menubarDropIn {
247+
from {
248+
opacity: 0;
249+
transform: translateY(-12px);
250+
}
251+
to {
252+
opacity: 1;
253+
transform: translateY(0);
254+
}
255+
}
256+
257+
@keyframes menubarDropOut {
258+
from {
259+
opacity: 1;
260+
transform: translateY(0);
261+
}
262+
to {
263+
opacity: 0;
264+
transform: translateY(-12px);
265+
}
220266
}

projects/css-fusion-g/src/lib/scss/_nav.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,4 +271,4 @@
271271
.d-none {
272272
display: none !important;
273273
visibility: hidden;
274-
}
274+
}

projects/css-fusion-g/src/lib/scss/_templates.scss

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,47 @@
3030
overflow-y: auto;
3131
}
3232
}
33+
34+
@media only screen and (max-width: 800px) {
35+
.app-body {
36+
height: calc(var(--app-layout-height) - var(--menubar-height) - var(--navbar-mobile-height));
37+
grid-template-columns: 1fr !important;
38+
}
39+
40+
.navbar-box {
41+
width: 100% !important;
42+
height: var(--navbar-mobile-height) !important;
43+
grid
44+
45+
.navbar-set01, .navbar-set03 {
46+
display: none !important;
47+
}
48+
49+
.navbar-set02 {
50+
flex-direction: row !important;
51+
justify-content: flex-start;
52+
padding: 10px !important;
53+
overflow-y: hidden;
54+
overflow-x: auto !important;
55+
56+
.nav-menu {
57+
display: none;
58+
}
59+
60+
.navbar-link {
61+
flex-direction: column;
62+
align-items: center;
63+
justify-content: center;
64+
text-align: center;
65+
66+
.nav-txt {
67+
font-size: 12px;
68+
padding: 0 !important;
69+
}
70+
}
71+
}
72+
}
73+
}
3374
}
3475

3576
.neon-flow {

projects/css-fusion-g/src/lib/scss/_variables.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
--navbar-size: 260px;
8282
--navbar-set01-height: 68px;
8383
--navbar-resized: 80px;
84+
--navbar-mobile-height: 68px;
8485
--navbar-trigger-bg: #ffffff;
8586
--navbar-trigger-font: #000;
8687
--navbar-bg: #ffffff;

src/app/app-routing-module.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
import { NgModule } from '@angular/core';
22
import { RouterModule, Routes } from '@angular/router';
33
import { HashLocationStrategy, LocationStrategy } from '@angular/common';
4-
import { HomeComponent } from './home/home.component';
54

65
const routes: Routes = [
7-
{ path: '', redirectTo: 'Home', pathMatch: 'full' },
8-
{ path: 'Home', component: HomeComponent },
6+
{ path: '', redirectTo: 'components', pathMatch: 'full' },
97
{
10-
path: 'ComponentsModule',
8+
path: 'components',
119
loadChildren: () =>
1210
import('./components/components.module').then((m) => m.ComponentsModule),
1311
},
1412
{
15-
path: 'TemplatesModule',
13+
path: 'templates',
1614
loadChildren: () =>
1715
import('./templates/templates.module').then((m) => m.TemplatesModule),
1816
},

0 commit comments

Comments
 (0)