kramars-realspeak / fm-gai-lottie-true-false-v1

0 stars 0 forks source link

Refactor Image Click Behavior for New Tab Opening #11

Open Peter96K opened 1 day ago

Peter96K commented 1 day ago

Propose how to improve the design to separate the concerns of opening the image in a new tab and having it printed. In v1, clicking an image is expected to opena. new browser tab with the image source URL as per the current script:

  document.getElementById('image_container').addEventListener('click', () => {
    window.open(jsonData.media.image_src, '_blank');
  }

However, instead depending on the chrome version, the print dialog sometimes appears first, and the image opens only after the print window is closed. The behavior is inconsistent and tehrefore not suitable. Please add a proposal in the comment section describing what a better approach would look like.

Peter96K commented 1 day ago

The div containing the sentence doesn't adapt its font-size automatically, hence resulting in a malformatted sentence presentation :

<span id="sentence" class="sentence">Bananas taste better than watermelon.</span>

modify the style for class "sentence" so that its size is calculated dynamically e.g. : .sentence { font-size : calc(2em) } or something similar