import {
  INPUT_LIFT_VAR,
  KEYBOARD_ADAPT_DATA_ATTR,
  KEYBOARD_ADAPT_TARGET_VALUE,
} from "./constants";

export function setInputLiftVar(lift: number): void {
  document.documentElement.style.setProperty(INPUT_LIFT_VAR, `${lift}px`);
  document.documentElement.dataset[KEYBOARD_ADAPT_DATA_ATTR] =
    KEYBOARD_ADAPT_TARGET_VALUE;
}

export function resetInputLiftVar(): void {
  document.documentElement.style.setProperty(INPUT_LIFT_VAR, "0px");
  delete document.documentElement.dataset[KEYBOARD_ADAPT_DATA_ATTR];
}
