diff --git a/src/elements/project.js b/src/elements/project.js new file mode 100644 index 0000000..e69de29 diff --git a/src/elements/task.js b/src/elements/task.js new file mode 100644 index 0000000..4eb3dda --- /dev/null +++ b/src/elements/task.js @@ -0,0 +1,9 @@ +import generateElement from "../modules/genElement"; + +const task = generateElement({ + element: "div", + className: "task text-4xl", + innerHTML: "task", +}) + +export default task; \ No newline at end of file diff --git a/src/main.js b/src/main.js index 319c5bb..b267151 100644 --- a/src/main.js +++ b/src/main.js @@ -19,4 +19,7 @@ function firstLaunch() { document.addEventListener("DOMContentLoaded", firstLaunch); -pubsub.subscribe("refreshDOM", refreshDOM); \ No newline at end of file +pubsub.subscribe("refreshDOM", refreshDOM); + +import task from "./elements/task"; +app.append(task); \ No newline at end of file diff --git a/src/modules/genElement.js b/src/modules/genElement.js new file mode 100644 index 0000000..f8bdbe0 --- /dev/null +++ b/src/modules/genElement.js @@ -0,0 +1,11 @@ +export default function generateElement(obj) { + if (!obj.element) { + throw new Error("No element argument provided"); + } else { + const element = document.createElement(`${obj.element}`); + for (let key in obj) { + element[key] = obj[key]; + } + return element; + } +} \ No newline at end of file diff --git a/src/template.html b/src/template.html index 107f7fe..90230bb 100644 --- a/src/template.html +++ b/src/template.html @@ -5,17 +5,17 @@ Tasks - +
-
Tasks
-
-
+
Tasks
+
+
-
+
diff --git a/tailwind.config.js b/tailwind.config.js index 709c9f1..df31b63 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -2,7 +2,11 @@ module.exports = { content: ["./src/*.html"], theme: { - extend: {}, + extend: { + gridTemplateColumns: { + 'lists': 'minmax(1fr, 400px)) 1fr', + } + }, }, plugins: [], }