• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
jonmaim

jonmaim

flashcard

anki-style flash cards
Public
Like
flashcard
Home
Code
10
backend
4
frontend
3
shared
2
.vtignore
AGENTS.md
ARCHITECTURE.md
GETTING_STARTED.md
README.md
deno.json
H
main.ts
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
frontend
/
README.md
Code
/
frontend
/
README.md
Search
11/11/2025
Viewing readonly version of main branch: v64
View latest version
README.md

Frontend

This directory contains the client-side code for the Flashcard Learning App.

Files

  • index.html - Single-page application with all views and layouts
  • index.js - Client-side JavaScript for UI logic and API calls

Views

The app uses a view-based navigation system where views are shown/hidden:

  1. Login View - Username entry
  2. Deck List View - Dashboard showing all decks
  3. Deck Editor View - Create/edit deck form
  4. Card Manager View - List and manage cards in a deck
  5. Study View - Spaced repetition study session
  6. Statistics View - Performance metrics and history
  7. Backup View - Data export/import

Key Features

Card Flip Animation

CSS 3D transforms create realistic card flipping effect:

  • Front shows question
  • Back shows answer
  • Smooth 0.6s transition

Study Timer

Real-time timer tracks session duration:

  • Updates every second
  • Displays as MM:SS format
  • Stops when session ends

Session Persistence

Username stored in sessionStorage for auto-login on page reload.

State Management

Global state variables in index.js:

  • currentUser - Logged-in username
  • userData - Full user data object
  • currentDeckId - Active deck being viewed/studied
  • studyCards - Cards in current study session
  • sessionStartTime - Study session start time
  • sessionCorrectCount - Correct answers counter

API Communication

All API calls use the apiCall() wrapper:

  • Adds X-Username header automatically
  • Handles JSON parsing
  • Provides error handling with user feedback

Styling

  • TailwindCSS via CDN for utility-first styling
  • Custom CSS for card flip animations
  • Responsive design works on mobile and desktop

Adding New Features

  1. Add HTML in index.html (or create new view)
  2. Add JavaScript logic in index.js
  3. Connect event listeners in DOMContentLoaded
  4. Style with TailwindCSS classes
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
Β© 2025 Val Town, Inc.