Compare commits

...

3 commits

Author SHA1 Message Date
grassblock
342ebde2d4 fix: fediverse statuses caused overflow 2025-05-18 20:48:58 +08:00
grassblock
c56db7d692 feat: back to top scrolls back more gracefully 2025-05-18 19:52:35 +08:00
grassblock
a95920db70 feat: cooler path display style 2025-05-18 19:43:14 +08:00
3 changed files with 22 additions and 7 deletions

View file

@ -21,7 +21,14 @@
// When the user clicks on the button, scroll to the top of the document
toTopButton.addEventListener("click", toTop);
function toTop() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
try {
// scrollback gracefully
window.scrollTo({top: 0, behavior: 'smooth'});
} catch (e) {
// if there is a error,return to top directly
console.error(e);
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
}
</script>

View file

@ -193,8 +193,16 @@ const { instanceDomain, userId, extraParams = '' } = Astro.props;
.account-name {
color: #666;
font-size: 0.9em;
/* fix overflow caused by long names */
word-break: break-word;
}
/* post content */
.post .content pre code {
/*this should fix code overflows*/
white-space: pre-wrap;
overflow-wrap: break-word;
word-break: normal;
}
/* post actions */
.post-actions {
margin-top: 10px;

View file

@ -80,11 +80,11 @@ main {
}
.terminal-path {
color: var(--terminal-green);
padding: 1rem;
font-size: 1.2rem;
background-color: var(--accent-color);
color: var(--bg-color);
padding: 5px 10px;
font-size: 1rem;
font-weight: 500;
border-radius: 4px;
margin-bottom: 1rem;
display: inline-block;
}