الگو:لوکیشن/پوشاک بابازاده: تفاوت میان نسخهها
Esfandiari (بحث | مشارکتها) بدون خلاصۀ ویرایش |
Esfandiari (بحث | مشارکتها) بدون خلاصۀ ویرایش |
||
| (یک نسخهٔ میانیِ ایجادشده توسط همین کاربر نشان داده نشد) | |||
| خط ۱: | خط ۱: | ||
<html | <html> | ||
<div style="width: 100%; max-width: 1000px; font-family: Tahoma, sans-serif; direction: rtl;"> | |||
<style> | <style> | ||
: | .map-card { position: relative; border: 1px solid #ccc; border-radius: 12px; overflow: hidden; background: #fff; line-height: 0; } | ||
.map-frame { display: block; width: 100%; height: 280px; border: none; } | |||
.map-overlay-link { position: absolute; inset: 0; z-index: 2; display: block; background: transparent; cursor: pointer; } | |||
.map-actions { display: flex; gap: 10px; margin-top: 15px; } | |||
.map-actions a, .map-actions button { flex: 1; padding: 12px; text-align: center; border-radius: 8px; font-weight: bold; border: 1px solid transparent; cursor: pointer; font-family: inherit; font-size: 14px; text-decoration: none; transition: 0.2s; } | |||
.btn-route { background: #e3f2fd; color: #1976d2; border-color: #bbdefb; } | |||
.btn-contact { background: #e8f5e9; color: #388e3c; border-color: #c8e6c9; } | |||
} | .btn-share { background: #fff3e0; color: #f57c00; border-color: #ffe0b2; } | ||
.share-sheet { display: none; position: fixed; inset: 0; z-index: 9999; background: rgba(0, 0, 0, 0.55); align-items: center; justify-content: center; padding: 16px; line-height: normal; } | |||
.share-panel { width: 100%; max-width: 400px; background: #f3efe7; border-radius: 22px; padding: 22px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22); } | |||
.share-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; } | |||
.share-close { background: transparent; border: 0; font-size: 22px; cursor: pointer; color: #333; } | |||
.share-title { font-size: 18px; font-weight: 700; color: #222; } | |||
.share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; text-align: center; } | |||
.share-item { text-decoration: none; color: inherit; background: transparent; border: 0; cursor: pointer; padding: 0; } | |||
.share-icon { width: 52px; height: 52px; margin: 0 auto 8px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); font-size: 24px; } | |||
.share-label { font-size: 13px; color: #222; } | |||
.share-link-text { margin-top: 20px; font-size: 11px; color: #999; direction: ltr; text-align: left; word-break: break-all; opacity: 0.8; } | |||
</style> | |||
<!-- تنظیمات مختصات و لینکها --> | |||
<script> | |||
// مختصات جدید ارسالی شما | |||
const MAP_LAT = 35.56192273941163; | |||
const MAP_LNG = 51.16097081423416; | |||
// تنظیم زوم (عدد کمتر = زوم بیشتر) | |||
const MAP_BBOX_DELTA = 0.003; | |||
// لینک نشان با مختصات جدید | |||
const NESHAN_URL = `https://neshan.org/maps/@${MAP_LAT},${MAP_LNG},17z`; | |||
const CONTACT_PHONE = "09120000000"; // شماره خود را اینجا وارد کنید | |||
function buildOsmUrl(lat, lng, delta) { | |||
const minLat = lat - delta; const maxLat = lat + delta; | |||
const minLng = lng - delta; const maxLng = lng + delta; | |||
return `https://www.openstreetmap.org/export/embed.html?bbox=${minLng}%2C${minLat}%2C${maxLng}%2C${maxLat}&layer=mapnik&marker=${lat}%2C${lng}`; | |||
} | } | ||
. | function openShareSheet() { | ||
const url = window.location.href; | |||
const text = "لوکیشن مجموعه ما"; | |||
document.getElementById("shareSheet").style.display = "flex"; | |||
document.getElementById("shareLinkText").textContent = url; | |||
document.getElementById("shareTelegram").href = `https://t.me/share/url?url=${encodeURIComponent(url)}&text=${encodeURIComponent(text)}`; | |||
document.getElementById("shareWhatsApp").href = `https://wa.me/?text=${encodeURIComponent(text + " " + url)}`; | |||
document.getElementById("shareEitaa").href = `https://eitaa.com/share/url?url=${encodeURIComponent(url)}&text=${encodeURIComponent(text)}`; | |||
document.getElementById("shareBale").href = `https://ble.ir/share?url=${encodeURIComponent(url)}&text=${encodeURIComponent(text)}`; | |||
document.getElementById("shareX").href = `https://x.com/intent/tweet?url=${encodeURIComponent(url)}&text=${encodeURIComponent(text)}`; | |||
} | } | ||
. | function closeShareSheet() { document.getElementById("shareSheet").style.display = "none"; } | ||
async function copyLink() { | |||
await navigator.clipboard.writeText(window.location.href); | |||
alert("لینک کپی شد"); | |||
} | } | ||
async function nativeShare() { | |||
if (navigator.share) { | |||
try { await navigator.share({ title: document.title, url: window.location.href }); } catch (e) {} | |||
} else { copyLink(); } | |||
} | } | ||
. | document.addEventListener("DOMContentLoaded", () => { | ||
document.getElementById("mapFrame").src = buildOsmUrl(MAP_LAT, MAP_LNG, MAP_BBOX_DELTA); | |||
document.getElementById("neshanOverlay").href = NESHAN_URL; | |||
document.getElementById("routeBtn").href = NESHAN_URL; | |||
document.getElementById("callBtn").href = "tel:" + CONTACT_PHONE; | |||
}); | |||
</script> | |||
} | |||
<!-- بخش بصری --> | |||
<div class="map-card"> | |||
<a id="neshanOverlay" class="map-overlay-link" target="_blank" rel="noopener noreferrer" title="باز کردن در نشان"></a> | |||
<iframe id="mapFrame" class="map-frame" loading="lazy" src=""></iframe> | |||
</div> | |||
<div class="map- | |||
<div class="map-actions"> | |||
<a id="routeBtn" class="btn-route" target="_blank" rel="noopener noreferrer">مسیریابی</a> | |||
<a id="callBtn" class="btn-contact">تماس</a> | |||
<button type="button" class="btn-share" onclick="openShareSheet()">اشتراکگذاری</button> | |||
</div> | </div> | ||
<!-- | <!-- شیت اشتراکگذاری --> | ||
<div id=" | <div id="shareSheet" class="share-sheet" onclick="if(event.target===this)closeShareSheet()"> | ||
<div class="share- | <div class="share-panel"> | ||
<div class="share- | <div class="share-header"> | ||
<button type="button" class="close | <button type="button" class="share-close" onclick="closeShareSheet()">✕</button> | ||
<div | <div class="share-title">اشتراکگذاری</div> | ||
</div> | </div> | ||
<div class="share-grid"> | <div class="share-grid"> | ||
<button type="button" class=" | <button type="button" class="share-item" onclick="copyLink()"> | ||
<div class="share-icon">🔗</div> | <div class="share-icon">🔗</div><div class="share-label">کپی لینک</div> | ||
</button> | </button> | ||
<a id="shareTelegram" class="share-item" target="_blank"> | |||
<a id="shareTelegram" class="share-item" target="_blank | <div class="share-icon">✈️</div><div class="share-label">تلگرام</div> | ||
<div class="share-icon">✈️</div> | |||
</a> | </a> | ||
<a id="shareWhatsApp" class="share-item" target="_blank"> | |||
<a id="shareWhatsApp" class="share-item" target="_blank | <div class="share-icon">💬</div><div class="share-label">واتساپ</div> | ||
<div class="share-icon">💬</div> | |||
</a> | </a> | ||
<a id="shareEitaa" class="share-item" target="_blank"> | |||
<a id="shareEitaa" class="share-item" target="_blank | <div class="share-icon" style="font-weight:bold; font-size:20px; font-family:serif;">E</div><div class="share-label">ایتا</div> | ||
<div class="share-icon" style="font-weight: | |||
</a> | </a> | ||
<a id="shareBale" class="share-item" target="_blank"> | |||
<a id="shareBale" class="share-item" target="_blank | <div class="share-icon">🗨️</div><div class="share-label">بله</div> | ||
<div class="share-icon">🗨️</div> | |||
</a> | </a> | ||
<a id="shareX" class="share-item" target="_blank"> | |||
<a id="shareX" class="share-item" target="_blank | <div class="share-icon" style="font-weight:bold; font-size:20px;">X</div><div class="share-label">ایکس</div> | ||
<div class="share-icon" style="font-weight: | |||
</a> | </a> | ||
<button type="button" class="share-item" onclick="nativeShare()"> | |||
<button type="button" class=" | <div class="share-icon">⬆️</div><div class="share-label">بیشتر</div> | ||
<div class="share-icon">⬆️</div> | |||
</button> | </button> | ||
</div> | </div> | ||
<div id="shareLinkText" class="share-link-text"></div> | |||
<div id="shareLinkText" class="share-link"> | |||
</div> | </div> | ||
</div> | </div> | ||
</div> | |||
</html> | </html> | ||