Music: add Panels level#55758
Conversation
thomasoniii
left a comment
There was a problem hiding this comment.
one minor request about destructuring a variable, but otherwise lgtm 🚀
sanchitmalhotra126
left a comment
There was a problem hiding this comment.
Cool stuff! Just some minor comments
| import EnhancedSafeMarkdown from '@cdo/apps/templates/EnhancedSafeMarkdown'; | ||
| import FontAwesome from '@cdo/apps/templates/FontAwesome'; | ||
|
|
||
| function useWindowSize() { |
There was a problem hiding this comment.
Seems like a good candidate for a reusable util? (separate change probably?)
There was a problem hiding this comment.
Yes. I also think there's a bigger opportunity to factor out the responsive sizing from this file and standaloneVideo/Video.tsx but would like to do in a follow-up.
sanchitmalhotra126
left a comment
There was a problem hiding this comment.
A few more minor things but looks good!
| : commonI18n.continue()} | ||
| </button> | ||
| <div id="panels-bubbles"> | ||
| {Array.from(Array(levelPanels.panels.length).keys()).map(index => { |
There was a problem hiding this comment.
I've seen this kind of index generator in a couple of places (Array.from(Array(length).keys()) - worth pulling out into a util later?
There was a problem hiding this comment.
Oh, we have getRangeArray.ts now. Maybe we could move it to apps/src/util/?
…ts-panels Music: add Panels level
This adds a new
Panelslevel type. This type of level can provide a series of "panels" of information.In this initial implementation, each panel contains one large image and one piece of markdown text. The user presses "Next" to go through the panels, "Continue" to go to the next level from the final panel, and can also use some bubbles at the bottom to navigate between the panels.
If useful, this level type can be made more flexible, to support a wider variety of content types and layouts. It's currently supported for Lab2 progressions, though could be supported in legacy progressions as well.
Authoring is currently done via JSON, and is quite simple, for example:
It's used in one level so far: https://studio.code.org/s/music-intro-2024/lessons/1/levels/8.
music-panels-1.mov
Background
I was pondering a new kind of instructional level for Music Lab that might address some of our discussed needs:
Long ago
Funnily enough, the last time I built something very similar to this was all the way back in 2007, when there was a last minute scramble and I pitched, prototyped and started building the Inside Xbox live news feed feature for the Xbox 360. Inside Xbox provided a bunch of panels that the user could move between, with a variety of content types supported over time, including images, text, and video. It was easy for the content team to author new content daily.
Here's a screenshot with the entry button, that I found: