Add ellipses to long messages + remove access token

This commit is contained in:
idotj 2021-05-17 20:13:19 +02:00
parent d2c6190297
commit 050222abe1
5 changed files with 246 additions and 247 deletions

View File

@ -1,5 +1,5 @@
/* Mastodon embed timeline */ /* Mastodon embed timeline */
/* main container */ /* Main container */
.mt-timeline { .mt-timeline {
height: calc(100% - 4rem); height: calc(100% - 4rem);
padding: 2rem 3rem; padding: 2rem 3rem;
@ -25,7 +25,7 @@
display: none; display: none;
} }
/* toots messages */ /* Toot container */
.mt-toot { .mt-toot {
margin: 0 0.5rem 0 0; margin: 0 0.5rem 0 0;
padding: 1rem 0 2rem 65px; padding: 1rem 0 2rem 65px;
@ -34,21 +34,19 @@
background-color: transparent; background-color: transparent;
border-bottom: 1px solid #dee2e6; border-bottom: 1px solid #dee2e6;
} }
.mt-toot:hover { .mt-toot:hover {
cursor: pointer; cursor: pointer;
background-color: rgba(124, 124, 124, 0.2); background-color: rgba(124, 124, 124, 0.2);
} }
.mt-toot p:last-child { .mt-toot p:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
/* User icon */
.mt-user { .mt-user {
display: table; display: table;
font-weight: 600; font-weight: 600;
} }
.mt-avatar { .mt-avatar {
position: absolute; position: absolute;
top: 20px; top: 20px;
@ -62,12 +60,10 @@
background-color: #fff; background-color: #fff;
border-radius: 5px; border-radius: 5px;
} }
.mt-avatar-boosted { .mt-avatar-boosted {
width: 40px; width: 40px;
height: 40px; height: 40px;
} }
.mt-avatar-booster { .mt-avatar-booster {
width: 25px; width: 25px;
height: 25px; height: 25px;
@ -75,10 +71,13 @@
left: 25px; left: 25px;
} }
/* Message */
.toot-text { .toot-text {
margin-bottom: 0.25rem; margin-bottom: 0.25rem;
} }
.toot-text .ellipsis::after{
content:'...';
}
.mt-error { .mt-error {
color: darkred; color: darkred;
background: lightpink; background: lightpink;
@ -86,7 +85,7 @@
padding: 10px; padding: 10px;
} }
/* poll */ /* Poll */
.toot-poll { .toot-poll {
margin-bottom: 0.25rem; margin-bottom: 0.25rem;
} }
@ -103,7 +102,7 @@
padding-right: 0.5rem; padding-right: 0.5rem;
} }
/* medias */ /* Medias */
.toot-media { .toot-media {
overflow: hidden; overflow: hidden;
margin-bottom: 0.25rem; margin-bottom: 0.25rem;
@ -141,13 +140,13 @@ transform: translate(-50%, -50%);
text-align: center; text-align: center;
} }
/* date */ /* Date */
.toot-date { .toot-date {
font-size: 0.75rem; font-size: 0.75rem;
opacity: 0.5; opacity: 0.5;
} }
/* loading-spinner */ /* Loading-spinner */
.loading-spinner { .loading-spinner {
height: 100%; height: 100%;
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns:svg='http://www.w3.org/2000/svg' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.0' viewBox='0 0 128 128' %3E%3Cg%3E%3Cpath d='M64 128A64 64 0 0 1 18.34 19.16L21.16 22a60 60 0 1 0 52.8-17.17l.62-3.95A64 64 0 0 1 64 128z' fill='%23404040'/%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 64 64' to='360 64 64' dur='1000ms' repeatCount='indefinite'%3E%3C/animateTransform%3E%3C/g%3E%3C/svg%3E"); background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns:svg='http://www.w3.org/2000/svg' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.0' viewBox='0 0 128 128' %3E%3Cg%3E%3Cpath d='M64 128A64 64 0 0 1 18.34 19.16L21.16 22a60 60 0 1 0 52.8-17.17l.62-3.95A64 64 0 0 1 64 128z' fill='%23404040'/%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 64 64' to='360 64 64' dur='1000ms' repeatCount='indefinite'%3E%3C/animateTransform%3E%3C/g%3E%3C/svg%3E");
@ -157,7 +156,7 @@ text-align: center;
background-size: min(2.5rem, calc(100% - 0.5rem)); background-size: min(2.5rem, calc(100% - 0.5rem));
} }
/* see more btn */ /* See more btn */
.mt-seeMore{ .mt-seeMore{
margin: 2rem auto; margin: 2rem auto;
padding: 0 2rem; padding: 0 2rem;

View File

@ -20,7 +20,6 @@ let MastodonApi = function (params_) {
// Endpoint access settings // Endpoint access settings
this.INSTANCE_URI = params_.instance_uri; this.INSTANCE_URI = params_.instance_uri;
this.ACCESS_TOKEN = params_.access_token;
this.ACCOUNT_ID = params_.account_id; this.ACCOUNT_ID = params_.account_id;
this.PROFILE_NAME = params_.profile_name; this.PROFILE_NAME = params_.profile_name;
this.TOOTS_LIMIT = params_.toots_limit || 20; this.TOOTS_LIMIT = params_.toots_limit || 20;
@ -71,6 +70,7 @@ MastodonApi.prototype.getToots = function () {
let allHashtags = document.querySelectorAll("#mt-timeline .hashtag"); let allHashtags = document.querySelectorAll("#mt-timeline .hashtag");
for(let j=0; j<allHashtags.length; j++) { for(let j=0; j<allHashtags.length; j++) {
allHashtags[j].target = "_blank"; allHashtags[j].target = "_blank";
allHashtags[j].rel = "tag noopener noreferrer";
} }
// Insert button to visit account page, after last toot // Insert button to visit account page, after last toot