پرش به محتوا

لوکیشن/دماوند پلیمر - فراغیب

از فراغیب
بدون خلاصۀ ویرایش
بدون خلاصۀ ویرایش
خط ۱: خط ۱:
<html>


<div style="width: 100%; max-width: 1000px; font-family: Tahoma, sans-serif; direction: rtl;">
<html lang="fa" dir="rtl">
  <style>
<head>
    .map-card { position: relative; border: 1px solid #ccc; border-radius: 12px; overflow: hidden; background: #fff; line-height: 0; }
    <meta charset="UTF-8">
    .map-frame { display: block; width: 100%; height: 280px; border: none; }
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    .map-overlay-link { position: absolute; inset: 0; z-index: 2; display: block; background: transparent; cursor: pointer; }
    <title>مسیریابی و اشتراک‌گذاری</title>
    .map-actions { display: flex; gap: 10px; margin-top: 15px; }
    <style>
    .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; }
        :root {
    .btn-route { background: #e3f2fd; color: #1976d2; border-color: #bbdefb; }
            --primary-bg: #ffffff;
    .btn-contact { background: #e8f5e9; color: #388e3c; border-color: #c8e6c9; }
            --btn-route: #e3f2fd; --text-route: #1976d2;
    .btn-share { background: #fff3e0; color: #f57c00; border-color: #ffe0b2; }
            --btn-call: #e8f5e9; --text-call: #388e3c;
    .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; }
            --btn-share: #fff3e0; --text-share: #f57c00;
    .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; }
        .location-container { width: 100%; max-width: 600px; margin: 0 auto; font-family: Tahoma, sans-serif; }
    .share-close { background: transparent; border: 0; font-size: 22px; cursor: pointer; color: #333; }
        .map-card { position: relative; border: 1px solid #e0e0e0; border-radius: 16px; overflow: hidden; background: #eee; height: 280px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
    .share-title { font-size: 18px; font-weight: 700; color: #222; }
        .map-frame { width: 100%; height: 100%; border: none; }
    .share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; text-align: center; }
        .map-overlay-link { position: absolute; inset: 0; z-index: 2; cursor: pointer; }
    .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; }
        .map-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
    .share-label { font-size: 13px; color: #222; }
        .btn { padding: 12px 5px; text-align: center; border-radius: 10px; font-weight: 600; font-size: 13px; text-decoration: none; border: none; cursor: pointer; transition: transform 0.1s, opacity 0.2s; }
     .share-link-text { margin-top: 20px; font-size: 11px; color: #999; direction: ltr; text-align: left; word-break: break-all; opacity: 0.8; }
        .btn:active { transform: scale(0.98); }
  </style>
        .btn-route { background: var(--btn-route); color: var(--text-route); }
        .btn-call { background: var(--btn-call); color: var(--text-call); }
        .btn-share { background: var(--btn-share); color: var(--text-share); }
 
        /* Modal Styles - Centered */
        .share-sheet { display: none; position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.6); align-items: center; justify-content: center; padding: 15px; }
        .share-panel { width: 100%; max-width: 350px; background: #fff; border-radius: 20px; padding: 25px; animation: fadeIn 0.3s; }
        @keyframes fadeIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
       
        /* Grid 2 rows, 3 columns */
        .share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 25px 0; }
        .share-item { text-decoration: none; text-align: center; color: #333; border: none; background: transparent; cursor: pointer; }
        .share-icon { width: 50px; height: 50px; margin: 0 auto 8px; border-radius: 50%; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
        .share-icon img { width: 100%; height: 100%; object-fit: cover; }
        .share-label { font-size: 12px; }
     </style>
</head>
<body>
 
<div class="location-container">
    <div class="map-card">
        <a id="neshanOverlay" class="map-overlay-link" target="_blank" rel="noopener noreferrer" aria-label="باز کردن در نقشه"></a>
        <iframe id="mapFrame" class="map-frame" loading="lazy" src=""></iframe>
    </div>
 
    <div class="map-actions">
        <a id="routeBtn" class="btn btn-route" target="_blank" rel="noopener noreferrer">مسیریابی</a>
        <a id="callBtn" class="btn btn-call">تماس</a>
        <button type="button" class="btn btn-share" onclick="openShareSheet()">اشتراک‌گذاری</button>
    </div>
</div>
 
<div id="shareSheet" class="share-sheet" onclick="if(event.target===this)closeShareSheet()">
    <div class="share-panel">
        <div style="text-align: center; font-weight: bold; margin-bottom: 10px;">اشتراک‌گذاری</div>
        <div class="share-grid">
            <button class="share-item" onclick="copyLink()">
                <div class="share-icon"><img src="https://dl.faraghaib.ir/m/100/link.png" alt="کپی"></div><div class="share-label">کپی</div>
            </button>
            <a id="shareTelegram" class="share-item" target="_blank"><div class="share-icon"><img src="https://dl.faraghaib.ir/m/100/telegram2.png" alt="تلگرام"></div><div class="share-label">تلگرام</div></a>
            <a id="shareWhatsApp" class="share-item" target="_blank"><div class="share-icon"><img src="https://dl.faraghaib.ir/m/100/whatsapp2.png" alt="واتساپ"></div><div class="share-label">واتساپ</div></a>
            <a id="shareEitaa" class="share-item" target="_blank"><div class="share-icon"><img src="https://dl.faraghaib.ir/m/100/ita.png" alt="ایتا"></div><div class="share-label">ایتا</div></a>
            <a id="shareBale" class="share-item" target="_blank"><div class="share-icon"><img src="https://dl.faraghaib.ir/m/100/bale.png" alt="بله"></div><div class="share-label">بله</div></a>
            <a id="shareRobika" class="share-item" target="_blank"><div class="share-icon"><img src="https://dl.faraghaib.ir/m/100/robika.png" alt="روبیکا"></div><div class="share-label">روبیکا</div></a>
        </div>
        <button onclick="closeShareSheet()" style="width:100%; padding:12px; border:none; background:#f0f0f0; border-radius:10px; font-weight:bold;">بستن</button>
    </div>
</div>


  <!-- تنظیمات مختصات و لینک‌ها -->
<script>
  <script>
    // مختصات جدید ارسالی شما
     const MAP_LAT = 35.51553379708153;
     const MAP_LAT = 35.51553379708153;
     const MAP_LNG = 51.1508280605789;
     const MAP_LNG = 51.1508280605789;
 
     const CONTACT_PHONE = "09120000000";
     // تنظیم زوم (عدد کمتر = زوم بیشتر)
     const BALAD_URL = `https://balad.ir/p/${MAP_LAT},${MAP_LNG}`;  
     const MAP_BBOX_DELTA = 0.003;  


     // لینک نشان با مختصات جدید
     function buildOsmUrl(lat, lng) {
    const NESHAN_URL = `https://balad.ir/maps/@${MAP_LAT},${MAP_LNG},17z`;
        const delta = 0.003;
     const CONTACT_PHONE = "09120000000"; // شماره خود را اینجا وارد کنید
        return `https://www.openstreetmap.org/export/embed.html?bbox=${lng-delta}%2C${lat-delta}%2C${lng+delta}%2C${lat+delta}&layer=mapnik&marker=${lat}%2C${lng}`;
     }


     function buildOsmUrl(lat, lng, delta) {
     function init() {
      const minLat = lat - delta; const maxLat = lat + delta;
        document.getElementById("mapFrame").src = buildOsmUrl(MAP_LAT, MAP_LNG);
      const minLng = lng - delta; const maxLng = lng + delta;
        document.getElementById("neshanOverlay").href = BALAD_URL;
      return `https://www.openstreetmap.org/export/embed.html?bbox=${minLng}%2C${minLat}%2C${maxLng}%2C${maxLat}&layer=mapnik&marker=${lat}%2C${lng}`;
        document.getElementById("routeBtn").href = BALAD_URL;
        document.getElementById("callBtn").href = "tel:" + CONTACT_PHONE;
     }
     }


     function openShareSheet() {
     function openShareSheet() {
      const url = window.location.href;
        const url = window.location.href;
      const text = "لوکیشن مجموعه ما";
        const text = "لوکیشن ما";
      document.getElementById("shareSheet").style.display = "flex";
        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("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("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("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("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)}`;
        document.getElementById("shareRobika").href = `https://rubika.ir/`;  
     }
     }


خط ۵۷: خط ۱۰۲:


     async function copyLink() {
     async function copyLink() {
      await navigator.clipboard.writeText(window.location.href);
        await navigator.clipboard.writeText(window.location.href);
      alert("لینک کپی شد");
        alert("لینک کپی شد");
    }
         closeShareSheet();
 
    async function nativeShare() {
      if (navigator.share) {
         try { await navigator.share({ title: document.title, url: window.location.href }); } catch (e) {}
      } else { copyLink(); }
     }
     }


     document.addEventListener("DOMContentLoaded", () => {
     init();
      document.getElementById("mapFrame").src = buildOsmUrl(MAP_LAT, MAP_LNG, MAP_BBOX_DELTA);
</script>
      document.getElementById("neshanOverlay").href = NESHAN_URL;
</body>
      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-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 id="shareSheet" class="share-sheet" onclick="if(event.target===this)closeShareSheet()">
    <div class="share-panel">
      <div class="share-header">
        <button type="button" class="share-close" onclick="closeShareSheet()">✕</button>
        <div class="share-title">اشتراک‌گذاری</div>
      </div>
      <div class="share-grid">
        <button type="button" class="share-item" onclick="copyLink()">
          <div class="share-icon"><img src="https://dl.faraghaib.ir/m/100/link.png"></div><div class="share-label">کپی لینک</div>
        </button>
        <a id="shareTelegram" class="share-item" target="_blank">
          <div class="share-icon"><img src="https://dl.faraghaib.ir/m/100/telegram2.png"></div><div class="share-label">تلگرام</div>
        </a>
        <a id="shareWhatsApp" class="share-item" target="_blank">
          <div class="share-icon"><img src="https://dl.faraghaib.ir/m/100/whatsapp2.png"></div><div class="share-label">واتساپ</div>
        </a>
        <a id="shareEitaa" class="share-item" target="_blank">
          <div class="share-icon" style="font-weight:bold; font-size:20px; font-family:serif;"><img src="https://dl.faraghaib.ir/m/100/ita.png"></div><div class="share-label">ایتا</div>
        </a>
        <a id="shareBale" class="share-item" target="_blank">
          <div class="share-icon"><img src="https://dl.faraghaib.ir/m/100/bale.png"></div><div class="share-label">بله</div>
        </a>
        <a id="shareX" class="share-item" target="_blank">
          <div class="share-icon" style="font-weight:bold; font-size:20px;"><img src="https://dl.faraghaib.ir/m/100/robika.png"></div><div class="share-label">روبیکا</div>
        </a>   
       
      </div>
      <!-- div id="shareLinkText" class="share-link-text"></div-->
    </div>
  </div>
</div>
 
</html>
</html>

نسخهٔ ‏۱۰ اوت ۲۰۲۶، ساعت ۰۹:۲۹

مسیریابی و اشتراک‌گذاری

مسیریابی تماس