@keyframes animation1 {
0% {
opacity: 0;
}
33% {
opacity: 1;
}
66% {
opacity: 0;
}
100% {
opacity: 0;
}
}
@keyframes animation2 {
0% {
opacity: 0;
}
33% {
opacity: 0;
}
66% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@keyframes animation3 {
0% {
opacity: 0;
}
33% {
opacity: 0;
}
66% {
opacity: 0;
}
100% {
opacity: 1;
}
}
<div class="wrapper">
<h1 class="title">Заголовок</h1>
</div>
.wrapper {
position: relative;
z-index: 0;
display: flex;
justify-content: center;
}
.wrapper:after {
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 1px;
width: 100%;
background-color: red;
z-index: -1;
margin: auto;
}
.title {
background-color: #fff;
padding: 0 10px;
}
element.style.display = 'block';
const elementHeight = element.innerHeight;
element.style.display = 'none';
element.setAttribute('style', `--height:${height};`):
.element {
height: var(--height);
max-height: 300px;
}
const inputs = document.querySelectorAll('.input');
if( inputs.length ) {
const inputSelection = input => {
input.type = 'text';
input.setSelectionRange(0,0);
input.type = 'number';
input.blur();
}
inputs.forEach(input => {
input.addEventListener('input', event => {
if( input.value.length == input.maxLength ) inputSelection(input);
if( input.value.length > input.maxLength ) {
input.value = input.value.slice(0, input.maxLength);
inputSelection(input);
}
});
});
}