Benjamin Völkl 2023-05-15 21:30:18 +02:00
parent 599423dc71
commit a7a2d95d00
3 changed files with 72 additions and 20 deletions

View File

@ -0,0 +1,41 @@
@extends('template.'.config('settings.template').'.content.master')
@section('content')

<a href="{{url('/')}}"> ← Back</a>

<h1>{{$content->title}}</h1>


<p>{{$content->desription}}</p>
<img src="{{$content->image}}" alt="">


<div id="map"></div>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAKGJCCKvmWZl-L5bBF0uS5BWf0gN4ZkpI&callback=initMap&v=weekly" defer></script>
<script>
function initMap() {
let items = {!! json_encode($content) !!};
items = items.data;

const map = new google.maps.Map(document.getElementById("map"), {
zoom: 5,
center: { lat: parseFloat(content.location.lat), lng: parseFloat(content.location.lng) }
});

items.forEach(function(item){
let marker = new google.maps.Marker({
position: { lat: parseFloat(item.location.lat), lng: parseFloat(item.location.lng) },
map: map,
title: item.title,
optimized: false,
});

});
}
window.initMap = initMap;
</script>

@stop



View File

@ -1,19 +1,9 @@
<html> @extends('template.'.config('settings.template').'.content.master')
<head> @section('content')
<title>{{config('settings.name')}}</title>


<link rel="apple-touch-icon" sizes="180x180" href="{{$favicon['180']}}"> <h1>{{config('settings.name')}}</h1>
<link rel="icon" type="image/png" sizes="32x32" href="{{$favicon['32']}}">
<link rel="icon" type="image/png" sizes="16x16" href="{{$favicon['16']}}">


<style> <p>{{config('settings.description')}}</p>
#map {
height: 400px;
width: 100%;
}
</style>
</head>
<body>
<div id="map"></div> <div id="map"></div>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAKGJCCKvmWZl-L5bBF0uS5BWf0gN4ZkpI&callback=initMap&v=weekly" defer></script> <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAKGJCCKvmWZl-L5bBF0uS5BWf0gN4ZkpI&callback=initMap&v=weekly" defer></script>
<script> <script>
@ -40,5 +30,5 @@
} }
window.initMap = initMap; window.initMap = initMap;
</script> </script>
</body>
</html> @stop

21
content/master.blade.php Normal file
View File

@ -0,0 +1,21 @@
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">

<head>


<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta name="description" content="{{config('settings.description')}}" />
<meta name="author" content="" />


</head>

<body>
@yield('content')


</body>

</html>