diff --git a/index.html b/index.html index 12440cf..f58ec6e 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,53 @@ DEMO + \ No newline at end of file diff --git a/main.js b/main.js index b869590..6e2814c 100644 --- a/main.js +++ b/main.js @@ -1 +1,27 @@ -console.log('main.js') +import { div, main, section, aside, h3, p, ul, li } from '@laniakeasupercluster/widgets' + +const blogData = [ + { id: '1', title: 'Blog 1', content: 'Content 1', date: new Date() }, + { id: '2', title: 'Blog 2', content: 'Content 2', date: new Date() }, + { id: '3', title: 'Blog 3', content: 'Content 3', date: new Date() }, +] +const tagData = ['JavaScript', 'CSS', 'HTML', 'Web'] +const articleData = ['Article 1', 'Article 2', 'Article 3'] + +document.body.appendChild(div.grid({ gridTemplateColumns: '3fr 1fr', gap: '1rem' }).p('1rem').childs([ + main.grid({ gap: '1rem' }).childs(blogData.map(blog => section.childs([ + h3.text(blog.title), + p.text(blog.content), + p.text(blog.date), + ]))), + aside.grid({ gridColumn: '2', flexDirection: 'column', gap: '1rem' }).childs([ + div.childs([ + h3.text('# TAG'), + ul.bg('#ececec').radius('1rem').childs(tagData.map(tag => li.text(tag))), + ]), + div.childs([ + h3.text('# 归档'), + ul.childs(articleData.map(article => li.text(article))), + ]), + ]), +])) diff --git a/package.json b/package.json index 529a36f..744d74c 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "author": "satori ", "license": "MIT", "dependencies": { + "@laniakeasupercluster/widgets": "^1.1.3", "axios": "^0.27.2", "express": "^4.17.1", "express-session": "^1.17.2",