From 3fd95744a9b0989a6c02d394821ade8252449099 Mon Sep 17 00:00:00 2001 From: Olivier PARPAILLON Date: Mon, 25 Nov 2024 14:01:59 +0100 Subject: [PATCH] error page --- .env | 2 +- .idea/sortir.iml | 1 + assets/not-found.js | 10 +++ assets/styles/not-found.css | 88 +++++++++++++++++++ composer.lock | 16 ++-- package-lock.json | 19 ++++ package.json | 4 + .../TwigBundle/Exception/error.html.twig | 23 +++++ webpack.config.js | 1 + 9 files changed, 155 insertions(+), 9 deletions(-) create mode 100644 assets/not-found.js create mode 100644 assets/styles/not-found.css create mode 100644 templates/bundles/TwigBundle/Exception/error.html.twig diff --git a/.env b/.env index cc08693..2ed074b 100644 --- a/.env +++ b/.env @@ -15,7 +15,7 @@ # https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration ###> symfony/framework-bundle ### -APP_ENV=dev +APP_ENV=prod APP_SECRET=ba1ab1eaa1c6662c10564a7a82901198 ###< symfony/framework-bundle ### diff --git a/.idea/sortir.iml b/.idea/sortir.iml index 0fa7baa..cf93744 100644 --- a/.idea/sortir.iml +++ b/.idea/sortir.iml @@ -3,6 +3,7 @@ + diff --git a/assets/not-found.js b/assets/not-found.js new file mode 100644 index 0000000..b213df4 --- /dev/null +++ b/assets/not-found.js @@ -0,0 +1,10 @@ +// import './bootstrap.js'; +/* + * Welcome to your app's main JavaScript file! + * + * This file will be included onto the page via the importmap() Twig function, + * which should already be in your base.html.twig. + */ +import './styles/not-found.css'; + +console.log('This log comes from assets/notfound.js - welcome to AssetMapper! 🎉'); diff --git a/assets/styles/not-found.css b/assets/styles/not-found.css new file mode 100644 index 0000000..5eebdce --- /dev/null +++ b/assets/styles/not-found.css @@ -0,0 +1,88 @@ +@import url('https://fonts.googleapis.com/css?family=VT323'); + +@tailwind base; +@tailwind components; +@tailwind utilities; + +:root { + --light-grey: #e0e2f4; + --grey: #aaaaaa; + --blue: #0414a7; + --base-font-size: 20px; + --font-stack: 'VT323', monospace; +} + +body, +h1, +h2, +h3, +h4, +p, +a { + color: var(--light-grey); +} + +body, +p { + font: normal var(--base-font-size)/1.25rem var(--font-stack); +} + +h1 { + font: normal 2.75rem/1.05em var(--font-stack); +} + +h2 { + font: normal 2.25rem/1.25em var(--font-stack); +} + +h3 { + font: lighter 1.5rem/1.25em var(--font-stack); +} + +h4 { + font: lighter 1.125rem/1.2222222em var(--font-stack); +} + +body { + background: var(--blue); +} + +.container { + width: 90%; + margin: auto; + max-width: 640px; +} + +.bsod { + padding-top: 10%; +} + +.bsod .neg { + text-align: center; + color: var(--blue); +} + +.bsod .neg .bg { + background: var(--grey); + padding: 0 15px 2px 13px; +} + +.bsod .title { + margin-bottom: 50px; +} + +.bsod .nav { + margin-top: 35px; + text-align: center; +} + +.bsod .nav .link { + text-decoration: none; + padding: 0 9px 2px 8px; +} + +.bsod .nav .link:hover, +.bsod .nav .link:focus { + background: var(--grey); + color: var(--blue); +} diff --git a/composer.lock b/composer.lock index e681eea..692f259 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": "1fd68014d63c789294bcc54a5c6d1c50", + "content-hash": "e172d72b9dfb496cd9861e9141efa997", "packages": [ { "name": "composer/semver", @@ -428,16 +428,16 @@ }, { "name": "doctrine/doctrine-bundle", - "version": "2.13.0", + "version": "2.13.1", "source": { "type": "git", "url": "https://github.com/doctrine/DoctrineBundle.git", - "reference": "ca59d84b8e63143ce1aed90cdb333ba329d71563" + "reference": "2740ad8b8739b39ab37d409c972b092f632b025a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/DoctrineBundle/zipball/ca59d84b8e63143ce1aed90cdb333ba329d71563", - "reference": "ca59d84b8e63143ce1aed90cdb333ba329d71563", + "url": "https://api.github.com/repos/doctrine/DoctrineBundle/zipball/2740ad8b8739b39ab37d409c972b092f632b025a", + "reference": "2740ad8b8739b39ab37d409c972b092f632b025a", "shasum": "" }, "require": { @@ -451,7 +451,7 @@ "symfony/console": "^5.4 || ^6.0 || ^7.0", "symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0", "symfony/deprecation-contracts": "^2.1 || ^3", - "symfony/doctrine-bridge": "^5.4.19 || ^6.0.7 || ^7.0", + "symfony/doctrine-bridge": "^5.4.46 || ^6.4.3 || ^7.0.3", "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0", "symfony/polyfill-php80": "^1.15", "symfony/service-contracts": "^1.1.1 || ^2.0 || ^3" @@ -528,7 +528,7 @@ ], "support": { "issues": "https://github.com/doctrine/DoctrineBundle/issues", - "source": "https://github.com/doctrine/DoctrineBundle/tree/2.13.0" + "source": "https://github.com/doctrine/DoctrineBundle/tree/2.13.1" }, "funding": [ { @@ -544,7 +544,7 @@ "type": "tidelift" } ], - "time": "2024-09-01T09:46:40+00:00" + "time": "2024-11-08T23:27:54+00:00" }, { "name": "doctrine/doctrine-migrations-bundle", diff --git a/package-lock.json b/package-lock.json index b1e2d60..ae2b98f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,10 @@ "packages": { "": { "license": "UNLICENSED", + "dependencies": { + "gsap": "^3.0.0-beta.11", + "split-text": "^1.0.0" + }, "devDependencies": { "@babel/core": "^7.17.0", "@babel/preset-env": "^7.16.0", @@ -3837,6 +3841,12 @@ "dev": true, "license": "MIT" }, + "node_modules/gsap": { + "version": "3.0.0-beta.11", + "resolved": "https://registry.npmjs.org/gsap/-/gsap-3.0.0-beta.11.tgz", + "integrity": "sha512-MC5VetUp+PbupAHOGFtgXzsD8zHBAyq3gGOvIiaYU9NhIyhBm0F7unVb9XYYUg5iNo7lkhGqHki6WdjAskEHtQ==", + "license": "Standard 'no charge' license: https://greensock.com/standard-license. Club GreenSock members get more: https://greensock.com/licensing/. Why GreenSock doesn't employ an MIT license: https://greensock.com/why-license/" + }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -6093,6 +6103,15 @@ "source-map": "^0.6.0" } }, + "node_modules/split-text": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/split-text/-/split-text-1.0.0.tgz", + "integrity": "sha512-uUKOFGpdt4/rrrBSmLugVbGmHaD7Ex4FcqIEXQRwlnxnDN+pL21Rx2lTgA3CSM8JE6EZPL4ZeEJp1ntzBsnc6Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/stackframe": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", diff --git a/package.json b/package.json index 8a04de1..9df2b79 100644 --- a/package.json +++ b/package.json @@ -20,5 +20,9 @@ "dev": "encore dev", "watch": "encore dev --watch", "build": "encore production --progress" + }, + "dependencies": { + "gsap": "^3.0.0-beta.11", + "split-text": "^1.0.0" } } diff --git a/templates/bundles/TwigBundle/Exception/error.html.twig b/templates/bundles/TwigBundle/Exception/error.html.twig new file mode 100644 index 0000000..375bf11 --- /dev/null +++ b/templates/bundles/TwigBundle/Exception/error.html.twig @@ -0,0 +1,23 @@ +{% block head %} + + + {% block stylesheets %} + {{ encore_entry_link_tags('not-found') }} + {% endblock %} + +{% endblock %} + +{% block content %} +
+

+ Error - {{ status_code }} +

+

An error has occured, to continue:

+

+ * Return to our homepage. +

+ +
+{% endblock %} \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index 6f1add8..4c160d8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -21,6 +21,7 @@ Encore * and one CSS file (e.g. app.css) if your JavaScript imports CSS. */ .addEntry('app', './assets/app.js') + .addEntry('not-found', './assets/not-found.js') .addEntry('lieu', './assets/js/lieu.js') .addEntry('add-lieu', './assets/js/add-lieu.js')