style: update app and friends-photo styles for improved layout and loading indicators

This commit is contained in:
iHeyTang 2025-09-28 18:30:34 +08:00
parent f02e8d949a
commit bc2abb29d2
5 changed files with 15 additions and 35 deletions

View File

@ -26,7 +26,7 @@ html, body {
.app-content { .app-content {
flex: 1; flex: 1;
overflow: hidden; overflow-y: auto;
padding-bottom: 60px; /* 为底部导航留出空间 */ padding-bottom: 60px; /* 为底部导航留出空间 */
} }

View File

@ -52,28 +52,14 @@
} }
.submit-button.disabled { .submit-button.disabled {
background-color: #ccc;
cursor: not-allowed; cursor: not-allowed;
border: none; border: none;
outline: none; outline: none;
} }
/* 加载动画 */ .loading-container {
.loading-spinner { display: flex;
width: 16px; align-items: center;
height: 16px; justify-content: center;
border: 2px solid rgb(255 255 255 / 30%); gap: 8px;
border-top: 2px solid white;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
} }

View File

@ -8,7 +8,6 @@ import { i18nManager } from '../../i18n/manager';
// 导入组件 // 导入组件
import UploadCard from './components/UploadCard'; import UploadCard from './components/UploadCard';
import './index.css'; import './index.css';
export default function FriendsPhoto() { export default function FriendsPhoto() {
@ -56,19 +55,17 @@ export default function FriendsPhoto() {
try { try {
// 将两个图片URL用逗号分隔 // 将两个图片URL用逗号分隔
const { hostname, protocol, port } = window.location; const { hostname, protocol, port } = window.location;
let baseUrl = `${protocol}//${hostname}` let baseUrl = `${protocol}//${hostname}`;
if (hostname === 'localhost') { if (hostname === 'localhost') {
baseUrl = `${protocol}//${hostname}:${port}` baseUrl = `${protocol}//${hostname}:${port}`;
} }
const cbUrl = `${baseUrl}/result` const cbUrl = `${baseUrl}/result`;
const checkout = await serverSdk.createCheckoutSession({ const checkout = await serverSdk.createCheckoutSession({
templateCode: templateCode, templateCode: templateCode,
metadata: { metadata: {
cb_url: cbUrl, cb_url: cbUrl,
imageUrls: [ imageUrls: [image1, image2],
image1, image2 },
]
}
}); });
if (checkout && checkout.url) { if (checkout && checkout.url) {
window.location.href = checkout.url; window.location.href = checkout.url;
@ -100,8 +97,7 @@ export default function FriendsPhoto() {
> >
{loading ? ( {loading ? (
<> <>
<div className="loading-spinner" /> <div className="loading-spinner" style={{ margin: 'auto' }} />
<div className="submit-text">{t('friendsPhoto.generating')}</div>
</> </>
) : ( ) : (
<div className="submit-text"> <div className="submit-text">

View File

@ -27,7 +27,6 @@
} }
.history-list { .history-list {
height: 100vh;
padding: 0; padding: 0;
position: relative; position: relative;
z-index: 2; z-index: 2;
@ -96,8 +95,8 @@
} }
.item-thumbnail { .item-thumbnail {
width: 160px; width: 80px;
height: 160px; height: 80px;
border-radius: 12px; border-radius: 12px;
margin-right: 20px; margin-right: 20px;
flex-shrink: 0; flex-shrink: 0;
@ -110,6 +109,7 @@
height: 100%; height: 100%;
border-radius: 12px; border-radius: 12px;
background: #f5f5f5; background: #f5f5f5;
object-fit: cover;
} }
.thumbnail-placeholder { .thumbnail-placeholder {
@ -253,7 +253,6 @@
.item-time { .item-time {
font-size: 14px; font-size: 14px;
color: #b9b9b9;
font-weight: 400; font-weight: 400;
opacity: 0.7; opacity: 0.7;
} }

View File

@ -25,7 +25,6 @@
.home-scroll { .home-scroll {
flex: 1; flex: 1;
height: 100%; height: 100%;
overflow-y: auto;
} }
.home-header { .home-header {