Skip to content

Instantly share code, notes, and snippets.

View okvv's full-sized avatar
🎯
Focusing

Vladimir Okun okvv

🎯
Focusing
View GitHub Profile
@okvv
okvv / what-forces-layout.md
Created May 30, 2022 14:52 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@okvv
okvv / mockup.md
Created May 30, 2022 14:50 — forked from morsdyce/mockup.md
Timer App

Timer App

Please create an app for managing timed tasks.

  1. The user can input a text and click Add
  2. A new task is added with the title, and 00:00 time, and a play button.
  3. Clicking Play will play this task: the timer will start running, and the icon will change to a pause icon. Also - any other running task will be paused.
  4. Clicking Pause will pause the task.
  5. The total time is always updated.