Skip to content

Commit

Permalink
refactor: routing 로직 변경 및 parcel 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
rjc1704 committed Jun 4, 2023
1 parent e0547b3 commit 0bf8f3a
Show file tree
Hide file tree
Showing 12 changed files with 3,278 additions and 107 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.sass-cache/
*.css.map
*.sass.map
*.scss.map
.parcel-cache/
dist/
node_modules/
.vscode/
40 changes: 20 additions & 20 deletions css/styles.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
html,
* {
margin: 0;
padding: 0;
}

body {
box-sizing: border-box;
font-family: sans-serif;
margin: 0;
height: 100%;
display: flex;
}
h1 {
margin-bottom: 2rem;
}
h2 {
margin-bottom: 2rem;
}

p {
margin-block-start: 0;
text-indent: 1rem;
margin-bottom: 2rem;
}

hr {
Expand All @@ -18,37 +28,27 @@ hr {
margin: 1.5rem 0 1rem 0;
}

#container {
display: flex;
width: 100%;
height: 100%;
}

#root {
flex-grow: 1;
}

.sidebar {
display: flex;
flex-direction: column;
padding: 1rem;

border-right: 1px solid lightgray;
}

.sidebar > a {
margin: 0.5rem 0;
}

#root {
padding-top: 2rem;
flex-grow: 1;
}

.page-container {
display: flex;
flex-direction: column;

padding: 0 1rem;
}

.align-center {
align-items: center;
padding: 0 1rem;
}

.socials-container {
Expand Down
17 changes: 7 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,16 @@
<meta charset="UTF-8" />
<link rel="stylesheet" href="css/styles.css" />
<link href="https://cdn.jsdelivr.net/npm/@mdi/[email protected]/css/materialdesignicons.min.css" rel="stylesheet" />
<script src="src/main.js" type="module"></script>
</head>

<body>
<div id="container">
<nav id="main-nav" class="sidebar">
<a href="/" onclick="route(event)">Home</a>
<a href="#about" onclick="route(event)">About</a>
<a href="#lorem" onclick="route(event)">Lorem</a>
</nav>
<div id="root"></div>
</div>

<script type="module" src="src/router.js"></script>
<nav class="sidebar">
<a href="#/">Home</a>
<a href="#/about">About</a>
<a href="#/lorem">Lorem</a>
</nav>
<div id="root"></div>
</body>

</html>
Loading

0 comments on commit 0bf8f3a

Please sign in to comment.