improving main menu for mobile devices
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -10,6 +10,7 @@ import TimeRecorder from './TimeRecorder.svelte';
|
|||||||
let key = $state(null);
|
let key = $state(null);
|
||||||
const router = useTinyRouter();
|
const router = useTinyRouter();
|
||||||
const modules = $state([]);
|
const modules = $state([]);
|
||||||
|
let expand = $state(false);
|
||||||
|
|
||||||
async function fetchModules(){
|
async function fetchModules(){
|
||||||
const url = `${location.protocol}//${location.host.replace('5173','8080')}/legacy/user/modules`;
|
const url = `${location.protocol}//${location.host.replace('5173','8080')}/legacy/user/modules`;
|
||||||
@@ -27,6 +28,7 @@ async function fetchModules(){
|
|||||||
|
|
||||||
function onclick(e){
|
function onclick(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
expand = false;
|
||||||
let href = e.target.getAttribute('href');
|
let href = e.target.getAttribute('href');
|
||||||
if (href) router.navigate(href);
|
if (href) router.navigate(href);
|
||||||
return false;
|
return false;
|
||||||
@@ -47,11 +49,12 @@ onMount(fetchModules);
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<nav>
|
<nav class={expand?"":"collapsed"}>
|
||||||
<form onsubmit={search}>
|
<form onsubmit={search}>
|
||||||
<input type="text" bind:value={key} />
|
<input type="text" bind:value={key} />
|
||||||
<button type="submit">{t('search')}</button>
|
<button type="submit">{t('search')}</button>
|
||||||
</form>
|
</form>
|
||||||
|
<button class="symbol" onclick={e => expand = !expand}></button>
|
||||||
<a href="/user" {onclick} class="user">{t('users')}</a>
|
<a href="/user" {onclick} class="user">{t('users')}</a>
|
||||||
<a href="/company" {onclick} class="company">{t('companies')}</a>
|
<a href="/company" {onclick} class="company">{t('companies')}</a>
|
||||||
<a href="/project" {onclick} class="project">{t('projects')}</a>
|
<a href="/project" {onclick} class="project">{t('projects')}</a>
|
||||||
@@ -72,7 +75,7 @@ onMount(fetchModules);
|
|||||||
{#if module.name.trim()}<a href={module.url}>{module.name}</a>{/if}
|
{#if module.name.trim()}<a href={module.url}>{module.name}</a>{/if}
|
||||||
{/each}
|
{/each}
|
||||||
{#if user.name }
|
{#if user.name }
|
||||||
<a onclick={logout}>{t('logout_user',{user:user.name})}</a>
|
<a class="logout" onclick={logout}>{t('logout_user',{user:user.name})}</a>
|
||||||
{/if}
|
{/if}
|
||||||
<TimeRecorder />
|
<TimeRecorder />
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@@ -297,4 +297,11 @@ tr:hover .taglist .tag button {
|
|||||||
|
|
||||||
.easylist .filter{
|
.easylist .filter{
|
||||||
background: black;
|
background: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 900px) {
|
||||||
|
#app nav a{
|
||||||
|
background: black;
|
||||||
|
color: orange;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -504,6 +504,41 @@ a.wikilink{
|
|||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 900px) {
|
||||||
|
#app nav button.symbol{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 900px) {
|
||||||
|
#app nav{
|
||||||
|
grid-template-columns: auto auto auto;
|
||||||
|
display: grid;
|
||||||
|
margin: 0 5px;
|
||||||
|
|
||||||
|
}
|
||||||
|
#app nav form{
|
||||||
|
grid-column-end: span 2;
|
||||||
|
}
|
||||||
|
#app nav .logout{
|
||||||
|
grid-column-end: 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
#app nav.collapsed a{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#app nav a {
|
||||||
|
font-size: 19px !important;
|
||||||
|
display: grid;
|
||||||
|
text-align: center;
|
||||||
|
border: 1px solid;
|
||||||
|
margin: 5px;
|
||||||
|
border-radius: 7px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@media screen and (max-width: 600px) {
|
@media screen and (max-width: 600px) {
|
||||||
.grid2{
|
.grid2{
|
||||||
display: grid;
|
display: grid;
|
||||||
@@ -533,6 +568,15 @@ a.wikilink{
|
|||||||
.easylist input{
|
.easylist input{
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
|
#app nav{
|
||||||
|
grid-template-columns: auto auto;
|
||||||
|
}
|
||||||
|
#app nav form{
|
||||||
|
grid-column-end: span 1;
|
||||||
|
}
|
||||||
|
#app nav .logout{
|
||||||
|
grid-column-end: 3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fieldset.vcard{
|
fieldset.vcard{
|
||||||
|
|||||||
Reference in New Issue
Block a user