From 926cc5d1751314a18c0e3056243c0a12e804d81c Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 5 Apr 2021 23:23:21 +0200 Subject: Added stub of labels --- derelict.js | 1 + style.css | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/derelict.js b/derelict.js index 2bb47c7..2471104 100644 --- a/derelict.js +++ b/derelict.js @@ -54,6 +54,7 @@ class Wreck { this.killmail = killmail this.domElement.className = 'wreck' + this.domElement.dataset.label = `${this.killmail.killmail_id}` this.domElement.appendChild(iconElement) this.point.position.copy(position) this.point.add(object2d) diff --git a/style.css b/style.css index bbeb91b..472cbd8 100644 --- a/style.css +++ b/style.css @@ -21,6 +21,19 @@ body { border: 2px solid #eee; } +.wreck::after { + display: block; + content: attr(data-label); + color: #eee; + position: absolute; + top: 0; + left: 107.5%; + padding: 0.2em 0.5em; + background: #000a; + border-radius: 0.5em; + pointer-events: none; +} + #wrapper { display: flex; width: 100vw; -- cgit v1.1