small tweaks

This commit is contained in:
2020-06-15 01:02:40 +02:00
parent 0613f5362a
commit 59c0b50a4e
7 changed files with 39 additions and 16 deletions

2
.gitignore vendored
View File

@@ -2,3 +2,5 @@
/public/build/ /public/build/
.DS_Store .DS_Store
.now

18
TODO.md
View File

@@ -1,13 +1,17 @@
- deploy
- now.sh, waiting for it to be purely front end
- purely front end except for mailing list
- remove repeated exercises
- make text inputs big enough for MAX_DIGITS_PROBLEMS and MAX_DIGITS_BITS - make text inputs big enough for MAX_DIGITS_PROBLEMS and MAX_DIGITS_BITS
- show a message on submit - show a message on submit
- show warning when specifying invalid number of bits or problems - show warning when specifying invalid number of bits or problems
- prevent submissions more than x times per time
- show a live-updating preview as you select different settings
- make it look nice
- add contact info - add contact info
- add 'about' - add 'about'
- add mailing list - add mailing list
- prompt at the end of a quiz to sign up for it
- uncomment PDF part
- add PDF export in pure front end
- does it work on mobile?
- add animations
- 'nuh-uh' shake for wrong answers
- nice reward animations for right answers
- make the placeholders become real text for a split second before starting
- super mario land pixellation animation
- deploy to production
- use a custom domain

View File

@@ -1,6 +1,6 @@
{ {
"name": "binary-quiz-frontend", "name": "binary-quiz-frontend",
"version": "0.0.1", "version": "0.0.3",
"author": "Zev Averbach <zev@averba.ch> (https://averba.ch)", "author": "Zev Averbach <zev@averba.ch> (https://averba.ch)",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {

View File

@@ -68,6 +68,9 @@ button:focus {
text-align: right; width: 2em; border: none; outline: none; text-align: right; width: 2em; border: none; outline: none;
} }
input:focus {
outline: none;
}
.primary-button { .primary-button {
cursor: pointer; cursor: pointer;

View File

@@ -14,6 +14,9 @@
} }
const submit = () => { const submit = () => {
if (!$num_problems){
num_problems.update(() => DEFAULT_NUM_PROBLEMS)
}
const problems_ = generateProblems($bits, $num_problems) const problems_ = generateProblems($bits, $num_problems)
problems.update(() => problems_) problems.update(() => problems_)
activeQuiz.update(() => true) activeQuiz.update(() => true)
@@ -33,7 +36,7 @@
type=number type=number
bind:value={$bits} bind:value={$bits}
> >
Bits bits
</label> </label>
<label> <label>
<input <input
@@ -44,9 +47,18 @@
type=number type=number
bind:value={$num_problems} bind:value={$num_problems}
> >
Number of Problems problems
</label> </label>
</div> </div>
<input class="primary-button" disabled={!$valid} type=submit value="Start Quiz" > <input class="primary-button" disabled={!$valid} type=submit value="Start Quiz [enter]" >
<input class="button" disabled={!$valid} type=button on:click={downloadAndClear} value="Download PDFs"> <!-- <input class="button" disabled={!$valid} type=button on:click={downloadAndClear} value="Download PDFs">-->
</form> </form>
<style>
input[type=number] {
font-size: 3em;
}
input[type=submit] {
font-size: 1.5em;
}
</style>

View File

@@ -36,7 +36,7 @@
<form on:submit|preventDefault={check} class="{class_} problem"> <form on:submit|preventDefault={check} class="{class_} problem">
<label> <label>
{problem} = {problem} =
<input autofocus type=number style="width: {$bits}em" bind:value={solution}> <input autofocus type=number bind:value={solution}>
</label> </label>
<input type=submit style="visibility: hidden"> <input type=submit style="visibility: hidden">
</form> </form>
@@ -45,8 +45,10 @@
<style> <style>
.problem { .problem {
font-size: 3em; font-size: 3em;
display: flex; }
flex-direction: row;
.problem input[type=number] {
border: none;
} }
.incorrect { .incorrect {
border: dodgerblue; border: dodgerblue;

View File

@@ -14,6 +14,6 @@ export const valid = derived([bits, num_problems], ([$bits, $num_problems]) => (
&& ($bits || DEFAULT_BITS) >= MIN_BITS && ($bits || DEFAULT_BITS) >= MIN_BITS
&& ($num_problems || DEFAULT_NUM_PROBLEMS) >= MIN_PROBLEMS && ($num_problems || DEFAULT_NUM_PROBLEMS) >= MIN_PROBLEMS
&& ($num_problems || DEFAULT_NUM_PROBLEMS) <= MAX_PROBLEMS && ($num_problems || DEFAULT_NUM_PROBLEMS) <= MAX_PROBLEMS
&& ($num_problems || DEFAULT_NUM_PROBLEMS) <= getMaxPermutations($bits) && ($num_problems || DEFAULT_NUM_PROBLEMS) <= getMaxPermutations($bits || DEFAULT_BITS)
)) ))