UX: Мобильная версия
This commit is contained in:
parent
df0be43f2e
commit
d8e3f2890c
6 changed files with 17 additions and 26 deletions
|
@ -59,12 +59,6 @@ return [
|
||||||
'title' => __('app.admin'),
|
'title' => __('app.admin'),
|
||||||
'icon' => 'bi-person-x',
|
'icon' => 'bi-person-x',
|
||||||
'id' => 'admin',
|
'id' => 'admin',
|
||||||
], [
|
|
||||||
'tl' => UserData::REGISTERED_ADMIN,
|
|
||||||
'url' => url('admin.facets.all'),
|
|
||||||
'title' => __('app.facets'),
|
|
||||||
'icon' => 'bi-bezier2',
|
|
||||||
'id' => 'admin',
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
// Profile Cover Color
|
// Profile Cover Color
|
||||||
let colorPicker = document.getElementById("colorPicker");
|
isIdEmpty('colorPicker').onclick = function() {
|
||||||
if (colorPicker) {
|
|
||||||
let box = document.getElementById("box");
|
let box = document.getElementById("box");
|
||||||
let color = document.getElementById("color");
|
let color = document.getElementById("color");
|
||||||
|
|
||||||
|
|
|
@ -154,10 +154,14 @@ document.querySelectorAll(".user-card")
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
function isIdEmpty(elmId) {
|
||||||
|
var elem = document.getElementById(elmId);
|
||||||
|
if(typeof elem !== 'undefined' && elem !== null) return elem;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Toggle dark mode
|
// Toggle dark mode
|
||||||
let toggledark = document.querySelector('#toggledark');
|
isIdEmpty('toggledark').onclick = function() {
|
||||||
if (toggledark) {
|
|
||||||
toggledark.addEventListener('click', function () {
|
|
||||||
let mode = getCookie("dayNight");
|
let mode = getCookie("dayNight");
|
||||||
let d = new Date();
|
let d = new Date();
|
||||||
d.setTime(d.getTime() + (365 * 24 * 60 * 60 * 1000)); //365 days
|
d.setTime(d.getTime() + (365 * 24 * 60 * 60 * 1000)); //365 days
|
||||||
|
@ -169,13 +173,10 @@ if (toggledark) {
|
||||||
document.cookie = "dayNight" + "=" + "dark" + "; " + expires + ";path=/";
|
document.cookie = "dayNight" + "=" + "dark" + "; " + expires + ";path=/";
|
||||||
document.getElementsByTagName('body')[0].classList.add('dark');
|
document.getElementsByTagName('body')[0].classList.add('dark');
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Navigation menu on/off
|
// Navigation menu on/off
|
||||||
let togglemenu = document.querySelector('#togglemenu');
|
isIdEmpty('togglemenu').onclick = function() {
|
||||||
if (togglemenu) {
|
|
||||||
togglemenu.addEventListener('click', function () {
|
|
||||||
let mode = getCookie("menuYesNo");
|
let mode = getCookie("menuYesNo");
|
||||||
let d = new Date();
|
let d = new Date();
|
||||||
d.setTime(d.getTime() + (365 * 24 * 60 * 60 * 1000)); //365 days
|
d.setTime(d.getTime() + (365 * 24 * 60 * 60 * 1000)); //365 days
|
||||||
|
@ -187,7 +188,6 @@ if (togglemenu) {
|
||||||
document.cookie = "menuYesNo" + "=" + "menuno" + "; " + expires + ";path=/";
|
document.cookie = "menuYesNo" + "=" + "menuno" + "; " + expires + ";path=/";
|
||||||
document.getElementsByTagName('body')[0].classList.add('menuno');
|
document.getElementsByTagName('body')[0].classList.add('menuno');
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: move to util
|
// TODO: move to util
|
||||||
|
@ -207,9 +207,8 @@ function getCookie(cname) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// search
|
// search
|
||||||
let find = document.getElementById('find');
|
isIdEmpty('find').onclick = function() {
|
||||||
if (find) {
|
document.getElementById('find').addEventListener('keydown', function () {
|
||||||
find.addEventListener('keydown', function () {
|
|
||||||
fetch_search();
|
fetch_search();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ $facet = $data['facet'] ?? false; ?>
|
||||||
<?= config('meta.name'); ?>
|
<?= config('meta.name'); ?>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="ml45 mb-ml10 relative w-100">
|
<div class="ml45 mb-ml10 relative w-100 mr30">
|
||||||
<form class="form mb-none" method="get" action="<?= url('search.go'); ?>">
|
<form class="form mb-none" method="get" action="<?= url('search.go'); ?>">
|
||||||
<input type="text" name="q" autocomplete="off" id="find" placeholder="<?= __('app.find'); ?>" class="search">
|
<input type="text" name="q" autocomplete="off" id="find" placeholder="<?= __('app.find'); ?>" class="search">
|
||||||
</form>
|
</form>
|
||||||
|
@ -34,11 +34,11 @@ $facet = $data['facet'] ?? false; ?>
|
||||||
|
|
||||||
<?php if (!UserData::checkActiveUser()) : ?>
|
<?php if (!UserData::checkActiveUser()) : ?>
|
||||||
<div class="flex right items-center">
|
<div class="flex right items-center">
|
||||||
<div id="toggledark" class="header-menu-item mb-none ml45">
|
<div id="toggledark" class="header-menu-item mr20">
|
||||||
<i class="bi-brightness-high gray-600 text-xl"></i>
|
<i class="bi-brightness-high gray-600 text-xl"></i>
|
||||||
</div>
|
</div>
|
||||||
<?php if (config('general.invite') == false) : ?>
|
<?php if (config('general.invite') == false) : ?>
|
||||||
<a class="w94 gray ml45 mr15 mb-mr5 mb-ml5 block" href="<?= url('register'); ?>">
|
<a class="w94 gray ml45 mr15 mb-mr5 mb-ml5 mb-none block" href="<?= url('register'); ?>">
|
||||||
<?= __('app.registration'); ?>
|
<?= __('app.registration'); ?>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
|
@ -203,7 +203,6 @@ img {
|
||||||
|
|
||||||
.br-rd3 { border-radius: 3px; }
|
.br-rd3 { border-radius: 3px; }
|
||||||
.br-rd5 { border-radius: 5px; }
|
.br-rd5 { border-radius: 5px; }
|
||||||
.br-rd20 { border-radius: 20px; }
|
|
||||||
.br-rd-50 { border-radius: 50%; }
|
.br-rd-50 { border-radius: 50%; }
|
||||||
|
|
||||||
.w-auto { width: auto; }
|
.w-auto { width: auto; }
|
||||||
|
|
|
@ -58,7 +58,7 @@ $facet = $data['facet'] ?? false; ?>
|
||||||
|
|
||||||
<?= Html::addPost($facet); ?>
|
<?= Html::addPost($facet); ?>
|
||||||
|
|
||||||
<div id="toggledark" class="only-icon p10 ml20 mb-ml10">
|
<div id="toggledark" class="only-icon p10 ml30 mb-ml10">
|
||||||
<i class="bi-brightness-high gray-600 text-xl"></i>
|
<i class="bi-brightness-high gray-600 text-xl"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue