Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-05-02 11:02:10 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-05-02 11:04:09 -0700
commita69623b0ab6baff9f968e126c25d7e961e9dde53 (patch)
treed1f84b493cb3cbf1f2ba8df61f9ff8bd6099277f /public/soldier_record_block.js
parent9ac571cc244ef02a32679f3fb47ffee5f7e0fd7c (diff)
Organize public directory contents into assets folders
Diffstat (limited to 'public/soldier_record_block.js')
-rw-r--r--public/soldier_record_block.js56
1 files changed, 0 insertions, 56 deletions
diff --git a/public/soldier_record_block.js b/public/soldier_record_block.js
deleted file mode 100644
index 3931649..0000000
--- a/public/soldier_record_block.js
+++ /dev/null
@@ -1,56 +0,0 @@
-customElements.define(
- 'damage-block',
- class extends HTMLSpanElement {
- constructor() {
- super();
-
- const template = document.querySelector('#damage-block'),
- templateContent = template.content,
- shadowRoot = this.attachShadow({ mode: "open" });
-
- shadowRoot.appendChild(templateContent.cloneNode(true));
- }
-
- connectedCallback() {
- const el = this.shadowRoot.querySelector('.damage-effect-indicator');
-
- el.addEventListener('click', e => {
- e.stopPropagation()
-
- this.#cycleThroughDamageStates(el);
- });
- }
-
- #cycleThroughDamageStates(el) {
- if (el.classList.contains('bruise')) {
- el.classList.remove('bruise');
- el.classList.add('lethal');
- } else if (el.classList.contains('lethal')) {
- el.classList.remove('lethal');
- } else {
- el.classList.add('bruise');
- }
- }
- },
- { extends: 'span' }
-);
-
-customElements.define(
- 'soldier-record-block',
- class extends HTMLDivElement {
- constructor() {
- super();
-
- const template = document.querySelector('#soldier-record-block'),
- templateContent = template.content,
- shadowRoot = this.attachShadow({ mode: "open" });
-
- shadowRoot.appendChild(templateContent.cloneNode(true));
- }
-
- connectedCallback() {
- this.shadowRoot.querySelector('.grenades').addEventListener('click', e => e.stopPropagation());
- }
- },
- { extends: 'div' }
-);