Little changes, grid, adding "template" elements
This commit is contained in:
parent
60d29ceb12
commit
05e20d25d2
|
@ -0,0 +1,9 @@
|
|||
import generateElement from "../modules/genElement";
|
||||
|
||||
const task = generateElement({
|
||||
element: "div",
|
||||
className: "task text-4xl",
|
||||
innerHTML: "task",
|
||||
})
|
||||
|
||||
export default task;
|
|
@ -19,4 +19,7 @@ function firstLaunch() {
|
|||
|
||||
document.addEventListener("DOMContentLoaded", firstLaunch);
|
||||
|
||||
pubsub.subscribe("refreshDOM", refreshDOM);
|
||||
pubsub.subscribe("refreshDOM", refreshDOM);
|
||||
|
||||
import task from "./elements/task";
|
||||
app.append(task);
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -5,17 +5,17 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Tasks</title>
|
||||
</head>
|
||||
<body class="bg-neutral-950 text-slate-50">
|
||||
<body class="bg-neutral-800 text-slate-50">
|
||||
<!-- <div id="btns">
|
||||
<button type="button" class="bg-green-600">add task</button>
|
||||
</div> -->
|
||||
<div id="app">
|
||||
<header class="w-11/12 border border-t-0 border-white text-center m-auto rounded-b-lg p-2">Tasks</header>
|
||||
<div id="contain" class="flex w-11/12 m-auto">
|
||||
<div id="projects-div" class="bg-green-600 flex-1">
|
||||
<header class="w-11/12 border border-t-0 border-white text-center m-auto mb-4 rounded-b-lg p-4 bg-neutral-950 text-2xl">Tasks</header>
|
||||
<div id="contain" class="grid md:grid-cols-[minmax(200px,_300px)_1fr] w-11/12 m-auto gap-4">
|
||||
<div id="projects-div" class="bg-slate-800 rounded-md p-4 border border-green-200">
|
||||
<div id="list"></div>
|
||||
</div>
|
||||
<div id="tasks-div" class="bg-green-400 flex-1 text-black">
|
||||
<div id="tasks-div" class="bg-slate-700 rounded-md p-4 border border-green-100">
|
||||
<div id="list"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -2,7 +2,11 @@
|
|||
module.exports = {
|
||||
content: ["./src/*.html"],
|
||||
theme: {
|
||||
extend: {},
|
||||
extend: {
|
||||
gridTemplateColumns: {
|
||||
'lists': 'minmax(1fr, 400px)) 1fr',
|
||||
}
|
||||
},
|
||||
},
|
||||
plugins: [],
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue