Vorlage:TopNews: Unterschied zwischen den Versionen
Aus Geoportal
Deepak (Diskussion | Beiträge) |
Deepak (Diskussion | Beiträge) |
||
Zeile 11: | Zeile 11: | ||
<span class="contact">Email: [mailto:{{{email|}}} {{{email|}}}]</span> |
<span class="contact">Email: [mailto:{{{email|}}} {{{email|}}}]</span> |
||
}} |
}} |
||
+ | <!-- Reading time calculation script --> |
||
+ | <div id="reading-time">Reading time: Calculating...</div> |
||
+ | <script> |
||
+ | function calculateReadingTime() { |
||
+ | const wordsPerMinute = 200; // Adjust this value based on your content. |
||
+ | const text = document.body.innerText; |
||
+ | const words = text.split(/\s+/).length; |
||
+ | const readingTime = Math.ceil(words / wordsPerMinute); |
||
+ | document.getElementById('reading-time').textContent = `Reading time: ${readingTime} minutes`; |
||
+ | } |
||
+ | calculateReadingTime(); |
||
+ | </script> |
||
</div> |
</div> |
Version vom 13. Oktober 2023, 05:38 Uhr
Reading time: Calculating...
<script> function calculateReadingTime() { const wordsPerMinute = 200; // Adjust this value based on your content. const text = document.body.innerText; const words = text.split(/\s+/).length; const readingTime = Math.ceil(words / wordsPerMinute); document.getElementById('reading-time').textContent = `Reading time: ${readingTime} minutes`; } calculateReadingTime(); </script>