```json
{
"summary": "已创建校园活动列表组件,采用现代化卡片设计,包含活动图片、标题、日期、地点、简介和操作按钮。组件响应式适配移动端和桌面端,使用网格布局展示活动卡片。",
"widget": {
"type": "custom-template",
"isAPI": false,
"fullWidth": true,
"html": "<div class=\"container mx-auto px-4 py-12\">\n <div class=\"mb-10 text-center\">\n <h2 class=\"text-3xl font-bold text-gray-900 mb-4\">校园活动</h2>\n <p class=\"text-gray-600 max-w-2xl mx-auto\">探索丰富多彩的校园活动,丰富你的大学生活</p>\n </div>\n \n <div class=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8\">\n <!-- 活动卡片 1 -->\n <div class=\"bg-white rounded-xl shadow-md overflow-hidden transition-all duration-300 hover:shadow-xl\">\n <div class=\"relative h-48 overflow-hidden\">\n <img src=\"/assets/images/showcase/1.jpg\" alt=\"科技文化节\" class=\"w-full h-full object-cover transition-transform duration-500 hover:scale-110\">\n <div class=\"absolute top-4 right-4 bg-blue-600 text-white px-3 py-1 rounded-full text-sm font-medium\">\n 进行中\n </div>\n </div>\n <div class=\"p-6\">\n <h3 class=\"text-xl font-bold text-gray-900 mb-2\">校园科技文化节</h3>\n <div class=\"flex items-center text-gray-600 mb-3\">\n <svg class=\"w-5 h-5 mr-2\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z\"></path>\n </svg>\n <span>2023年10月15日 - 10月20日</span>\n </div>\n <div class=\"flex items-center text-gray-600 mb-4\">\n <svg class=\"w-5 h-5 mr-2\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z\"></path>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M15 11a3 3 0 11-6 0 3 3 0 016 0z\"></path>\n </svg>\n <span>学校大礼堂</span>\n </div>\n <p class=\"text-gray-700 mb-5 line-clamp-3\">年度科技盛事,包含创新项目展示、科技讲座和互动体验,欢迎全校师生参与。</p>\n <div class=\"flex justify-between items-center\">\n <span class=\"inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-blue-100 text-blue-800\">\n 科技类\n </span>\n <button class=\"text-blue-600 font-medium hover:text-blue-800 transition-colors duration-200\">\n 查看详情 →\n </button>\n </div>\n </div>\n </div>\n \n <!-- 活动卡片 2 -->\n <div class=\"bg-white rounded-xl shadow-md overflow-hidden transition-all duration-300 hover:shadow-xl\">\n <div class=\"relative h-48 overflow-hidden\">\n <img src=\"/assets/images/showcase/2.jpg\" alt=\"艺术展演\" class=\"w-full h-full object-cover transition-transform duration-500 hover:scale-110\">\n <div class=\"absolute top-4 right-4 bg-green-600 text-white px-3 py-1 rounded-full text-sm font-medium\">\n 报名中\n </div>\n </div>\n <div class=\"p-6\">\n <h3 class=\"text-xl font-bold text-gray-900 mb-2\">校园艺术展演周</h3>\n <div class=\"flex items-center text-gray-600 mb-3\">\n <svg class=\"w-5 h-5 mr-2\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z\"></path>\n </svg>\n <span>2023年11月5日 - 11月12日</span>\n </div>\n <div class=\"flex items-center text-gray-600 mb-4\">\n <svg class=\"w-5 h-5 mr-2\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z\"></path>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M15 11a3 3 0 11-6 0 3 3 0 016 0z\"></path>\n </svg>\n <span>艺术中心</span>\n </div>\n <p class=\"text-gray-700 mb-5 line-clamp-3\">展示学生艺术创作成果,包括绘画、雕塑、音乐表演和戏剧演出,为艺术爱好者提供交流平台。</p>\n <div class=\"flex justify-between items-center\">\n <span class=\"inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-green-100 text-green-800\">\n 艺术类\n </span>\n <button class=\"text-blue-600 font-medium hover:text-blue-800 transition-colors duration-200\">\n 查看详情 →\n </button>\n </div>\n </div>\n </div>\n \n <!-- 活动卡片 3 -->\n <div class=\"bg-white rounded-xl shadow-md overflow-hidden transition-all duration-300 hover:shadow-xl\">\n <div class=\"relative h-48 overflow-hidden\">\n <img src=\"/assets/images/showcase/3.jpg\" alt=\"运动会\" class=\"w-full h-full object-cover transition-transform duration-500 hover:scale-110\">\n <div class=\"absolute top-4 right-4 bg-purple-600 text-white px-3 py-1 rounded-full text-sm font-medium\">\n 筹备中\n </div>\n </div>\n <div class=\"p-6\">\n <h3 class=\"text-xl font-bold text-gray-900 mb-2\">秋季运动会</h3>\n <div class=\"flex items-center text-gray-600 mb-3\">\n <svg class=\"w-5 h-5 mr-2\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z\"></path>\n </svg>\n <span>2023年9月28日 - 9月30日</span>\n </div>\n <div class=\"flex items-center text-gray-600 mb-4\">\n <svg class=\"w-5 h-5 mr-2\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z\"></path>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M15 11a3 3 0 11-6 0 3 3 0 016 0z\"></path>\n </svg>\n <span>学校体育场</span>\n </div>\n <p class=\"text-gray-700 mb-5 line-clamp-3\">年度体育盛会,包含田径比赛、球类竞技和趣味运动项目,展现青春活力。</p>\n <div class=\"flex justify-between items-center\">\n <span class=\"inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-purple-100 text-purple-800\">\n 体育类\n </span>\n <button class=\"text-blue-600 font-medium hover:text-blue-800 transition-colors duration-200\">\n 查看详情 →\n </button>\n </div>\n </div>\n </div>\n </div>\n \n <div class=\"mt-12 text-center\">\n <button class=\"inline-flex items-center px-6 py-3 border border-gray-300 rounded-full text-base font-medium text-gray-700 bg-white hover:bg-gray-50 transition-colors duration-200\">\n 查看更多活动\n <svg class=\"ml-2 w-5 h-5\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M19 9l-7 7-7-7\"></path>\n </svg>\n </button>\n </div>\n</div>"
},
"next": [
"添加筛选分类",
"实现分页功能",
"增加搜索框",
"添加收藏功能",
"日期倒计时"
]
}
```
推理
我们正在创建一个校园活动列表组件。这个组件应该展示多个校园活动,每个活动可能包含活动标题、日期、地点、简要描述、图片以及一个详情按钮或链接。
考虑到移动端优先和响应式设计,我们将使用Flexbox或Grid布局来排列活动卡片。
每个活动卡片将包含:
- 活动图片(使用提供的图片资源中的展示图或插图)
- 活动标题
- 活动日期和地点(可以放在标题下方)
- 活动描述(可能限制行数以保持卡片高度一致)
- 一个“查看详情”按钮
设计风格:现代化、简洁,使用TailwindCSS的卡片样式,有阴影和圆角,鼠标悬停时有轻微放大效果(交互状态)。
图片选择:使用展示图(/assets/images/showcase/{1~8}.jpg),如果没有合适的,使用占位符。
结构:
- 整个组件背景默认白色,不需要额外设置。
- 容器使用container来限制最大宽度,并居中。
- 活动列表使用Grid布局,在移动端一列,平板两列,桌面三列或四列。
步骤:
1. 组件外层容器,设置内边距(上下左右)。
2. 标题区域(可选,但用户没有要求,我们可以加一个“校园活动”的标题在列表上方居中显示)。
3. 活动列表使用grid布局,设置间距(gap)。
4. 每个活动卡片:圆角、阴影、溢出隐藏(图片需要)、背景白色(因为默认页面白色,但卡片需要白色背景以区分)。
5. 卡片内部结构:图片(顶部),然后下面是一个内容区域(包含标题、日期地点、描述和按钮)。
6. 图片使用object-cover来保持比例,并设置高度(比如h-48)。
7. 内容区域设置内边距。
8. 按钮样式:使用Tailwind的按钮基础样式(比如背景色、文字色、圆角、内边距),并添加悬停效果。
由于用户没有提供具体活动数据,我们将使用占位文本和图片。
注意:遵循原子化CSS,使用Tailwind的类,避免自定义CSS。
我们将创建如下:
组件结构:
<div class="container mx-auto px-4 py-12"> <!-- 整个组件的容器,有内边距 -->
<h2 class="text-3xl font-bold text-center mb-8">校园活动</h2> <!-- 标题 -->
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8"> <!-- 活动列表网格 -->
<!-- 单个活动卡片 -->
<div class="bg-white rounded-xl shadow-md overflow-hidden hover:shadow-xl transition-shadow duration-300">
<img src="/assets/images/showcase/1.jpg" alt="活动图片" class="w-full h-48 object-cover">
<div class="p-6">
<h3 class="text-xl font-semibold mb-2">春季运动会</h3>
<div class="text-gray-600 mb-4">
<p>日期:2023年4月15日</p>
<p>地点:学校操场</p>
</div>
<p class="text-gray-700 mb-4">一年一度的春季运动会,欢迎全体师生参加。</p>
<a href="#" class="inline-block bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-colors duration-300">查看详情</a>
</div>
</div>
<!-- 重复多个卡片,这里我们做三个示例 -->
...
</div>
</div>
由于用户要求是列表,我们使用网格来展示多个活动。
考虑到下一步建议,我们可以提供:
- 添加更多活动
- 实现分页加载
- 添加活动分类筛选
- 添加活动搜索功能
- 优化图片懒加载
但根据当前任务,我们只生成静态的列表组件。
输出格式严格按照要求,使用JSON,并且widget.html部分放入完整的HTML代码。
注意:图片路径使用提供的资源,这里我们使用展示图1~3,分别对应三个卡片。
考虑到移动端优先和响应式设计,我们将使用Flexbox或Grid布局来排列活动卡片。
每个活动卡片将包含:
- 活动图片(使用提供的图片资源中的展示图或插图)
- 活动标题
- 活动日期和地点(可以放在标题下方)
- 活动描述(可能限制行数以保持卡片高度一致)
- 一个“查看详情”按钮
设计风格:现代化、简洁,使用TailwindCSS的卡片样式,有阴影和圆角,鼠标悬停时有轻微放大效果(交互状态)。
图片选择:使用展示图(/assets/images/showcase/{1~8}.jpg),如果没有合适的,使用占位符。
结构:
- 整个组件背景默认白色,不需要额外设置。
- 容器使用container来限制最大宽度,并居中。
- 活动列表使用Grid布局,在移动端一列,平板两列,桌面三列或四列。
步骤:
1. 组件外层容器,设置内边距(上下左右)。
2. 标题区域(可选,但用户没有要求,我们可以加一个“校园活动”的标题在列表上方居中显示)。
3. 活动列表使用grid布局,设置间距(gap)。
4. 每个活动卡片:圆角、阴影、溢出隐藏(图片需要)、背景白色(因为默认页面白色,但卡片需要白色背景以区分)。
5. 卡片内部结构:图片(顶部),然后下面是一个内容区域(包含标题、日期地点、描述和按钮)。
6. 图片使用object-cover来保持比例,并设置高度(比如h-48)。
7. 内容区域设置内边距。
8. 按钮样式:使用Tailwind的按钮基础样式(比如背景色、文字色、圆角、内边距),并添加悬停效果。
由于用户没有提供具体活动数据,我们将使用占位文本和图片。
注意:遵循原子化CSS,使用Tailwind的类,避免自定义CSS。
我们将创建如下:
组件结构:
<div class="container mx-auto px-4 py-12"> <!-- 整个组件的容器,有内边距 -->
<h2 class="text-3xl font-bold text-center mb-8">校园活动</h2> <!-- 标题 -->
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8"> <!-- 活动列表网格 -->
<!-- 单个活动卡片 -->
<div class="bg-white rounded-xl shadow-md overflow-hidden hover:shadow-xl transition-shadow duration-300">
<img src="/assets/images/showcase/1.jpg" alt="活动图片" class="w-full h-48 object-cover">
<div class="p-6">
<h3 class="text-xl font-semibold mb-2">春季运动会</h3>
<div class="text-gray-600 mb-4">
<p>日期:2023年4月15日</p>
<p>地点:学校操场</p>
</div>
<p class="text-gray-700 mb-4">一年一度的春季运动会,欢迎全体师生参加。</p>
<a href="#" class="inline-block bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-colors duration-300">查看详情</a>
</div>
</div>
<!-- 重复多个卡片,这里我们做三个示例 -->
...
</div>
</div>
由于用户要求是列表,我们使用网格来展示多个活动。
考虑到下一步建议,我们可以提供:
- 添加更多活动
- 实现分页加载
- 添加活动分类筛选
- 添加活动搜索功能
- 优化图片懒加载
但根据当前任务,我们只生成静态的列表组件。
输出格式严格按照要求,使用JSON,并且widget.html部分放入完整的HTML代码。
注意:图片路径使用提供的资源,这里我们使用展示图1~3,分别对应三个卡片。
角色
assistant
content
total_tokens
9233