Skip to content

Let's use AI to Earn!

样式和图

daoyian5f192f52d303
diff --git a/src/app/[lng]/material/ai-generate/ai-generate.module.scss b/src/app/[lng]/material/ai-generate/ai-generate.module.scss
index 2dcc43d9..ea1932c6 100644
--- a/src/app/[lng]/material/ai-generate/ai-generate.module.scss
+++ b/src/app/[lng]/material/ai-generate/ai-generate.module.scss
@@ -1,6 +1,5 @@
.container {
padding: 24px;
- max-width: 1200px;
margin: 0 auto;
background-color: #fff;
min-height: 100vh;
@@ -225,6 +224,97 @@
}
}
+// 模板选择网格
+.templateGrid {
+ display: flex;
+ gap: 12px;
+ overflow-x: auto;
+ padding: 4px 0;
+ scrollbar-width: thin;
+ scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
+
+ &::-webkit-scrollbar {
+ height: 6px;
+ }
+
+ &::-webkit-scrollbar-track {
+ background: transparent;
+ }
+
+ &::-webkit-scrollbar-thumb {
+ background: rgba(0, 0, 0, 0.2);
+ border-radius: 3px;
+ }
+
+ &::-webkit-scrollbar-thumb:hover {
+ background: rgba(0, 0, 0, 0.3);
+ }
+}
+
+.templateCard {
+ border: 2px solid rgba(0, 0, 0, 0.08);
+ border-radius: 10px;
+ overflow: hidden;
+ background: #fff;
+ cursor: pointer;
+ transition: all 0.2s ease;
+ box-shadow: 0 2px 8px rgba(0,0,0,0.06);
+ flex-shrink: 0;
+ width: 160px;
+
+ &:hover {
+ transform: translateY(-2px);
+ box-shadow: 0 6px 20px rgba(0,0,0,0.12);
+ }
+}
+
+.templateCardActive {
+ border-color: var(--theColor5) !important;
+ box-shadow: 0 0 0 3px rgba(166, 106, 228, 0.2), 0 4px 12px rgba(166, 106, 228, 0.15) !important;
+ transform: translateY(-1px);
+ position: relative;
+
+ &::after {
+ content: '';
+ position: absolute;
+ top: -2px;
+ left: -2px;
+ right: -2px;
+ bottom: -2px;
+ border: 2px solid var(--theColor5);
+ border-radius: 12px;
+ pointer-events: none;
+ animation: pulse 2s infinite;
+ }
+}
+
+.templateThumb {
+ position: relative;
+ width: 100%;
+ /* 维持 800x500 比例 = 5:3 */
+ padding-top: 62.5%;
+ background: #f6f7f9;
+
+ img {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ }
+}
+
+.templateLabel {
+ padding: 10px 12px;
+ font-size: 13px;
+ color: #444;
+ text-align: left;
+ font-weight: 500;
+ background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
+ border-top: 1px solid rgba(0, 0, 0, 0.05);
+}
+
@keyframes fadeIn {
from {
opacity: 0;
@@ -236,6 +326,18 @@
}
}
+@keyframes pulse {
+ 0% {
+ opacity: 1;
+ }
+ 50% {
+ opacity: 0.6;
+ }
+ 100% {
+ opacity: 1;
+ }
+}
+
// 添加响应式样式
@media (max-width: 768px) {
.container {
@@ -264,4 +366,12 @@
flex-direction: column;
gap: 12px;
}
+
+ .templateGrid {
+ gap: 8px;
+
+ .templateCard {
+ width: 140px;
+ }
+ }
}
\ No newline at end of file
diff --git a/src/app/[lng]/material/ai-generate/page.tsx b/src/app/[lng]/material/ai-generate/page.tsx
index 008de618..2d03c70a 100644
--- a/src/app/[lng]/material/ai-generate/page.tsx
+++ b/src/app/[lng]/material/ai-generate/page.tsx
@@ -64,6 +64,18 @@ export default function AIGeneratePage() {
const [temp, setTemp] = useState("tempA");
const [loadingFirefly, setLoadingFirefly] = useState(false);
const [fireflyResult, setFireflyResult] = useState<string | null>(null);
+ const TEMPLATE_BASE = "https://aitoearn.s3.ap-southeast-1.amazonaws.com/common/firefly";
+ const templateList = [
+ { key: "tempA", name: "默认" },
+ { key: "tempB", name: "透明" },
+ { key: "tempC", name: "金句" },
+ { key: "tempJin", name: "书摘" },
+ { key: "tempMemo", name: "便当" },
+ { key: "tempEasy", name: "边框" },
+ { key: "tempE", name: "边框" },
+ { key: "tempWrite", name: "手写" },
+ { key: "tempD", name: "图片" },
+ ];
// 视频生成相关状态
const [videoPrompt, setVideoPrompt] = useState("");
@@ -464,23 +476,25 @@ export default function AIGeneratePage() {
onChange={(e) => setContent(e.target.value)}
rows={4}
/>
- <Select
- value={temp}
- onChange={setTemp}
- style={{ width: "100%" }}
- >
- <Option value="tempA">{t('aiGenerate.template')} A</Option>
- <Option value="tempB">{t('aiGenerate.template')} B</Option>
- <Option value="tempC">{t('aiGenerate.template')} C</Option>
- <Option value="tempJin">金卡模板</Option>
- <Option value="tempMemo">备忘录模板</Option>
- <Option value="tempEasy">简约模板</Option>
- <Option value="tempBlackSun">黑日模板</Option>
- <Option value="tempE">模板 E</Option>
- <Option value="tempWrite">写作模板</Option>
- <Option value="code">代码模板</Option>
- <Option value="tempD">模板 D</Option>
- </Select>
+ <div className={styles.templateGrid}>
+ {templateList.map((item) => (
+ <div
+ key={item.key}
+ className={`${styles.templateCard} ${temp === item.key ? styles.templateCardActive : ""}`}
+ onClick={() => setTemp(item.key)}
+ >
+ <div className={styles.templateThumb}>
+ <img
+ src={`${TEMPLATE_BASE}/${item.key}.png`}
+ alt={`${t('aiGenerate.template')} ${item.name}`}
+ />
+ </div>
+ <div className={styles.templateLabel}>
+ {item.name}
+ </div>
+ </div>
+ ))}
+ </div>
<Button
type="primary"
onClick={handleTextToFireflyCard}
diff --git a/src/app/[lng]/material/album/[id]/album.module.scss b/src/app/[lng]/material/album/[id]/album.module.scss
index aab54f7d..fd8b3d02 100644
--- a/src/app/[lng]/material/album/[id]/album.module.scss
+++ b/src/app/[lng]/material/album/[id]/album.module.scss
@@ -1,7 +1,6 @@
.container {
padding: 24px;
width: 100%;
- max-width: 1440px;
margin: 0 auto;
box-sizing: border-box;
}