Skip to content

Commit

Permalink
Add Static Starter (#27)
Browse files Browse the repository at this point in the history
* Add Static Starter

---------

Co-authored-by: Florens Verschelde <[email protected]>
  • Loading branch information
sulco and fvsch authored Feb 6, 2024
1 parent 18b3454 commit fd1591a
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 0 deletions.
23 changes: 23 additions & 0 deletions static/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Home</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<!--
Need a visual blank slate?
Remove all code in `styles.css`!
-->
<link rel="stylesheet" href="styles.css" />
<script type="module" src="script.js"></script>
</head>
<body>
<nav>
<a href="/" aria-current="page">Home</a>
<a href="/page2.html">Other page</a>
</nav>
<main>
<h1>Home page</h1>
</main>
</body>
</html>
8 changes: 8 additions & 0 deletions static/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"scripts": {
"start": "servor --reload"
},
"dependencies": {
"servor": "^4.0.2"
}
}
19 changes: 19 additions & 0 deletions static/page2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Other page</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="styles.css" />
<script type="module" src="script.js"></script>
</head>
<body>
<nav>
<a href="/">Home</a>
<a href="/page2.html" aria-current="page">Other page</a>
</nav>
<main>
<h1>My other page</h1>
</main>
</body>
</html>
1 change: 1 addition & 0 deletions static/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log('Hello!');
46 changes: 46 additions & 0 deletions static/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
* {
box-sizing: border-box;
}

body {
margin: 0;
font-family: system-ui, sans-serif;
color: black;
background-color: white;
}

nav {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
padding: 0.5rem;
gap: 0.5rem;
border-bottom: solid 1px #aaa;
background-color: #eee;
}

nav a {
display: inline-block;
min-width: 9rem;
padding: 0.5rem;
border-radius: 0.2rem;
border: solid 1px #aaa;
text-align: center;
text-decoration: none;
color: #555;
}

nav a[aria-current='page'] {
color: #000;
background-color: #d4d4d4;
}

main {
padding: 1rem;
}

h1 {
font-weight: bold;
font-size: 1.5rem;
}

0 comments on commit fd1591a

Please sign in to comment.