ldc-legaulois/resources/views/front/brand/ads.blade.php
Jérémy Munsch c0d8fdb73f
Fixes #11
CSP ISSUES Add missing nonces everywhere + add strict dynamic
2023-03-23 16:02:56 +01:00

96 lines
3.6 KiB
PHP

@extends('layouts.app')
@section('title', __('La saga publicitaire Le Gaulois'))
@section('description', __('Retrouvez nos célèbres spots publicitaires avec nos poules qui chantent et qui dansent.'))
@section('sub_header')
<div class="sub_header_saga" >
<div class="entete_content-saga">
<h1>{{ __('La saga publicitaire Le Gaulois') }}</h1>
</div>
<div class="video-bg">
<div class="video-opa">
@desktop
<video loop muted autoplay poster="{{ asset('assets/images/marque/sagaPub_background_2020.jpg') }}" class="header-bg_video">
<source src="{{ asset('assets/videos/marque/saga_pub_2020.webm') }}" type="video/webm">
<source src="{{ asset('assets/videos/marque/saga_pub_2020.mp4') }}" type="video/mp4">
<source src="{{ asset('assets/videos/marque/saga_pub_2020.ogv') }}" type="video/ogg">
</video>
@else
<img class="header-bg_video" src="{{ asset('assets/images/marque/sagaPub_background_2020.jpg') }}" alt="Le Gaulois - sage publicitaire">
@endif
</div>
</div>
</div>
@endsection
@section('content')
<div class="content ads">
<div class="txtsaga">
<h3>{{ __('C\'est Bon d\'être Gaulois') }}</h3>
<p>{{ __('Découvrez les différents films publicitaires Le Gaulois.') }}</p>
</div>
<div class="videoSaga @if(count($ads) == 1)onlyone @endif">
@foreach($ads as $ad)
@if($loop->first)
<div class="video first">
<a data-fslightbox="{{ $ad->link }}" data-class="display" href="#{{ $ad->link }}" title="{{ $ad->link }}" rel='nofollow noindex' >
<img src="{{ url($ad->picture) }}" alt="{{ $ad->title }}" width="760" height="456"/>
<i class="fa fa-play"></i>
</a>
<p class="first">{{ $ad->title }}</p>
</div>
@else
<div class="video">
<a data-fslightbox="{{ $ad->link }}" data-class="display" class="link" href="#{{ $ad->link }}" rel='nofollow noindex'>
<img src="{{ url($ad->picture) }}" alt="{{ $ad->title }}" width="370" height="220"/>
<i class="fa fa-play"></i>
</a>
<p>{{ $ad->title }}</p>
</div>
@endif
@php
$type = strpos(parse_url($ad->link, PHP_URL_HOST), 'vimeo.com') !== false ? 'vimeo' : null;
$type = (is_null($type) && strpos(parse_url($ad->link, PHP_URL_HOST), 'youtube.com') !== false) ? 'youtube' : $type;
@endphp
@if($type)
<iframe
id="{{ $ad->link }}"
class="display-none-weak video {{$type}}"
src="{{ route('front.frame', ['type' => $type]) }}"
data-src="{{ $ad->link }}"
data-authorize="0"
frameBorder="0"
allow="fullscreen"
width="1920px"
height="1080px">
</iframe>
@else
<div>
<p id="{{ $ad->link }}" class="text-white header3">Type de vidéo non supporté</p>
</div>
@endif
@endforeach
</div>
</div>
@endsection
@push('scripts')
<script nonce="{{ $nonce }}">
for(let video of document.querySelectorAll('.video a')) {
video.onclick = function(e) {
e.preventDefault();
let frame = document.getElementById(this.href.split('#').pop());
let link = this.href.split('#').pop();
fsLightboxInstances[this.dataset.fslightbox].open();
if (frame.dataset.authorize != 1) {
return;
} else {
setTimeout(function() {
let frame = document.querySelector('.fslightbox-source');
frame.src = link;
}, 50);
}
}
}
</script>
@endpush