Skip to content

Commit

Permalink
limit 5 tweets
Browse files Browse the repository at this point in the history
  • Loading branch information
Joeycho committed Jun 10, 2024
1 parent 6048915 commit f2e4b04
Showing 1 changed file with 1 addition and 39 deletions.
40 changes: 1 addition & 39 deletions content/feed/_index.md
Original file line number Diff line number Diff line change
@@ -1,39 +1 @@
<style>
/* Container for the horizontal timeline */
#twitter-timeline-container {
overflow-x: auto; /* Enable horizontal scrolling */
white-space: nowrap; /* Prevent line breaks */
}

/* Style the iframe container */
.twitter-timeline {
display: inline-block;
vertical-align: top;
white-space: normal; /* Allow wrapping within each tweet */
width: 300px; /* Adjust width of each tweet */
margin-right: 10px; /* Space between tweets */
}
</style>
<div class="twitter-timeline-container">
<a class="twitter-timeline" href="https://twitter.com/MICCAI_Society?ref_src=twsrc%5Etfw" style="display: none;">Tweets by MICCAI_Society</a>
</div>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<script>
window.addEventListener('load', function() {
const container = document.getElementById('twitter-timeline-container');

// Wait until the iframe is loaded and modify its content
const observer = new MutationObserver(() => {
const iframe = container.querySelector('iframe');
if (iframe) {
iframe.onload = () => {
const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
iframeDoc.documentElement.style.overflowX = 'auto'; // Enable horizontal scrolling within the iframe
iframeDoc.documentElement.style.whiteSpace = 'nowrap'; // Prevent line breaks inside the iframe
};
}
});

observer.observe(container, { childList: true });
});
</script>
<a class="twitter-timeline" href="https://twitter.com/MICCAI_Society?ref_src=twsrc%5Etfw" style="display: none;" data-tweet-limit="5">Tweets by MICCAI_Society</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

0 comments on commit f2e4b04

Please sign in to comment.