Menu.svelte 1.05 KB
<script>
	import Menuitems from './Menuitems.svelte'

    // 메뉴 바 항목들
    const navItems = [
        { label: "Article1", href: "#article1" },
        { label: "Article2", href: "#article2" },
        { label: "Article3", href: "#article3" },
        { label: "Article4", href: "#article4" }
    ];
</script>

<style>
	nav {
		background-color: #4527a0;
		font-family: "Helvetica Neue", "Helvetica", "Arial", sans-serif;
		height: 70px;
		top: 0;
	}

	.inner {
		max-width: 500px;
		padding-left: 10px;
		padding-right: 10px;
		margin: auto;
		box-sizing: border-box;
		display: flex;
		align-items: center;
		height: 100%;
	}

	.logo {
		display: flex;
		position: absolute;
		color: white;
		width: 50px;
		left: 40px;
		top: 25px
	}

	.navbar-list {
		display: flex;
		padding: 0;
		width: 100%;
		justify-content: space-between;
		margin: 0;
	}
</style>

<nav>
	<div class="logo">Logo</div>
	<div class="inner">
        <ul class='navbar-list'>
        {#each navItems as item}
            <Menuitems {item}/>
        {/each}
        </ul>
    </div>
</nav>