From 4eff48d930fd8aac3ea78fdc808d457e92da239d Mon Sep 17 00:00:00 2001 From: Sicco van Sas Date: Mon, 7 Mar 2022 16:54:58 +0100 Subject: [PATCH] Add toegankelijkheidsfilters; use font awesome webfonts instead svg+js which was superslow when called dynamically with some js + much bigger; use more icons --- app/assets/package.json | 11 +- app/assets/scripts/main.js | 13 -- app/assets/scripts/routes/map.js | 236 +++++++++++++++++++++---- app/assets/styles/common/_global.scss | 8 +- app/assets/styles/layouts/_footer.scss | 9 - app/assets/styles/layouts/_header.scss | 1 - app/assets/styles/layouts/_pages.scss | 40 ++--- app/assets/styles/main.scss | 6 +- app/assets/webpack.mix.js | 1 + app/assets/yarn.lock | 61 ++++--- app/templates/embed_gemeente.html | 4 +- app/templates/map.html | 127 ++++++++++++- app/templates/show_alles.html | 2 +- app/templates/show_gemeente.html | 4 +- 14 files changed, 391 insertions(+), 132 deletions(-) diff --git a/app/assets/package.json b/app/assets/package.json index f239eda..4d0f68e 100644 --- a/app/assets/package.json +++ b/app/assets/package.json @@ -13,16 +13,17 @@ "dependencies": { "@fontsource/montserrat": "^4.5.1", "@fontsource/source-code-pro": "^4.5.1", - "@fortawesome/fontawesome-svg-core": "^1.2.36", - "@fortawesome/free-brands-svg-icons": "^5.15.4", - "@fortawesome/free-regular-svg-icons": "^5.15.4", - "@fortawesome/free-solid-svg-icons": "^5.15.4", + "@fortawesome/fontawesome-svg-core": "^1.3.0", + "@fortawesome/fontawesome-free": "^6.0.0", + "@fortawesome/free-brands-svg-icons": "^6.0.0", + "@fortawesome/free-regular-svg-icons": "^6.0.0", + "@fortawesome/free-solid-svg-icons": "^6.0.0", "bootstrap-filestyle": "1.2.1", "bootstrap-sass": "3.3.6", "bootstrap-select": "^1.13.5", "bootstrap-table": "1.19.1", "cross-env": "^5.2.1", - "fuse.js": "^3.2.0", + "fuse.js": "^6.5.3", "jquery": "2.2.4", "leaflet": "1.3.4", "leaflet.awesome-markers": "2.0.5", diff --git a/app/assets/scripts/main.js b/app/assets/scripts/main.js index 7a5b85a..8bbe9ba 100644 --- a/app/assets/scripts/main.js +++ b/app/assets/scripts/main.js @@ -16,19 +16,6 @@ import home from './routes/home'; import map from './routes/map'; -// Import the needed Font Awesome functionality -import { config, library, dom } from '@fortawesome/fontawesome-svg-core'; -// Import required icons -import { faPencilAlt, faEnvelope, faExternalLinkAlt, faQuestionCircle, faWheelchair, faBan, faCode, faMapMarkerAlt, faSearch, faCheck, faQuestion, faVolumeMute } from '@fortawesome/free-solid-svg-icons'; -import { faTwitter, faLinkedin, faFacebookF, faGithub } from '@fortawesome/free-brands-svg-icons'; -import { faEnvelope as faEnvelopeR } from '@fortawesome/free-regular-svg-icons'; - -// Add the imported icons to the library -library.add(faPencilAlt, faEnvelope, faExternalLinkAlt, faQuestionCircle, faWheelchair, faBan, faCode, faLinkedin, faTwitter, faFacebookF, faGithub, faEnvelopeR, faMapMarkerAlt, faSearch, faCheck, faQuestion, faVolumeMute); - -// Tell FontAwesome to watch the DOM and add the SVGs when it detects icon markup -dom.watch(); - // Allows us to use jQuery in