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);
|
||||
const router = useTinyRouter();
|
||||
const modules = $state([]);
|
||||
let expand = $state(false);
|
||||
|
||||
async function fetchModules(){
|
||||
const url = `${location.protocol}//${location.host.replace('5173','8080')}/legacy/user/modules`;
|
||||
@@ -27,6 +28,7 @@ async function fetchModules(){
|
||||
|
||||
function onclick(e){
|
||||
e.preventDefault();
|
||||
expand = false;
|
||||
let href = e.target.getAttribute('href');
|
||||
if (href) router.navigate(href);
|
||||
return false;
|
||||
@@ -47,11 +49,12 @@ onMount(fetchModules);
|
||||
}
|
||||
</style>
|
||||
|
||||
<nav>
|
||||
<nav class={expand?"":"collapsed"}>
|
||||
<form onsubmit={search}>
|
||||
<input type="text" bind:value={key} />
|
||||
<button type="submit">{t('search')}</button>
|
||||
</form>
|
||||
<button class="symbol" onclick={e => expand = !expand}></button>
|
||||
<a href="/user" {onclick} class="user">{t('users')}</a>
|
||||
<a href="/company" {onclick} class="company">{t('companies')}</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}
|
||||
{/each}
|
||||
{#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}
|
||||
<TimeRecorder />
|
||||
</nav>
|
||||
|
||||
@@ -297,4 +297,11 @@ tr:hover .taglist .tag button {
|
||||
|
||||
.easylist .filter{
|
||||
background: black;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 900px) {
|
||||
#app nav a{
|
||||
background: black;
|
||||
color: orange;
|
||||
}
|
||||
}
|
||||
@@ -504,6 +504,41 @@ a.wikilink{
|
||||
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) {
|
||||
.grid2{
|
||||
display: grid;
|
||||
@@ -533,6 +568,15 @@ a.wikilink{
|
||||
.easylist input{
|
||||
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{
|
||||
|
||||
Reference in New Issue
Block a user