From ae5506cac3b94960bee58bb78b4bc70a469c99b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A7=89?= Date: Thu, 16 May 2024 20:53:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ main.js | 28 +++++++++++++++++++++++++++- package.json | 1 + 3 files changed, 77 insertions(+), 1 deletion(-) 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",