有关个人数据处理的任何需求,请联系数据保护官 (DPO): dpo@apptaxi.it
客户端app
争议
网页
注册商标
// Funzione di utilità per confrontare colori in formato rgb
function isColorMatch(rgbString, hex) {
const bigint = parseInt(hex.slice(1), 16);
const r = (bigint >> 16) & 255;
const g = (bigint >> 8) & 255;
const b = bigint & 255;
return rgbString === `rgb(${r}, ${g}, ${b})`;
}
// Seleziona h1, h2, h3
document.querySelectorAll('h1, h2').forEach(el => {
const style = window.getComputedStyle(el);
const color = style.color;
// Controlla se è uno dei colori ammessi: nero, #3a3a3a o #333333
if (
isColorMatch(color, '#000000') ||
isColorMatch(color, '#3a3a3a') ||
isColorMatch(color, '#333333')
) {
const txt = el.textContent;
if (txt.length > 1) {
const match = txt.match(/^(.*)(.)(.)$/);
const rest = match[1];
const pen = match[2];
const last = match[3];
el.innerHTML = `${rest}
${pen}${last}`;
}
}
});
.penultima {
color: #ffcc33;
}