Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ <h2>What not to do?</h2>
</main>

<footer>
<p>© <span data-js="year"></span> — How to survive in the forest 🌳</p>
<p>© <span data-js="date"></span> — How to survive in the forest 🌳</p>
</footer>
</body>
</html>
6 changes: 3 additions & 3 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const yearElement = document.querySelector('[data-js="year"]');
const year = new Date().getFullYear();
yearElement.textContent = year;
const dateElement = document.querySelector('[data-js="date"]');
const date = new Date().toLocaleDateString("en-US");
dateElement.textContent = date;
19 changes: 18 additions & 1 deletion styles.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
:root {
--font: system-ui;
--max-width: 60ch;
--body-padding: 2rem;

--color-text: rgb(0, 0, 0, 0.9);
--color-text-light: rgb(0, 0, 0, 0.6);
}

body {
width: min(var(--max-width), 100% - var(--body-padding));
margin: 0 auto;
width: min(100% - 2rem, 60ch);
color: var(--color-text);
font-family: var(--font);
}

footer {
margin-top: 2rem;
color: var(--color-text-light);
font-size: 0.8rem;
}