Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions public/dashboard/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,18 @@ padding: 0.05rem 0.4rem 0.15rem;
padding-bottom: 2rem;
}

.active-theme{
/* border: #2b2d42 0.1rem solid;
border-radius: 5%; */
box-shadow: inset 0 0 0 2px #2b2d42;
}

.theme-submit-parent{
display: flex;
flex-direction: column;
align-items: center;
}

.theme-submit{
background-color:#06d6a0 ;
padding: 1rem;
Expand All @@ -416,6 +428,7 @@ padding: 0.05rem 0.4rem 0.15rem;
.theme-card{
justify-content: center;
text-align: center;
border-radius: 5%;
}

.theme-img{
Expand Down
18 changes: 16 additions & 2 deletions views/dashboard/appearance.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@
</div>
</div>
</div>
<a class="theme-submit">Done</a>
<div class="theme-submit-parent">
<a class="theme-submit">Done</a>
</div>
</div>
</div>

Expand Down Expand Up @@ -217,6 +219,8 @@
location.reload();
}
console.log(data);
// Set active theme on page-load
$("."+data.theme).addClass("active-theme");
console.log(status);
});
});
Expand Down Expand Up @@ -260,10 +264,20 @@
const toggleModal = () => {
document.querySelector('.modal').classList.toggle('hidden');
}

const setTheme = (themeName) => {
// const themeCard = document.getElementsByClassName('theme-cards')
const selecttheme = document.querySelector('#profileTheme');
selecttheme.value = themeName;

// Set active Theme on button click
const themeArray = document.getElementsByClassName("theme-card");
// set all themes as inactive first
for(i=0; i<themeArray.length; i++){
themeArray[i].classList.remove("active-theme");
}
// Set border on active theme onClick
const activeTheme = document.getElementsByClassName(themeName);
activeTheme[0].classList.add("active-theme");
}

// Toggle Dialog Box
Expand Down