relatively new to blazor..
I have been using MVC, and webforms but made a dive into blazor and .net core...
What a pain it has been so far from start to finish... Anyway my issue...
I am trying to follow this codepen, typewriter text `https://codepen.io/hckkiu/pen/KKzgEMr`
Very easy to implement anywhere but blazor... So i have my CSS and javascript file loading correctly but the output is never there..
Can anyone tell me why its not loading / blazor / c#
The javascript is blinking but no text continuation.
<div class='containers'>
<div class="bodys">
<p class='typewriter'>
I'm a
<span class='typewriter-text' data-text='[ "photographer. ", "designer. ", "developer. " ]'></span>
</p>
</div>
</div>
Javascript
$(document).ready(function () {
typing(0, $('.typewriter-text').data('text'));
function typing(index, text) {
var textIndex = 1;
var tmp = setInterval(function () {
if (textIndex < text[index].length + 1) {
$('.typewriter-text').text(text[index].substr(0, textIndex));
textIndex++;
} else {
setTimeout(function () { deleting(index, text) }, 2000);
clearInterval(tmp);
}
}, 150);
}
function deleting(index, text) {
var textIndex = text[index].length;
var tmp = setInterval(function () {
if (textIndex + 1 > 0) {
$('.typewriter-text').text(text[index].substr(0, textIndex));
textIndex--;
} else {
index++;
if (index == text.length) { index = 0; }
typing(index, text);
clearInterval(tmp);
}
}, 150)
}
});
CSS
bodys {
width: 100%;
height: 100%;
background-color: #3a3a3a;
}
.containers {
display: flex;
align-items: center;
width: 100%;
height: 100%;
}
.typewriter {
font-family: sans-serif;
color: black;
padding-left: 30px;
display: block;
}
.typewriter-text {
padding-right: 10px;
color: red;
border-right: solid #ffe509 7px;
text-transform: uppercase;
animation: cursor 1s ease-in-out infinite;
font-weight: bold;
}
@keyframes cursor {
from {
border-color: #ffe509;
}
to {
border-color: transparent;
}
}
@media (max-width: 767.98px) {
.typewriter {
font-size: 35px;
}
}
@media (min-width: 768px) {
.typewriter {
font-size: 60px;
}
}
