From 5907a3f62bda3f51ed41636670649e61d3af3954 Mon Sep 17 00:00:00 2001 From: Maulerant Date: Fri, 28 Jun 2024 02:37:25 -0700 Subject: [PATCH] Created item template and JSON files --- scripts/itemDisplay.js | 15 ++++++ scripts/items.json | 11 +++++ templates/item/item-weapon-sheet.hbs | 74 ++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+) create mode 100644 scripts/itemDisplay.js create mode 100644 scripts/items.json create mode 100644 templates/item/item-weapon-sheet.hbs diff --git a/scripts/itemDisplay.js b/scripts/itemDisplay.js new file mode 100644 index 0000000..405acce --- /dev/null +++ b/scripts/itemDisplay.js @@ -0,0 +1,15 @@ + document.addEventListener("DOMContentLoaded", function () { + fetch('./scripts/items.json') + .then(Response => Response.json()) + .then(data => { + const itemDisplay = document.getElementById("iType"); + + //creates HTML elements to display JSON data + const typeElement = document.createElement("option"); + typeElement.textContent = items.itemTypes; + + //append the elements to the options + itemDisplay.appendChile(itemDisplay); + }) + .catch(error => console.error("Error fetching JSON Data:", error)); + }); \ No newline at end of file diff --git a/scripts/items.json b/scripts/items.json new file mode 100644 index 0000000..c5f3bd0 --- /dev/null +++ b/scripts/items.json @@ -0,0 +1,11 @@ +{ + "itemtypes":[ + "Item", + "weapons" + ], + "weaponTypes":[ + "Martial", + "Throwing", + "Taser" + ] +} \ No newline at end of file diff --git a/templates/item/item-weapon-sheet.hbs b/templates/item/item-weapon-sheet.hbs new file mode 100644 index 0000000..02b7e64 --- /dev/null +++ b/templates/item/item-weapon-sheet.hbs @@ -0,0 +1,74 @@ +
+
+ +
+

+
+
+ + +
+
+ + +
+
+
+
+ + {{!-- Sheet Tab Navigation --}} + + + {{!-- Sheet Body --}} +
+ + {{!-- Description Tab --}} +
+ {{!-- To render inline rolls in a TinyMCE editor, you need to pass the parent actor's (if any) roll data to the + rollData prop. --}} + {{editor system.description target="system.description" rollData=rollData button=true owner=owner + editable=editable}} +
+ + {{!-- Attributes Tab --}} +
+ {{!-- As you add new fields, add them in here! --}} +
+ + + Choose a Weapon type + +
+
+ + + + + +
+
+ +{{log system}} \ No newline at end of file