From afad70924bf789fa1aa0ef3a899387f147bfb57e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Tue, 26 Mar 2024 12:23:04 +0100 Subject: [PATCH] Carto on Unveil ok --- .../Controllers/Fo/StaticPageController.php | 37 ++- .../Requests/Bo/Sites/StoreSiteRequest.php | 2 +- composer.json | 3 +- composer.lock | 279 +++++++++++++++++- config/image-resizer.php | 70 +++++ .../assets/sites/default-picture-1000x727.jpg | Bin 0 -> 13734 bytes .../assets/sites/default-picture-300x300.png | Bin 2555 -> 0 bytes database/seeders/Development/SiteSeeder.php | 2 +- resources/sass/fo/base/_common.scss | 6 + resources/sass/fo/pages/_unveil.scss | 10 +- resources/ts/fo/base/common.ts | 40 ++- .../fo/components/LeafletMapVueComponent.vue | 132 ++++++--- resources/ts/index.d.ts | 7 + resources/views/bo/pages/sites/form.blade.php | 4 +- resources/views/fo/pages/site.blade.php | 2 +- resources/views/fo/pages/unveil.blade.php | 24 +- resources/views/fo/partials/carte.blade.php | 61 ++++ 17 files changed, 588 insertions(+), 91 deletions(-) create mode 100644 config/image-resizer.php create mode 100644 database/factories/assets/sites/default-picture-1000x727.jpg delete mode 100644 database/factories/assets/sites/default-picture-300x300.png create mode 100644 resources/views/fo/partials/carte.blade.php diff --git a/app/Http/Controllers/Fo/StaticPageController.php b/app/Http/Controllers/Fo/StaticPageController.php index de72f36..c3f2117 100644 --- a/app/Http/Controllers/Fo/StaticPageController.php +++ b/app/Http/Controllers/Fo/StaticPageController.php @@ -21,6 +21,7 @@ use App\Models\StaticPage; use App\Models\Strip; use App\Models\Testimonial; use Illuminate\Support\Facades\Mail; +use Illuminate\Support\Str; class StaticPageController extends Controller { @@ -80,18 +81,24 @@ class StaticPageController extends Controller $historySection = $sectionModels->where('section', PageSectionEnum::unveil_history)->first(); $commitmentSection = $sectionModels->where('section', PageSectionEnum::unveil_commitments)->first(); - // * Calcul Viewbox leaflet map. - $viewBox = (object)[ - // @phpstan-ignore-next-line - 'lat' => \round($siteModelList->sum(fn (Site $siteModel) => - $siteModel->latitude) / $siteModelList->count(), 6), - // @phpstan-ignore-next-line - 'lng' => \round($siteModelList->sum(fn (Site $siteModel) => - $siteModel->longitude) / $siteModelList->count(), 6) - ]; + $viewBox = null; + $initialZoom = null; + // * Calcul Viewbox leaflet map (). + // Carte  page “on se dévoile” : Point central = Laval + rayon = 100 km  + /** @var \App\Models\Site|null $lavalSite */ + // @phpstan-ignore-next-line + $lavalSite = $siteModelList->first(fn (Site $site) => Str::contains($site->name, 'Laval')); + if ($lavalSite) { + $viewBox = (object)[ + 'lat' => $lavalSite->latitude, + 'lng' => $lavalSite->longitude + ]; + $initialZoom = 9; + } return view('fo.pages.unveil', compact( 'viewBox', + 'initialZoom', 'staticPageModel', 'sectionModels', 'historicalMilestoneModels', @@ -276,9 +283,17 @@ class StaticPageController extends Controller $nextSiteModel = Site::query()->orderBy('order')->where('order', '>', $site->order)->first(); } + $viewBox = (object)[ + 'lat' => $site->latitude, + 'lng' => $site->longitude + ]; + $initialZoom = 9; + return view('fo.pages.site', [ 'siteModel' => $site, - 'nextSiteModel' => $nextSiteModel + 'nextSiteModel' => $nextSiteModel, + 'viewBox' => $viewBox, + 'initialZoom' => $initialZoom, ]); } -} \ No newline at end of file +} diff --git a/app/Http/Requests/Bo/Sites/StoreSiteRequest.php b/app/Http/Requests/Bo/Sites/StoreSiteRequest.php index 832c6c9..49734d1 100644 --- a/app/Http/Requests/Bo/Sites/StoreSiteRequest.php +++ b/app/Http/Requests/Bo/Sites/StoreSiteRequest.php @@ -80,7 +80,7 @@ class StoreSiteRequest extends FormRequest ]; return \array_merge( $rules, - $this->pictureRules('logo', 300, 300, 300, 300, false), + $this->pictureRules('logo', 1000, 727, 1000, 727, false), $this->pictureRules('picture_1', 1000, 562, 1000, 562, false), $this->pictureRules('picture_2', 1000, 562, 1000, 562, true), $this->pictureRules('picture_3', 1000, 562, 1000, 562, true), diff --git a/composer.json b/composer.json index a312fbb..abb7b6e 100644 --- a/composer.json +++ b/composer.json @@ -16,6 +16,7 @@ "axlon/laravel-postal-code-validation": "^3.5", "diglactic/laravel-breadcrumbs": "^8.0", "guzzlehttp/guzzle": "^7.2", + "kwaadpepper/image-resizer": "^2.1", "laravel/framework": "^10.0", "laravel/tinker": "^2.8", "laravel/ui": "^4.2", @@ -28,7 +29,7 @@ "fakerphp/faker": "^1.9.1", "kitloong/laravel-migrations-generator": "^6.8", "krlove/eloquent-model-generator": "dev-l10-compatibility", - "larastan/larastan": "^2.6", + "larastan/larastan": "^2.9", "laravel-lang/common": "^4.0", "laravel/pint": "^1.0", "laravel/sail": "^1.18", diff --git a/composer.lock b/composer.lock index d7285ee..9ec12b2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4bf7c1fe3b307c9b2251f4ebcfbd0cd4", + "content-hash": "1da5334945451015dfb5c5edc5c9b42f", "packages": [ { "name": "axlon/laravel-postal-code-validation", @@ -1422,6 +1422,158 @@ ], "time": "2023-12-03T19:50:20+00:00" }, + { + "name": "intervention/image", + "version": "2.7.2", + "source": { + "type": "git", + "url": "https://github.com/Intervention/image.git", + "reference": "04be355f8d6734c826045d02a1079ad658322dad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Intervention/image/zipball/04be355f8d6734c826045d02a1079ad658322dad", + "reference": "04be355f8d6734c826045d02a1079ad658322dad", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "guzzlehttp/psr7": "~1.1 || ^2.0", + "php": ">=5.4.0" + }, + "require-dev": { + "mockery/mockery": "~0.9.2", + "phpunit/phpunit": "^4.8 || ^5.7 || ^7.5.15" + }, + "suggest": { + "ext-gd": "to use GD library based image processing.", + "ext-imagick": "to use Imagick based image processing.", + "intervention/imagecache": "Caching extension for the Intervention Image library" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + }, + "laravel": { + "providers": [ + "Intervention\\Image\\ImageServiceProvider" + ], + "aliases": { + "Image": "Intervention\\Image\\Facades\\Image" + } + } + }, + "autoload": { + "psr-4": { + "Intervention\\Image\\": "src/Intervention/Image" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Oliver Vogel", + "email": "oliver@intervention.io", + "homepage": "https://intervention.io/" + } + ], + "description": "Image handling and manipulation library with support for Laravel integration", + "homepage": "http://image.intervention.io/", + "keywords": [ + "gd", + "image", + "imagick", + "laravel", + "thumbnail", + "watermark" + ], + "support": { + "issues": "https://github.com/Intervention/image/issues", + "source": "https://github.com/Intervention/image/tree/2.7.2" + }, + "funding": [ + { + "url": "https://paypal.me/interventionio", + "type": "custom" + }, + { + "url": "https://github.com/Intervention", + "type": "github" + } + ], + "time": "2022-05-21T17:30:32+00:00" + }, + { + "name": "intervention/imagecache", + "version": "2.6.0", + "source": { + "type": "git", + "url": "https://github.com/Intervention/imagecache.git", + "reference": "86136575a62d3634b51f196a998fce4a583b49bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Intervention/imagecache/zipball/86136575a62d3634b51f196a998fce4a583b49bb", + "reference": "86136575a62d3634b51f196a998fce4a583b49bb", + "shasum": "" + }, + "require": { + "illuminate/cache": "^5.5|~6|~7|~8|~9|~10", + "illuminate/filesystem": "^5.5|~6|~7|~8|~9|~10", + "intervention/image": "~2.2", + "nesbot/carbon": "^2.39", + "opis/closure": "^3.5", + "php": "~7.2|~8" + }, + "require-dev": { + "phpunit/phpunit": "^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Intervention\\Image\\": "src/Intervention/Image" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Oliver Vogel", + "email": "oliver@intervention.io", + "homepage": "http://intervention.io/" + } + ], + "description": "Caching extension for the Intervention Image Class", + "homepage": "https://image.intervention.io", + "keywords": [ + "cache", + "gd", + "image", + "imagick", + "laravel" + ], + "support": { + "issues": "https://github.com/Intervention/imagecache/issues", + "source": "https://github.com/Intervention/imagecache/tree/2.6.0" + }, + "funding": [ + { + "url": "https://paypal.me/interventionio", + "type": "custom" + }, + { + "url": "https://github.com/Intervention", + "type": "github" + } + ], + "abandoned": true, + "time": "2023-02-25T19:40:47+00:00" + }, { "name": "jean85/pretty-package-versions", "version": "2.0.6", @@ -1481,6 +1633,66 @@ }, "time": "2024-03-08T09:58:59+00:00" }, + { + "name": "kwaadpepper/image-resizer", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/Kwaadpepper/image-resizer.git", + "reference": "2a14ad153b34916f437af50549bad47c018902df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Kwaadpepper/image-resizer/zipball/2a14ad153b34916f437af50549bad47c018902df", + "reference": "2a14ad153b34916f437af50549bad47c018902df", + "shasum": "" + }, + "require": { + "illuminate/support": "~10", + "intervention/image": "^2.7.2", + "intervention/imagecache": "^2.6", + "laravel/framework": "~10" + }, + "require-dev": { + "slevomat/coding-standard": "^8.11" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Kwaadpepper\\ImageResizer\\ImageResizerServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Kwaadpepper\\ImageResizer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jérémy Munsch", + "email": "github@jeremydev.ovh", + "homepage": "https://jeremydev.ovh" + } + ], + "description": "Resize images on the fly and cache them", + "homepage": "https://github.com/kwaadpepper/image-resizer", + "keywords": [ + "images", + "laravel", + "resize" + ], + "support": { + "issues": "https://github.com/Kwaadpepper/image-resizer/issues", + "source": "https://github.com/Kwaadpepper/image-resizer/tree/2.1.0" + }, + "time": "2023-06-08T12:07:24+00:00" + }, { "name": "laravel/framework", "version": "v10.48.3", @@ -2982,6 +3194,71 @@ ], "time": "2023-11-13T09:31:12+00:00" }, + { + "name": "opis/closure", + "version": "3.6.3", + "source": { + "type": "git", + "url": "https://github.com/opis/closure.git", + "reference": "3d81e4309d2a927abbe66df935f4bb60082805ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opis/closure/zipball/3d81e4309d2a927abbe66df935f4bb60082805ad", + "reference": "3d81e4309d2a927abbe66df935f4bb60082805ad", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0 || ^8.0" + }, + "require-dev": { + "jeremeamia/superclosure": "^2.0", + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.6.x-dev" + } + }, + "autoload": { + "files": [ + "functions.php" + ], + "psr-4": { + "Opis\\Closure\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marius Sarca", + "email": "marius.sarca@gmail.com" + }, + { + "name": "Sorin Sarca", + "email": "sarca_sorin@hotmail.com" + } + ], + "description": "A library that can be used to serialize closures (anonymous functions) and arbitrary objects.", + "homepage": "https://opis.io/closure", + "keywords": [ + "anonymous functions", + "closure", + "function", + "serializable", + "serialization", + "serialize" + ], + "support": { + "issues": "https://github.com/opis/closure/issues", + "source": "https://github.com/opis/closure/tree/3.6.3" + }, + "time": "2022-01-27T09:35:39+00:00" + }, { "name": "phpoption/phpoption", "version": "1.9.2", diff --git a/config/image-resizer.php b/config/image-resizer.php new file mode 100644 index 0000000..4443faa --- /dev/null +++ b/config/image-resizer.php @@ -0,0 +1,70 @@ + 'imagick', + + /** + * The cache driver to use as defined + * in config/cache of your app + */ + 'cache' => 'file', + + /** + * The path where to store image in cache + */ + 'cachePath' => 'cache/images', + + /** + * Image cache life time + * This is given in minutes + * Here the cache for images is + * one hour + */ + 'lifetime' => 60, + + /** + * Format can specifiy to which format save the image + * JPEG PNG GIF TIF BMP ICO PSD WebP + * GD ✔️ ✔️ ✔️ - - - - ✔️ * + * Imagick ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ * + * For WebP support GD driver must be used with PHP 5 >= 5.5.0 or PHP 7 + * in order to use imagewebp(). If Imagick is used, it must be compiled + * with libwebp for WebP support. + * resize => will resize the image (boolean) + * fit => Combine cropping and resizing to format image in a smart way (boolean) + * keepRatio => will keep image ratio wile resizing (boolean) + * trim => boolean to trim the image using border color + * inCanvas => to make sure image boundarie is respected + * format => select tha wantd ouput form, yan can just convert images if you want + * example : + * 'small' => [ + * 'height' => 500, + * 'width' => 250, + * 'inCanvas' => true, + * 'trim' => ['transparent', null, 10] + * ], + * 'smallWebp' => [ + * 'height' => 500, + * 'width' => 250, + * 'inCanvas' => true, + * 'format' => 'webp' + * ], + * 'justconvertImage' => [ + * 'format' => 'webp' + * ] + */ + 'templates' => [ + 'cartoPicture' => [ + 'height' => 140, + 'width' => 155, + 'fit' => true, + 'inCanvas' => true, + 'trim' => ['transparent', null, 10], + 'format' => 'webp', + ] + ] +]; diff --git a/database/factories/assets/sites/default-picture-1000x727.jpg b/database/factories/assets/sites/default-picture-1000x727.jpg new file mode 100644 index 0000000000000000000000000000000000000000..68c2be001353d8ed684706cbc61858bff63a8ed7 GIT binary patch literal 13734 zcmeI%XH*kg0tfIL5|RKxhz2PVk)lSz;|YYOQWPnoE=59naHs;JQE5R?2vvQtAXQ~~ z0wNM(K!a2jL8XXD2~7>h5{-_8oU{Xn16FY<%Lw z$Jx0ry!o#Si%ZLExnKbPTP)%Fw_yL23oFbeflh*u}#bmEbc?kPaeTFgQf~Ndm@o> zR5^{OveqnX`Il0R1DlH9hZ#!2+xPfMROTA#U$zzH67uo^jw~N`-1#j-W0C)UDEkzn z*X;q>n-xjK_{IFdF~|APkslWDJpHmukqKyA^!_fgj z^uO;4GUx>1S%17L?v$D4cqeCRl>e!q=fR9?g!5qo6O;b7g0fI#1G4H^e|S~nz=Q#h zH660*Yhq@qFiR`6Suo#PcUvMnO#sj>8Xg~yta2RYsrB(vjv_HSEXulEon{?;&fM8l zr!mg-fVPUL61z!twjf}#yjJOxmTq*6R_MjQ&owfBYr*Gfm$Rd`Y zyQsD%)=uu6l3NK_Q(WkuQ;pabh5@ZQ)7-qClZS#>;-@__mdR1rnhswNhqg%pcysq7 z?MXLT$|jxGHg3A{1n-vRU+ zzwhG`+09AmPs;*JLiJYrnkV)a1p+bP`&pe-dESDXYSA*m5-TJk`TeYu8AF?;vyyy1 zm~QIc)MvJd5|QV~(||Fj8T-psM#5BKG%k;+KzZoyrrXsQ6RgwMj_k+TnaYf@%PUjQ zv1d;B?7qklfD%^CcoKgPt)bXKKU{?SZq&&1ePkwR=<+V7o5v0OIN+aJnRPa-=%9qw zF{G5Xz6LGdwuADz)2J)!{b!qyzMgL26&P&PvfQgYXa&w@KHiudco8128m^Z7jX8To zJ|1UpxzEx%OxS8yFqe_Jo;r@$&{4`;;tsXouR5Q$DOS&5hvu7?D3%Amot}0oU6ia& zQN?JDBozVO(q=vH2E~-%XdgZ)`yJKeOQQfNnG8D-cRM|rqtsbPN9G>JM? z{gdMvzgLAuQBu{%S{S|N@?PpyQ_PS|@cR1roAV~)xA`{;CgT@omB^~|cRGg8UK+0o zdY%$86F9(zWpr8PZPQ8Rt?jlCqx06gIadDz|mT!AGRFn?oP5v>#kOS;~!hUK$Vwk)gkHfsqC8Pt~%etxZI ziTex8c#sS=Mw~umFdEz8QE9oob0D7;<@%YuqT!ahF#C-G-?8teh^&fHe^hmlyMtA7 zU7_42Ff5bCwa`GKmQ9zEYRYz7J?X3QyY{VlL5wH7nZUKtwZ7->k0k13tD$NiPXLVP z%bc|Y;Lc>iEz@8ctaHg0*;1-9(66HO+;DlJFhF?1tEb)6R7rMUW882>$IW{lJ5N2_ zAGG>qb;nofcfEx0%EY_#13PQ10cn+#CpLrhU>xb~Tj?n>`}+9Q(&8olij0a?isnd| z*T(`9_*hF@ym5R}WX=g%t>x0{@xU<~b*{^9W{PoHdT!&*t!ZCjmcs(@F-Ma5NB$GY zk1AL#ySDULFV1)-WVxG5fMKb(i$h}Ru7n(MCs$wn!!>EqBjL;4zU}S$ZM(4(vNA>H zK$~EXt_xz2@r5J4o*Z-F*Oq6dy79{Ei0R98t59bj&kn;>JUiAk)OKyAc&DhU`lEDD z@mpw8sV&m&k=miUM&cHps_xdO$rw%i+m|oyTA)T-jm zz%8QV;8=xSdZTgm@qKha+(jW6y~)N6*tMRP-NO&dGY4B*k$>fDAweAOnyA j$N*#jG5{HX3_u1T1CRm80Av6%02zP`{C^lQ5xn~goX_3B literal 0 HcmV?d00001 diff --git a/database/factories/assets/sites/default-picture-300x300.png b/database/factories/assets/sites/default-picture-300x300.png deleted file mode 100644 index 8daffacf10a44cd41900079cd5a6e922e0f572d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2555 zcmeHJ`%}{C8YjECw%N@s?V_cdWxA=Ym03zT)ao81Z)sYBVzs7*X^Ns;%*;z(7{?sl zOg&b{ItHj5bQ6&lO-w7-#rhsZR74{M1XK`3`JS)M`6qT}-w^e{!PYpfUQ-h&qO-BGg~7hz`6A8*r#(>)M+6Op+vI4@rv<#h%KlsLz- zUVTeUq2>%Dq~ZAPB8|;H8yiZ()ox25rQu^NTTGHJE$ob3g$xZAG?3gMzrB9!*LPhu`08KK)J}<7UEiLYyV0<}3Q2)GmiQo^4WJl6EGvsf zMlt}$@;+U}u+i8dMlV)ZSNBdf%iAP(^iZX{i;#<#naF*S+4zebvk>AX_YZUJ5HiM% zw5*S6eePZB(#~#lR(D%w_#HoLP1zHj&Z!oczH2j{8i+|wO$EHXPM>D7kD*!NtV^R} zaTRI|Ay_p)`wP_ihK@sf2jWjSmOTV-e81hn!b}*COS{Mbm|HMS|LsDLqp!=g>2Yy! zOnS|%tWE&wM1&ZplBcz8SX z7r#2#ts7xmistbk1$x7POQA=~6vZ>Mvws;`928_4tLUc#G4;Xenv;bYUpZ2zCog1^ zt-jr$Njvka-w>d}wq}q>sQTcXR-X*L8{rKm8?-aLgs66z=ia`h3#^pk`Fy?(9&n^= z`G*X9=T)s1k(^=oy(|Cns#&0D!fBtTrs_TMckuYI!xoAK<)+NvT?a-l%RS4u18cG25@sY z3x9#lSDcE`Gn?WGkZSGx!M=y4=rOe89=P}yINs$0cc2T4V$#WVlD^>`DlD;}q<(Fo z8X4q#(3Wry%u=dimp3Pm)82MlvKR8+U~~>pZjr%Ykf<+o5ZGUnt%IB!F4uq)6BBZP zG1@__)MqJ2y)ZfSxW&*KrLx@4+S*z%Vprm`?kf0{#6{CWid<{`zexEMo#)5J#l@bo z9EY1#|5t&Qo{h6>v>CAir{27I;2HanFEwf|JMCm%y}}gk74ohDo^W_8Wktlg838_x zWyL0-L_(o(XlO_%bnX6j!+n835Ngc%x_5@DC`^NOlznLvb?eN`49U1G#I|m{e^1_~ zTgx!YV2Yd>(a1>4mSPHpL8mJ?p-PckZZ%t1z7=evo}$`EllrX1FeJ>Xl&at7}+2CR4=) zjm*~l6w?RZb%D1CqQ@yK2xuYb9{JY#TXu{l5sBg%)-`}QdG1yw)H0Xy`f}?G9w^7L zwdtIXvBJCGL7T^zf!NV{AWmQ7k`w`W9W3wjTzC`)P<{jCI@+U^YYM$H+{2@pU4?0? z=$jmgUUf*~^yRbJnU=ZFGA*~6U=XHx+Yao%00sVe{2eq{*;3Qk=6hq^@qXx22lG9T KM9{q>v;GHaF=D6y diff --git a/database/seeders/Development/SiteSeeder.php b/database/seeders/Development/SiteSeeder.php index 583986c..0e10ac8 100644 --- a/database/seeders/Development/SiteSeeder.php +++ b/database/seeders/Development/SiteSeeder.php @@ -25,7 +25,7 @@ class SiteSeeder extends Seeder $site->logo = FileStorageHelper::storeFile( new Site(), new \SplFileInfo(\resource_path( - '../database/factories/assets/sites/default-picture-300x300.png' + '../database/factories/assets/sites/default-picture-1000x727.jpg' )) ); $site->picture_1 = FileStorageHelper::storeFile( diff --git a/resources/sass/fo/base/_common.scss b/resources/sass/fo/base/_common.scss index 73a8205..eeb3b08 100644 --- a/resources/sass/fo/base/_common.scss +++ b/resources/sass/fo/base/_common.scss @@ -176,3 +176,9 @@ $theme-colors: map.merge($theme-colors, $light-colors); } } } + +// .map-site-widget { +// img { +// width: 6rem; +// } +// } diff --git a/resources/sass/fo/pages/_unveil.scss b/resources/sass/fo/pages/_unveil.scss index affb0f9..fc79930 100644 --- a/resources/sass/fo/pages/_unveil.scss +++ b/resources/sass/fo/pages/_unveil.scss @@ -18,7 +18,15 @@ .sites { .embed-map { - min-height: 20rem; + min-height: 30rem; + + @include media-breakpoint-up(sm) { + min-height: 35rem; + } + + @include media-breakpoint-up(md) { + min-height: 40rem; + } iframe { width: 100%; diff --git a/resources/ts/fo/base/common.ts b/resources/ts/fo/base/common.ts index 1d999e9..f58de70 100644 --- a/resources/ts/fo/base/common.ts +++ b/resources/ts/fo/base/common.ts @@ -177,6 +177,27 @@ document.addEventListener("DOMContentLoaded", function () { }, }, }, + "swiper-sites-map": { + centeredSlides: true, + modules: [Keyboard], + grabCursor: true, + slidesPerView: 1, + spaceBetween: 20, + keyboard: { + enabled: true, + }, + breakpoints: { + 768: { + slidesPerView: 1.5, + }, + 992: { + slidesPerView: 1, + }, + 1200: { + slidesPerView: 1.3, + }, + }, + }, "swiper-sites-pictures": { modules: [Navigation, Keyboard], grabCursor: true, @@ -301,13 +322,8 @@ document.addEventListener("DOMContentLoaded", function () { }, }; - type SwiperSlider = { - element: HTMLElement; - swiper: Swiper; - }; - - const swiperVol = document.getElementsByClassName("swiper") as HTMLCollectionOf, - sliders: SwiperSlider[] = []; + const swiperVol = document.getElementsByClassName("swiper") as HTMLCollectionOf; + window.__SLIDERS = new Map(); for (const htmlElt of swiperVol) { if (!swiperConfig[htmlElt.id as keyof typeof swiperConfig]) { @@ -315,10 +331,12 @@ document.addEventListener("DOMContentLoaded", function () { } // @ts-ignore const swiper = new Swiper(htmlElt, swiperConfig[htmlElt.id as keyof typeof swiperConfig]); - sliders.push({ - element: htmlElt, - swiper: swiper, - }); + window.__SLIDERS.set( + htmlElt.id, + { + element: htmlElt, + swiper: swiper, + }); if (swiper.el.id === "swiper-teams") { const btnPlayPause = document.querySelector(".swiper-pagination-playpause"); btnPlayPause?.addEventListener("click", function () { diff --git a/resources/ts/fo/components/LeafletMapVueComponent.vue b/resources/ts/fo/components/LeafletMapVueComponent.vue index 6c869d7..eb70d35 100644 --- a/resources/ts/fo/components/LeafletMapVueComponent.vue +++ b/resources/ts/fo/components/LeafletMapVueComponent.vue @@ -5,7 +5,7 @@ >
- - -
- -
- -
- - +