Skip to content

Commit 53b78cc

Browse files
Fabio BrasileiroFabio Brasileiro
authored andcommitted
menu dinamico
1 parent 7012341 commit 53b78cc

5 files changed

Lines changed: 56 additions & 2 deletions

File tree

package-lock.json

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"@angular/router": "^17.3.0",
2323
"@fortawesome/angular-fontawesome": "^0.14.1",
2424
"angular-font-awesome": "^3.1.2",
25+
"flowbite": "^2.3.0",
2526
"rxjs": "~7.8.0",
2627
"tslib": "^2.3.0",
2728
"zone.js": "~0.14.3"

src/app/page/header-landing-page/header-landing-page.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<!-- <a href="#" class="text-gray-800 dark:text-white hover:bg-gray-50 focus:ring-4 focus:ring-gray-300 font-medium rounded-lg text-sm px-4 lg:px-5 py-2 lg:py-2.5 sm:mr-2 dark:hover:bg-gray-700 focus:outline-none dark:focus:ring-gray-800">Log in</a> -->
1515
<!-- <a href="https://themesberg.com/product/tailwind-css/landing-page"
1616
class="text-white bg-green-700 hover:bg-green-800 focus:ring-4 focus:ring-green-300 font-medium rounded-lg text-sm px-4 lg:px-5 py-2 lg:py-2.5 sm:mr-2 lg:mr-0 dark:bg-green-600 dark:hover:bg-green-700 focus:outline-none dark:focus:ring-green-800">Download</a> -->
17-
<button data-collapse-toggle="mobile-menu-2" type="button"
17+
<button data-collapse-toggle="mobile-menu-2" type="button" (click)="removerHidden()"
1818
class="inline-flex items-center p-2 ml-1 text-sm text-gray-500 rounded-lg lg:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600"
1919
aria-controls="mobile-menu-2" aria-expanded="false">
2020
<span class="sr-only">Open main menu</span>

src/app/page/header-landing-page/header-landing-page.component.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,42 @@ import { ButtonToggleDarkLightComponent } from '../button-toggle-dark-light/butt
1111
export class HeaderLandingPageComponent {
1212
inicio() {
1313
document.getElementById('inicio')?.scrollIntoView({ behavior: 'smooth' });
14+
if (window.innerWidth < 10) {
15+
this.removerHidden();
16+
}
1417
}
1518
porqueJava() {
1619
document
1720
.getElementById('porqueJava')
1821
?.scrollIntoView({ behavior: 'smooth' });
22+
if (window.innerWidth < 1024) {
23+
this.removerHidden();
24+
}
1925
}
2026
sobre() {
2127
document.getElementById('sobre')?.scrollIntoView({ behavior: 'smooth' });
28+
if (window.innerWidth < 1024) {
29+
this.removerHidden();
30+
}
2231
}
2332
evento() {
2433
document.getElementById('evento')?.scrollIntoView({ behavior: 'smooth' });
34+
if (window.innerWidth < 1024) {
35+
this.removerHidden();
36+
}
2537
}
2638
contato() {
2739
document.getElementById('contato')?.scrollIntoView({ behavior: 'smooth' });
40+
if (window.innerWidth < 1024) {
41+
this.removerHidden();
42+
}
43+
}
44+
45+
// Método para remover a classe 'hidden'
46+
removerHidden() {
47+
const mobileMenu = document.getElementById('mobile-menu-2');
48+
if (mobileMenu) {
49+
mobileMenu.classList.toggle('hidden');
50+
}
2851
}
2952
}

tailwind.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ module.exports = {
77
},
88
purge: [
99
'./src/**/*.html'
10-
]
10+
],
11+
plugins: [
12+
require('flowbite/plugin')
13+
]
1114
// plugins: [require("taos/plugin")],
1215
// safelist: [
1316
// "!duration-[0ms]",

0 commit comments

Comments
 (0)