Do you want IT that works simply and securely, without any headaches?

IT is constantly evolving and many companies struggle to keep up. It’s not just about the technology, but also about actively involving your team.
Our job is to find workable solutions that really help – with the right technologies for sustainable change and a successful future, tailored to your requirements.
function wrapHeadingLines() {
const headings = document.querySelectorAll('[data-heading]');
headings.forEach(heading => {
// Get the computed styles of the heading
const computedStyle = window.getComputedStyle(heading);
const headingWidth = heading.offsetWidth;
// Create a hidden element for measuring
const measure = document.createElement('span');
measure.style.cssText = `
position: absolute;
visibility: hidden;
white-space: nowrap;
font: ${computedStyle.font}
`;
document.body.appendChild(measure);
// Get the text and split into words
const words = heading.textContent.trim().split(' ');
let lines = [];
let currentLine = [];
// Build lines word by word
words.forEach(word => {
measure.textContent = [...currentLine, word].join(' ');
if (measure.offsetWidth > headingWidth && currentLine.length > 0) {
lines.push(currentLine.join(' '));
currentLine = [word];
} else {
currentLine.push(word);
}
});
// Add the last line
if (currentLine.length > 0) {
lines.push(currentLine.join(' '));
}
// Remove measuring element
document.body.removeChild(measure);
// Replace heading content with wrapped lines
heading.innerHTML = lines
.map(line => `<span class="line">${line}</span>`)
.join('');
});
}
// Run on load and resize
document.addEventListener('DOMContentLoaded', wrapHeadingLines);
let resizeTimer;
window.addEventListener('resize', () => {
clearTimeout(resizeTimer);
resizeTimer = setTimeout(wrapHeadingLines, 250);
});
Wir sind IT Partner
Flowciety GmbHUnser Motto: IT im Geschäftsalltag als Lösung etablieren, nicht als Quelle von Problemen.
- IT Stabilität als Ziel
IT Prozesse beschleunigen
- Smarter Wandel
Konzepte implementieren
- Wachstumsfähigkeit
IT Skalierbarkeit sicherstellen
- Erfolgreich ans Ziel
Geschäftsziele erreichen