diff --git a/src/assets/images/Figure.jpg b/src/assets/images/Figure.jpg new file mode 100644 index 0000000..3537e5f Binary files /dev/null and b/src/assets/images/Figure.jpg differ diff --git a/src/pages/index/index.css b/src/pages/index/index.css index b90956f..b68ea71 100644 --- a/src/pages/index/index.css +++ b/src/pages/index/index.css @@ -1,3 +1,95 @@ -.index{ - font-size: 1rem; -} \ No newline at end of file +.index { + font-size: 1rem; + display: flex; + flex-direction: column; + align-items: center; + justify-content: flex-end; + min-height: 100vh; + min-width: 100vw; + margin: 0; + padding: 0; + background-size: cover; + background-position: center; + background-repeat: no-repeat; + position: relative; +} + +.button-container { + position: absolute; + bottom: 20vh; + left: 50%; + transform: translateX(-50%); + z-index: 10; +} + +.create-button { + background: linear-gradient(135deg, #ff6b9d, #ff9a56, #ffd93d); + border: none; + border-radius: 72px; + padding: 24px 108px; + font-size: 36px; + font-weight: bold; + color: #fff; + text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); + box-shadow: 0 8px 25px rgba(255, 107, 157, 0.4), + 0 4px 15px rgba(255, 154, 86, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.3); + position: relative; + overflow: hidden; + transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); + cursor: pointer; + transform: scale(1); +} + +.create-button::before { + content: ""; + position: absolute; + top: 0; + left: -100%; + width: 100%; + height: 100%; + background: linear-gradient( + 90deg, + transparent, + rgba(255, 255, 255, 0.4), + transparent + ); + transition: left 0.5s; +} + +.create-button:hover { + transform: scale(1.05) translateY(-2px); + box-shadow: 0 12px 35px rgba(255, 107, 157, 0.5), + 0 6px 20px rgba(255, 154, 86, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.4); + filter: brightness(1.1); +} + +.create-button:hover::before { + left: 100%; +} + +.create-button:active { + transform: scale(0.98) translateY(1px); + box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3), + 0 2px 8px rgba(255, 154, 86, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.2); +} + +/* 添加闪烁动画 */ +@keyframes sparkle { + 0%, + 100% { + opacity: 0; + } + 50% { + opacity: 1; + } +} + +.create-button::after { + content: "✨"; + position: absolute; + top: -5px; + right: -5px; + font-size: 16px; + animation: sparkle 2s infinite; + pointer-events: none; +} diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index 44fcd03..1bba6c2 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -1,28 +1,34 @@ -import { View, Text, Button } from '@tarojs/components' -import { useLoad } from '@tarojs/taro' -import './index.css' -import { useAd, useSdk } from '../../hooks/index' +import { View, Button } from "@tarojs/components"; +import { useLoad } from "@tarojs/taro"; +import figureImg from "../../assets/images/figure.jpg"; +import { useSdk } from "../../hooks/index"; +import "./index.css"; export default function Index() { - - const sdk = useSdk() + const sdk = useSdk(); useLoad(() => { - return () => { } - }) + return () => {}; + }); + + const handleCreateClick = () => { + sdk + .chooseAndGenerateImage() + .then((task_id) => { + console.log({ task_id }); + return sdk.getTaskStatus(task_id); + }) + .then((res) => { + console.log(res); + }); + }; return ( - - Hello world Ymm !!!! - + + + + - ) + ); }