Add water temperature production workspace
This commit is contained in:
@@ -28,7 +28,7 @@ export function drawOnMap(
|
||||
const numericValue = roundValues ? Math.round(value) : value.toFixed(1);
|
||||
const stringValue = numericValue.toString().replace(".", ",");
|
||||
|
||||
ctx.font = `bold ${props.fontSize}px Rubik`;
|
||||
ctx.font = `bold ${props.fontSize}px Monda`;
|
||||
const badgeWidth = getBadgeWidth(ctx, stringValue, props);
|
||||
ctx.fillStyle = "#FFFFFF";
|
||||
ctx.fillRect(localX - badgeWidth / 2, localY - props.boxSize / 2, badgeWidth, props.boxSize);
|
||||
@@ -39,7 +39,7 @@ export function drawOnMap(
|
||||
const localX = props.offsetX + x * props.scale;
|
||||
const localY = props.offsetY + y * props.scale;
|
||||
|
||||
ctx.font = `bold ${props.fontSize}px Rubik`;
|
||||
ctx.font = `bold ${props.fontSize}px Monda`;
|
||||
ctx.textAlign = "center";
|
||||
ctx.textBaseline = "middle";
|
||||
ctx.fillStyle = "#000000";
|
||||
@@ -75,7 +75,7 @@ export function drawOnMap(
|
||||
if (!props.showWind) return;
|
||||
|
||||
// wind values
|
||||
ctx.font = `bold ${props.windFontSize}px Rubik`;
|
||||
ctx.font = `bold ${props.windFontSize}px Monda`;
|
||||
ctx.textAlign = "left";
|
||||
ctx.textBaseline = "top";
|
||||
ctx.fillStyle = "#FFFFFF";
|
||||
@@ -88,18 +88,18 @@ export function drawOnMap(
|
||||
|
||||
const speedWidth = ctx.measureText(windSpeed).width;
|
||||
ctx.fillText(windSpeed, windProp.offsetX + boxMiddleX - speedWidth / 2 - 30, (windProp.offsetY + 575)*windProp.scaleY);
|
||||
ctx.font = "bold 25px Rubik";
|
||||
ctx.font = "bold 25px Monda";
|
||||
ctx.fillText("M/S", windProp.offsetX + boxMiddleX + speedWidth / 2 - 22, (windProp.offsetY + 590)*windProp.scaleY);
|
||||
|
||||
ctx.font = `bold ${props.windFontSize}px Rubik`;
|
||||
ctx.font = `bold ${props.windFontSize}px Monda`;
|
||||
const gustsWidth = ctx.measureText(windGusts).width;
|
||||
ctx.fillText(windGusts, windProp.offsetX + boxMiddleX - gustsWidth / 2 - 30, (windProp.offsetY + 790)*windProp.scaleY);
|
||||
ctx.font = "bold 25px Rubik";
|
||||
ctx.font = "bold 25px Monda";
|
||||
ctx.fillText("M/S", windProp.offsetX + boxMiddleX + gustsWidth / 2 - 22, (windProp.offsetY + 805)*windProp.scaleY);
|
||||
}
|
||||
|
||||
function getBadgeWidth(ctx: CanvasRenderingContext2D, value: string, props: ResolutionPropsValue, restoreValueFont = false): number {
|
||||
if (restoreValueFont) ctx.font = `bold ${props.fontSize}px Rubik`;
|
||||
if (restoreValueFont) ctx.font = `bold ${props.fontSize}px Monda`;
|
||||
const width = Math.max(props.boxSize, Math.ceil(ctx.measureText(value).width + props.fontSize * 0.8));
|
||||
if (restoreValueFont) ctx.font = `normal ${props.fontSize * 4.2}px Daira by LTV grafika`;
|
||||
return width;
|
||||
@@ -126,7 +126,7 @@ function drawTitleOverlay(ctx: CanvasRenderingContext2D, title: string, source:
|
||||
|
||||
ctx.textAlign = "left";
|
||||
ctx.textBaseline = "middle";
|
||||
ctx.font = `bold ${30 * scale}px Rubik`;
|
||||
ctx.font = `bold ${30 * scale}px Monda`;
|
||||
const titleText = title.trim().toUpperCase();
|
||||
const titleWidth = Math.max(360 * scale, ctx.measureText(titleText).width + horizontalPadding * 2);
|
||||
const titleX = canvasWidth - right - titleWidth;
|
||||
@@ -137,7 +137,7 @@ function drawTitleOverlay(ctx: CanvasRenderingContext2D, title: string, source:
|
||||
ctx.fillText(titleText, titleX + horizontalPadding, top + titleHeight / 2);
|
||||
|
||||
if (source.trim()) {
|
||||
ctx.font = `bold ${19 * scale}px Rubik`;
|
||||
ctx.font = `bold ${19 * scale}px Monda`;
|
||||
const sourceText = source.trim().toUpperCase();
|
||||
const sourceWidth = Math.max(130 * scale, ctx.measureText(sourceText).width + horizontalPadding * 2);
|
||||
const sourceX = canvasWidth - right - sourceWidth;
|
||||
|
||||
@@ -68,7 +68,7 @@ function drawTable(
|
||||
|
||||
ctx.textAlign = 'center'
|
||||
ctx.textBaseline = 'middle'
|
||||
ctx.font = 'bold 30px Rubik'
|
||||
ctx.font = 'bold 30px Monda'
|
||||
ctx.fillStyle = '#000000'
|
||||
ctx.letterSpacing = '10px'
|
||||
ctx.fillText(title, rigaBg.width/2, rigaBg.height*0.065)
|
||||
@@ -78,18 +78,18 @@ function drawTable(
|
||||
data.forEach((weather, i) => {
|
||||
const midX = colWidth * (i + 0.5)
|
||||
ctx.textAlign = 'center'
|
||||
ctx.font = 'bold 20px Rubik'
|
||||
ctx.font = 'bold 20px Monda'
|
||||
ctx.fillStyle = '#FFFFFF'
|
||||
ctx.fillText(weather.hour, midX, rigaBg.height * 0.2)
|
||||
|
||||
ctx.font = `normal 240px Daira by LTV grafika`
|
||||
ctx.fillText(weather.icon, midX, rigaBg.height * 0.5)
|
||||
|
||||
ctx.font = 'normal 50px Rubik'
|
||||
ctx.font = 'normal 50px Monda'
|
||||
ctx.fillText(weather.temperature, midX, rigaBg.height * 0.75)
|
||||
|
||||
const bottomLineY = rigaBg.height * 0.9
|
||||
ctx.font = 'bold 30px Rubik'
|
||||
ctx.font = 'bold 30px Monda'
|
||||
ctx.textAlign = 'center'
|
||||
ctx.fillText(weather.windDirection, midX, bottomLineY)
|
||||
const dirWidth = ctx.measureText(weather.windDirection).width
|
||||
@@ -109,4 +109,4 @@ const weekDaysLV = new Map([
|
||||
[4, 'ceturtdiena'],
|
||||
[5, 'piektdiena'],
|
||||
[6, 'sestdiena'],
|
||||
])
|
||||
])
|
||||
|
||||
@@ -74,7 +74,7 @@ function drawTable(
|
||||
|
||||
ctx.textAlign = 'center'
|
||||
ctx.textBaseline = 'middle'
|
||||
ctx.font = 'bold 30px Rubik'
|
||||
ctx.font = 'bold 30px Monda'
|
||||
ctx.fillStyle = '#000000'
|
||||
ctx.letterSpacing = '10px'
|
||||
ctx.fillText(title, rigaBg.width/2, rigaBg.height*0.065)
|
||||
@@ -89,11 +89,11 @@ function drawTable(
|
||||
ctx.font = `normal 240px Daira by LTV grafika`
|
||||
ctx.fillText(weather.icon, midX, rigaBg.height * 0.4)
|
||||
|
||||
ctx.font = 'normal 50px Rubik'
|
||||
ctx.font = 'normal 50px Monda'
|
||||
ctx.fillText(weather.temperature, midX, rigaBg.height * 0.7)
|
||||
|
||||
const bottomLineY = rigaBg.height * 0.85
|
||||
ctx.font = 'bold 30px Rubik'
|
||||
ctx.font = 'bold 30px Monda'
|
||||
ctx.textAlign = 'center'
|
||||
ctx.fillText(weather.windDirection, midX, bottomLineY)
|
||||
const dirWidth = ctx.measureText(weather.windDirection).width
|
||||
@@ -113,4 +113,4 @@ const weekDaysLV = new Map([
|
||||
[4, 'ceturtdiena'],
|
||||
[5, 'piektdiena'],
|
||||
[6, 'sestdiena'],
|
||||
])
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user