// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. import { LitElement, html, css, unsafeCSS } from "lit"; import { PROJECTION } from "./Map.js"; export class Orientation extends LitElement { static styles = css` :host { transform-style: preserve-3d; transform: ${unsafeCSS(PROJECTION.toString())}; perspective-origin: center; display: flex; position: relative; } .axis { position: absolute; left: 50%; width: 3px; height: 50%; transform-origin: bottom center; background: currentColor; } .z { color: blue; } .x { color: green; } .y { color: red; } .circle { position: absolute; left: 17.5%; top: 17.5%; height: 65%; width: 65%; opacity: 0.3; } .value { color: yellow; } .arrow::after { content: ""; display: block; border-left: 2px solid currentColor; border-top: 2px solid currentColor; width: 10px; height: 10px; transform: rotate(45deg) translate(0, -2px); transform-origin: top left; } `; static properties = { yaw: { type: Number }, pitch: { type: Number }, roll: { type: Number }, }; constructor() { super(); this.yaw = 0; this.pitch = 0; this.roll = 0; } render() { const a = (0.5 / Math.PI) * 360 * 4; const { yaw, pitch } = this; return html`
`; } } customElements.define("pika-orientation", Orientation);