نقاط روی عکس - فراغیب
ظاهر
بدون خلاصۀ ویرایش |
بدون خلاصۀ ویرایش |
||
| خط ۱: | خط ۱: | ||
<!DOCTYPE html> | |||
<html lang="fa" dir="rtl"> | <html lang="fa" dir="rtl"> | ||
<head> | <head> | ||
| خط ۶: | خط ۶: | ||
<title>ست نخی تابستانه - پوشاک سجاد</title> | <title>ست نخی تابستانه - پوشاک سجاد</title> | ||
<style> | <style> | ||
/* | /* تنظیمات پایه */ | ||
* { box-sizing: border-box; } | |||
.interactive-image { | .interactive-image { | ||
position: relative; | position: relative; | ||
width: min(100%, 800px); | width: min(100%, 800px); | ||
margin: 40px auto; | margin: 40px auto; | ||
font-family: | font-family: iransans, Arial, sans-serif; | ||
isolation: isolate; | /* ایجاد یک محیط لایهبندی جدید */ | ||
isolation: isolate; | |||
} | } | ||
.interactive-image__main { | .interactive-image__main { | ||
display: block; | display: block; | ||
| خط ۲۱: | خط ۲۳: | ||
height: auto; | height: auto; | ||
border-radius: 14px; | border-radius: 14px; | ||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0. | box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); | ||
} | } | ||
/* نگهدارنده | /* نگهدارنده نقطه و کارت */ | ||
.hotspot-wrapper { | .hotspot-wrapper { | ||
position: absolute; | position: absolute; | ||
left: var(--x); | left: var(--x); | ||
top: var(--y); | top: var(--y); | ||
z-index: | /* Z-index پایین در حالت عادی */ | ||
z-index: 5; | |||
} | |||
/* افزایش اولویت لایه هنگام هاور شدن */ | |||
.hotspot-wrapper:hover { | |||
z-index: 100; /* این باعث میشود کادر روی همه نقاط دیگر قرار بگیرد */ | |||
} | } | ||
/* استایل نقطه | /* استایل نقطه قرمز */ | ||
.image-hotspot { | .image-hotspot { | ||
width: 20px; | width: 20px; | ||
| خط ۳۹: | خط ۴۷: | ||
border: 3px solid #ffffff; | border: 3px solid #ffffff; | ||
border-radius: 50%; | border-radius: 50%; | ||
background-color: #e11d48; | background-color: #e11d48; | ||
cursor: pointer; | cursor: pointer; | ||
transform: translate(-50%, -50%); | transform: translate(-50%, -50%); | ||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); | box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); | ||
display: block; | display: block; | ||
} | } | ||
/* استایل کادر اطلاعات | /* استایل کادر اطلاعات */ | ||
.hotspot-card { | .hotspot-card { | ||
position: absolute; | position: absolute; | ||
/* نمایش کادر زیر نقطه برای جلوگیری از بیرون زدگی از بالای تصویر */ | |||
top: calc(100% + 15px); | |||
left: 50%; | left: 50%; | ||
transform: translateX(-50%) translateY(10px); | transform: translateX(-50%) translateY(-10px); | ||
width: | width: 260px; | ||
background: #ffffff; | background: #ffffff; | ||
border-radius: 12px; | border-radius: 12px; | ||
box-shadow: 0 | box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2); | ||
padding: | padding: 12px; | ||
visibility: hidden; | visibility: hidden; | ||
opacity: 0; | opacity: 0; | ||
transition: | transition: all 0.3s ease; | ||
pointer-events: none; | |||
pointer-events: none; | |||
display: flex; | display: flex; | ||
flex-direction: column; | flex-direction: column; | ||
} | } | ||
/* | /* مثلث کوچک بالای کادر */ | ||
.hotspot-card:: | .hotspot-card::before { | ||
content: ''; | content: ''; | ||
position: absolute; | position: absolute; | ||
bottom: 100%; | |||
left: 50%; | left: 50%; | ||
transform: translateX(-50%); | transform: translateX(-50%); | ||
border-width: | border-width: 10px; | ||
border-style: solid; | border-style: solid; | ||
border-color: #ffffff | border-color: transparent transparent #ffffff transparent; | ||
} | } | ||
/* نمایش کادر | /* نمایش کادر با هاور */ | ||
.hotspot-wrapper:hover .hotspot-card { | .hotspot-wrapper:hover .hotspot-card { | ||
visibility: visible; | visibility: visible; | ||
opacity: 1; | opacity: 1; | ||
transform: translateX(-50%) translateY(0); | transform: translateX(-50%) translateY(0); | ||
pointer-events: auto; | pointer-events: auto; | ||
} | } | ||
/* | /* محتوای داخلی کادر */ | ||
.hotspot-card__image { | .hotspot-card__image { | ||
width: 100%; | width: 100%; | ||
height: | height: 150px; | ||
object-fit: cover; | object-fit: cover; | ||
border-radius: 8px; | border-radius: 8px; | ||
margin-bottom: | margin-bottom: 10px; | ||
} | } | ||
.hotspot-card__title { | .hotspot-card__title { | ||
display: block; | display: block; | ||
font-size: | font-size: 15px; | ||
font-weight: bold; | font-weight: bold; | ||
color: # | color: #1e293b; | ||
margin-bottom: 6px; | margin-bottom: 6px; | ||
text-align: center; | |||
} | } | ||
.hotspot-card__description { | .hotspot-card__description { | ||
font-size: 13px; | |||
color: #64748b; | color: #64748b; | ||
margin-bottom: 15px; | |||
line-height: 1. | text-align: center; | ||
line-height: 1.6; | |||
} | } | ||
.hotspot-card__cta { | .hotspot-card__cta { | ||
display: block; | display: block; | ||
width: 100%; | width: 100%; | ||
padding: | padding: 10px 0; | ||
background-color: #0f172a; | background-color: #0f172a; | ||
color: #ffffff; | color: #ffffff; | ||
text-align: center; | text-align: center; | ||
text-decoration: none; | text-decoration: none; | ||
border-radius: | border-radius: 8px; | ||
font-size: | font-size: 14px; | ||
font-weight: bold; | font-weight: bold; | ||
transition: background | transition: background 0.2s; | ||
} | } | ||
| خط ۱۴۳: | خط ۱۳۸: | ||
} | } | ||
/* ریسپانسیو | /* ریسپانسیو موبایل */ | ||
@media (max-width: 600px) { | @media (max-width: 600px) { | ||
.hotspot-card { | .hotspot-card { width: 220px; } | ||
.hotspot-card__image { height: 120px; } | |||
.hotspot-card__image { | |||
} | } | ||
</style> | </style> | ||
| خط ۱۵۶: | خط ۱۴۷: | ||
<body> | <body> | ||
<div class="interactive-image | <div class="interactive-image"> | ||
<!-- تصویر اصلی --> | <!-- تصویر اصلی --> | ||
<img | <img class="interactive-image__main" src="https://dl.faraghaib.ir/m/101/m101shalvarset.jpg" alt="ست نخی تابستانه سجاد"> | ||
<!-- نقطه اول | <!-- نقطه اول --> | ||
<div class="hotspot-wrapper" style="--x: 45%; --y: 29%;"> | <div class="hotspot-wrapper" style="--x: 45%; --y: 29%;"> | ||
< | <div class="image-hotspot"></div> | ||
<div class="hotspot-card"> | |||
<img class="hotspot-card__image" src="https://dl.faraghaib.ir/m/101/m101shalvarset1.jpg" alt="بلوز نخی"> | |||
<strong class="hotspot-card__title">بلوز نخی تابستانه سجاد</strong> | |||
<p class="hotspot-card__description">جنس ۱۰۰٪ پنبه با تنخور خنک و عالی</p> | |||
<a href="#" class="hotspot-card__cta">مشاهده محصول</a> | |||
<div class="hotspot-card | |||
<img | |||
</div> | </div> | ||
</div> | </div> | ||
<!-- | <!-- نقطه دوم --> | ||
<div class="hotspot-wrapper" style="--x: 58%; --y: 59%;"> | <div class="hotspot-wrapper" style="--x: 58%; --y: 59%;"> | ||
< | <div class="image-hotspot"></div> | ||
<div class="hotspot-card"> | |||
<img class="hotspot-card__image" src="https://dl.faraghaib.ir/m/101/m101shalvarset1.jpg" alt="شلوار نخی"> | |||
<strong class="hotspot-card__title">شلوار نخی تابستانه سجاد</strong> | |||
<p class="hotspot-card__description">طراحی راحت و ایدهآل برای استایل تابستانه</p> | |||
<a href="#" class="hotspot-card__cta">دریافت اطلاعات</a> | |||
<div class="hotspot-card | |||
<img | |||
</div> | </div> | ||
</div> | </div> | ||
</div> | </div> | ||
</body> | </body> | ||
</html> | </html> | ||
نسخهٔ ۱۹ ژوئیهٔ ۲۰۲۶، ساعت ۱۰:۲۹
<!DOCTYPE html>
بلوز نخی تابستانه سجاد