From 02ed33c67425f618d759d9e7623e9baa949d0847 Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Wed, 14 Dec 2022 15:32:22 -0800 Subject: [PATCH] add top div to instance article --- css/instance.css | 4 ++++ scripts/elements.js | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/css/instance.css b/css/instance.css index 70fa182..4b634f2 100644 --- a/css/instance.css +++ b/css/instance.css @@ -2,4 +2,8 @@ article { border-top: solid white 1px; border-bottom: solid white 1px; margin: 0px; +} + +.instance-top-div { + display: flex; } \ No newline at end of file diff --git a/scripts/elements.js b/scripts/elements.js index 987bcaa..1650afd 100644 --- a/scripts/elements.js +++ b/scripts/elements.js @@ -24,17 +24,22 @@ class Instance extends HTMLElement { set data (data) { let instanceArticle = this.shadowElement.querySelector("article"); + let topDiv = document.createElement("div"); + topDiv.classList.add("instance-top-div"); + let typeImg = document.createElement("img"); typeImg.src = `images/instances/${data.type}/${data.status}.svg`; - instanceArticle.append(typeImg); + topDiv.append(typeImg); let vmidParagraph = document.createElement("p"); vmidParagraph.innerText = data.vmid; - instanceArticle.append(vmidParagraph); + topDiv.append(vmidParagraph); let nameParagraph = document.createElement("p"); nameParagraph.innerText = data.name; - instanceArticle.append(nameParagraph); + topDiv.append(nameParagraph); + + instanceArticle.append(topDiv); let nodeImg = document.createElement("img"); nodeImg.src = `images/nodes/${data.node.status}.svg`;