UX: Мобильная версия

This commit is contained in:
Evg 2022-06-01 19:09:45 +03:00
parent df0be43f2e
commit d8e3f2890c
6 changed files with 17 additions and 26 deletions

View file

@ -59,12 +59,6 @@ return [
'title' => __('app.admin'),
'icon' => 'bi-person-x',
'id' => 'admin',
], [
'tl' => UserData::REGISTERED_ADMIN,
'url' => url('admin.facets.all'),
'title' => __('app.facets'),
'icon' => 'bi-bezier2',
'id' => 'admin',
],
],

View file

@ -1,6 +1,5 @@
// Profile Cover Color
let colorPicker = document.getElementById("colorPicker");
if (colorPicker) {
isIdEmpty('colorPicker').onclick = function() {
let box = document.getElementById("box");
let color = document.getElementById("color");
@ -72,7 +71,7 @@ document.querySelectorAll(".add-favorite")
dom.classList.toggle("sky");
}
});
}));
}));
// Add or remove your post to your profile
document.querySelectorAll(".add-profile")

View file

@ -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
let toggledark = document.querySelector('#toggledark');
if (toggledark) {
toggledark.addEventListener('click', function () {
isIdEmpty('toggledark').onclick = function() {
let mode = getCookie("dayNight");
let d = new Date();
d.setTime(d.getTime() + (365 * 24 * 60 * 60 * 1000)); //365 days
@ -169,13 +173,10 @@ if (toggledark) {
document.cookie = "dayNight" + "=" + "dark" + "; " + expires + ";path=/";
document.getElementsByTagName('body')[0].classList.add('dark');
}
});
}
}
// Navigation menu on/off
let togglemenu = document.querySelector('#togglemenu');
if (togglemenu) {
togglemenu.addEventListener('click', function () {
isIdEmpty('togglemenu').onclick = function() {
let mode = getCookie("menuYesNo");
let d = new Date();
d.setTime(d.getTime() + (365 * 24 * 60 * 60 * 1000)); //365 days
@ -187,7 +188,6 @@ if (togglemenu) {
document.cookie = "menuYesNo" + "=" + "menuno" + "; " + expires + ";path=/";
document.getElementsByTagName('body')[0].classList.add('menuno');
}
});
}
// TODO: move to util
@ -207,9 +207,8 @@ function getCookie(cname) {
}
// search
let find = document.getElementById('find');
if (find) {
find.addEventListener('keydown', function () {
isIdEmpty('find').onclick = function() {
document.getElementById('find').addEventListener('keydown', function () {
fetch_search();
});
}

View file

@ -25,7 +25,7 @@ $facet = $data['facet'] ?? false; ?>
<?= config('meta.name'); ?>
</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'); ?>">
<input type="text" name="q" autocomplete="off" id="find" placeholder="<?= __('app.find'); ?>" class="search">
</form>
@ -34,11 +34,11 @@ $facet = $data['facet'] ?? false; ?>
<?php if (!UserData::checkActiveUser()) : ?>
<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>
</div>
<?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'); ?>
</a>
<?php endif; ?>

View file

@ -203,7 +203,6 @@ img {
.br-rd3 { border-radius: 3px; }
.br-rd5 { border-radius: 5px; }
.br-rd20 { border-radius: 20px; }
.br-rd-50 { border-radius: 50%; }
.w-auto { width: auto; }

View file

@ -58,7 +58,7 @@ $facet = $data['facet'] ?? false; ?>
<?= 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>
</div>