Skip to content

Commit

Permalink
feat: add nav (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
aliefprihantoro committed Nov 23, 2024
1 parent 916e61f commit b0b2101
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/view/nav/Nav.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import Nav from './'

export default {
render: () => {
return Nav
return Nav('/', 'Serabi Ngampin Bu Yuni')
},
}
export const nav = {}

33 changes: 33 additions & 0 deletions src/view/nav/bottom.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import List from '../../configs/links/nav'

let LIST_LINK = ''
for (let i = 0; i < List.length; i++) {
const { name, url, icon } = List[i]
LIST_LINK += html`
<li class="m-auto align-middle max-w-full text-white">
<a
href="${url}"
class="m-1 capitalize font-Rokkit font-bold flex
justify-center items-center flex-col md:flex-row "
data-tip="${name}">
${icon}
<span>${name}</span>
</a>
</li>
`
}
export default html`
<nav
class="fixed bottom-0 left-0 z-50 w-full
flex justify-center items-center
md:static md:justify-end md:items-end
"
data-aos="zoom-in">
<div class="w-fit h-fit m-auto md:mr-0">
<ul
class="menu menu-xs md:menu-md menu-horizontal bg-primary md:bg-transparent rounded-box align-middle">
${LIST_LINK}
</ul>
</div>
</nav>
`
15 changes: 14 additions & 1 deletion src/view/nav/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
export default html` <div>hello world</div> `
import NavBottom from './bottom'

export default function Nav(url: string, title: string) {
return html`
<div class="navbar bg-primary">
<header class="text-white">
<a class="btn btn-ghost text-xl" title="${title}" href="${url}">
${title}
</a>
</header>
${NavBottom}
</div>
`
}

0 comments on commit b0b2101

Please sign in to comment.