haxtheweb / issues

Issue queue for hax, haxcms, elmsln, lrnwebcomponents, wcfactory, websites and more.
Apache License 2.0
10 stars 1 forks source link

9xPETJ - image gallery presentation thing #1946

Open btopro opened 3 months ago

btopro commented 3 months ago

Context

I absolutely love the effect as applied to images on the page - https://help.figma.com/hc/en-us/articles/1500004414082-Get-FigJam-templates#01H8JFSYS4NARR301NM76EMD0G

Some times when we're building out a design system, we find gaps that we didn't think of. In DDD currently there isn't anything around the following big questions:

This project will require imagining all three of these, and then applying those ability to produce 3 different elements that work together. This also requires a design pattern known as a "Singleton". You can read more about this pattern here -- https://www.pentalog.com/blog/design-patterns/singleton-design-pattern/

TLDR; A single element who's entire job it is to manage a single process / task

Description

Images within websites, especially documentation or educational material are often related or associated in some way. By clicking on an image, you should get additional details about the image, it should be zoomed in, but you should also be able to browse just between them as they are a different visual layer than the text they are mixed amongst.

Hint

https://github.com/elmsln/lrnwebcomponents/blob/master/elements/simple-modal/src/simple-modal.js#L608-L621


// register globally so we can make sure there is only one
globalThis.SimpleModal = globalThis.SimpleModal || {};
// request if this exists. This helps invoke the element existing in the dom
// as well as that there is only one of them. That way we can ensure everything
// is rendered through the same modal
globalThis.SimpleModal.requestAvailability = () => {
  if (!window.SimpleModal.instance) {
    globalThis.SimpleModal.instance = document.createElement("simple-modal");
    document.body.appendChild(globalThis.SimpleModal.instance);
  }
  return globalThis.SimpleModal.instance;
};

export const SimpleModalStore = globalThis.SimpleModal.requestAvailability();

This is an example of a Singleton implementation in HTML.

Usage pattern

Requirements

Example data

Because this is a singleton, it's only able to have 1 instance on a page / demo. As such. I want you to write an article about a topic that your group agrees upon (if this is via ChatGPT I don't care, it just has to be a context that you can then add images to for flavor / realistic feeling content). I'd like to see at least 6 images in the content (can also be GPT / fake generated, don't care).

Pick a topic that you enjoy or want to build the content around, everyone in the pod agree on this sample data for the topic and start building from there.

zdodson21 commented 2 months ago

My pod will do this

cmd6824 commented 2 months ago

my pod is doing this one

AshleySantana commented 2 months ago

We'll be doing the carousel.

icm5131 commented 2 months ago

Taking the underdog choice!

btopro commented 1 month ago

https://github.com/iqiroukun/project-2/blob/main/src/gallery-view.js