Initial commit
This commit is contained in:
25
miniprogram/pages/home/home.js
Normal file
25
miniprogram/pages/home/home.js
Normal file
@@ -0,0 +1,25 @@
|
||||
Page({
|
||||
data: {
|
||||
keyword: ''
|
||||
},
|
||||
|
||||
onInput(e) {
|
||||
this.setData({
|
||||
keyword: e.detail.value
|
||||
});
|
||||
},
|
||||
|
||||
startNaming() {
|
||||
if (!this.data.keyword.trim()) {
|
||||
wx.showToast({
|
||||
title: '请输入一抹期待',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
wx.navigateTo({
|
||||
url: `/pages/index/index?keyword=${encodeURIComponent(this.data.keyword)}`
|
||||
});
|
||||
}
|
||||
});
|
||||
3
miniprogram/pages/home/home.json
Normal file
3
miniprogram/pages/home/home.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
25
miniprogram/pages/home/home.wxml
Normal file
25
miniprogram/pages/home/home.wxml
Normal file
@@ -0,0 +1,25 @@
|
||||
<view class="container">
|
||||
<view class="content">
|
||||
<view class="title">见素</view>
|
||||
<view class="subtitle">回归名字的诗意与留白</view>
|
||||
|
||||
<view class="input-section">
|
||||
<input
|
||||
class="keyword-input"
|
||||
placeholder="输入关键词,如:自由、清冷"
|
||||
placeholder-class="placeholder"
|
||||
bindinput="onInput"
|
||||
value="{{keyword}}"
|
||||
/>
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
|
||||
<view class="action-section">
|
||||
<button class="generate-btn" bindtap="startNaming">感悟名字</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="footer">
|
||||
<text>© 见素 · 审美溢价</text>
|
||||
</view>
|
||||
</view>
|
||||
123
miniprogram/pages/home/home.wxss
Normal file
123
miniprogram/pages/home/home.wxss
Normal file
@@ -0,0 +1,123 @@
|
||||
page {
|
||||
background-color: #FFFFFF;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.container {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 0 80rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-top: 35vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
animation: contentFadeIn 1.5s cubic-bezier(0.19, 1, 0.22, 1);
|
||||
}
|
||||
|
||||
.title {
|
||||
font-family: "Noto Serif SC", serif;
|
||||
font-size: 80rpx;
|
||||
color: #2D2D2D;
|
||||
letter-spacing: 24rpx;
|
||||
font-weight: 300;
|
||||
margin-bottom: 20rpx;
|
||||
padding-left: 24rpx;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
font-size: 22rpx;
|
||||
color: #D0D0D0;
|
||||
letter-spacing: 6rpx;
|
||||
margin-bottom: 150rpx;
|
||||
}
|
||||
|
||||
.input-section {
|
||||
width: 100%;
|
||||
margin-bottom: 80rpx;
|
||||
}
|
||||
|
||||
.keyword-input {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
color: #4A4A4A;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
color: #E0E0E0;
|
||||
font-weight: 200;
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 40rpx;
|
||||
height: 1rpx;
|
||||
background-color: #F0F0F0;
|
||||
margin: 10rpx auto 0;
|
||||
transition: width 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
|
||||
}
|
||||
|
||||
.input-section:focus-within .line {
|
||||
width: 80rpx;
|
||||
background-color: #2D2D2D;
|
||||
}
|
||||
|
||||
.action-section {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.generate-btn {
|
||||
background: none !important;
|
||||
color: #A0A0A0 !important;
|
||||
font-size: 24rpx !important;
|
||||
font-weight: 200 !important;
|
||||
padding: 20rpx 60rpx !important;
|
||||
letter-spacing: 12rpx !important;
|
||||
text-indent: 12rpx !important;
|
||||
transition: all 0.3s;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.generate-btn::after {
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.generate-btn:active {
|
||||
color: #2D2D2D !important;
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: absolute;
|
||||
bottom: 80rpx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
text-align: center;
|
||||
animation: footerFadeIn 3s ease-in;
|
||||
}
|
||||
|
||||
.footer text {
|
||||
font-size: 16rpx;
|
||||
color: #F0F0F0;
|
||||
letter-spacing: 4rpx;
|
||||
}
|
||||
|
||||
@keyframes contentFadeIn {
|
||||
from { opacity: 0; transform: translateY(20rpx); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
@keyframes footerFadeIn {
|
||||
0% { opacity: 0; }
|
||||
70% { opacity: 0; }
|
||||
100% { opacity: 1; }
|
||||
}
|
||||
Reference in New Issue
Block a user