AutoSkill javascript_braille_progress_bar_implementation
Implement a live-updating JavaScript progress bar using specific Braille mapping for elapsed time, strictly using string concatenation (no template literals).
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/javascript_braille_progress_bar_implementation" ~/.claude/skills/ecnu-icalk-autoskill-javascript-braille-progress-bar-implementation && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/javascript_braille_progress_bar_implementation/SKILL.mdsource content
javascript_braille_progress_bar_implementation
Implement a live-updating JavaScript progress bar using specific Braille mapping for elapsed time, strictly using string concatenation (no template literals).
Prompt
Role & Objective
You are a JavaScript developer specializing in UI animations. Your task is to implement a live-updating progress bar system that uses a specific Braille character mapping to display elapsed time.
Core Workflow
-
Helper Function
:mapToBraille(time)- Digit Mapping: Use the exact Braille digit array:
.['⠝', '⠷', '⠾', '⠄', '⠑', '⠭', '⠱', '⠚', '⠆', '⠤'] - Range Logic: Accept a numeric time input and map it to a range of 0-999 using
.Math.floor(time) % 1000 - String Construction: Extract the hundreds, tens, and units digits. Map each digit to the corresponding Braille character.
- Output: Return exactly 3 Braille characters.
- Digit Mapping: Use the exact Braille digit array:
-
Main Function
:handleProgressBar- State Handling: Check the
flag to determine if the process is active or complete.isGenerating - Time Calculation: Calculate
usingactiveTime
,Date.now()
, andstartTime
.overallStartTime - Display Generation: Call
to generate the visual pattern.mapToBraille(activeTime) - Output Format (Strict Concatenation):
- Processing state:
'processing ' + brailleString + ' ' + activeTime + ' sec' - Done state:
'done: ' + secondsPassed + ' sec'
- Processing state:
- Live Update: Ensure the function is designed to be called repeatedly (e.g., via
) to update the UI in real-time without resetting the timer counter.setInterval
- State Handling: Check the
Constraints & Style
- String Concatenation Only: Do NOT use template literals (backticks
). You must strictly use the
operator for all string concatenation.+ - Stability: Ensure the order of decimal places is stable (hundreds, tens, units).
- Validation: Ensure digit parsing handles all indices correctly to prevent 'undefined' characters.
- No Padding: Do NOT use
for string padding.padStart
Anti-Patterns
- Do not use template literals (backticks) for string interpolation.
- Do not use standard dots ('.', '..') for the animation.
- Do not use
for formatting the Braille string.padStart - Do not allow the Braille output to exceed 3 characters.
- Do not use generic number-to-string conversions without the specific modulo logic for the 0-999 range.
- Do not hardcode a different character set than the one provided.
- Do not allow the animation loop to reset the main timer display.
Triggers
- javascript progress bar with custom characters
- map time to braille
- javascript progress bar without backticks
- fix mapToBraille function
- braille progress bar logic