Merge Sams updates
4457
static/css/index.css
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 7.2 KiB |
@@ -4,6 +4,19 @@ var hamburgerShown = false;
|
||||
let width = screen.width;
|
||||
var isMobile = width < 1024;
|
||||
|
||||
function readingTime() {
|
||||
let articles = document.querySelectorAll(".article");
|
||||
let times = document.querySelectorAll(".time");
|
||||
const wpm = 225;
|
||||
let words;
|
||||
for (var i = 0; i < articles.length; i++) {
|
||||
words = articles[i].innerText.trim().split(/\s+/).length;
|
||||
let time = Math.ceil(words / wpm);
|
||||
times[i].innerText = `${time} minute read`
|
||||
}
|
||||
}
|
||||
readingTime()
|
||||
|
||||
function toggleMenu(button) {
|
||||
if (displayedMenu === button.id.split("-")[0]) {
|
||||
button.className = button.className.replace(" text-gray-800 bg-stone-200 sm:bg-transparent", " text-gray-900");
|
||||
@@ -93,3 +106,7 @@ window.onload = function () {
|
||||
document.getElementById("filter-btn").addEventListener('click', toggleFilter);
|
||||
document.getElementById("mobile-learn-btn").addEventListener('click', toggleMenu);
|
||||
}
|
||||
|
||||
function openInNewTab(url) {
|
||||
window.open(url, '_blank').focus()
|
||||
}
|
||||