├── LICENSE.txt ├── README.md ├── gap-card.js └── hacs.json /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Thomas Lovén 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DEPRECATED 2 | 3 | Gap-card is now included in [layout-card](https://github.com/thomasloven/lovelace-layout-card) 4 | 5 | --- 6 | 7 | gap-card 8 | ======== 9 | 10 | [![hacs_badge](https://img.shields.io/badge/HACS-Default-orange.svg)](https://github.com/custom-components/hacs) 11 | 12 | A dummy card that is invisible, but has a height. It's most useful together with [layout-card](https://github.com/thomasloven/lovelace-layout-card) 13 | 14 | ![gap_card](https://user-images.githubusercontent.com/1299821/53566682-32b17a00-3b5d-11e9-9794-eace8ae8c0c2.jpg) 15 | 16 | 17 | # Installation instructions 18 | 19 | For installation instructions [see this guide](https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins). 20 | 21 | The recommended type of this plugin is: `module`. 22 | 23 | ```yaml 24 | resources: 25 | url: /local/gap-card.js 26 | type: module 27 | ``` 28 | 29 | # Usage instructions 30 | 31 | ```yaml 32 | type: custom:gap-card 33 | height: 34 | size: 35 | ``` 36 | 37 | ### `` 38 | Optional. Default: 50 39 | 40 | The height of the gap, in pixels. 41 | 42 | ### `` 43 | Optional. Default: ``/50 44 | 45 | The size of the card as seen by the layouting engine. 46 | 47 | --- 48 | Buy Me A Coffee 49 | -------------------------------------------------------------------------------- /gap-card.js: -------------------------------------------------------------------------------- 1 | class GapCard extends HTMLElement { 2 | 3 | setConfig(config) { 4 | this.height = ('height' in config) ? config.height : 50; 5 | this.size = ('size' in config) ? config.size : Math.ceil(this.height/50); 6 | this.style.setProperty('height', this.height + 'px'); 7 | } 8 | 9 | getCardSize() { 10 | return this.size; 11 | } 12 | } 13 | 14 | customElements.define('gap-card', GapCard); 15 | -------------------------------------------------------------------------------- /hacs.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gap-card", 3 | "render_readme": true 4 | } 5 | --------------------------------------------------------------------------------