Textbooks are mid. Master the bridge from HSK 4 to real-world talk.
The perfect fusion of academic precision and colloquial soul.
In traditional Chinese learning, there has always been a disconnect.
- The Red: Represents the formal, structured HSK curriculumโessential for exams but often sounding "robotic" in real life.
- The Gold: Represents the colloquial, native rhythmโthe way people actually talk in the streets of Beijing or Shanghai.
RedGold bridges this gap. We transform the HSK 4 Standard Course into a premium, interactive experience that teaches you not just what to say, but how to say it like a native.
Our intelligent Scroll Engine in the TextSection component provides a seamless reading experience.
- Forward-Only Logic: The viewport only moves forward with the audio, preventing distracting "snaps" back to previous lines.
- Timing Heuristics: Calculates line changes based on character weight and audio duration for frame-perfect synchronization.
Unlike standard HSK tools, RedGold explicitly identifies and styles Proper Nouns โ names, places, brands โ with pinyin AND English meaning right there, no lookup needed. Styled in the signature Modern Han Elegant gold theme.
Zero-latency transitions. The app predicts your learning path and pre-warms audio assets and lesson data as you browse, ensuring the next chapter is ready before you even click.
A premium "glassmorphic" interface designed for focus:
- Responsive Layout: Tailored for high-aspect-ratio mobile displays (Galaxy S26 / iPhone Pro Max).
- Sticky Navigation: Smooth tab switching between Vocab, Grammar, and Texts.
- Visual Selection: Browse lessons via high-resolution 3D-styled textbook covers.
The app header now shows the current version and last build date in real time โ no more guessing what's deployed.
Every lesson can now be opened directly with https://heroyik.github.io/redgold/?lesson=N, so external apps can send learners straight to the right chapter.
Lesson data generation now uses a compact plan/auto_json rule pack:
- Execution Context: Load only
0.rules_common.mdthrough3.rules_mastery.mdfor lesson work. - Schema Alignment: Use
data/lesson1.jsonas the practical data-shape baseline, withplan/lesson-schema-canonical.mdas a reference. - Locale Safety: Keep source fields such as
proper_nounsandkey_sentencesaligned with translation-pack fields such asproperNounsandkeySentences. - Translation Matching: Require
texts,grammar, andkeySentencestranslations to match source array counts and order.
Built for performance, scalability, and the Google Cloud ecosystem:
- Frontend: Vite + TypeScript
- Architecture: Vanilla Web Components (Shadow DOM, 0-dependency runtime)
- Styling: Vanilla CSS with a centralized token system (Modern Han Elegant)
- Backend: Firebase (Hosting, Auth, Firestore ready)
- CI/CD: GitHub Actions deploys
mainto GitHub Pages. Local git hooks bump the patch version (+0.0.1) before each commit and stamp that version into the commit message.
redgold/
โโโ data/ # HSK 4 Lesson JSONs (Vocab, Grammar, Texts)
โโโ plan/ # Technical specs, auto JSON rules, and design documentation
โโโ public/ # Assets (Audio, Images, Logos)
โโโ scripts/ # Python automation for data processing
โโโ src/
โโโ components/ # Custom Web Components (TextSection, VocabCard, etc.)
โโโ styles/ # Global design tokens and CSS
โโโ utils/ # Security (XSS Sanitizer) and Helpers
โโโ web/ # Main App container and routing# Clone the repo
git clone https://github.com/heroyik/redgold.git
# Install dependencies
npm install# Start the dev server
npm run dev# Build for deployment
npm run build| Phase | Milestone | Status |
|---|---|---|
| UI/UX | Landing Page Refresh (Book Covers + Hip Tagline) | โ Done |
| Logic | Forward-only Scroll Sync Engine | โ Done |
| Pedagogy | Proper Nouns with Pinyin + English Meaning | โ Done |
| Versioning | Pre-commit patch bump + versioned commit messages + header badge | โ Done |
| Auth | Firebase Authentication Implementation | โ Done |
| Data | Lesson 5 Textbook Data Build-Out | โ Done |
| Data | Lesson 11 Textbook Data Build-Out | โ Done |
| Data | Lesson 12 Textbook Data Build-Out | โ Done |
| Data | Lesson 1-20 Complete Textbook JSON Coverage | โ Done |
| Pipeline | Auto JSON Rule Pack Optimization | โ Done |
| Data | Mastery Quiz System & Progress Tracking | โณ Next |
Every local commit bumps the patch version by 0.0.1, and the commit message is auto-stamped with that exact version. Here's the human-readable tea:
Lesson deep links. RedGold now supports direct lesson URLs for cross-app navigation from QingVoca and other tools.
- ๐ Lesson URL Routing โ Added
?lesson=Nsupport sohttps://heroyik.github.io/redgold/?lesson=7opens Lesson 7 directly instead of landing on the chapter picker. - ๐งญ History-Aware Navigation โ Internal lesson changes now update the address bar, home navigation clears the lesson parameter, and browser back/forward follows the URL state.
- ๐งฉ Shadow DOM Compatible โ Deep links route through the existing app state and lesson loading flow instead of depending on clickable DOM cards.
- ๐ผ๏ธ Favicon 404 Fixed โ Added an explicit favicon link using the existing RedGold logo asset, eliminating the browser's default
/favicon.ico404. - โ
Validation โ Confirmed production build, direct
?lesson=7entry, lesson switching URL updates, home URL cleanup, and zero 4xx favicon responses.
Full textbook run complete. RedGold now has complete HSK 4 textbook JSON coverage from Lesson 1 through Lesson 20.
- ๐ Lessons 1-20 Complete โ Completed and validated all lesson JSON data across textbook texts, vocabulary, grammar/notes, mastery sentences, and locale translation packs.
- ๐ Lesson 20 Finalized โ Added Lesson 20 notes and mastery sentences, including repeated-progressive verb patterns, immediate-sequence structures, emphasis adverbs, directional complements, and same-character vocab notes.
- ๐ Locale Packs Completed โ Backfilled missing
translations.vocabulary,properNouns,lessonTitle,textTitles, grammar examples, and mastery fields where needed. - ๐งฑ Auto JSON Rules Hardened โ Updated
plan/auto_jsonrules to prevent recurring schema gaps around optionalproper_nouns, grammar translation wrappers, and mastery base fields. - โ
Full Validation Pass โ Revalidated Lessons 1-20 with optional proper nouns excluded correctly:
checked: 20,passed: 20,failed: 0.
Auto JSON Rules Hardened. The lesson-generation prompts are now smaller, stricter, and safer for locale data.
- ๐งฑ Auto JSON Rule Pack โ Added
plan/auto_jsonas the execution-ready rule set for Lesson JSON generation, split into common, Kewen, Notes, and Mastery files. - ๐ซ Spec Excluded from Runtime Context โ Marked
rules-optimization-spec.mdas design/history only, so future Lesson work loads only0~3.rules_*.md. - ๐ Locale Mapping Guardrails โ Documented the source-vs-translation naming split for
proper_nouns/properNounsandkey_sentences/keySentences. - โ Translation Count Checks โ Required text-line, grammar-example, and mastery-sentence translations to match the source arrays by count and order.
Lesson 12 Complete. The textbook data pipeline now covers the careful-observation and methods chapter.
- ๐ Lesson 12 Textbook Data Complete โ Added
data/lesson12.jsonfor the attentive-world-discovery chapter, covering Text 1-5, 33 vocabulary items, 6 grammar/notes entries, 5 mastery sentences, and 3 same-character word examples. - ๐งฉ Grammar Notes Preserved โ Added the full set of Lesson 12 conjunction, comparison, noun-measure reduplication, and contrast notes with complete formal examples.
- ๐ Mastery Expansion โ Added 5 Golden Sentences with Living Language equivalents for problem solving, praise, education methods, giving advice, and choosing methods.
- ๐ Locale Sync โ Filled KO/JA/EN translations for vocabulary, proper nouns, text titles, text lines, grammar explanations/examples, same-character examples, and mastery sentences.
- โ Validation โ Confirmed Lesson 12 JSON parses successfully, locale mapping reports zero missing fields, and text line indexes are 0-based.
Lesson 11 Complete. The textbook data pipeline now covers the reading-methods chapter.
- ๐ Lesson 11 Textbook Data Complete โ Added
data/lesson11.jsonfor the self-study-methods chapter, covering Text 1-5, 30 vocabulary items, 7 grammar/notes entries, 5 mastery sentences, and complete locale data. - ๐งฉ Grammar Notes Preserved โ Added the full set of Lesson 11 emphasis, condition, no-matter, contrast, simultaneity, and same-character notes with full formal and colloquial examples.
- ๐ Locale Sync โ Filled KO/JA/EN translations for vocabulary, proper nouns, text titles, text lines, grammar explanations/examples, and mastery sentences.
- โ Validation โ Confirmed Lesson 11 JSON parses successfully and locale mapping reports zero issues.
Lessons 1-5 Grammar Image Review Complete. The textbook grammar notes were rechecked against the source images.
- ๐ Lesson 1-5 Grammar Review โ Rechecked grammar sections in
data/lesson1.jsonthroughdata/lesson5.jsonagainst the provided textbook images. - ๐งฉ Compare & Expansion Notes Preserved โ Stored comparison pages as explicit grammar items and preserved same-character expansion pages as dedicated notes.
- ๐ถ Chinese Examples Complete โ Ensured every Chinese example shown in the grammar images is represented in the JSON data.
- ๐ Locale Sync โ Aligned
translations.grammarkeys and example counts with the updated grammar entries, including Korean, Japanese, and English translations. - ๐ ๏ธ Recognition Rules Hardened โ Updated
plan/image_recognition/2.rules_notes.mdso future grammar image passes preserve comparison/expansion pages instead of collapsing or inventing structure. - โ
Validation โ Verified lesson 1-5 grammar translation keys/counts and ran
npm run buildsuccessfully.
Lesson 5 Complete. The textbook data pipeline now covers Lesson 5.
- ๐ Lesson 5 Textbook Data Complete โ Added
data/lesson5.jsonfor the furniture-store sofa-buying chapter, covering Text 1-5, vocabulary, grammar notes, comparison content, same-character word notes, mastery sentences, and locale data. - โ
Validation โ Confirmed
data/lesson5.jsonparses as valid JSON.
Lesson 4 Image Recognition Pass, Canonical Schema Rules & Fixed Lesson Header. Today's work tightened the data pipeline and made lesson navigation stay put.
- ๐ Always-Fixed Lesson Selector Header โ The top lesson chip bar (
Home,L1..., language picker, pinyin toggle) now uses viewport-level fixed positioning, so it remains visible while scrolling anywhere inside a lesson page. - ๐งญ Sticky Lesson Toolbar โ The lesson title and tab row are grouped into a dedicated sticky toolbar below the fixed lesson selector. This keeps the current lesson context and tab controls accessible without covering the content.
- ๐ Lesson 4 Textbook Data Build-Out โ Expanded
data/lesson4.jsonfrom the provided textbook images: 5 text sections, 36 vocabulary items, 6 grammar points, 5 mastery sentences, and complete text-line translations. - ๐ Missing Translation Fixes โ Filled the previously missing translations for Lesson 4 text 1 line 0, text 4, and text 5. The translation map now covers all 20 Lesson 4 text lines with KO, JA, and EN entries.
- ๐งฉ 0-Based Text Translation Rule โ Updated localization rules so
translations.texts[{textId}].linesmust use JavaScript array indices (0,1,2...) instead of textbook-style line numbers. This prevents app-visible โmissing translationโ cases for one-line monologues. - ๐งฑ Canonical Lesson Schema Added โ Added
plan/lesson-schema-canonical.mdas the official schema reference based on the currentlesson1.jsonstructure, includingformal_examples[],colloquial_examples[],lessonTitle,textTitles, and KO/JA/EN translation objects. - ๐ธ Image Recognition Pipeline v2 Docs โ Added
plan/image-recognition-spec.mdandplan/image_recognition_status.mdto document the textbook-image-to-JSON workflow, current lesson progress, and schema expectations. - ๐ ๏ธ Rule Files Hardened โ Updated
1.rules_kewen.md,2.rules_notes.md,3.rules_mastery.md, and4.rules_locale.mdto reference the canonical schema, require complete locale data, preserve proper pinyin such asรผ, and use array-based grammar examples. - โ
Validation โ Ran
npm run buildsuccessfully after the data and UI changes.
Textbook-Sourced Vocab, Lesson Title i18n & Pinyin Toggle Polish. Precision over assumptions.
- ๐ Pinyin Toggle Fix for Text Titles โ Extracted pinyin from text titles into a separate
.pinyindiv via thetitlePinyinfield inlessonTranslations.ts, so the global pinyin toggle CSS properly hides/shows it. - ๐ฏ Vocab & Review Tabs Now Sourced from Textbook New-Words Sections โ Both tabs now collect unique vocabulary items from each text's new-words section instead of the top-level
lesson.vocabularyarray. This ensures only words actually introduced in the textbook pages appear. - ๐ง
getTextVocab()Extracted โ Deduplicated vocab collection logic into a reusable exported function inlessonTranslations.ts, used by both the vocab tab and review tab. - ๐ก๏ธ Meaning Fallback Fix โ Added
pickLocalized(...) || item.meaningso text vocabulary items without a translation pack entry still display their original English meaning. - ๐ Lesson Title Korean/Japanese i18n โ Filled in
lessonTitleandtextTitlestranslations (ko/ja) for Lessons 1โ4. Now the lesson header properly displays the locale-specific subtitle below the pinyin line.
Firebase Authentication & User Profile. Identity is now live.
- ๐ Firebase Authentication โ Implemented Google Sign-In with a custom
UserMenuWeb Component. - ๐ค User Profile UI โ Added a sleek, glassmorphic profile menu to both the landing page and lesson view header, showing user name, email, and photo.
- ๐ Auth Utility โ Created a centralized
auth.tsutility for handling user state and authentication logic. - ๐ข Version Bump โ Updated to v0.9.49 as part of the automated versioning workflow.
Mobile-First UX Optimization & Cloud Sync. The Review Tab gets a massive glow-up.
- โ๏ธ Firestore Integration โ Migrated local
lesson1.jsondata to Firebase Firestore, laying the groundwork for a true backend architecture. - ๐ฑ Mobile UI/UX Polish โ Complete overhaul of the Review tab for modern, high-aspect-ratio screens (Galaxy S26 / iPhone Pro). Eliminated rogue left-margins and packed the top header icons perfectly into a single responsive row.
- ๐ Click-to-Flip Refined โ Resolved PC vs Mobile interaction conflicts. Cards now flip flawlessly on a simple click or tap through a centralized
InteractionManager. - ๐ Perfect Card Boundaries โ Leveraged
dvhcalculations (calc(100dvh - 380px)) to aggressively subtract header real estate. Flashcard outlines now fit perfectly on-screen without clipping, and long texts (like complex meanings or examples) are neatly scrollable inside the card itself. - ๐ฏ Absolute Center Alignment โ Chinese characters on the front face are perfectly centered vertically and horizontally. Fixed descender drifts by applying
line-height: 1alongside precise flexbox layouts. - ๐ง Visual Audio Triggers โ Replaced text-based audio buttons with sleek, static PNG icons for better intuition.
- ๐ App Manifesto Update โ Rewrote the intro messaging to sound more colloquial and explicitly highlight the "HSK4 learners" target audience, while strictly preserving the GitHub footer link.
- โฌ
๏ธ Navigation Enhancements โ Added tactile left/right arrows flanking the progress counter (
< 1/31 >) for immediate visual navigation cues. - ๐งน Layout Compaction โ Reduced unnecessary padding between the version badge and the logo to grant more breathing room to core content.
The version system drops. Things just got official.
- ๐ข Version badge is live โ header now shows
vX.X.X+ last build date on both the landing page and the lesson view - โ๏ธ Automatic patch bump โ local git hooks patch
0.0.1before every commit and make sure the commit message includes the bumped version - ๐ท๏ธ Proper Nouns Overhaul โ corrected all proper noun entries to match the actual textbook pages (images > assumptions, always)
- ๐ Dialogue 2 Data Fix โ cleaned up the proper noun list so it follows the textbook instead of guesswork.
- โ Missing Vocab Added โ added the missing "happy" vocab item from Dialogue 2 because the textbook had it and the data needed to catch up.
- ๐ Vocabulary meanings tightened up โ part-of-speech labels (
adj.,v.,adv.) now match the textbook format exactly
Redgold is an educational tool designed to complement the HSK Standard Course 4 textbook series authorized by Hanban and published by BLCUP.
Built with โค๏ธ by the RedGold Team.
Speak the Language, Not Just the Grammar.
