diff --git a/data/projects.json b/data/projects.json index 5a46e7d..0d2ee52 100644 --- a/data/projects.json +++ b/data/projects.json @@ -194,6 +194,16 @@ "twitterURL": "", "lowercaseName": "crash" }, + { + "projectName": "CRC", + "projectDescription": "A tool for managing a local OpenShift cluster.", + "projectRepository": "https://github.com/crc-org", + "projectWebsite": "https://crc.dev", + "category": "Development", + "twitterHandle": "", + "twitterURL": "", + "lowercaseName": "crc" + }, { "projectName": "Cryostat", "projectDescription": "JFR management for JVMs in the cloud", @@ -369,6 +379,16 @@ "twitterURL": "", "lowercaseName": "immutant" }, + { + "projectName": "InstructLab", + "projectDescription": "InstructLab is a model-agnostic open source AI project that facilitates contributions to Large Language Models (LLMs).", + "projectRepository": "https://github.com/instructlab/", + "projectWebsite": "https://instructlab.ai/", + "category": "Development", + "twitterHandle": "", + "twitterURL": "", + "lowercaseName": "instructlab" + }, { "projectName": "IronJacamar", "projectDescription": "An implementation of the Java EE Connector Architecture 1.7 specification", @@ -1390,6 +1410,16 @@ "twitterURL": "", "lowercaseName": "strimzi" }, + { + "projectName": "Submariner", + "projectDescription": "Submariner enables direct networking between Pods and Services in different Kubernetes clusters, either on-premises or in the cloud.", + "projectRepository": "https://github.com/submariner-io", + "projectWebsite": "https://submariner.io/", + "category": "Middleware", + "twitterHandle": "submarinerio", + "twitterURL": "https://twitter.com/submarinerio", + "lowercaseName": "submariner" + }, { "projectName": "SwitchYard", "projectDescription": "SwitchYard is a component-based development framework focused on building structured, maintainable services and applications", @@ -1989,8 +2019,8 @@ "projectRepository": "https://github.com/moby", "projectWebsite": "https://mobyproject.org/", "category": "Operations", - "twitterHandle": "", - "twitterURL": "", + "twitterHandle": "moby", + "twitterURL": "https://twitter.com/moby", "lowercaseName": "moby project" }, { @@ -2060,16 +2090,6 @@ "twitterURL": "", "lowercaseName": "okd" }, - { - "projectName": "OpenDaylight", - "projectDescription": "A modular open platform for customizing and automating networks of any size and scale.", - "projectRepository": "https://github.com/opendaylight/", - "projectWebsite": "https://www.opendaylight.org/", - "category": "Operations", - "twitterHandle": "", - "twitterURL": "", - "lowercaseName": "opendaylight" - }, { "projectName": "OpenSCAP", "projectDescription": "Open Source Security Compliance Solution", diff --git a/static/js/rht-picture.js b/static/js/rht-picture.js index aad09da..a29ae14 100644 --- a/static/js/rht-picture.js +++ b/static/js/rht-picture.js @@ -1,20 +1,52 @@ document.addEventListener('DOMContentLoaded', function() { - const body = document.querySelector('body'); + const body = document.body; const pictureEls = document.querySelectorAll('rht-picture'); + let prefersDark = false; + const colorScheme = localStorage.getItem('rhdsColorScheme'); + + if (!colorScheme || colorScheme === 'light dark') { + if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { + prefersDark = true; + pictureEls.forEach((art) => { + art.classList.add('dark'); + }); + } + } + + if (colorScheme === 'dark') { + pictureEls.forEach((art) => { + art.classList.add('dark'); + }); + } else if (colorScheme === 'light') { + pictureEls.forEach((art) => { + art.classList.remove('dark'); + }); + } + var observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { - if (mutation.type === "attributes") { - let styleAttr = mutation.target.getAttribute('style'); + if (mutation.type === 'attributes' && mutation.attributeName === 'style') { + const styleAttr = body.getAttribute('style'); - if (styleAttr.includes('color-scheme: dark')) { + if (styleAttr === 'color-scheme: dark;') { pictureEls.forEach((art) => { art.classList.add('dark'); }); - } else { + } else if (styleAttr === 'color-scheme: light;') { pictureEls.forEach((art) => { art.classList.remove('dark'); }); + } else { + if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { + pictureEls.forEach((art) => { + art.classList.add('dark'); + }); + } else { + pictureEls.forEach((art) => { + art.classList.remove('dark'); + }); + } } } }); diff --git a/static/styles/main.css b/static/styles/main.css index a4c76b2..39aa1f9 100644 --- a/static/styles/main.css +++ b/static/styles/main.css @@ -18,6 +18,7 @@ @layer base { body { color: var(--rh-color-text-primary); + color-scheme: light dark; } a { @@ -349,16 +350,6 @@ display: none; } } - - @media (prefers-color-scheme: dark) { - .img-on-dark { - display: inline; - } - - .img-on-light { - display: none; - } - } } rht-text-input { diff --git a/templates/index.html b/templates/index.html index d073920..1f1caa0 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,8 +1,7 @@ - {# Temporarily using 3rd pary CDN while we fix CORS issue with https://redhatstatic.com/dssf-001/v2/ #} - {% set cdn_base_url = "https://cdn.jsdelivr.net/npm/" %} + {% set cdn_base_url = "https://www.redhatstatic.com/dssf-001/v2/" %} {% if config.extra.env == "dev" %} {% set cdn_base_url = "https://cdn.jsdelivr.net/npm/" %} {% endif %}