copy embed code

This commit is contained in:
HolgerHatGarKeineNode
2023-03-15 14:33:39 +01:00
parent 2eb7315ac0
commit 25dd74312e
5 changed files with 125 additions and 12 deletions

View File

@@ -0,0 +1,50 @@
<div class="h-full">
@php
$focus = '';
$map = $country->code . '_merc';
if (!\File::exists(public_path('vendor/jvector/maps/' . $country->code . '.js'))) {
$map = 'europe_merc';
$focus = 'focusOn: {lat:'.$country->latitude.',lng:'.$country->longitude.',scale:8,animate:true},';
}
@endphp
<div
wire:ignore
class="w-full flex justify-center h-full"
x-data="{
init() {
let markers = {{ Js::from($markers) }};
$('#map').vectorMap({
{{ $focus }}
zoomButtons : true,
zoomOnScroll: true,
map: '{{ $map }}',
backgroundColor: 'transparent',
markers: markers.map(function(h){ return {name: h.name, latLng: h.coords, url: h.url} }),
onMarkerClick: function(event, index) {
window.open(
markers[index].url,
'_blank'
);
},
markerStyle: {
initial: {
image: '{{ asset('img/btc.png') }}',
}
},
regionStyle: {
initial: {
fill: '#151515'
},
hover: {
'fill-opacity': 1,
cursor: 'default'
},
}
});
}
}"
>
<div id="map" style="width: 100%; height: 100vh;" class="my-4 sm:my-0"></div>
</div>
</div>

View File

@@ -5,15 +5,26 @@
<section class="w-full mb-12">
<div class="max-w-screen-2xl mx-auto px-2 sm:px-10 space-y-4 py-4">
<div class="w-full flex justify-end">
<x-button
x-data="{
<div class="flex flex-col space-y-2">
<x-button
x-data="{
textToCopy: '{{ route('meetup.ics', ['country' => $country]) }}',
}"
@click.prevent="window.navigator.clipboard.writeText(textToCopy);window.$wireui.notify({title:'{{ __('Calendar Stream Url copied!') }}',description:'{{ __('Paste the calendar stream link into a compatible calendar app.') }}',icon:'success'});"
amber>
<i class="fa fa-thin fa-calendar-arrow-down mr-2"></i>
{{ __('Calendar Stream-Url for all meetup events') }}
</x-button>
@click.prevent="window.navigator.clipboard.writeText(textToCopy);window.$wireui.notify({title:'{{ __('Calendar Stream Url copied!') }}',description:'{{ __('Paste the calendar stream link into a compatible calendar app.') }}',icon:'success'});"
amber>
<i class="fa fa-thin fa-calendar-arrow-down mr-2"></i>
{{ __('Calendar Stream-Url for all meetup events') }}
</x-button>
<x-button
x-data="{
textToCopy: '{{ $mapEmbedCode }}',
}"
@click.prevent="window.navigator.clipboard.writeText(textToCopy);window.$wireui.notify({title:'{{ __('Embed code for the map copied!') }}',icon:'success'});"
amber>
<i class="fa fa-thin fa-code mr-2"></i>
{{ __('Copy embed code for the map') }} <img class="h-6 rounded" src="{{ asset('vendor/blade-country-flags/4x3-'. $country->code .'.svg') }}" alt="{{ $country->code }}">
</x-button>
</div>
</div>
<div class="flex flex-col sm:flex-row">
@php