mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Added: Reviewer framework
This commit is contained in:
parent
7805b1b426
commit
eac356139c
6 changed files with 57 additions and 2 deletions
|
@ -1,5 +1,17 @@
|
||||||
<script>
|
<script>
|
||||||
import ReviewerBottomOuter from "./reviewer-bottom/ReviewerBottomOuter.svelte";
|
import ReviewerBottomOuter from "./reviewer-bottom/ReviewerBottomOuter.svelte";
|
||||||
|
import ReviewerOuter from "./reviewerOuter.svelte";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ReviewerBottomOuter></ReviewerBottomOuter>
|
<div>
|
||||||
|
<ReviewerOuter></ReviewerOuter>
|
||||||
|
<ReviewerBottomOuter></ReviewerBottomOuter>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
div {
|
||||||
|
height: calc(100vh - 40px);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
@ -6,7 +6,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import { onMount } from "svelte";
|
import { onMount } from "svelte";
|
||||||
import ReviewerBottom from "./ReviewerBottom.svelte";
|
import ReviewerBottom from "./ReviewerBottom.svelte";
|
||||||
import "./index.scss";
|
import "./index.scss";
|
||||||
import { setupBottomBar } from "./reviewer";
|
import { setupBottomBar } from "./reviewer-bottom";
|
||||||
|
|
||||||
let reviewerInfo: null | ReturnType<typeof setupBottomBar> = null;
|
let reviewerInfo: null | ReturnType<typeof setupBottomBar> = null;
|
||||||
|
|
||||||
|
|
15
ts/routes/reviewer/reviewer.svelte
Normal file
15
ts/routes/reviewer/reviewer.svelte
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
<script lang="ts">
|
||||||
|
import type { Writable } from "svelte/store";
|
||||||
|
|
||||||
|
export let html: Writable<string>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="qa">
|
||||||
|
{@html $html}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.qa {
|
||||||
|
flex: 1
|
||||||
|
}
|
||||||
|
</style>
|
7
ts/routes/reviewer/reviewer.ts
Normal file
7
ts/routes/reviewer/reviewer.ts
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
import { writable } from "svelte/store"
|
||||||
|
|
||||||
|
export function setupReviewer() {
|
||||||
|
const html = writable("")
|
||||||
|
|
||||||
|
return {html}
|
||||||
|
}
|
21
ts/routes/reviewer/reviewerOuter.svelte
Normal file
21
ts/routes/reviewer/reviewerOuter.svelte
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
<!--
|
||||||
|
Copyright: Ankitects Pty Ltd and contributors
|
||||||
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
-->
|
||||||
|
<script lang="ts">
|
||||||
|
import { onMount } from "svelte";
|
||||||
|
import { setupReviewer } from "./reviewer";
|
||||||
|
import Reviewer from "./reviewer.svelte";
|
||||||
|
|
||||||
|
import "../../reviewer/reviewer.scss"
|
||||||
|
|
||||||
|
let reviewerInfo: null | ReturnType<typeof setupReviewer> = null;
|
||||||
|
|
||||||
|
onMount(() => {
|
||||||
|
reviewerInfo = setupReviewer()
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#if reviewerInfo}
|
||||||
|
<Reviewer {...reviewerInfo}></Reviewer>
|
||||||
|
{/if}
|
Loading…
Reference in a new issue