Added tokelist to user profile.

This commit is contained in:
rainbow napkin 2024-12-14 07:03:25 -05:00
parent 0b84c51cbf
commit 80f0c5435f
6 changed files with 79 additions and 7 deletions

View file

@ -40,4 +40,32 @@ input.account-settings-password-reset{
a#account-settings-delete-button{
font-weight: bold;
}
span.profile-toke-count{
display: flex;
flex-direction: row;
width: fit-content;
}
p.profile-toke-count{
margin: 0;
}
#profile-tokes{
resize: vertical;
max-width: fit-content;
height: fit-content;
min-height: 1.5em;
max-height: 5.8em;
display: none;
}
/*Little hacky but this keeps initial max-height from fucking up resizing*/
#profile-tokes[style*="height"]{
max-height: 40vh;
}
.profile-toke{
margin: 0.2em 1em;
}

View file

@ -77,7 +77,7 @@ a:hover, i:hover{
a:active, i:active{
color: var(--focus0-alt1);
box-shadow: var(--focus-glow0-alt0);
text-shadow: var(--focus-glow0-alt0);
}
select{
@ -196,10 +196,6 @@ div.channel-guide-entry{
box-shadow: 0.2em 0.2em 0.1em var(--bg1-alt0) inset;
}
a.channel-guide-entry-item{
color: var(--accent1);
}
span.channel-guide-entry-item{
background-color: var(--bg1-alt0);
box-shadow: 0.2em 0.2em 0.1em black inset;

View file

@ -155,6 +155,31 @@ class passwordResetPrompt{
}
}
class tokeList{
constructor(){
this.tokeList = document.querySelector('#profile-tokes');
this.tokeListLabel = document.querySelector('.profile-toke-count');
this.tokeListToggleIcon = document.querySelector('#toggle-toke-list');
console.log(this.tokeList)
this.setupInput();
}
setupInput(){
this.tokeListLabel.addEventListener('click', this.toggleTokeList.bind(this));
}
toggleTokeList(){
if(this.tokeList.checkVisibility()){
this.tokeList.style.display = "none";
this.tokeListToggleIcon.classList.replace("bi-caret-down-fill","bi-caret-left-fill");
}else{
this.tokeList.style.display = "block";
this.tokeListToggleIcon.classList.replace("bi-caret-left-fill","bi-caret-down-fill");
}
}
}
class deleteAccountButton{
constructor(){
this.deleteLink = document.querySelector('#account-settings-delete-button');
@ -197,5 +222,6 @@ class deleteAccountPopup{
new profileTextEditPrompt("signature");
new profileTextEditPrompt("bio", true);
new profileImgEditPrompt();
new tokeList();
new passwordResetPrompt();
new deleteAccountButton();