Skip to content
Open
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
40 changes: 40 additions & 0 deletions generator.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@

input[type=number] { width: 3em; }
label { display: inline-block; margin-right: 1em; }

.hidden { display: none; }

</style>
<script>
var bar_styles = [
Expand All @@ -52,6 +55,18 @@
'◯⬤',
'⚪⚫',
];
var allOptions = [
'percentage',
'min-size',
'max-size'
]
function makeURLToCurrentSettings() {
const url = new URL(window.location.href)
allOptions.forEach(opt => {
url.searchParams.set(opt, document.querySelector(`#${opt}`).value)
})
return url
}
function repeat(s, i) {
var r = '';
for(var j=0; j<i; j++) r += s;
Expand Down Expand Up @@ -102,6 +117,14 @@
r1.innerHTML += row;
r2.innerHTML += row;
}

const bookmarkLink = makeURLToCurrentSettings()
const bookmarkInput = document.querySelector('#bookmark-link')
bookmarkInput.value = bookmarkLink.toString()
bookmarkInput.classList.remove('hidden')
if (window.location.href !== bookmarkLink.toString()) {
window.location.replace(bookmarkLink)
}
}
</script>
</head>
Expand All @@ -122,6 +145,8 @@

<noscript>This application requires JavaScript.</noscript>

<label>Bookmark Link: <input type="text" id="bookmark-link" class="hidden" size="100"/></label>

<table id="sans-serif" style="display: none">
<thead><tr><th>Helvetica Neue<th>Arial<th>sans-serif<th>Delta</thead>
<tbody id="sans-serif-body"></tbody>
Expand All @@ -134,4 +159,19 @@

</div>
</body>
<script>
(() => {
const params = (new URL(window.location.href)).searchParams

const preSets = allOptions
.filter(opt => params.has(opt))

if (preSets.length) {
preSets.forEach(opt => {
document.querySelector(`#${opt}`).value = params.get(opt)
})
generate()
}
})()
</script>
</html>