Kshitij (Tjay) Dhyani

Command Palette

Search for a command to run...

Taste

Developing taste in design — recognizing what works and why.

Good/bad decision making + experiences (struggles) + introspection builds judgement.
Applied judgement becomes wisdom.
Wisdom applied over long durations of time becomes taste (gut).

Loading...
Loading...
Vertical sidebar navigation example
Old songs used in movie trailers
Loading...
Loading...
Loading...
Loading...
Loading...
Color panel example 1Color panel example 3Color panel example 4Color panel example 5
Font pairing example 1Font pairing example 2Font pairing example 3Font pairing example 4
Figma plugins collection
Flag icons collection

Nucleo Flag Icons for React

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Landing page bento component example 1Landing page bento component example 2Landing page bento component example 3Landing page bento component example 4Landing page bento component example 6
Loading...
Loading...
Loading...
Loading...
Loading...

Landing.love

A sophisticated image expansion animation using CSS scale() and translate() functions with viewport calculations. The animation uses ease-in-out-quart easing for 400ms and is origin-aware.

Loading...
Loading...

The Math Behind It

The scaling calculation handles images of different aspect ratios by fitting them within the viewport with proper margins:

  1. Calculate scale factors: First, calculate the necessary scale factor to fit the image within the window's inner dimensions given a margin of 0.95.
  2. Choose minimum scale: Select the minimum scale so it doesn't exceed either the horizontal or vertical boundaries of the viewport.
const margin = 0.95;
const scaleX = (window.innerWidth * margin) / rect.width;
const scaleY = (window.innerHeight * margin) / rect.height;

// Choosing the lowest so that it doesn't exceed the viewport
// It scales until it hits either x or y axis edge of viewport
const scale = Math.min(scaleX, scaleY);

setTransform(
  `translate(${translateX}px, ${translateY}px) scale(${scale})`
);
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Origami Archive

Loading...
Loading...
Loading...
Loading...