feat: build website
This commit is contained in:
10
static/js/readingTime.js
Normal file
10
static/js/readingTime.js
Normal file
@@ -0,0 +1,10 @@
|
||||
function readingTime() {
|
||||
const text = document.querySelector("article").innerText;
|
||||
const wpm = 225;
|
||||
const words = text.trim().split(/\s+/).length;
|
||||
const time = Math.ceil(words / wpm);
|
||||
|
||||
const timeElement = document.querySelector("span#readingTime");
|
||||
timeElement.innerHTML = "<small> | </small>" + time + timeElement.innerHTML;
|
||||
}
|
||||
readingTime();
|
||||
Reference in New Issue
Block a user