From 25c3af083945d029e6b76bfb00240ca6ede983dd Mon Sep 17 00:00:00 2001 From: Steven Clontz Date: Fri, 6 Dec 2024 02:36:27 +0000 Subject: [PATCH 1/7] add very simple open quesiton roller --- .../src/components/Questions/Questions.svelte | 34 +++++++++++++++++++ .../viewer/src/components/Questions/index.ts | 1 + .../src/routes/(app)/questions/+page.svelte | 8 +++++ .../src/routes/(app)/questions/+page.ts | 1 + 4 files changed, 44 insertions(+) create mode 100644 packages/viewer/src/components/Questions/Questions.svelte create mode 100644 packages/viewer/src/components/Questions/index.ts create mode 100644 packages/viewer/src/routes/(app)/questions/+page.svelte create mode 100644 packages/viewer/src/routes/(app)/questions/+page.ts diff --git a/packages/viewer/src/components/Questions/Questions.svelte b/packages/viewer/src/components/Questions/Questions.svelte new file mode 100644 index 00000000..cc4a23a4 --- /dev/null +++ b/packages/viewer/src/components/Questions/Questions.svelte @@ -0,0 +1,34 @@ + + +Does {openQuestion?.space.name} satisfy {openQuestion?.property.name}? diff --git a/packages/viewer/src/components/Questions/index.ts b/packages/viewer/src/components/Questions/index.ts new file mode 100644 index 00000000..9489a87d --- /dev/null +++ b/packages/viewer/src/components/Questions/index.ts @@ -0,0 +1 @@ +export { default as Questions } from './Questions.svelte' diff --git a/packages/viewer/src/routes/(app)/questions/+page.svelte b/packages/viewer/src/routes/(app)/questions/+page.svelte new file mode 100644 index 00000000..e0437b49 --- /dev/null +++ b/packages/viewer/src/routes/(app)/questions/+page.svelte @@ -0,0 +1,8 @@ + + + + +<Questions /> diff --git a/packages/viewer/src/routes/(app)/questions/+page.ts b/packages/viewer/src/routes/(app)/questions/+page.ts new file mode 100644 index 00000000..176ae642 --- /dev/null +++ b/packages/viewer/src/routes/(app)/questions/+page.ts @@ -0,0 +1 @@ +export const prerender = true From 4eae6515a8434e73ec4a0ccbf05acd06ac62fc61 Mon Sep 17 00:00:00 2001 From: Steven Clontz <steven.clontz@gmail.com> Date: Fri, 6 Dec 2024 02:48:02 +0000 Subject: [PATCH 2/7] typesetting --- .../viewer/src/components/Questions/Questions.svelte | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/viewer/src/components/Questions/Questions.svelte b/packages/viewer/src/components/Questions/Questions.svelte index cc4a23a4..03e54db8 100644 --- a/packages/viewer/src/components/Questions/Questions.svelte +++ b/packages/viewer/src/components/Questions/Questions.svelte @@ -1,5 +1,6 @@ <script lang="ts"> import type { Space, Property, Trait } from '@/types' + import Typeset from '../Shared/Typeset.svelte' import context from '@/context' const { spaces, traits } = context() let openQuestion: @@ -29,6 +30,15 @@ } } rollOpenQuestion() + $: bodyMain = `Does {S${openQuestion?.space.id}} satisfy {P${openQuestion?.property.id}}?` + $: bodySecondary = `Trait link: {S${openQuestion?.space.id}|P${openQuestion?.property.id}}` </script> -Does {openQuestion?.space.name} satisfy {openQuestion?.property.name}? +<div class="lead text-center my-5"> + <div class="mb-3" style="font-size:2em"> + <Typeset body={bodyMain} /> + </div> + <div> + <Typeset body={bodySecondary} /> + </div> +</div> From b6a837b4710e8a841ac5be7870138c4facb802c1 Mon Sep 17 00:00:00 2001 From: Steven Clontz <steven.clontz@gmail.com> Date: Fri, 6 Dec 2024 02:54:04 +0000 Subject: [PATCH 3/7] add re-roll feature --- packages/viewer/src/components/Questions/Questions.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/viewer/src/components/Questions/Questions.svelte b/packages/viewer/src/components/Questions/Questions.svelte index 03e54db8..6fdebf2f 100644 --- a/packages/viewer/src/components/Questions/Questions.svelte +++ b/packages/viewer/src/components/Questions/Questions.svelte @@ -35,10 +35,13 @@ </script> <div class="lead text-center my-5"> + <div class="mb-3"> + <button type="button" class="btn btn-outline-secondary btn-lg" on:click={()=>rollOpenQuestion()}>Reroll question</button> + </div> <div class="mb-3" style="font-size:2em"> <Typeset body={bodyMain} /> </div> - <div> + <div class="mb-3"> <Typeset body={bodySecondary} /> </div> </div> From c939239cb17091ef02a203b2aac336509c303672 Mon Sep 17 00:00:00 2001 From: Steven Clontz <steven.clontz@gmail.com> Date: Fri, 6 Dec 2024 03:07:16 +0000 Subject: [PATCH 4/7] styling, icon --- .../viewer/src/components/Questions/Questions.svelte | 11 +++++++++-- .../viewer/src/components/Shared/Icons/Dice.svelte | 10 ++++++++++ packages/viewer/src/components/Shared/Icons/index.ts | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 packages/viewer/src/components/Shared/Icons/Dice.svelte diff --git a/packages/viewer/src/components/Questions/Questions.svelte b/packages/viewer/src/components/Questions/Questions.svelte index 6fdebf2f..ca107dae 100644 --- a/packages/viewer/src/components/Questions/Questions.svelte +++ b/packages/viewer/src/components/Questions/Questions.svelte @@ -1,5 +1,6 @@ <script lang="ts"> import type { Space, Property, Trait } from '@/types' + import { Dice } from '../Shared/Icons' import Typeset from '../Shared/Typeset.svelte' import context from '@/context' const { spaces, traits } = context() @@ -34,9 +35,15 @@ $: bodySecondary = `Trait link: {S${openQuestion?.space.id}|P${openQuestion?.property.id}}` </script> -<div class="lead text-center my-5"> +<div class="lead text-center my-3"> <div class="mb-3"> - <button type="button" class="btn btn-outline-secondary btn-lg" on:click={()=>rollOpenQuestion()}>Reroll question</button> + <button + type="button" + class="btn btn-outline-secondary" + on:click={() => rollOpenQuestion()} + > + <Dice /> Reroll question + </button> </div> <div class="mb-3" style="font-size:2em"> <Typeset body={bodyMain} /> diff --git a/packages/viewer/src/components/Shared/Icons/Dice.svelte b/packages/viewer/src/components/Shared/Icons/Dice.svelte new file mode 100644 index 00000000..b93c4685 --- /dev/null +++ b/packages/viewer/src/components/Shared/Icons/Dice.svelte @@ -0,0 +1,10 @@ +<svg + fill="currentColor" + viewBox="0 0 640 512" + height="1.5em" + width="1.5em" + xmlns="http://www.w3.org/2000/svg" + ><!--!Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path + d="M592 192H473.3c12.7 29.6 7.1 65.2-17 89.3L320 417.6V464c0 26.5 21.5 48 48 48h224c26.5 0 48-21.5 48-48V240c0-26.5-21.5-48-48-48zM480 376c-13.3 0-24-10.8-24-24 0-13.3 10.8-24 24-24s24 10.7 24 24c0 13.3-10.8 24-24 24zm-46.4-186.7L258.7 14.4c-19.2-19.2-50.2-19.2-69.4 0L14.4 189.3c-19.2 19.2-19.2 50.2 0 69.4L189.3 433.6c19.2 19.2 50.2 19.2 69.4 0L433.6 258.7c19.2-19.2 19.2-50.2 0-69.4zM96 248c-13.3 0-24-10.8-24-24 0-13.3 10.8-24 24-24s24 10.7 24 24c0 13.3-10.8 24-24 24zm128 128c-13.3 0-24-10.8-24-24 0-13.3 10.8-24 24-24s24 10.7 24 24c0 13.3-10.8 24-24 24zm0-128c-13.3 0-24-10.8-24-24 0-13.3 10.8-24 24-24s24 10.7 24 24c0 13.3-10.8 24-24 24zm0-128c-13.3 0-24-10.8-24-24 0-13.3 10.8-24 24-24s24 10.7 24 24c0 13.3-10.8 24-24 24zm128 128c-13.3 0-24-10.8-24-24 0-13.3 10.8-24 24-24s24 10.7 24 24c0 13.3-10.8 24-24 24z" + /></svg +> diff --git a/packages/viewer/src/components/Shared/Icons/index.ts b/packages/viewer/src/components/Shared/Icons/index.ts index 57ae5ce1..15267334 100644 --- a/packages/viewer/src/components/Shared/Icons/index.ts +++ b/packages/viewer/src/components/Shared/Icons/index.ts @@ -1,5 +1,6 @@ export { default as Branch } from './Branch.svelte' export { default as Check } from './Check.svelte' +export { default as Dice } from './Dice.svelte' export { default as Question } from './Question.svelte' export { default as Repeat } from './Repeat.svelte' export { default as Search } from './Search.svelte' From 7e2fa935c5071fb949ac3dca27c2806cd3864e93 Mon Sep 17 00:00:00 2001 From: Steven Clontz <steven.clontz@gmail.com> Date: Fri, 6 Dec 2024 03:11:49 +0000 Subject: [PATCH 5/7] disclaimer, styling --- .../viewer/src/components/Questions/Questions.svelte | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/viewer/src/components/Questions/Questions.svelte b/packages/viewer/src/components/Questions/Questions.svelte index ca107dae..7d708a71 100644 --- a/packages/viewer/src/components/Questions/Questions.svelte +++ b/packages/viewer/src/components/Questions/Questions.svelte @@ -35,7 +35,7 @@ $: bodySecondary = `Trait link: {S${openQuestion?.space.id}|P${openQuestion?.property.id}}` </script> -<div class="lead text-center my-3"> +<div class="text-center my-3"> <div class="mb-3"> <button type="button" @@ -45,10 +45,15 @@ <Dice /> Reroll question </button> </div> - <div class="mb-3" style="font-size:2em"> + <div class="lead mb-3" style="font-size:2em"> <Typeset body={bodyMain} /> </div> <div class="mb-3"> <Typeset body={bodySecondary} /> </div> + <p> + <small> + Disclaimer: some questions cannot be answered in ZFC! + </small> + </p> </div> From 999411bcf55f64d37be3f773133a0d6e4f6f14c4 Mon Sep 17 00:00:00 2001 From: Steven Clontz <steven.clontz@gmail.com> Date: Fri, 6 Dec 2024 03:13:20 +0000 Subject: [PATCH 6/7] add link to nav --- packages/viewer/src/components/Nav.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/viewer/src/components/Nav.svelte b/packages/viewer/src/components/Nav.svelte index 2e298f25..7ab55cba 100644 --- a/packages/viewer/src/components/Nav.svelte +++ b/packages/viewer/src/components/Nav.svelte @@ -18,6 +18,7 @@ <a class="nav-link" href="/spaces/all">Spaces</a> <a class="nav-link" href="/properties">Properties</a> <a class="nav-link" href="/theorems">Theorems</a> + <a class="nav-link" href="/questions">Questions</a> </div> <div class="navbar-nav"> From afc2ec97e77c0b972f9271a276a3422aa256cbd5 Mon Sep 17 00:00:00 2001 From: Steven Clontz <steven.clontz@gmail.com> Date: Fri, 6 Dec 2024 03:15:07 +0000 Subject: [PATCH 7/7] =?UTF-8?q?=F0=9F=A7=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/viewer/src/components/Questions/Questions.svelte | 4 +--- packages/viewer/src/components/Shared/Icons/Dice.svelte | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/viewer/src/components/Questions/Questions.svelte b/packages/viewer/src/components/Questions/Questions.svelte index 7d708a71..533c8faa 100644 --- a/packages/viewer/src/components/Questions/Questions.svelte +++ b/packages/viewer/src/components/Questions/Questions.svelte @@ -52,8 +52,6 @@ <Typeset body={bodySecondary} /> </div> <p> - <small> - Disclaimer: some questions cannot be answered in ZFC! - </small> + <small> Disclaimer: some questions cannot be answered in ZFC! </small> </p> </div> diff --git a/packages/viewer/src/components/Shared/Icons/Dice.svelte b/packages/viewer/src/components/Shared/Icons/Dice.svelte index b93c4685..2760c070 100644 --- a/packages/viewer/src/components/Shared/Icons/Dice.svelte +++ b/packages/viewer/src/components/Shared/Icons/Dice.svelte @@ -1,4 +1,4 @@ -<svg +<svg fill="currentColor" viewBox="0 0 640 512" height="1.5em"