میتونی پایین دکمه شروع یه انیمیشن بسازی که مثلاً یک مدل باشه با یک لباس و یک علامت مساوی…
- User
میتونی پایین دکمه شروع یه انیمیشن بسازی که مثلاً یک مدل باشه با یک لباس و یک علامت مساوی تن مدل لباس نباشه و بعد تن مدل با انیمیشن لباس بشه و مساوی بشه با مدل که اون لباس پوشیده راستی کد رو هم کامل میخواستم با اضافه این
.ai-animation-gallery { padding: 20px; width: 100%; max-width: 800px; text-align: center; } .ai-animation-gallery .section { margin: 0; text-align: center; } /* دکمه شروع جدید با انیمیشن */ .start-button { position: relative; background: linear-gradient(45deg, #FF6B6B, #6B5B95); color: white; padding: 15px 40px; font-size: 18px; font-weight: bold; cursor: pointer; overflow: hidden; transition: all 0.3s ease; display: inline-flex; align-items: center; text-decoration: none; border-radius: 50px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); } /* محتوای دکمه */ .button-content { display: flex; align-items: center; justify-content: space-between; width: 100%; } .button-text { margin-right: 0; } .clothing-icon { margin-right: 15px; font-size: 24px; animation: changeClothes 3s infinite; } @keyframes changeClothes { 0% { content: "👔"; } 33% { content: "👗"; } 66% { content: "🧥"; } 100% { content: "👔"; } } /* افکت hover */ .start-button:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); background: linear-gradient(45deg, #6B5B95, #FF6B6B); } /* افکت ripple */ .start-button::after { content: ""; position: absolute; top: 50%; left: 50%; width: 0; height: 0; background: rgba(255, 255, 255, 0.2); border-radius: 50%; transform: translate(-50%, -50%); transition: width 0.6s ease-out, height 0.6s ease-out; } .start-button:active::after { width: 200px; height: 200px; } /* استایل آکوردئون */ .accordion { max-width: 800px; width: 100%; background: #ffffff; padding: 30px; border-radius: 12px; box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15); animation: fadeIn 1s ease-out; margin-top: 20px; } @keyframes fadeIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } } .accordion-item { border-bottom: 1px solid #e2e8f0; overflow: hidden; } .accordion-header { background: none; border: none; outline: none; padding: 20px; width: 100%; text-align: right; font-size: 18px; font-weight: 600; color: #2d3748; cursor: pointer; display: flex; align-items: center; justify-content: space-between; transition: all 0.3s ease; } .accordion-header:hover { color: #6B5B95; background: #f8f9fa; } .chevron { transition: transform 0.3s ease; font-size: 20px; color: #a0aec0; } .accordion-header.active .chevron { transform: rotate(180deg); color: #6B5B95; } .accordion-content { max-height: 0; opacity: 0; transform: translateY(-20px); overflow: hidden; transition: all 0.5s ease; background-color: #f7fafc; padding: 0 20px; } .accordion-content.active { max-height: 1000px; opacity: 1; transform: translateY(0); padding: 20px; } .accordion-content p { color: #4a5568; line-height: 1.6; margin: 10px 0; } /* استایل ویدیو */ .accordion-content video { width: 100%; max-width: 800px; height: auto; border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; } .accordion-content video:hover { transform: scale(1.02); } /* واکنشگرایی */ @media (max-width: 600px) { .accordion { padding: 15px; } .accordion-header { font-size: 16px; padding: 15px; } .start-button { padding: 12px 30px; font-size: 16px; } } </style>// اسکریپت انیمیشن آیکون لباس const clothingIcons = ["👔", "👗", "🧥"]; let currentIcon = 0; setInterval(() => { const icon = document.querySelector('.clothing-icon'); currentIcon = (currentIcon + 1) % clothingIcons.length; icon.textContent = clothingIcons[currentIcon]; }, 1000); </script> - Assistant
برای ایجاد انیمیشن تغییر لباس و نمایش آن در یک صفحه وب، از HTML, CSS و JavaScript استفاده میکنیم. با توجه به توضیحات و کد ارائهشده، شما میخواهید انیمیشنی بسازید که تغییر لباس بر روی مدل را نمایش دهد. در زیر، کدی طراحی شده است که یک دکمه دارد و با کلیک روی دکمه، انیمیشن تغییر لباس اجرا میشود:
<!DOCTYPE html> <html lang="fa"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>تغییر لباس با هوش مصنوعی</title> <style> /* تنظیمات استایل کلی */ body { background: linear-gradient(135deg, #f5f7fa, #c3cfe2); min-height: 100vh; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; direction: rtl; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } .start-button { position: relative; background: linear-gradient(45deg, #FF6B6B, #6B5B95); color: white; padding: 15px 40px; font-size: 18px; font-weight: bold; cursor: pointer; border-radius: 50px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); transition: transform 0.3s ease; display: inline-flex; align-items: center; } .start-button:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); background: linear-gradient(45deg, #6B5B95, #FF6B6B); } .animation-container { margin-top: 40px; width: 200px; height: 300px; position: relative; overflow: hidden; } .model { position: absolute; width: 100%; height: 100%; background-image: url('model.png'); /* لینک به تصویر مدل */ background-size: cover; transition: opacity 1s; } .clothing { position: absolute; width: 100%; height: 100%; background-image: url('clothing.png'); /* لینک به تصویر لباس */ background-size: cover; opacity: 0; transition: opacity 1s; } .show-clothing { opacity: 1; } </style> </head> <body> <div class="ai-animation-gallery"> <div class="section"> <button class="start-button">شروع</button> <div class="animation-container"> <div class="model"></div> <div class="clothing"></div> </div> </div> </div> <script> // اسکریپت برای نمایش انیمیشن document.querySelector('.start-button').addEventListener('click', () => { const clothing = document.querySelector('.clothing'); clothing.classList.toggle('show-clothing'); }); </script> </body> </html>توضیحات:
-
مدل و لباس: در این کد، فرض شده شما از دو تصویر به نامهای
model.pngوclothing.pngاستفاده میکنید. لطفا لینکهای تصویر را به لینکهای صحیح در پروژه خود تغییر دهید. -
انیمیشن تغییر لباس: با کلیک روی دکمه "شروع" کلاس
show-clothingبهdivمربوط به لباس اضافه یا حذف میشود. این کلاس کنترل میکند که لباس نمایش داده شود یا خیر، با استفاده از ویژگیopacityدر CSS. -
ظاهر دکمه: دکمه شروع دارای برخی انیمیشنهای CSS برای افکتهای hover است تا ظاهر کاربرپسندتری داشته باشد.
این کد ساده است و میتواند به عنوان یک پایه برای پروژههای پیشرفتهتر استفاده شود. با بهبود و توسعه این ایده میتوانید قابلیتهای بیشتری اضافه کنید.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.