Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 32 additions & 12 deletions data/projects.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"
},
{
Expand Down Expand Up @@ -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",
Expand Down
42 changes: 37 additions & 5 deletions static/js/rht-picture.js
Original file line number Diff line number Diff line change
@@ -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');
});
}
}
}
});
Expand Down
11 changes: 1 addition & 10 deletions static/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
@layer base {
body {
color: var(--rh-color-text-primary);
color-scheme: light dark;
}

a {
Expand Down Expand Up @@ -349,16 +350,6 @@
display: none;
}
}

@media (prefers-color-scheme: dark) {
.img-on-dark {
display: inline;
}

.img-on-light {
display: none;
}
}
}

rht-text-input {
Expand Down
3 changes: 1 addition & 2 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<!doctype html>
<html lang="en">
<head>
{# 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 %}
Expand Down