webwidget/ts_web/elements/uptimelink-webwidget.ts

59 lines
1.4 KiB
TypeScript
Raw Normal View History

2020-09-19 15:51:50 +00:00
import { LitElement, property, html, customElement, TemplateResult } from 'lit-element';
import * as domtools from '@designestate/dees-domtools';
@customElement('uptimelink-webwidget')
export class UptimelinkWebwidget extends LitElement {
public static demo = () => html`
<uptimelink-webwidget projectSlug="uptime.link"></uptimelink-webwidget>
`;
@property()
public projectSlug: string;
constructor() {
super();
domtools.DomTools.setupDomTools();
}
public render(): TemplateResult {
return html`
${domtools.elementBasic.styles}
<style>
2020-11-23 22:03:02 +00:00
:host {
display: block;
}
2020-09-19 15:51:50 +00:00
.mainbox {
2020-11-23 22:03:02 +00:00
line-height: 1em;
2020-09-19 15:51:50 +00:00
margin: auto;
display: grid;
grid-template-columns: 26px auto;
font-family: Roboto;
font-weight: 400;
font-size: 13px;
box-sizing: border-box;
width: 150px;
border-radius: 20px;
height: 30px;
2020-09-19 15:55:22 +00:00
background: #222;
2020-09-19 15:51:50 +00:00
padding: 5px;
color: #CCC;
cursor: pointer;
}
.statusindicator {
height: 20px;
width: 20px;
background: #66BB6A;
border-radius: 10px;
}
.statustext {
padding-top: 3px;
}
</style>
<div class="mainbox">
<div class="statusindicator"></div>
<div class="statustext">All systems are up!</div>
</div>
`;
}
}