Vue
by Roland Doda
HTML
<div id="app">
<div class="text">
SomethingSomething
</div>
</div>
CSS
body {
background: #20262E;
padding: 20px;
font-family: Helvetica;
}
#app {
background: #fff;
border-radius: 4px;
padding: 20px;
transition: all 0.2s;
display: flex;
justify-content: start;
width: 200px;
}
.text {
animation: showText 7s steps(30) forwards;
position: relative;
background: yellow;
color: black;
overflow: hidden;
margin: 0 auto;
letter-spacing: .15em;
}
.text:after {
content: "";
position: absolute;
width: 2px;
top: 0;
right: 0;
height: 100%;
background: black;
animation: pulse 1.2s linear infinite;
z-index: 3;
visibility: hidden;
}
@keyframes showText {
0% {
width: 0;
}
20% {
width: 50%;
}
40% {
width: 20%;
}
80% {
width: 80%;
}
100% {
width: 100%;
}
}
@keyframes pulse {
50% {
visibility: hidden;
}
100% {
visibility: visible;
}
}
Vue
/* new Vue({
el: "#app",
data: {
todos: [
{ text: "Learn JavaScript", done: false },
{ text: "Learn Vue", done: false },
{ text: "Play around in JSFiddle", done: true },
{ text: "Build something awesome", done: true }
]
},
methods: {
toggle: function(todo){
todo.done = !todo.done
}
}
}) */