Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to @siteup/cli for site building
Doesn't provide as much advantage here.
- Loading branch information
Showing
11 changed files
with
190 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import {toggleTheme} from './src/theme-switcher.js'; | ||
|
||
window.toggleTheme = toggleTheme | ||
|
||
const page = document.querySelector('body') | ||
const sansButton = document.querySelector('.style-sans') | ||
const serifButton = document.querySelector('.style-serif') | ||
const roundButton = document.querySelector('.style-round') | ||
const toggle = document.querySelector('.id') | ||
|
||
function round () { | ||
page.classList.toggle('serif', false) | ||
page.classList.toggle('round', true) | ||
|
||
sansButton.classList.toggle('current-page', false) | ||
serifButton.classList.toggle('current-page', false) | ||
roundButton.classList.toggle('current-page', true) | ||
} | ||
|
||
function serif () { | ||
page.classList.toggle('serif', true) | ||
page.classList.toggle('round', false) | ||
sansButton.classList.toggle('current-page', false) | ||
serifButton.classList.toggle('current-page', true) | ||
roundButton.classList.toggle('current-page', false) | ||
} | ||
|
||
function sans () { | ||
page.classList.toggle('serif', false) | ||
page.classList.toggle('round', false) | ||
sansButton.classList.toggle('current-page', true) | ||
serifButton.classList.toggle('current-page', false) | ||
roundButton.classList.toggle('current-page', false) | ||
} | ||
|
||
sansButton.addEventListener('click', sans) | ||
serifButton.addEventListener('click', serif) | ||
roundButton.addEventListener('click', round) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// The global.vars.js file should export default either an object, function that | ||
// returns an object or an async function that returns an object. | ||
// | ||
// These variables are available to every page, and have the lowest precedence. | ||
|
||
export default async function () { | ||
return { | ||
siteName: 'bcomnes/mine.css' | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { html, render } from 'uhtml-isomorphic' | ||
|
||
export default async function RootLayout ({ | ||
title, | ||
siteName, | ||
scripts, | ||
styles, | ||
children | ||
}) { | ||
return render(String, html` | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>${title ? `${title} | ` : ''}${siteName}</title> | ||
${scripts | ||
? scripts.map(script => html`<script src="${script}" type='module'></script>`) | ||
: null} | ||
${styles | ||
? styles.map(style => html`<link rel="stylesheet" href=${style} />`) | ||
: null} | ||
</head> | ||
<body> | ||
<nav class="top-bar"> | ||
<div class="top-bar-title"> | ||
<a href="/">mine.css</a> | ||
</div> | ||
<a class="top-bar-link" href="/guide/">guide</a> | ||
<a class="top-bar-link sans style-sans current-page">sans</a> | ||
<a class="top-bar-link serif style-serif">serif</a> | ||
<a class="top-bar-link round style-round">round</a> | ||
<span class="top-bar-link"><input class="dark-icon" onclick="toggleTheme()" type="image" alt="Toogle Theme" height="14" width="14" src="/light-dark.svg"></span> | ||
<div class="top-bar-right"> | ||
<a class="top-bar-link" href="https://github.com/bcomnes/mine.css/"> | ||
🐈 github | ||
</a> | ||
</div> | ||
</nav> | ||
<main class="markdown-body mine-layout"> | ||
${typeof children === 'string' ? html([children]) : children /* Support both uhtml and string children. Optional. */} | ||
</main> | ||
<footer> | ||
<a href="https://github.com/bcomnes/mine.css/issues"><small>💌</small></a> | ||
</footer> | ||
</body> | ||
</html> | ||
`) | ||
} |
This file was deleted.
Oops, something went wrong.