mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 17:40:46 -04:00
image updates
This commit is contained in:
@@ -134,33 +134,6 @@ function buildEmbedCopy(state, camera) {
|
|||||||
lockdown: 'locked',
|
lockdown: 'locked',
|
||||||
}[mode] || mode;
|
}[mode] || mode;
|
||||||
|
|
||||||
let title = 'Roomba Rover';
|
|
||||||
if (mode === 'lockdown') {
|
|
||||||
title = 'Private mode is on';
|
|
||||||
} else if (roversOnline === 0) {
|
|
||||||
title = 'Rovers offline - check back soon';
|
|
||||||
} else if (driverCount > 0) {
|
|
||||||
title = 'Rovers in use - drive a rover';
|
|
||||||
} else if (mode === 'turns') {
|
|
||||||
title = 'Controls open - jump in';
|
|
||||||
} else {
|
|
||||||
title = 'Controls open - drive a rover';
|
|
||||||
}
|
|
||||||
|
|
||||||
const descriptionParts = [];
|
|
||||||
descriptionParts.push(`${roversOnline} rover${roversOnline === 1 ? '' : 's'} online`);
|
|
||||||
if (driverCount > 0) {
|
|
||||||
descriptionParts.push(`${driverCount} driving`);
|
|
||||||
} else {
|
|
||||||
descriptionParts.push('no active drivers');
|
|
||||||
}
|
|
||||||
if (mode === 'lockdown') {
|
|
||||||
descriptionParts.push('privacy mode');
|
|
||||||
} else {
|
|
||||||
descriptionParts.push(modeLabel);
|
|
||||||
}
|
|
||||||
const description = descriptionParts.join(' | ');
|
|
||||||
|
|
||||||
const statsParts = [
|
const statsParts = [
|
||||||
`${roversOnline} online`,
|
`${roversOnline} online`,
|
||||||
driverCount > 0 ? `${driverCount} driving` : 'no drivers',
|
driverCount > 0 ? `${driverCount} driving` : 'no drivers',
|
||||||
@@ -173,9 +146,6 @@ function buildEmbedCopy(state, camera) {
|
|||||||
|
|
||||||
const cameraLabel = camera?.name || camera?.id || 'room cam';
|
const cameraLabel = camera?.name || camera?.id || 'room cam';
|
||||||
return {
|
return {
|
||||||
title,
|
|
||||||
description,
|
|
||||||
subtitle: 'Control a live rover from your browser',
|
|
||||||
stats: statsParts.join(' | '),
|
stats: statsParts.join(' | '),
|
||||||
cameraLabel: mode === 'lockdown' ? 'Room cams hidden' : `Room cam: ${cameraLabel}`,
|
cameraLabel: mode === 'lockdown' ? 'Room cams hidden' : `Room cam: ${cameraLabel}`,
|
||||||
};
|
};
|
||||||
@@ -346,7 +316,8 @@ async function renderOgImage() {
|
|||||||
const overlaySvg = Buffer.from(
|
const overlaySvg = Buffer.from(
|
||||||
buildOverlaySvg({
|
buildOverlaySvg({
|
||||||
title: siteMetadata.name,
|
title: siteMetadata.name,
|
||||||
subtitle: copy.subtitle,
|
// The image must use the same resolved description as the page metadata and installed shortcut.
|
||||||
|
subtitle: siteMetadata.description,
|
||||||
stats: copy.stats,
|
stats: copy.stats,
|
||||||
cameraLabel: copy.cameraLabel,
|
cameraLabel: copy.cameraLabel,
|
||||||
hasFrame,
|
hasFrame,
|
||||||
|
|||||||
Reference in New Issue
Block a user