Skip to content

Commit

Permalink
style: fix code style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kantord committed Feb 26, 2021
1 parent 03f8b0a commit 241c520
Show file tree
Hide file tree
Showing 20 changed files with 303 additions and 245 deletions.
3 changes: 2 additions & 1 deletion apps/web/src/components/ChallengePanel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
class:typo
class="panel is-primary"
out:slide|local="{{ duration: 100 }}"
in:slide|local="{{ duration: 300, delay: 50 }}">
in:slide|local="{{ duration: 300, delay: 50 }}"
>
<div class="panel-block">
<div class="control">
<div class="left">
Expand Down
21 changes: 14 additions & 7 deletions apps/web/src/components/ChallengeScreen.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,17 @@
<div
class="challenge"
in:fade|local="{{ duration: 300, delay: 350 }}"
out:fade|local="{{ duration: 300 }}">
out:fade|local="{{ duration: 300 }}"
>
{#if challenge.type === "cards"}
<DeckChallenge
skipChallenge="{skipChallenge}"
currentChallenge="{currentChallenge}"
alternativeChallenges="{alternativeChallenges}"
resolveChallenge="{resolveChallenge}"
registerResult="{registerResult}"
skipAllChallenges="{skipAllChallenges}" />
skipAllChallenges="{skipAllChallenges}"
/>
{/if}
{#if challenge.type === "options"}
<OptionChallenge
Expand All @@ -131,7 +133,8 @@
alternativeChallenges="{alternativeChallenges}"
resolveChallenge="{resolveChallenge}"
registerResult="{registerResult}"
skipAllChallenges="{skipAllChallenges}" />
skipAllChallenges="{skipAllChallenges}"
/>
{/if}
{#if challenge.type === "shortInput"}
<ShortInputChallenge
Expand All @@ -142,7 +145,8 @@
registerResult="{registerResult}"
resolveChallenge="{resolveChallenge}"
challenge="{challenge}"
skipAllChallenges="{skipAllChallenges}" />
skipAllChallenges="{skipAllChallenges}"
/>
{/if}
{#if challenge.type === "listeningExercise"}
<ListeningChallenge
Expand All @@ -153,15 +157,17 @@
resolveChallenge="{resolveChallenge}"
challenge="{challenge}"
skipAllChallenges="{skipAllChallenges}"
skipAllVoice="{skipAllVoice}" />
skipAllVoice="{skipAllVoice}"
/>
{/if}
{#if challenge.type === "chips"}
<ChipsChallenge
registerResult="{registerResult}"
resolveChallenge="{resolveChallenge}"
challenge="{challenge}"
skipChallenge="{skipChallenge}"
skipAllChallenges="{skipAllChallenges}" />
skipAllChallenges="{skipAllChallenges}"
/>
{/if}
</div>
{/if}
Expand All @@ -176,7 +182,8 @@
courseURL="{courseURL}"
rawChallenges="{rawChallenges}"
skillId="{skillId}"
stats="{stats}" />
stats="{stats}"
/>
</div>
{/if}

Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/components/GitHubButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
inverted
info
size="{size}"
href="https://github.com/kantord/LibreLingo">
href="https://github.com/kantord/LibreLingo"
>
{#if stars}
<span class="tag is-white">
<span class="stars">{stars}</span>
Expand Down
6 changes: 4 additions & 2 deletions apps/web/src/components/InputFieldWithVirtualKeyboard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
lang="{languageCode}"
use:focusMe
bind:value
bind:this="{inputFieldRef}" />
bind:this="{inputFieldRef}"
/>

<div class="keyboard">
{#each specialCharacters as specialCharacter}
Expand All @@ -77,7 +78,8 @@
key
size="small"
disabled="{disabled}"
on:click="{handleVirtualKey(specialCharacter)}">
on:click="{handleVirtualKey(specialCharacter)}"
>
{specialCharacter}
</Button>
{/each}
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/components/LicenseLogo.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<img
src="images/agpl-logo.svg"
alt="Licensed under AGPL - Free as in Freedom" />
alt="Licensed under AGPL - Free as in Freedom"
/>

<style type="text/scss">
img {
Expand Down
21 changes: 14 additions & 7 deletions apps/web/src/components/ListeningChallenge.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
specialCharacters="{specialCharacters}"
languageCode="{languageCode}"
disabled="{submitted}"
bind:value="{answer}" />
bind:value="{answer}"
/>
</Column>
</Columns>

Expand All @@ -103,7 +104,8 @@
submit
skipAction="{skipChallenge}"
skipAllAction="{skipAllChallenges}"
skipAllVoice="{skipAllVoice}" />
skipAllVoice="{skipAllVoice}"
/>
{/if}

{#if answer === "" && !submitted}
Expand All @@ -112,7 +114,8 @@
buttonText="{null}"
skipAction="{skipChallenge}"
skipAllAction="{skipAllChallenges}"
skipAllVoice="{skipAllVoice}" />
skipAllVoice="{skipAllVoice}"
/>
{/if}

{#if submitted}
Expand All @@ -122,7 +125,8 @@
messageDetail="{`Correct answer: ${challenge.answer}`}"
buttonText="Continue"
incorrect
buttonAction="{finishChallenge}" />
buttonAction="{finishChallenge}"
/>
{/if}

{#if correct}
Expand All @@ -132,16 +136,19 @@
messageDetail="{`Meaning: "${challenge.meaning}"`}"
buttonText="Continue"
correct
buttonAction="{finishChallenge}" />
buttonAction="{finishChallenge}"
/>
{/if}
{#if spellingSuggestion}
<ChallengePanel
message="You have a typo!"
messageDetail="{spellingSuggestion || `Meaning: "${challenge.meaning}"`}"
messageDetail="{spellingSuggestion ||
`Meaning: "${challenge.meaning}"`}"
buttonText="Continue"
typo
buttonAction="{finishChallenge}" />
buttonAction="{finishChallenge}"
/>
{/if}
{/if}
{/if}
Expand Down
6 changes: 4 additions & 2 deletions apps/web/src/components/NavBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
class:dark
class:is-hidden-mobile="{is_hidden_mobile}"
role="navigation"
aria-label="main navigation">
aria-label="main navigation"
>
<div class="navbar-brand">
<a class="navbar-item" href="/">
<img src="/images/logo.svg" alt="LibreLingo" />
Expand All @@ -40,7 +41,8 @@
size="small"
outlined
inverted
info>
info
>
Log out
</Button>
{:else}
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/components/Option.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
<div
class="option"
data-test="{active ? 'active' : inactive ? 'inactive' : 'neutral'}"
data-test-correct="{correct}">
data-test-correct="{correct}"
>
<div class="option-content">
<div class="is-size-5 is-size-6-mobile">{formInTargetLanguage}</div>
</div>
Expand Down
6 changes: 4 additions & 2 deletions apps/web/src/components/OptionCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
<div
class="card"
data-test="{active ? 'active' : inactive ? 'inactive' : 'neutral'}"
data-test-correct="{correct}">
data-test-correct="{correct}"
>
<div class="card-image">
<figure class="image is-1by1">
<img src="{`images/${picture}`}" alt="" />
Expand All @@ -22,7 +23,8 @@
{formInTargetLanguage}
</div>
<div
class="is-size-6 has-text-centered is-hidden-touch is-hidden-tablet-only">
class="is-size-6 has-text-centered is-hidden-touch is-hidden-tablet-only"
>
{number}
</div>
</div>
Expand Down
6 changes: 4 additions & 2 deletions apps/web/src/components/OptionDeck.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@
value="{i}"
name="{i}"
id="{i}"
disabled="{disabled}" />
disabled="{disabled}"
/>
<OptionCard
correct="{correct}"
active="{selectedOption === i}"
inactive="{selectedOption !== null && selectedOption !== i}"
picture="{shuffle(pictures)[0]}"
number="{i + 1 - (keymap[i] - i) + 1}"
formInTargetLanguage="{formInTargetLanguage}" />
formInTargetLanguage="{formInTargetLanguage}"
/>
</label>
{/each}
</ul>
Expand Down
6 changes: 4 additions & 2 deletions apps/web/src/components/Options.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@
value="{i}"
name="{i}"
id="{i}"
disabled="{disabled}" />
disabled="{disabled}"
/>
<Option
correct="{correct}"
active="{selectedOption === i}"
inactive="{selectedOption !== null && selectedOption !== i}"
formInTargetLanguage="{formInTargetLanguage}" />
formInTargetLanguage="{formInTargetLanguage}"
/>
</label>
{/each}
</ul>
Expand Down
18 changes: 12 additions & 6 deletions apps/web/src/components/ShortInputChallenge.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
specialCharacters="{specialCharacters}"
languageCode="{languageCode}"
disabled="{submitted}"
bind:value="{answer}" />
bind:value="{answer}"
/>
</Column>
<Column>
<div class="card">
Expand All @@ -92,15 +93,17 @@
buttonText="Submit"
submit
skipAction="{skipChallenge}"
skipAllAction="{skipAllChallenges}" />
skipAllAction="{skipAllChallenges}"
/>
{/if}

{#if answer === "" && !submitted}
<ChallengePanel
message="{null}"
buttonText="{null}"
skipAction="{skipChallenge}"
skipAllAction="{skipAllChallenges}" />
skipAllAction="{skipAllChallenges}"
/>
{/if}

{#if submitted}
Expand All @@ -110,7 +113,8 @@
messageDetail="{`Correct answer: ${challenge.formInTargetLanguage[0]}`}"
buttonText="Continue"
incorrect
buttonAction="{finishChallenge}" />
buttonAction="{finishChallenge}"
/>
{/if}
{#if correct}
{#if !spellingSuggestion}
Expand All @@ -119,7 +123,8 @@
messageDetail=""
buttonText="Continue"
correct
buttonAction="{finishChallenge}" />
buttonAction="{finishChallenge}"
/>
{/if}

{#if spellingSuggestion}
Expand All @@ -128,7 +133,8 @@
messageDetail="{spellingSuggestion}"
buttonText="Continue"
typo
buttonAction="{finishChallenge}" />
buttonAction="{finishChallenge}"
/>
{/if}
{/if}
{/if}
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/components/SponsorButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
size="small"
outlined
inverted
info>
info
>
<Icon icon="heart" />
<div>Sponsor</div>
</Button>
3 changes: 2 additions & 1 deletion apps/web/src/components/TwitterButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
color="#55acee"
textColor="white"
target="_blank"
href="https://twitter.com/intent/tweet?hashtags=LibreLingo%2Copensource&url=https%3A%2F%2Flibrelingo.app&text=LibreLingo%20-%20an%20experiment%20to%20create%20a%20community-owned%20language%20learning%20tool%0A">
href="https://twitter.com/intent/tweet?hashtags=LibreLingo%2Copensource&url=https%3A%2F%2Flibrelingo.app&text=LibreLingo%20-%20an%20experiment%20to%20create%20a%20community-owned%20language%20learning%20tool%0A"
>
<Icon icon="twitter" prefix="fab" />
<div>Tweet about LibreLingo</div>
</Button>
12 changes: 8 additions & 4 deletions apps/web/src/routes/_layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,26 @@
<meta
name="twitter:description"
content="an experiment to create a community-owned language-learning
platform" />
platform"
/>
<meta name="twitter:title" content="LibreLingo" />

<meta
name="twitter:image"
content="https://librelingo.app/images/social_cover_1.png" />
content="https://librelingo.app/images/social_cover_1.png"
/>
<meta name="twitter:creator" content="@cacophonism" />

<meta property="og:title" content="LibreLingo" />
<meta
property="og:description"
content="an experiment to create a community-driven language-learning
platform" />
platform"
/>
<meta
property="og:image"
content="https://librelingo.app/images/social_cover_1.png" />
content="https://librelingo.app/images/social_cover_1.png"
/>
</svelte:head>

{#if process.browser !== true}
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/routes/about.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
<MarkDownPage
readmeHTML="{readmeHTML}"
title="About LibreLingo"
description="{$_('about.meta.description')}" />
description="{$_('about.meta.description')}"
/>
Loading

1 comment on commit 241c520

@vercel
Copy link

@vercel vercel bot commented on 241c520 Feb 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.