Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanMillett committed Oct 25, 2024
1 parent 4bfbd60 commit 9229d71
Show file tree
Hide file tree
Showing 21 changed files with 32 additions and 175 deletions.
8 changes: 8 additions & 0 deletions Bases/LessonTypeBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ public class LessonTypeBase : ComponentBase

[Inject]
public ProfileService Profile { get; set; } = default!;

[Inject]
public TextToSpeechService TTS { get; set; } = default!;

[Parameter, EditorRequired]
public LessonLogic Logic { get; set; } = default!;
Expand All @@ -32,5 +35,10 @@ public bool NotReady()

return false;
}

public void PlayOneShot()
{
_ = TTS.Speak(Logic.Included[0].RU);
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@

@if (FindEnglish)
{
<VocabIcon />
<h1>@Logic.Included[0].RU</h1>
//<div @onclick="PlayOneShot" class="clickable">
<VocabIcon />
<h1>@Logic.Included[0].RU</h1>
//</div>
}else
{
<VocabIcon Vocab="@Logic.Included[0]"/>
Expand Down Expand Up @@ -38,6 +40,7 @@
if (FindEnglish)
{
Options.Add(Logic.Included[0].EN);
PlayOneShot();
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
@{
VocabHeader Term = Logic.Included[0];

<VocabIcon Vocab="@Term"/>

<h1>@Term.RU</h1>
//<div @onclick="PlayOneShot" class="clickable">
<VocabIcon Vocab="@Term"/>
<h1>@Term.RU</h1>
//</div>
<h5>(@Term.EN)</h5>

if(Term.Category == "Noun")
Expand All @@ -30,6 +31,11 @@

@code
{
protected override void OnInitialized()
{
PlayOneShot();
}

void Done()
{
Logic.Results.Add(Logic.Included[0].RU, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
<div class="col-12 text-center">
@{
VocabHeader Term = Logic.Included[0];

<VocabIcon Vocab="@Term"/>
<h1>@Term.EN</h1>

}

<br>
Expand All @@ -28,6 +26,7 @@

protected override void OnInitialized()
{
PlayOneShot();
NormalIndex = Rand.Next(0, 4);
Generated.Add(Logic.Included[0].RU);
}
Expand Down
File renamed without changes.
File renamed without changes.
162 changes: 0 additions & 162 deletions Components/LessonTypeMatch.txt

This file was deleted.

2 changes: 1 addition & 1 deletion Components/NoLearnedTerms.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<br>
<h3><strong>You haven't learned any terms.</strong></h3>
<br>
<button class="btn"><a href="">Visit Lessons</a></button>
<a href=""><button class="btn">Visit Lessons</button></a>
</div>
File renamed without changes.
2 changes: 1 addition & 1 deletion Pages/DeveloperPage.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@page "/developer"
@using Vetra.Components
@using Vetra.Components.ProgressPage
@using System.Text.Json
@using System.Text.Encodings.Web;
@using System.Linq;
Expand Down Expand Up @@ -120,7 +121,6 @@
string Status = "";
string AllKeys = "";
string EditTerm = "";
string TermStatus = "";

protected override void OnInitialized()
{
Expand Down
2 changes: 1 addition & 1 deletion Pages/LearnPage.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/"
@using Vetra.Components
@using Vetra.Components.LearnPage

<PageTitle>Vetra - Learn</PageTitle>

Expand Down
3 changes: 2 additions & 1 deletion Pages/LessonPage.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@page "/Lesson/{URL}"
@inherits PracticePageBase
@using Vetra.Components
@using Vetra.Components.LessonPage

<PageTitle>Vetra - Lesson</PageTitle>

Expand Down Expand Up @@ -46,7 +47,7 @@ else
<br>
<h3><strong>You have finished this lesson!</strong></h3>
<br>
<button class="btn"><a href="">Exit Lesson</a></button>
<a href=""><button class="btn">Exit Lesson</button></a>
<button class="btn" @onclick="ToggleEndless">Continue</button>
</div>
}
Expand Down
3 changes: 2 additions & 1 deletion Pages/PracticePage.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@page "/Practice"
@inherits PracticePageBase
@using Vetra.Components
@using Vetra.Components.LessonPage

<PageTitle>Vetra - Practice</PageTitle>

Expand Down Expand Up @@ -38,7 +39,7 @@ else
<br>
<h3><strong>You have finished all of your terms!</strong></h3>
<br>
<button class="btn"><a href="">Exit Practice</a></button>
<a href=""><button class="btn">Exit Practice</button></a>
<button class="btn" @onclick="ToggleEndless">Continue</button>
</div>
}
Expand Down
1 change: 1 addition & 0 deletions Pages/ProgressPage.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@page "/progress"
@using Vetra.Components
@using Vetra.Components.ProgressPage
@inject ProfileService Profile

<PageTitle>Vetra - Progress</PageTitle>
Expand Down
2 changes: 1 addition & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
builder.Services.AddBlazorBootstrap();
builder.Services.AddSingleton<BlazorBootstrap.ToastService>();

//builder.Services.AddSingleton<TextToSpeechService>();
builder.Services.AddSingleton<TextToSpeechService>();

builder.Services.AddSingleton<SettingsService>();
builder.Services.AddSingleton<ProfileService>();
Expand Down

0 comments on commit 9229d71

Please sign in to comment.