feat: Add capitalizeFirstLetter() to app

This commit is contained in:
sthag 2026-02-14 18:53:48 +01:00
parent e5516c81f1
commit 5092c1680d

View file

@ -351,12 +351,12 @@ function checkButtonAndTarget(event, element, button = 0) {
function getClosestEdgeToElement(element) { function getClosestEdgeToElement(element) {
'use strict'; 'use strict';
const rect = element.getBoundingClientRect(); const bounding = element.getBoundingClientRect();
const distances = { const distances = {
top: rect.top, top: bounding.top,
right: window.innerWidth - rect.right, right: window.innerWidth - bounding.right,
bottom: window.innerHeight - rect.bottom, bottom: window.innerHeight - bounding.bottom,
left: rect.left left: bounding.left
}; };
return Object.keys(distances).reduce((a, b) => distances[a] < distances[b] ? a : b); return Object.keys(distances).reduce((a, b) => distances[a] < distances[b] ? a : b);
@ -519,6 +519,10 @@ function convertToRomanNumeral(num) {
return result; return result;
} }
function capitalizeFirstLetter(text) {
return text.charAt(0).toUpperCase() + text.slice(1);
}
// CONCEPTS // CONCEPTS
// NOTE: Benutzt private Zuweisungen // NOTE: Benutzt private Zuweisungen