Add (nav): share button
This commit is contained in:
@@ -1 +0,0 @@
|
||||
import{_ as u,l as p,c as r,i as e,j as c,o as n,k as _,m}from"./vue-4ae8bf2c.js";const b={name:"ShareToFriends",data(){return{showModal:!1,shareUrl:null}},methods:{handleShareButton(){if(navigator.share){const o=document.title,t=document.querySelector('meta[name="description"]'),d=t?"Check this out: "+t.content:"",i=o||"FutureWalker",s=d||"Check this AI & tech news platform out!";navigator.share({title:i,text:s,url:this.shareUrl}).then(()=>{}).catch(a=>{this.showModal=!0})}else this.showModal=!0;this.showModal=!0},copyLink(){navigator.clipboard.writeText(this.shareUrl).then(()=>{p("Copied!",{position:"bottom-center",type:"success",timeout:1500,closeOnClick:!0,pauseOnFocusLoss:!0,pauseOnHover:!0,draggable:!0,draggablePercent:.6,showCloseButtonOnHover:!1,hideProgressBar:!1,closeButton:!0,icon:!0,rtl:!1})}).catch(o=>{})}},mounted(){this.shareUrl=window.location.href}},h=o=>(_("data-v-d913a747"),o=o(),m(),o),f=h(()=>e("i",{class:"bi bi-share-fill"},null,-1)),y=[f],g={key:0,class:"modal fade show",id:"shareModal",tabindex:"-1","aria-labelledby":"shareModalLabel",style:{display:"block"},"aria-modal":"true",role:"dialog"},k={class:"modal-dialog modal-dialog-centered"},v={class:"modal-content"},w={class:"modal-header"},x=h(()=>e("h1",{class:"modal-title fs-5 text-black fw-bold",id:"shareModalLabel"}," Share to Friends ",-1)),S={class:"modal-body d-grid gap-2"},C=["value"],M={key:1,class:"modal-backdrop fade show"};function B(o,t,d,i,s,a){return n(),r("div",null,[e("button",{type:"button",class:"align-self-center btn btn-outline-light ms-2",onClick:t[0]||(t[0]=(...l)=>a.handleShareButton&&a.handleShareButton(...l))},y),s.showModal?(n(),r("div",g,[e("div",k,[e("div",v,[e("div",w,[x,e("button",{type:"button",class:"btn-close",onClick:t[1]||(t[1]=l=>s.showModal=!1),"aria-label":"Close"})]),e("div",S,[e("input",{type:"text",readonly:"",class:"form-control",value:s.shareUrl},null,8,C),e("button",{class:"btn btn-primary w-full",onClick:t[2]||(t[2]=(...l)=>a.copyLink&&a.copyLink(...l))}," Copy Link ")])])])])):c("",!0),s.showModal?(n(),r("div",M)):c("",!0)])}const T=u(b,[["render",B],["__scopeId","data-v-d913a747"]]);export{T as default};
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -190,7 +190,7 @@
|
||||
"resources/js/vue/front/LqipLoader.vue",
|
||||
"resources/js/vue/front/ShareToFriends.vue"
|
||||
],
|
||||
"file": "assets/app-front-78ecf9bd.js",
|
||||
"file": "assets/app-front-bd5d3122.js",
|
||||
"imports": [
|
||||
"_vue-4ae8bf2c.js"
|
||||
],
|
||||
@@ -213,7 +213,7 @@
|
||||
"css": [
|
||||
"assets/ShareToFriends-e3b0c442.css"
|
||||
],
|
||||
"file": "assets/ShareToFriends-5cbb942f.js",
|
||||
"file": "assets/ShareToFriends-d797fdeb.js",
|
||||
"imports": [
|
||||
"_vue-4ae8bf2c.js"
|
||||
],
|
||||
|
||||
Binary file not shown.
@@ -94,8 +94,6 @@ export default {
|
||||
} else {
|
||||
this.showModal = true;
|
||||
}
|
||||
|
||||
this.showModal = true;
|
||||
},
|
||||
copyLink() {
|
||||
navigator.clipboard
|
||||
|
||||
Reference in New Issue
Block a user