Read Time

Calculate the time to read a section with just 2 attributes

Loads
CDN ScriptDocumentationExample

Copy the Read Time <script> and paste into the <head> of your page

<!-- [Webflow Trickery by CodeRaccoons]  -->
<script async src= "https://cdn.jsdelivr.net/gh/TheCodeRaccoons/WebflowTrickery@1.0.0/Dist/Functional/ReadTime.min.js" ></script>
Copy Script

Required attributes

I want this element to display the time it will take to read the contents selected
Attribute to add
Name
wt-readtime-element
Value
display
Instructions

This Text field will be showing the time it'll take to read the selected section.

we can have multiple text fields within the page with this attribute and all of them will show the value.

How does it look?
I want the contents of this section to be considered for the read time calculation
Attribute to add
Name
wt-readtime-element
Value
article
Instructions

This element will be the container that holds the text that will be used to calculate the time to read.

This can be any element that contain text inside but make sure all of the content to be calculated is within it.

How does it look?
Optional
I want this to be the number of words per minute for the calculation of time
Attribute to add
Name
wt-readtime-words
Value
256
Instructions

Add this to the text element that is holding the display Attribute.

the read time calculation is using a default read time of 225 words per minute. This attribute will override the amount of words per minute for the calculation.

How does it look?
Optional
I want this to be the suffix after the time to read.
Attribute to add
Name
wt-readtime-suffix
Value
suffix
Instructions

This will be added at the end of the time calculation.

By default it'll say "x minutes" minutes being the suffix, if this tag is added the minutes will be replaced by whichever text the attribute has.

this does not apply to a flat minute which will show up as "a minute".

How does it look?
Optional
I want this to be the suffix to show when the read time is less than a minute.
Attribute to add
Name
wt-readtime-smallsuffix
Value
small suffix
Instructions

This will be added if the text takes less than a minute to read.

By default it'll say "Less than a minute", if this tag is added this phrase will be replaced by whichever text the attribute has.

this does not apply to a flat minute which will show up as "a minute".

How does it look?

Optional Attributes

I want this element to display the time it will take to read the contents selected
Attribute to add
Name
wt-readtime-element
Value
display
Instructions

This Text field will be showing the time it'll take to read the selected section.

we can have multiple text fields within the page with this attribute and all of them will show the value.

How does it look?
I want the contents of this section to be considered for the read time calculation
Attribute to add
Name
wt-readtime-element
Value
article
Instructions

This element will be the container that holds the text that will be used to calculate the time to read.

This can be any element that contain text inside but make sure all of the content to be calculated is within it.

How does it look?
Optional
I want this to be the number of words per minute for the calculation of time
Attribute to add
Name
wt-readtime-words
Value
256
Instructions

Add this to the text element that is holding the display Attribute.

the read time calculation is using a default read time of 225 words per minute. This attribute will override the amount of words per minute for the calculation.

How does it look?
Optional
I want this to be the suffix after the time to read.
Attribute to add
Name
wt-readtime-suffix
Value
suffix
Instructions

This will be added at the end of the time calculation.

By default it'll say "x minutes" minutes being the suffix, if this tag is added the minutes will be replaced by whichever text the attribute has.

this does not apply to a flat minute which will show up as "a minute".

How does it look?
Optional
I want this to be the suffix to show when the read time is less than a minute.
Attribute to add
Name
wt-readtime-smallsuffix
Value
small suffix
Instructions

This will be added if the text takes less than a minute to read.

By default it'll say "Less than a minute", if this tag is added this phrase will be replaced by whichever text the attribute has.

this does not apply to a flat minute which will show up as "a minute".

How does it look?

Working examples

See the Pen Article Details by Code Raccoons (@jorchie) on CodePen.

Need more?

Do you need multiple instances of this Attribute?

All of our attributes follow the same structure for multiple instances!

In order to use multiple instances on an attribute add -n at the end of the value of the element attribute. being "n" a unique number.

This unique number is how we can tell between multiple instances.

For example, container-2, trigger-2, and target-2 will all be connected to the same instance.

This is what you need to add multiple instances of this:

First attribute instance
No items found.
Second instance
No items found.
Third instance
No items found.