theWitcher commited on
Commit
0b1f7ca
·
1 Parent(s): 6f0c882

Updated sharing functionality in index.html to use a consistent share link across platforms and added a Twitter card meta tag for enhanced sharing capabilities.

Browse files
Files changed (1) hide show
  1. index.html +13 -21
index.html CHANGED
@@ -16,8 +16,9 @@ sagi test
16
  <meta property="og:title" content="הכירו את ארגז הכלים של שגיא בר און">
17
  <meta property="og:description" content="כנסו עכשיו לכלי המדהים שלנו!">
18
  <meta property="og:image" content="https://thewitcher-sagi-ai-tools.static.hf.space/sagi_ai_toolbox.png">
19
- <meta property="og:url" content="https://thewitcher-sagi-ai-tools.static.hf.space/index.html">
20
  <meta property="og:type" content="website">
 
21
 
22
  <title>ארגז הכלים שלי לבינה מלאכותית</title>
23
  <link
@@ -2038,43 +2039,33 @@ sagi test
2038
  e.stopPropagation();
2039
 
2040
  const platform = btn.dataset.platform;
2041
- // const url = btn.dataset.url;
2042
- const url = window.location.href; // Set URL to the current address in the browser
2043
  const title = btn.dataset.title;
2044
  const text = `בדקו את הכלי ${title} מארגז הכלים של שגיא בר און`;
2045
- const imageUrl = `${window.location.origin}/sagi_ai_toolbox.png`; // נתיב מלא לקובץ התמונה
2046
 
2047
  let shareUrl;
2048
 
2049
  switch (platform) {
2050
  case 'facebook':
2051
  shareUrl = `https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(
2052
- url
2053
  )}&quote=${encodeURIComponent(text)}`;
2054
  window.open(shareUrl, '_blank', 'width=600,height=400');
2055
  break;
2056
  case 'twitter':
2057
  shareUrl = `https://twitter.com/intent/tweet?url=${encodeURIComponent(
2058
- url
2059
  )}&text=${encodeURIComponent(text)}`;
2060
  window.open(shareUrl, '_blank', 'width=600,height=400');
2061
  break;
2062
- case 'whatsapp':
2063
- const message = `בדקו את הכלי ${title} מארגז הכלים של שגיא בר און\n\n${url}`;
2064
- shareUrl = `https://api.whatsapp.com/send?text=${encodeURIComponent(message)}`;
2065
- window.open(shareUrl, '_blank');
2066
- break;
2067
-
2068
-
2069
- // case 'whatsapp':
2070
- // shareUrl = `https://api.whatsapp.com/send?text=${encodeURIComponent(
2071
- // text + ' ' + url
2072
- // )}`;
2073
- // window.open(shareUrl, '_blank');
2074
- // break;
2075
  case 'copy':
2076
- navigator.clipboard.writeText(url).then(() => {
2077
- // הודעה זמנית על העתקה מוצלחת
2078
  const toast = document.createElement('div');
2079
  toast.className =
2080
  'fixed top-4 left-1/2 transform -translate-x-1/2 bg-green-500 text-white px-4 py-2 rounded shadow-lg z-50';
@@ -2091,6 +2082,7 @@ sagi test
2091
  });
2092
  }
2093
 
 
2094
  // פונקציה להוספת כפתור המועדפים לאזור הקטגוריות
2095
  function updateCategoryFilters() {
2096
  const categoryFilterDiv = document.querySelector('.category-filter');
 
16
  <meta property="og:title" content="הכירו את ארגז הכלים של שגיא בר און">
17
  <meta property="og:description" content="כנסו עכשיו לכלי המדהים שלנו!">
18
  <meta property="og:image" content="https://thewitcher-sagi-ai-tools.static.hf.space/sagi_ai_toolbox.png">
19
+ <meta property="og:url" content="https://thewitcher-sagi-ai-tools.static.hf.space">
20
  <meta property="og:type" content="website">
21
+ <meta name="twitter:card" content="summary_large_image">
22
 
23
  <title>ארגז הכלים שלי לבינה מלאכותית</title>
24
  <link
 
2039
  e.stopPropagation();
2040
 
2041
  const platform = btn.dataset.platform;
2042
+ const shareLink = "https://bit.ly/a-tools"; // כאן מחליפים
 
2043
  const title = btn.dataset.title;
2044
  const text = `בדקו את הכלי ${title} מארגז הכלים של שגיא בר און`;
 
2045
 
2046
  let shareUrl;
2047
 
2048
  switch (platform) {
2049
  case 'facebook':
2050
  shareUrl = `https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(
2051
+ shareLink
2052
  )}&quote=${encodeURIComponent(text)}`;
2053
  window.open(shareUrl, '_blank', 'width=600,height=400');
2054
  break;
2055
  case 'twitter':
2056
  shareUrl = `https://twitter.com/intent/tweet?url=${encodeURIComponent(
2057
+ shareLink
2058
  )}&text=${encodeURIComponent(text)}`;
2059
  window.open(shareUrl, '_blank', 'width=600,height=400');
2060
  break;
2061
+ case 'whatsapp':
2062
+ shareUrl = `https://api.whatsapp.com/send?text=${encodeURIComponent(
2063
+ text + ' ' + shareLink
2064
+ )}`;
2065
+ window.open(shareUrl, '_blank');
2066
+ break;
 
 
 
 
 
 
 
2067
  case 'copy':
2068
+ navigator.clipboard.writeText(shareLink).then(() => {
 
2069
  const toast = document.createElement('div');
2070
  toast.className =
2071
  'fixed top-4 left-1/2 transform -translate-x-1/2 bg-green-500 text-white px-4 py-2 rounded shadow-lg z-50';
 
2082
  });
2083
  }
2084
 
2085
+
2086
  // פונקציה להוספת כפתור המועדפים לאזור הקטגוריות
2087
  function updateCategoryFilters() {
2088
  const categoryFilterDiv = document.querySelector('.category-filter');