diff --git a/.github/workflows/crowdin-actions.yaml b/.github/workflows/crowdin-actions.yaml index 0f853e20f4..f3d104c475 100644 --- a/.github/workflows/crowdin-actions.yaml +++ b/.github/workflows/crowdin-actions.yaml @@ -19,12 +19,12 @@ jobs: uses: actions/checkout@v3 - name: Upload or update source files to Crowdin - uses: crowdin/github-action@1.4.15 + uses: crowdin/github-action@1.4.16 with: upload_sources: true - name: Download German translations - uses: crowdin/github-action@1.4.15 + uses: crowdin/github-action@1.4.16 with: upload_sources: false download_translations: true @@ -42,7 +42,7 @@ jobs: config: crowdin.yaml - name: Download Spanish translations - uses: crowdin/github-action@1.4.15 + uses: crowdin/github-action@1.4.16 with: upload_sources: false download_translations: true diff --git a/csfieldguide/config/__init__.py b/csfieldguide/config/__init__.py index 01c0559016..a664eb9acf 100644 --- a/csfieldguide/config/__init__.py +++ b/csfieldguide/config/__init__.py @@ -1,3 +1,3 @@ """Module for Django system configuration.""" -__version__ = "3.12.2" +__version__ = "3.12.3" diff --git a/csfieldguide/package-lock.json b/csfieldguide/package-lock.json index c64b23cd60..90a58528c7 100644 --- a/csfieldguide/package-lock.json +++ b/csfieldguide/package-lock.json @@ -638,13 +638,13 @@ "dev": true }, "autoprefixer": { - "version": "10.4.12", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.12.tgz", - "integrity": "sha512-WrCGV9/b97Pa+jtwf5UGaRjgQIg7OK3D06GnoYoZNcG1Xb8Gt3EfuKjlhh9i/VtT16g6PYjZ69jdJ2g8FxSC4Q==", + "version": "10.4.13", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.13.tgz", + "integrity": "sha512-49vKpMqcZYsJjwotvt4+h/BCjJVnhGwcLpDt5xkcaOG3eLrG/HUYLagrihYsQ+qrIBgIzX1Rw7a6L8I/ZA1Atg==", "dev": true, "requires": { "browserslist": "^4.21.4", - "caniuse-lite": "^1.0.30001407", + "caniuse-lite": "^1.0.30001426", "fraction.js": "^4.2.0", "normalize-range": "^0.1.2", "picocolors": "^1.0.0", @@ -664,15 +664,15 @@ } }, "caniuse-lite": { - "version": "1.0.30001409", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001409.tgz", - "integrity": "sha512-V0mnJ5dwarmhYv8/MzhJ//aW68UpvnQBXv8lJ2QUsvn2pHcmAuNtu8hQEDz37XnA1iE+lRR9CIfGWWpgJ5QedQ==", + "version": "1.0.30001426", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001426.tgz", + "integrity": "sha512-n7cosrHLl8AWt0wwZw/PJZgUg3lV0gk9LMI7ikGJwhyhgsd2Nb65vKvmSexCqq/J7rbH3mFG6yZZiPR5dLPW5A==", "dev": true }, "electron-to-chromium": { - "version": "1.4.256", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.256.tgz", - "integrity": "sha512-x+JnqyluoJv8I0U9gVe+Sk2st8vF0CzMt78SXxuoWCooLLY2k5VerIBdpvG7ql6GKI4dzNnPjmqgDJ76EdaAKw==", + "version": "1.4.284", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz", + "integrity": "sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==", "dev": true }, "node-releases": { @@ -688,9 +688,9 @@ "dev": true }, "update-browserslist-db": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.9.tgz", - "integrity": "sha512-/xsqn21EGVdXI3EXSum1Yckj3ZVZugqyOZQ/CxYPBD/R+ko9NSUScf8tFF4dOKY+2pvSSJA/S+5B8s4Zr4kyvg==", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", + "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", "dev": true, "requires": { "escalade": "^3.1.1", diff --git a/csfieldguide/package.json b/csfieldguide/package.json index 465a560d23..ee9d116e7b 100644 --- a/csfieldguide/package.json +++ b/csfieldguide/package.json @@ -6,7 +6,7 @@ "dependencies": {}, "devDependencies": { "ansi-colors": "4.1.3", - "autoprefixer": "10.4.12", + "autoprefixer": "10.4.13", "bootstrap": "4.6.2", "browser-sync": "2.27.10", "browserify": "17.0.0", diff --git a/csfieldguide/static/img/csfg-icon-with-text-white.png b/csfieldguide/static/img/csfg-icon-with-text-white.png new file mode 100644 index 0000000000..d7441e9e02 Binary files /dev/null and b/csfieldguide/static/img/csfg-icon-with-text-white.png differ diff --git a/csfieldguide/static/img/csfg-icon-with-text.png b/csfieldguide/static/img/csfg-icon-with-text.png new file mode 100644 index 0000000000..1a33dda286 Binary files /dev/null and b/csfieldguide/static/img/csfg-icon-with-text.png differ diff --git a/csfieldguide/static/img/guide-favicon-white.png b/csfieldguide/static/img/guide-favicon-white.png new file mode 100644 index 0000000000..03d24ffcc1 Binary files /dev/null and b/csfieldguide/static/img/guide-favicon-white.png differ diff --git a/csfieldguide/static/img/guide-favicon.png b/csfieldguide/static/img/guide-favicon.png index 9dca303d55..55f843121c 100644 Binary files a/csfieldguide/static/img/guide-favicon.png and b/csfieldguide/static/img/guide-favicon.png differ diff --git a/csfieldguide/static/img/logos/guide-logo-light.png b/csfieldguide/static/img/logos/guide-logo-light.png deleted file mode 100644 index 9742b652eb..0000000000 Binary files a/csfieldguide/static/img/logos/guide-logo-light.png and /dev/null differ diff --git a/csfieldguide/static/interactives/cmy-mixer/scss/cmy-mixer.scss b/csfieldguide/static/interactives/cmy-mixer/scss/cmy-mixer.scss index e6f2fe179c..4ca87fff6b 100644 --- a/csfieldguide/static/interactives/cmy-mixer/scss/cmy-mixer.scss +++ b/csfieldguide/static/interactives/cmy-mixer/scss/cmy-mixer.scss @@ -1,4 +1,4 @@ -@import "node_modules/nouislider/distribute/nouislider.css"; +@import "static/interactives/cmy-mixer/node_modules/nouislider/distribute/nouislider"; @import "node_modules/bootstrap/scss/functions"; @import "node_modules/bootstrap/scss/variables"; @import "node_modules/bootstrap/scss/mixins"; diff --git a/csfieldguide/static/interactives/colour-matcher/scss/colour-matcher.scss b/csfieldguide/static/interactives/colour-matcher/scss/colour-matcher.scss index 6831061236..215e7d8551 100644 --- a/csfieldguide/static/interactives/colour-matcher/scss/colour-matcher.scss +++ b/csfieldguide/static/interactives/colour-matcher/scss/colour-matcher.scss @@ -1,4 +1,4 @@ -@import "node_modules/nouislider/distribute/nouislider.css"; +@import "static/interactives/colour-matcher/node_modules/nouislider/distribute/nouislider"; /* Distance between bottom of slider and pips */ #interactive-colour-matcher .noUi-pips { diff --git a/csfieldguide/static/interactives/data-bias/css/data-bias.scss b/csfieldguide/static/interactives/data-bias/css/data-bias.scss index 7350b783e8..25da1f0139 100644 --- a/csfieldguide/static/interactives/data-bias/css/data-bias.scss +++ b/csfieldguide/static/interactives/data-bias/css/data-bias.scss @@ -1,4 +1,4 @@ -@import "node_modules/nouislider/distribute/nouislider.css"; +@import "static/interactives/data-bias/node_modules/nouislider/distribute/nouislider"; @import "node_modules/bootstrap/scss/functions"; @import "node_modules/bootstrap/scss/variables"; @import "node_modules/bootstrap/scss/mixins"; diff --git a/csfieldguide/static/interactives/matrix-simplifier/js/matrix-simplifier.js b/csfieldguide/static/interactives/matrix-simplifier/js/matrix-simplifier.js index ba54464cfa..963f574860 100644 --- a/csfieldguide/static/interactives/matrix-simplifier/js/matrix-simplifier.js +++ b/csfieldguide/static/interactives/matrix-simplifier/js/matrix-simplifier.js @@ -1,5 +1,5 @@ const dragula = require('dragula'); -const mathjs = require('mathjs'); +const mathjs_import = require('mathjs'); const sprintf = require('sprintf-js').sprintf; const vsprintf = require('sprintf-js').vsprintf; @@ -18,7 +18,7 @@ const MATRIX_CHILD_INDEX = 3; // Index for which child of the draggable element/ * Below is adapted from https://mathjs.org/examples/browser/angle_configuration.html.html * This is used to configure mathjs to accept degrees as input for trig functions. */ - +const mathjs = mathjs_import.create(mathjs_import.all); let replacements = {}; // the trigonometric functions that we are configuring to handle inputs of degrees instead of radians @@ -90,7 +90,7 @@ var resultEqtn; // only show equations once they are rendered // URL for mathjax script loaded from CDN -var mjaxURL = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML,Safe.js'; +var mjaxURL = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/MathJax.js?config=TeX-AMS-MML_HTMLorMML,Safe.js'; // load mathjax script $.getScript(mjaxURL, function() { // mathjax successfully loaded, let it render @@ -595,11 +595,11 @@ function populateModalForEditing() { $('#matrix-row-0-col-0').val(matrix[0][0]); $('#matrix-row-0-col-1').val(matrix[0][1]); $('#matrix-row-0-col-2').val(matrix[0][2]); - + $('#matrix-row-1-col-0').val(matrix[1][0]); $('#matrix-row-1-col-1').val(matrix[1][1]); $('#matrix-row-1-col-2').val(matrix[1][2]); - + $('#matrix-row-2-col-0').val(matrix[2][0]); $('#matrix-row-2-col-1').val(matrix[2][1]); $('#matrix-row-2-col-2').val(matrix[2][2]); diff --git a/csfieldguide/static/interactives/matrix-simplifier/scss/matrix-simplifier.scss b/csfieldguide/static/interactives/matrix-simplifier/scss/matrix-simplifier.scss index 131c2bfa20..ca271a9df4 100644 --- a/csfieldguide/static/interactives/matrix-simplifier/scss/matrix-simplifier.scss +++ b/csfieldguide/static/interactives/matrix-simplifier/scss/matrix-simplifier.scss @@ -1,4 +1,4 @@ -@import "node_modules/dragula/dist/dragula.css"; +@import "static/interactives/matrix-simplifier/node_modules/dragula/dist/dragula"; @import "node_modules/bootstrap/scss/functions"; @import "node_modules/bootstrap/scss/variables"; @import "node_modules/bootstrap/scss/mixins"; @@ -81,19 +81,13 @@ } } -#output-container { - > div { - > span { - display: inline !important; - } - } -} - +#output-container > div { + display: flex; + align-items: center; + justify-content: center; -#matrix-output, -#vector-output { - > span { - display: inline !important; + .MathJax_Display { + width: min-content; } } diff --git a/csfieldguide/static/interactives/pixel-viewer/README.md b/csfieldguide/static/interactives/pixel-viewer/README.md index 796cea16ec..7375dea1ee 100644 --- a/csfieldguide/static/interactives/pixel-viewer/README.md +++ b/csfieldguide/static/interactives/pixel-viewer/README.md @@ -1,6 +1,6 @@ # Pixel Viewer Interactive -**Author:** Jack Morgan +**Author:** Jack Morgan **Modified by:** Andy Bell, Courtney Bracefield, Alasdair Smith, Jack Morgan This interactive is created to allow users to see the values of each pixel of an image. @@ -29,6 +29,7 @@ The interactive has the following optional parameters to configure the interacti - `image` - Filename of image to use (for example `arnold.jpg`). - `picturepicker` - Displays a set of pictures available for using. - `hide-menu` - Hides the menu. +- `hide-colour-codes` - Hides the colour codes within pixels. - `hide-colour-code-picker` - Hides the option to change between colour code formats. - `hide-config-selector` - Hides the option to change between modes. - `no-pixel-fill` - Displays pixels without background fill from start (also doesn't show initial image with transition). diff --git a/csfieldguide/static/interactives/pixel-viewer/js/pixel-viewer.js b/csfieldguide/static/interactives/pixel-viewer/js/pixel-viewer.js index e1c664439a..30547f89c2 100644 --- a/csfieldguide/static/interactives/pixel-viewer/js/pixel-viewer.js +++ b/csfieldguide/static/interactives/pixel-viewer/js/pixel-viewer.js @@ -1,9 +1,10 @@ // Settings and intialize layout this.MAX_HEIGHT = 133; this.CELL_SIZE = 50; - this.MAX_NOISE = 15; +var searchParameters = new URL(window.location.href).searchParams; + this.container = document.getElementById("pixel-viewer-interactive-container"); this.content = document.getElementById("pixel-viewer-interactive-content"); this.context = content.getContext('2d'); @@ -15,8 +16,8 @@ this.contentHeight = 6650; this.cell_line_height = 15; this.cell_text = 'R \nG \nB '; this.text_opacity = 0; - this.mode = 'datarep'; +var showColourCode = true; this.picturePicker = false; this.filter = null; @@ -73,15 +74,15 @@ var colour_code_rep = 'rgb'; $( document ).ready(function() { init_cache(300, MAX_HEIGHT); - if (getUrlParameter('image')){ - image_filename = getUrlParameter('image'); + if (searchParameters.has('image')){ + image_filename = searchParameters.get('image'); } var image_filepath = image_base_path + image_filename; $('#pixel-viewer-interactive-original-image').attr('crossorigin', 'anonymous').attr('src', image_filepath); load_resize_image(image_filepath, false); - switch(getUrlParameter('mode')) { + switch (searchParameters.get('mode')) { case 'threshold': mode = 'threshold'; break; case 'thresholdgreyscale': @@ -94,24 +95,28 @@ $( document ).ready(function() { mode = 'brightness'; break; } - if (getUrlParameter('picturepicker')){ + if (searchParameters.has('picturepicker')){ // Whether or not to allow student to pick from set pictures picturePicker = true; } - if (getUrlParameter('hide-menu')) { + if (searchParameters.has('hide-menu')) { $('#pixel-viewer-interactive-menu-toggle').remove(); } - if (getUrlParameter('pixelmania')){ + if (searchParameters.has('hide-colour-codes')) { + showColourCode = false; + } + + if (searchParameters.has('pixelmania')){ $('#pixelmania-logo').removeClass('d-none'); } - if (getUrlParameter('hide-colour-code-picker')) { + if (searchParameters.has('hide-colour-code-picker')) { $("#colour-code-radio").addClass('d-none').removeClass('d-flex'); } - if (getUrlParameter('hide-config-selector')) { + if (searchParameters.has('hide-config-selector')) { $("#configSelector").addClass('d-none'); } @@ -120,7 +125,7 @@ $( document ).ready(function() { createPicturePicker(); } - colour_code_rep = getUrlParameter('colour-code'); + colour_code_rep = searchParameters.get('colour-code'); if (colour_code_rep == 'rgb-hex') { $("input[id='rgb-hex-colour-code']").prop('checked', true); } else if (colour_code_rep == 'hex') { @@ -149,7 +154,7 @@ $( document ).ready(function() { scroller_position_left = image_position_left; reflow(); - if (getUrlParameter('no-pixel-fill')){ + if (searchParameters.has('no-pixel-fill')){ $('#pixel-viewer-interactive-show-pixel-fill').prop('checked', false); $("#pixel-viewer-interactive-loader").hide(); $("#pixel-viewer-interactive-buttons").css({opacity: 1}); @@ -1066,7 +1071,7 @@ var paint = function(row, col, left, top, width, height, zoom) { } // If text opacity is greater than 0, then display RGB values -if (text_opacity > 0) { + if (showColourCode && text_opacity > 0) { if (!show_pixel_fill) { context.fillStyle = "rgba(0, 0, 0, " + text_opacity + ")"; } else if ((((pixelData[0] / 255) + (pixelData[1] / 255) + (pixelData[2] / 255)) / 3) < 0.85) { @@ -1126,7 +1131,7 @@ var reflow = function() { }; // Set zoom to see numbers if no colour fill -if (getUrlParameter('no-pixel-fill')) { +if (searchParameters.has('no-pixel-fill')) { this.scroller.zoomTo(1.5); } @@ -1239,19 +1244,3 @@ function sum(array){ return prev + curr; }); } - -// From jquerybyexample.net/2012/06/get-url-parameters-using-jquery.html -function getUrlParameter(sParam) { - var sPageURL = decodeURIComponent(window.location.search.substring(1)), - sURLVariables = sPageURL.split('&'), - sParameterName, - i; - - for (i = 0; i < sURLVariables.length; i++) { - sParameterName = sURLVariables[i].split('='); - - if (sParameterName[0] === sParam) { - return sParameterName[1] === undefined ? true : sParameterName[1]; - } - } -}; diff --git a/csfieldguide/static/interactives/pixel-viewer/scss/pixel-viewer.scss b/csfieldguide/static/interactives/pixel-viewer/scss/pixel-viewer.scss index 540ed74ac9..89193d6870 100644 --- a/csfieldguide/static/interactives/pixel-viewer/scss/pixel-viewer.scss +++ b/csfieldguide/static/interactives/pixel-viewer/scss/pixel-viewer.scss @@ -6,6 +6,8 @@ user-select: none !important; background-color: #3f51b5; flex-grow: 1; + height: 100vh; + overflow: hidden; #pixel-viewer-interactive-source-canvas { height: 133px; diff --git a/csfieldguide/static/interactives/scene-editor/package.json b/csfieldguide/static/interactives/scene-editor/package.json index 658f663050..293cf42477 100644 --- a/csfieldguide/static/interactives/scene-editor/package.json +++ b/csfieldguide/static/interactives/scene-editor/package.json @@ -4,7 +4,7 @@ "private": true, "dependencies": { "mathjs": "6.0.3", - "three": "0.145.0", + "three": "0.146.0", "three-orbit-controls": "82.1.0", "sprintf-js": "1.1.2" } diff --git a/csfieldguide/static/interactives/sorting-algorithms/scss/sorting-algorithms.scss b/csfieldguide/static/interactives/sorting-algorithms/scss/sorting-algorithms.scss index 141504eaed..899fedcd62 100644 --- a/csfieldguide/static/interactives/sorting-algorithms/scss/sorting-algorithms.scss +++ b/csfieldguide/static/interactives/sorting-algorithms/scss/sorting-algorithms.scss @@ -1,5 +1,5 @@ @use "sass:math"; -@import "node_modules/dragula/dist/dragula.css"; +@import "static/interactives/sorting-algorithms/node_modules/dragula/dist/dragula"; @import "node_modules/bootstrap/scss/functions"; @import "node_modules/bootstrap/scss/variables"; @import "node_modules/bootstrap/scss/mixins"; @@ -61,7 +61,7 @@ z-index: 1; } -// Partial copy of its namesake from Dragula.css +// Partial copy of its namesake from Dragula // but !important to override changes made in JS for a different purpose .gu-transit { opacity: 0.2 !important; diff --git a/csfieldguide/static/interactives/training-ground/scss/training-ground.scss b/csfieldguide/static/interactives/training-ground/scss/training-ground.scss index 41522604c0..c0647651ca 100644 --- a/csfieldguide/static/interactives/training-ground/scss/training-ground.scss +++ b/csfieldguide/static/interactives/training-ground/scss/training-ground.scss @@ -1,4 +1,4 @@ -@import "node_modules/nouislider/distribute/nouislider.css"; +@import "static/interactives/training-ground/node_modules/nouislider/distribute/nouislider"; #interactive-training-ground { max-width: 1000px; diff --git a/csfieldguide/static/svg/csfg-icon-with-text-white.svg b/csfieldguide/static/svg/csfg-icon-with-text-white.svg new file mode 100644 index 0000000000..a7bcb86ca4 --- /dev/null +++ b/csfieldguide/static/svg/csfg-icon-with-text-white.svg @@ -0,0 +1,177 @@ + + diff --git a/csfieldguide/static/svg/csfg-icon-with-text.svg b/csfieldguide/static/svg/csfg-icon-with-text.svg new file mode 100644 index 0000000000..3534e0a94b --- /dev/null +++ b/csfieldguide/static/svg/csfg-icon-with-text.svg @@ -0,0 +1,177 @@ + + diff --git a/csfieldguide/templates/base.html b/csfieldguide/templates/base.html index 8f9b50319f..89a468bf98 100644 --- a/csfieldguide/templates/base.html +++ b/csfieldguide/templates/base.html @@ -32,7 +32,12 @@ {% block css %} {% endblock css %} - + + + {% if PRODUCTION_ENVIRONMENT %} + + + {% endif %}
{% block body %} @@ -337,19 +342,6 @@ {% block scripts %} {% endblock scripts %} - - {% if DEPLOYED %} - - - {% endif %} {% endblock body %}