Add (pwa)
This commit is contained in:
@@ -12,11 +12,6 @@
|
||||
|
||||
@include('feed::links')
|
||||
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
|
||||
<link rel="manifest" href="/site.webmanifest">
|
||||
|
||||
@vite(['resources/sass/app-front.scss', 'resources/js/app-front.js'])
|
||||
{{-- @laravelPWA --}}
|
||||
@laravelPWA
|
||||
@include('googletagmanager::head')
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
@extends('front.layouts.app')
|
||||
@section('content')
|
||||
<main class="container">
|
||||
@if(!is_null($featured_post))
|
||||
<div class="p-4 p-md-5 mb-4 rounded text-body-emphasis bg-body-secondary">
|
||||
<div class="col-lg-12 px-0">
|
||||
<h1 class="display-4 fst-italic">{{ $featured_post->title }}</h1>
|
||||
<p class="lead my-3">{{ $featured_post->excerpt }}</p>
|
||||
<p class="lead mb-0"><a href="{{ route('front.post', ['slug' => $featured_post->slug]) }}"
|
||||
class=" fw-bold">Continue reading...</a></p>
|
||||
@if (!is_null($featured_post))
|
||||
<div class="p-4 p-md-5 mb-4 rounded text-body-emphasis bg-body-secondary">
|
||||
<div class="col-lg-12 px-0">
|
||||
<h1 class="display-4 fst-italic">{{ $featured_post->title }}</h1>
|
||||
<p class="lead my-3">{{ $featured_post->excerpt }}</p>
|
||||
<p class="lead mb-0"><a href="{{ route('front.post', ['slug' => $featured_post->slug]) }}"
|
||||
class=" fw-bold">Continue reading...</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
<div class="row g-5">
|
||||
<div class="col-md-8">
|
||||
|
||||
@if($latest_posts->count() > 0)
|
||||
@foreach ($latest_posts as $post)
|
||||
@include('front.partials.post_detail', ['post' => $post])
|
||||
@endforeach
|
||||
@if ($latest_posts->count() > 0)
|
||||
@foreach ($latest_posts as $post)
|
||||
@include('front.partials.post_detail', ['post' => $post])
|
||||
@endforeach
|
||||
|
||||
<div class="w-100 d-flex justify-content-center">
|
||||
<a class="btn btn-outline-primary rounded-pill px-3 text-decoration-none"
|
||||
href="{{ route('front.all') }}">View Latest News</a>
|
||||
</div>
|
||||
<div class="w-100 d-flex justify-content-center">
|
||||
<a class="btn btn-outline-primary rounded-pill px-3 text-decoration-none"
|
||||
href="{{ route('front.all') }}">View Latest News</a>
|
||||
</div>
|
||||
@else
|
||||
<div class="py-3 text-center">
|
||||
<div class="mb-2">No posts found yet.</div>
|
||||
|
||||
67
resources/views/vendor/laravelpwa/meta.blade.php
vendored
Normal file
67
resources/views/vendor/laravelpwa/meta.blade.php
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
<!-- Web Application Manifest -->
|
||||
<link rel="manifest" href="{{ route('laravelpwa.manifest') }}">
|
||||
<!-- Chrome for Android theme color -->
|
||||
<meta name="theme-color" content="{{ $config['theme_color'] }}">
|
||||
|
||||
<!-- Add to homescreen for Chrome on Android -->
|
||||
<meta name="mobile-web-app-capable" content="{{ $config['display'] == 'standalone' ? 'yes' : 'no' }}">
|
||||
<meta name="application-name" content="{{ $config['short_name'] }}">
|
||||
<link rel="icon" sizes="{{ data_get(end($config['icons']), 'sizes') }}"
|
||||
href="{{ data_get(end($config['icons']), 'src') }}">
|
||||
|
||||
<!-- Add to homescreen for Safari on iOS -->
|
||||
<meta name="apple-mobile-web-app-capable" content="{{ $config['display'] == 'standalone' ? 'yes' : 'no' }}">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="{{ $config['status_bar'] }}">
|
||||
<meta name="apple-mobile-web-app-title" content="{{ $config['short_name'] }}">
|
||||
<link rel="apple-touch-icon" href="{{ data_get(end($config['icons']), 'src') }}">
|
||||
|
||||
|
||||
<link href="{{ $config['splash']['640x1136'] }}"
|
||||
media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)"
|
||||
rel="apple-touch-startup-image" />
|
||||
<link href="{{ $config['splash']['750x1334'] }}"
|
||||
media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)"
|
||||
rel="apple-touch-startup-image" />
|
||||
<link href="{{ $config['splash']['1242x2208'] }}"
|
||||
media="(device-width: 621px) and (device-height: 1104px) and (-webkit-device-pixel-ratio: 3)"
|
||||
rel="apple-touch-startup-image" />
|
||||
<link href="{{ $config['splash']['1125x2436'] }}"
|
||||
media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3)"
|
||||
rel="apple-touch-startup-image" />
|
||||
<link href="{{ $config['splash']['828x1792'] }}"
|
||||
media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2)"
|
||||
rel="apple-touch-startup-image" />
|
||||
<link href="{{ $config['splash']['1242x2688'] }}"
|
||||
media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3)"
|
||||
rel="apple-touch-startup-image" />
|
||||
<link href="{{ $config['splash']['1536x2048'] }}"
|
||||
media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2)"
|
||||
rel="apple-touch-startup-image" />
|
||||
<link href="{{ $config['splash']['1668x2224'] }}"
|
||||
media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2)"
|
||||
rel="apple-touch-startup-image" />
|
||||
<link href="{{ $config['splash']['1668x2388'] }}"
|
||||
media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2)"
|
||||
rel="apple-touch-startup-image" />
|
||||
<link href="{{ $config['splash']['2048x2732'] }}"
|
||||
media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2)"
|
||||
rel="apple-touch-startup-image" />
|
||||
|
||||
<!-- Tile for Win8 -->
|
||||
<meta name="msapplication-TileColor" content="{{ $config['background_color'] }}">
|
||||
<meta name="msapplication-TileImage" content="{{ data_get(end($config['icons']), 'src') }}">
|
||||
|
||||
<script type="text/javascript">
|
||||
// Initialize the service worker
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('/serviceworker.js', {
|
||||
scope: '.'
|
||||
}).then(function(registration) {
|
||||
// Registration was successful
|
||||
console.log('Laravel PWA: ServiceWorker registration successful with scope: ', registration.scope);
|
||||
}, function(err) {
|
||||
// registration failed :(
|
||||
console.log('Laravel PWA: ServiceWorker registration failed: ', err);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
5
resources/views/vendor/laravelpwa/offline.blade.php
vendored
Normal file
5
resources/views/vendor/laravelpwa/offline.blade.php
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<h1>You are currently not connected to any networks.</h1>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user