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,26 +1,16 @@
<html>
<head>
<title>{{config('settings.name')}}</title>
@extends('template.'.config('settings.template').'.content.master')
@section('content')

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

<style>
#map {
height: 400px;
width: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAKGJCCKvmWZl-L5bBF0uS5BWf0gN4ZkpI&callback=initMap&v=weekly" defer></script>
<script>
<p>{{config('settings.description')}}</p>
<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($contents) !!};
items = items.data;

const map = new google.maps.Map(document.getElementById("map"), {
zoom: 5,
center: { lat: parseFloat(items[0].location.lat), lng: parseFloat(items[0].location.lng) }
@ -40,5 +30,5 @@
}
window.initMap = initMap;
</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>