1.0.7 • Published 8 years ago
@zores/vratio v1.0.7
@zores/vratio
Is a Angular 5 module with a directive for automaticaly resizing the height of a div based on width/height ratio.
Instalation
Install using the command
npm install @zores/vratio
Usage
Add the AzVRatioModule to module imports.
vratio will only work on div tag.
It will set the div height according the defined ratio. Default ratio is 16:9.
Just add vratio attribute to the div. This will set the height according to the default ratio.
<div vratio ... >
...
</div>To set a 4:3 ratio, just add it to attribute
<div vratio="4:3" ... >
...
</div>or
<div vratio="10:4.5" ... >
...
</div>For an inline-block with a specified width
<div vratio="4:3" style="display: inline-block; width:100px" ... >
...
</div>