const { LitElement, html, css } = require('lit') const { commonCss, displayScreen } = require('./components/common') class PlayScreen extends LitElement { static get styles () { return css` ${commonCss} .title { top: 12px; } .edit-boxes { position: absolute; top: 59px; left: 50%; display: flex; flex-direction: column; gap: 14px 0; transform: translate(-50%); width: 310px; } .wrapper { width: 100%; display: flex; flex-direction: row; gap: 0 4px; } .button-wrapper { display: flex; flex-direction: row; gap: 0 4px; position: absolute; bottom: 9px; left: 50%; transform: translate(-50%); width: 310px; } ` } static get properties () { return { server: { type: String }, serverport: { type: Number }, proxy: { type: String }, proxyport: { type: Number }, username: { type: String }, password: { type: String } } } constructor () { super() this.server = '' this.serverport = 25565 this.proxy = '' this.proxyport = '' this.username = window.localStorage.getItem('username') ?? 'pviewer' + (Math.floor(Math.random() * 1000)) this.password = '' window.fetch('config.json').then(res => res.json()).then(config => { this.server = config.defaultHost this.serverport = config.defaultHostPort ?? 25565 this.proxy = config.defaultProxy this.proxyport = !config.defaultProxy && !config.defaultProxyPort ? '' : config.defaultProxyPort ?? 443 }) } render () { return html`
Join a Server