forked from projects/fipamo
settings page tab conversion part 1
the settings page needed to be updated to make space for incoming features and settins, so a tab system has been plugged in to reorganize the options availble of course, everything needs to be restyled to match the new comps https://www.figma.com/design/JQSy6XtVtSkiIxzXEM46IU/Fipamo-Dash?node-id=1204%3A285&t=kDgzU2ONXr3k5yUe-1 but the base structure is in, so now it's just about getting the css right
This commit is contained in:
parent
8c375e6ba1
commit
ab158c99b0
4 changed files with 90 additions and 39 deletions
|
@ -34,7 +34,7 @@ input[type="submit"] {
|
||||||
background: var(--secondary-highlight);
|
background: var(--secondary-highlight);
|
||||||
color: var(--primary);
|
color: var(--primary);
|
||||||
font: 20px var(--base-type);
|
font: 20px var(--base-type);
|
||||||
border-radius: 5px;
|
border-radius: 3px;
|
||||||
position: relative;
|
position: relative;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border: 0;
|
border: 0;
|
||||||
|
|
|
@ -16,7 +16,30 @@ article[class="settings"] label {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
|
|
||||||
section[class="member-settings"] {
|
article.settings div.tab-toolbar button {
|
||||||
|
width: 180px;
|
||||||
|
height: 40px;
|
||||||
|
color: var(--secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
article.settings section.settings-tabs section.section-tab {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 400px;
|
||||||
|
background: var(--secondary-highlight);
|
||||||
|
color: var(--secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.show {
|
||||||
|
display: block;
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hide {
|
||||||
|
display: none;
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
section#member-profile {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 1fr 1fr 1fr;
|
grid-template-columns: 1fr 1fr 1fr 1fr;
|
||||||
grid-auto-columns: auto;
|
grid-auto-columns: auto;
|
||||||
|
@ -26,61 +49,61 @@ section[class="member-settings"] {
|
||||||
margin: 10px auto;
|
margin: 10px auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
section[class="member-settings"] > div:nth-child(1) {
|
section#member-profile > div:nth-child(1) {
|
||||||
grid-column: 1/2;
|
grid-column: 1/2;
|
||||||
grid-row: 1/3;
|
grid-row: 1/3;
|
||||||
}
|
}
|
||||||
|
|
||||||
section[class="member-settings"] > div:nth-child(2) {
|
section#member-profile > div:nth-child(2) {
|
||||||
grid-column: 2/4;
|
grid-column: 2/4;
|
||||||
grid-row: 1/3;
|
grid-row: 1/3;
|
||||||
}
|
}
|
||||||
|
|
||||||
section[class="member-settings"] > div:nth-child(3) {
|
section#member-profile > div:nth-child(3) {
|
||||||
grid-row: 1/3;
|
grid-row: 1/3;
|
||||||
}
|
}
|
||||||
|
|
||||||
section[class="member-settings"] > div:nth-child(4) {
|
section#member-profile > div:nth-child(4) {
|
||||||
color: var(--white);
|
color: var(--white);
|
||||||
}
|
}
|
||||||
|
|
||||||
section[class="member-settings"] > div:nth-child(4) a {
|
section#member-profile > div:nth-child(4) a {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
color: var(--primary-highlight);
|
color: var(--primary-highlight);
|
||||||
}
|
}
|
||||||
|
|
||||||
section[class="member-settings"] > div:nth-child(5) {
|
section#member-profile > div:nth-child(5) {
|
||||||
grid-column: 2/4;
|
grid-column: 2/4;
|
||||||
}
|
}
|
||||||
|
|
||||||
section[class="member-settings"] > div:nth-child(6) {
|
section#member-profile > div:nth-child(6) {
|
||||||
grid-column: 1/3;
|
grid-column: 1/3;
|
||||||
}
|
}
|
||||||
|
|
||||||
section[class="member-settings"] > div:nth-child(7) {
|
section#member-profile > div:nth-child(7) {
|
||||||
grid-column: 3/5;
|
grid-column: 3/5;
|
||||||
min-height: 325px;
|
min-height: 325px;
|
||||||
}
|
}
|
||||||
|
|
||||||
section[class="member-settings"] > div:nth-child(8) {
|
section#member-profile > div:nth-child(8) {
|
||||||
grid-column: 1/4;
|
grid-column: 1/4;
|
||||||
color: var(--white);
|
color: var(--white);
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
section[class="member-settings"] > div[class="member-avatar"] div,
|
section#member-profile > div[class="member-avatar"] div,
|
||||||
section[class="member-settings"] > div[class="site-background"] div {
|
section#member-profile > div[class="site-background"] div {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
section[class="member-settings"] div input[type="file"] {
|
section#member-profile div input[type="file"] {
|
||||||
display: none;
|
display: none;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
section[class="member-settings"] div input[type="text"] {
|
section#member-profile div input[type="text"] {
|
||||||
width: 98.4%;
|
width: 98.4%;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
|
|
@ -45,6 +45,7 @@ export default class SettingsIndex {
|
||||||
document.querySelector('.background').addEventListener('click', () => {
|
document.querySelector('.background').addEventListener('click', () => {
|
||||||
document.getElementById('background-upload').click();
|
document.getElementById('background-upload').click();
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById('avatar-upload').addEventListener(
|
document.getElementById('avatar-upload').addEventListener(
|
||||||
'change',
|
'change',
|
||||||
e => {
|
e => {
|
||||||
|
@ -89,6 +90,25 @@ export default class SettingsIndex {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//handle tabs
|
||||||
|
let tabBtn = document.querySelectorAll('.tab-button');
|
||||||
|
let tabs = document.querySelectorAll('.section-tab');
|
||||||
|
for (i = 0, length = tabBtn.length; i < length; i++) {
|
||||||
|
tabBtn[i].addEventListener('click', e => {
|
||||||
|
let tab = 'member-' + e.target.id;
|
||||||
|
for (i = 0, length = tabs.length; i < length; i++) {
|
||||||
|
let tabID = tabs[i].id;
|
||||||
|
if (tab == tabID) {
|
||||||
|
tabs[i].classList.add('show');
|
||||||
|
tabs[i].classList.remove('hide');
|
||||||
|
} else {
|
||||||
|
tabs[i].classList.add('hide');
|
||||||
|
tabs[i].classList.remove('show');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
document
|
document
|
||||||
.getElementById('send-mail')
|
.getElementById('send-mail')
|
||||||
.addEventListener('click', e => this.handleMailer(e));
|
.addEventListener('click', e => this.handleMailer(e));
|
||||||
|
@ -109,17 +129,10 @@ export default class SettingsIndex {
|
||||||
for (i = 0, length = mailBtn.length; i < length; i++) {
|
for (i = 0, length = mailBtn.length; i < length; i++) {
|
||||||
mailBtn[i].addEventListener('click', e => this.handleMailOptions(e));
|
mailBtn[i].addEventListener('click', e => this.handleMailOptions(e));
|
||||||
}
|
}
|
||||||
//handle backup from settings [disabled]
|
//handle backup from settings
|
||||||
|
|
||||||
document
|
document
|
||||||
.getElementById('create-backup')
|
.getElementById('create-backup')
|
||||||
.addEventListener('click', e => this.handleBackup(e));
|
.addEventListener('click', e => this.handleBackup(e));
|
||||||
|
|
||||||
/*
|
|
||||||
document
|
|
||||||
.getElementById("reindex-pages")
|
|
||||||
.addEventListener("click", (e) => this.handleReindex(e));
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
//--------------------------
|
//--------------------------
|
||||||
// event handlers
|
// event handlers
|
||||||
|
|
|
@ -4,23 +4,38 @@
|
||||||
|
|
||||||
@section('main-content')
|
@section('main-content')
|
||||||
<article class="settings">
|
<article class="settings">
|
||||||
|
<div class="tab-toolbar" role="toolbar">
|
||||||
|
<button id="profile" class="tab-button">PROFILE</button>
|
||||||
|
<button id="features" class="tab-button">FEATURES</button>
|
||||||
|
<button id="themes" class="tab-button">THEMES</button>
|
||||||
|
</div>
|
||||||
|
<section class="settings-tabs">
|
||||||
|
<section id="member-profile" class="section-tab show">
|
||||||
|
<div class="member-avatar">
|
||||||
|
<div class="avatar" style="background: url({{ $member['avatar'] }} ) no-repeat center center / cover"></div>
|
||||||
|
<input id="avatar-upload" type="file" name="avatar-upload"/>
|
||||||
|
</div>
|
||||||
|
<div class="site-background">
|
||||||
|
<div class="background" style="background: url({{ $background }} ) no-repeat center center / cover"></div>
|
||||||
|
<input id="background-upload" type="file" name="backgrond-upload"/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<input type='text' name='handle' id='settings-handle' placeholder='handle' value="{{ $member['handle'] }}" autofocus/>
|
||||||
|
<input type='text' name='email' id='settings-email' placeholder='email' value="{{ $member['email'] }}" autofocus/>
|
||||||
|
<input type='hidden' name='member-id' id='member-id' value="{{ $member['id'] }}"/>
|
||||||
|
<input type='text' name='base-url' id='settings-url' placeholder='url' value="{{ $baseUrl }}" autofocus/>
|
||||||
|
<input type='text' name='base-title' id='settings-title' placeholder='site title' value="{{ $siteTitle }}" autofocus/>
|
||||||
|
<textarea id="settings-desc" type='text' name='settings_desc' class='settings-dec' placeholder='description stuff' , autofocus>{{ $desc }}</textarea>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<section id="member-features" class="section-tab hide">
|
||||||
|
MEMBER FEATURES
|
||||||
|
</section>
|
||||||
|
<section id="member-themes" class="section-tab hide">
|
||||||
|
MEMBER THEMES
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
<section class="member-settings">
|
<section class="member-settings">
|
||||||
<div class="member-avatar">
|
|
||||||
<div class="avatar" style="background: url({{ $member['avi'] }} ) no-repeat center center / cover"></div>
|
|
||||||
<input id="avatar-upload" type="file" name="avatar-upload"/>
|
|
||||||
</div>
|
|
||||||
<div class="site-background">
|
|
||||||
<div class="background" style="background: url({{ $background }} ) no-repeat center center / cover"></div>
|
|
||||||
<input id="background-upload" type="file" name="backgrond-upload"/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<input type='text' name='handle' id='settings-handle' placeholder='handle' value="{{ $member['handle'] }}" autofocus/>
|
|
||||||
<input type='text' name='email' id='settings-email' placeholder='email' value="{{ $member['email'] }}" autofocus/>
|
|
||||||
<input type='hidden' name='member-id' id='member-id' value="{{ $member['id'] }}"/>
|
|
||||||
<input type='text' name='base-url' id='settings-url' placeholder='url' value="{{ $baseUrl }}" autofocus/>
|
|
||||||
<input type='text' name='base-title' id='settings-title' placeholder='site title' value="{{ $siteTitle }}" autofocus/>
|
|
||||||
<textarea id="settings-desc" type='text' name='settings_desc' class='settings-dec' placeholder='description stuff' , autofocus>{{ $desc }}</textarea>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<button id="create-backup">
|
<button id="create-backup">
|
||||||
|
|
Loading…
Reference in a new issue