https://svgwave.in/…
- User
https://svgwave.in/ 参考这个网站的波浪形状,在微信小程序中实现弥散渐变的背景下面有波浪形状,搭配要非常精致,富有设计感,同时加上一些点缀的元素,主色调使用#4F46E5,要非常好看富有设计感,不要动态效果,是医疗健康相关的内容,只占据顶部背景,波浪不要动态,要有设计感,颜色要非常清淡,只是作为一个顶部的设计,要精致,给出完整微信小程序代码
Assistant
微信小程序精致波浪背景实现
下面是一个精致的医疗健康相关的波浪背景实现,采用清淡的渐变色调,搭配精致的点缀元素,符合医疗健康的专业感。
完整代码实现
1. WXML 文件 (index.wxml)
<view class="container"> <!-- 波浪背景容器 --> <view class="wave-container"> <!-- 渐变背景 --> <view class="gradient-bg"></view> <!-- 波浪形状 --> <view class="wave-shape"> <view class="wave"></view> </view> <!-- 点缀元素 --> <view class="decorations"> <view class="dot dot-1"></view> <view class="dot dot-2"></view> <view class="dot dot-3"></view> <view class="dot dot-4"></view> <view class="dot dot-5"></view> <view class="cross cross-1"></view> <view class="cross cross-2"></view> </view> </view> <!-- 内容区域 --> <view class="content"> <!-- 这里放置你的实际内容 --> <text class="title">健康管理</text> <text class="subtitle">专业医疗健康服务</text> </view> </view>2. WXSS 文件 (index.wxss)
/* 容器样式 */ .container { position: relative; width: 100%; height: 100vh; overflow: hidden; background-color: #f8fafc; } /* 波浪背景容器 */ .wave-container { position: relative; width: 100%; height: 40vh; overflow: hidden; } /* 渐变背景 */ .gradient-bg { position: absolute; width: 100%; height: 100%; background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(165, 180, 252, 0.05) 100%); z-index: 1; } /* 波浪形状容器 */ .wave-shape { position: absolute; bottom: 0; left: 0; width: 100%; height: 100px; overflow: hidden; z-index: 2; } /* 波浪形状 */ .wave { position: absolute; bottom: 0; left: 0; width: 200%; height: 100px; background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 100" preserveAspectRatio="none"><path fill="%23f8fafc" d="M0,0V7.3C0,7.3,128.7,55,288,55c159.3,0,288-47.7,288-47.7s288,47.7,288,47.7c0,0,288-47.7,432-55v92.7H0Z"></path><path fill="%23eef2ff" d="M0,0V14.6C0,14.6,128.7,69.3,288,69.3c159.3,0,288-54.7,288-54.7s288,54.7,288,54.7c0,0,288-54.7,432-69.3V100H0Z"></path><path fill="%23e0e7ff" d="M0,0V21.9C0,21.9,128.7,83.6,288,83.6c159.3,0,288-61.7,288-61.7s288,61.7,288,61.7c0,0,288-61.7,432-83.6V100H0Z"></path></svg>'); background-size: 50% 100px; background-repeat: repeat-x; z-index: 3; } /* 点缀元素 */ .decorations { position: absolute; width: 100%; height: 100%; z-index: 4; } /* 点元素 */ .dot { position: absolute; border-radius: 50%; background-color: rgba(79, 70, 229, 0.2); } .dot-1 { width: 8px; height: 8px; top: 20%; left: 10%; } .dot-2 { width: 6px; height: 6px; top: 60%; left: 25%; } .dot-3 { width: 10px; height: 10px; top: 30%; right: 15%; } .dot-4 { width: 5px; height: 5px; top: 70%; right: 30%; } .dot-5 { width: 7px; height: 7px; top: 40%; left: 50%; } /* 十字元素 */ .cross { position: absolute; width: 12px; height: 12px; border: 1px solid rgba(79, 70, 229, 0.3); border-radius: 2px; } .cross::before, .cross::after { content: ''; position: absolute; background-color: rgba(79, 70, 229, 0.3); } .cross::before { width: 8px; height: 1px; top: 5px; left: 2px; } .cross::after { width: 1px; height: 8px; top: 2px; left: 5px; } .cross-1 { top: 15%; left: 20%; } .cross-2 { top: 50%; right: 10%; } /* 内容区域 */ .content { position: relative; z-index: 5; padding: 20px; text-align: center; margin-top: 20px; } .title { font-size: 24px; font-weight: bold; color: #1f2937; margin-bottom: 8px; } .subtitle { font-size: 16px; color: #6b7280; }3. JS 文件 (index.js)
Page({ data: { // 可以在这里添加你的数据 }, onLoad: function() { // 页面加载时的逻辑 } })4. JSON 文件 (index.json)
{ "usingComponents": {} }设计说明
-
色彩方案:
- 主色调使用#4F46E5(紫罗兰色),但通过透明度调整使其显得清淡
- 渐变背景从rgba(79, 70, 229, 0.1)到rgba(165, 180, 252, 0.05)
- 波浪使用三层渐变色,从浅到深
-
波浪设计:
- 使用SVG路径创建精致的波浪形状
- 三层波浪叠加,创造深度感
- 波浪颜色与背景渐变协调
-
点缀元素:
- 添加了不同大小的圆点
- 添加了十字形元素,象征医疗健康
- 所有点缀元素都使用半透明色彩,不显得突兀
-
布局:
- 波浪背景仅占据顶部40%的高度
- 内容区域在波浪下方,保持清晰的层次关系
这个设计既保持了医疗健康的专业感,又通过精致的波浪和点缀元素增加了视觉吸引力,同时颜色清淡不会干扰内容展示。
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.