Jump to content

Typewriter Effect

Recommended Posts

Hello!

I found some amazing, simple code from @inside_the_square but hoping to expand upon it.  The code listed in this video / blog post allows for only one thing to be typed.  However I wish to "delete, retype a different word" and so on, with infinite playback.  I found this code on the forum previously but was hoping to simply alter the code listed here (below).  Thank you to anyone who can assist!!!  (thie first code block below within <div> tags is in my on-page code block.  The second section beginning with ".typit" is within my Design>Custom CSS

<div style="text-align:left">
  <h2>
    <span class= "typeit"> STANDOUT WEBSITES </span><br>
  THAT COMMAND YOUR CLIENTS</h2>
</div>
.typeit {
  overflow: hidden; 
  border-right: 2px solid #50bdb8; /* change this color in the keyframe too */

  white-space: nowrap; 
  margin: 0 auto; 
  animation: 
    typeit 3.5s steps(40, end),
    right-border .5s step-end infinite;
}

@keyframes typeit {  
from { width: 0 }
to { width: 100% }
}

@keyframes right-border {
from, to { border-color: transparent }
50% { border-color: #50bdb8; /* change this in the CSS above too */ }
}

 

Link to comment
  • Replies 1
  • Views 243
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

19 hours ago, DevonHarris said:

Hello!

I found some amazing, simple code from @inside_the_square but hoping to expand upon it.  The code listed in this video / blog post allows for only one thing to be typed.  However I wish to "delete, retype a different word" and so on, with infinite playback.  I found this code on the forum previously but was hoping to simply alter the code listed here (below).  Thank you to anyone who can assist!!!  (thie first code block below within <div> tags is in my on-page code block.  The second section beginning with ".typit" is within my Design>Custom CSS

<div style="text-align:left">
  <h2>
    <span class= "typeit"> STANDOUT WEBSITES </span><br>
  THAT COMMAND YOUR CLIENTS</h2>
</div>
.typeit {
  overflow: hidden; 
  border-right: 2px solid #50bdb8; /* change this color in the keyframe too */

  white-space: nowrap; 
  margin: 0 auto; 
  animation: 
    typeit 3.5s steps(40, end),
    right-border .5s step-end infinite;
}

@keyframes typeit {  
from { width: 0 }
to { width: 100% }
}

@keyframes right-border {
from, to { border-color: transparent }
50% { border-color: #50bdb8; /* change this in the CSS above too */ }
}

 

Have you tried this solution?

 

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.