@sofidevo/astro-dynamic-header 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sofidevo/astro-dynamic-header",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "A dynamic Astro header component that switches between floating and fullscreen styles",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/Header.astro CHANGED
@@ -77,7 +77,7 @@ const {
77
77
  </a>
78
78
  <NavMenu menuItems={menuItems} />
79
79
  <HamburgerButton />
80
- <MobileNav menuItems={menuItems} />
80
+ <MobileNav menuItems={menuItems} type={headerType} />
81
81
  </header>
82
82
  </div>
83
83
 
@@ -147,4 +147,9 @@ const {
147
147
  margin-right: 1rem;
148
148
  object-fit: contain;
149
149
  }
150
+
151
+ /* Adjust transform for fullscreen header */
152
+ .header--fullscreen .mobile-header__menu.is-active {
153
+ transform: translate(0%);
154
+ }
150
155
  </style>
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  export interface Props {
3
+ type?: "floating" | "fullscreen";
3
4
  menuItems?: Array<{
4
5
  link: string;
5
6
  text: string;
@@ -9,6 +10,7 @@ export interface Props {
9
10
  submenu?: Array<{
10
11
  link: string;
11
12
  text: string;
13
+
12
14
  }>;
13
15
  }>;
14
16
  }>;
@@ -17,6 +19,8 @@ export interface Props {
17
19
  accentColor?: string;
18
20
  }
19
21
 
22
+ const {type} = Astro.props;
23
+
20
24
  const {
21
25
  menuItems = [],
22
26
  showHomeLink = true,
@@ -27,7 +31,7 @@ const {
27
31
  const pagePathname = Astro.url.pathname;
28
32
  ---
29
33
 
30
- <nav class="mobile-header__menu" id="mobile-header-menu" style={`--mobile-accent-color: ${accentColor};`}>
34
+ <nav class={`mobile-header__menu mobile-header__menu--${type}`} id="mobile-header-menu" style={`--mobile-accent-color: ${accentColor};`}>
31
35
  <ol class="mobile-menu">
32
36
  {showHomeLink && pagePathname !== "/" && (
33
37
  <li class="header__item mobile-header__item">
@@ -190,6 +194,11 @@ const pagePathname = Astro.url.pathname;
190
194
  transform: translateX(-7%);
191
195
  }
192
196
 
197
+ /* Adjust transform for fullscreen header */
198
+ .mobile-header__menu--fullscreen.is-active {
199
+ transform: translate(0%);
200
+ }
201
+
193
202
  .menu__summary {
194
203
  width: 100%;
195
204
  font-size: 1.7rem;