Dynamic content in a front end modal

Hi! I’m a front end designer putting together my new portfolio with Kirby. I’ve solved most of my issues through reading the documentation and browsing the forum but I’ve not found any similar implementations of what I’d like to do for a page I’m currently working on.

See the images attached. I have a grid of logos that I’m looking to be clickable and expand out to a modal with an image carousel and short description of the design process. My question is, how should I go about creating the function of making the modal’s content dynamic on the click of each logo grid item? Would I need to use something specific built into Kirby or build the functionality in the javascript part of the modal design?

I’d appreciate any help or nudge in a specific direction. I’m a front end designer slowly getting into the development side of it all.

If it’s not a lot of content, you could print it in an html element and get it from there just via JS.

For more complex stuff, I’d load it via an Ajax call to a content representation that returns the relevant content: Content Representations | Kirby CMS

Another question. Within the content representation, how would I go about creating an array of all available images within the content folder? And how do I output all of the urls of said images to the outputted json?