Socket
Book a DemoInstallSign in
Socket

@teamthunderfoot/mobile-height-adjust

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@teamthunderfoot/mobile-height-adjust

Mobile Height Adjust package

0.0.4
unpublished
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
3
Weekly downloads
 
Created
Source

mobile-height-adjust

The Mobile Height Adjust package adjusts the height of the mobile screen by subtracting the height of the navigation bar, ensuring that the content occupies the full viewport height. Here's an example

Installation

npm install @teamthunderfoot/mobile-height-adjust

Usage

import MobileHeightAdjust from "@teamthunderfoot/mobile-height-adjust";

class Page {
  constructor() {
    this.init();
    this.events();
  }
  init() {
    const mobileHeightAdjust = new MobileHeightAdjust();
  }
  events() {}
}
export default Page;
new Page();

The mobile-height-adjust package automatically sets the CSS variable --vh to adjust the height of the mobile screen, excluding the height of the navigation bar. This ensures that the content fits within the visible viewport.

To make the adjustment work properly, you need to apply the following CSS rule to the component that should occupy the full viewport height:

.your-component {
  height: calc(var(--vh, 1vh) * 100);
}

This rule calculates the height based on the adjusted --vh value, allowing the component to fill the entire viewport height.

Destroy

To remove the functionality of the mobile-height-adjust package, you can simply destroy the instance. Call the destroy method on the instance of MobileHeightAdjust:

mobileHeightAdjust.destroy();

Calling the destroy method will remove the event listener and revert the CSS variable --vh to its original value.

Keywords

mobile

FAQs

Package last updated on 31 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.