- Word import (multi-format: word, word-def, word:def, word|def) - Flashcard filter UI (swipe + keyboard arrows + Space to flip) - SM-2 spaced repetition review queue - Stimulus flashcard controller with 3D flip animation
78 lines
3.2 KiB
Plaintext
78 lines
3.2 KiB
Plaintext
<% content_for :title, "Review — Lexivo" %>
|
|
|
|
<div class="container">
|
|
<% if @review.nil? %>
|
|
<div class="empty-state">
|
|
<div class="empty-icon">zz</div>
|
|
<h2>Nothing due!</h2>
|
|
<% if @upcoming_count > 0 %>
|
|
<p>Next review: <%= @upcoming.first.due_label %> — <%= @upcoming_count %> upcoming.</p>
|
|
<div class="upcoming-list">
|
|
<% @upcoming.each do |r| %>
|
|
<div class="upcoming-item">
|
|
<span class="upcoming-word"><%= r.word.text %></span>
|
|
<span class="upcoming-when"><%= r.due_label %></span>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
<% else %>
|
|
<p>No words in the learning queue yet. <%= link_to "Filter some words first", filter_path %>.</p>
|
|
<% end %>
|
|
<%= link_to "Back to words", words_path, class: "btn btn-outline" %>
|
|
</div>
|
|
<% else %>
|
|
<div class="filter-header">
|
|
<span class="progress-text">
|
|
<%= @due_count %> due · <%= @upcoming_count %> upcoming
|
|
</span>
|
|
<%= link_to "word list", words_path, class: "link-muted" %>
|
|
</div>
|
|
|
|
<div class="flashcard-wrap" data-controller="flashcard">
|
|
<div class="flashcard" data-flashcard-target="card"
|
|
data-action="touchstart->flashcard#touchstart touchend->flashcard#touchend click->flashcard#flip">
|
|
<div class="card-face card-front">
|
|
<div class="card-word"><%= @review.word.text %></div>
|
|
<div class="card-interval">interval: <%= @review.interval %>d · rep #<%= @review.repetitions %></div>
|
|
<div class="flip-hint">Space / tap to flip</div>
|
|
</div>
|
|
<div class="card-face card-back">
|
|
<div class="card-word"><%= @review.word.text %></div>
|
|
<% if @review.word.definition.present? %>
|
|
<div class="card-definition"><%= @review.word.definition %></div>
|
|
<% end %>
|
|
<% if @review.word.example.present? %>
|
|
<div class="card-example"><em><%= @review.word.example %></em></div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card-actions">
|
|
<%= form_with url: rate_review_path(@review), method: :post, id: "form-left", class: "inline-form",
|
|
data: { turbo_frame: "_top" } do |f| %>
|
|
<%= f.hidden_field :rating, value: "forgot" %>
|
|
<%= f.submit "Forgot 1", class: "btn btn-learning" %>
|
|
<% end %>
|
|
|
|
<%= form_with url: rate_review_path(@review), method: :post, id: "form-q3", class: "inline-form",
|
|
data: { turbo_frame: "_top" } do |f| %>
|
|
<%= f.hidden_field :rating, value: "hard" %>
|
|
<%= f.submit "Hard 2", class: "btn btn-skip" %>
|
|
<% end %>
|
|
|
|
<%= form_with url: rate_review_path(@review), method: :post, id: "form-right", class: "inline-form",
|
|
data: { turbo_frame: "_top" } do |f| %>
|
|
<%= f.hidden_field :rating, value: "easy" %>
|
|
<%= f.submit "Easy 3", class: "btn btn-known" %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="key-hint">
|
|
<kbd>1</kbd> / <kbd>←</kbd> Forgot
|
|
<kbd>2</kbd> Hard
|
|
<kbd>3</kbd> / <kbd>→</kbd> Easy
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|