diff --git a/script.js b/script.js
index fa94ffb..b87dded 100644
--- a/script.js
+++ b/script.js
@@ -95,10 +95,8 @@ const fetchPosts = async function(serverUrl, hashtag) {
// updateTimesOnPage updates the time information displayed for each post
const updateTimesOnPage = function() {
- $('.card-text a.time').each(function() {
- const timeValue = $(this).attr('data-time');
- if (timeValue === '') return;
- const date = new Date(timeValue);
+ $('.card-text a').each(function() {
+ const date = new Date($(this).attr('data-time'));
const newTimeAgo = timeAgo(secondsAgo(date));
$(this).text(newTimeAgo);
});
@@ -120,7 +118,7 @@ const displayPost = function(post) {
${post.media_attachments[0] ? `` : ''}
${DOMPurify.sanitize(post.content)}
${post.spoiler_text ? `${DOMPurify.sanitize(post.spoiler_text)}
` : ''} -${timeAgo(secondsAgo(new Date(post.created_at)))}
+${timeAgo(secondsAgo(new Date(post.created_at)))}
`; @@ -167,25 +165,16 @@ const updateCarousel = function(slides, posts) { var newHTML = ` ` newHTML += `${DOMPurify.sanitize(post.content)}
${DOMPurify.sanitize(post.content)}
- ${timeAgo(secondsAgo(new Date(post.created_at)))} + ${timeAgo(secondsAgo(new Date(post.created_at)))} ${post.favourites_count ? `, ${post.favourites_count} mal favorisiert` : '' } ${post.replies_count ? `, ${post.replies_count} mal kommentiert` : '' } ${post.reblogs_count ? `, ${post.reblogs_count} mal geteilt` : '' } @@ -229,11 +218,6 @@ const showCarousel = function() { $('#myCarousel').carousel("cycle"); } -const strip = function(html) { - let doc = new DOMParser().parseFromString(html, 'text/html'); - return doc.body.textContent || ""; -} - const hideCarousel = function() { // show popover document.getElementById('popover').style.opacity = '0'; diff --git a/styles.css b/styles.css index 3291ebf..b2f4fc5 100644 --- a/styles.css +++ b/styles.css @@ -50,12 +50,6 @@ margin-bottom: 1px !important; } -.carousel .card-text { - font-size: 1.4em; - overflow: hidden; - max-height: 60vh; -} - .card { font-size: 0.9em; /* adjust this value to get the desired text size */ } @@ -192,6 +186,10 @@ body { margin-bottom: 20px !important; } +.card-text ~ p { + font-size: 1.4em; +} + .card-img-bottom { max-width: 600px; max-height: 500px; @@ -203,7 +201,6 @@ body { margin-top: 0px !important; margin-bottom: 10px !important; align-items: center; - float: right; } .text-muted {