skip to content
Alvin Lucillo

UI tidbits and a health tip

/ 1 min read

💻 Tech

Few things I learned when I worked on a UI bug:

  • Compound an element’s classes by querying it with document.querySelector and using the . operator. For example, document.querySelector('.class1.class2') will return the first element with both class1 and class2.
  • Get how much an element is scrolled by using element.scrollTop and element.scrollLeft.
  • Get the distance between an element and its relative parent by using element.offsetTop and element.offsetLeft.

🥦 Health

If you want to deter yourself from eating ultra-processed foods, read the ingredients list. As you eat, read what you are consuming. You’ll realize you don’t know a lot of what you’re eating, so you’ll probably think twice before eating it again.