Custom exercises: create your own with name + body part
Users can add movements missing from the catalogue (issue #11) from the exercise picker or the Exercises tab. Custom exercises live in synced state (S.customEx) and are merged into the exercise index, so routines, supersets, logging, PRs, stats and history all work unchanged. The animation stays blank by design. Editable and deletable from the detail sheet; deleting keeps logged history readable by stamping the name into past entries. Translated into all 12 UI languages. Closes #11
This commit is contained in:
1 parent
93bd4e3850
commit
0cefcb3636
21 files changed
+355
-34
No files matched your search
@@ -3,8 +3,10 @@ import { imgSrc, gifSrc } from '../lib/exercises.js'
|
||||
import { t } from '../lib/i18n.js'
|
||||
|
||||
// Big autoplaying animation; tap toggles to the still frame. `compact` shrinks it (superset cards).
|
||||
// Custom exercises have no media — the animation stays blank by design (issue #11).
|
||||
export default function Media({ ex, id, compact }) {
|
||||
const [playing, setPlaying] = useState(true)
|
||||
if (!ex.gif) return null
|
||||
return (
|
||||
<div className={'exmedia' + (compact ? ' compact' : '')} id={id} onClick={() => setPlaying(p => !p)}>
|
||||
<img decoding="async" src={playing ? gifSrc(ex) : imgSrc(ex)} alt={ex.n} />
|
||||
@@ -14,5 +16,6 @@ export default function Media({ ex, id, compact }) {
|
||||
}
|
||||
|
||||
export function Thumb({ ex }) {
|
||||
if (!ex.img) return <div className="thumb thumb-x">🏋️</div>
|
||||
return <img className="thumb" loading="lazy" decoding="async" src={imgSrc(ex)} alt="" />
|
||||
}
|
||||
Reference in new issue
Block a user