Moving page elements out of the way when the navbar opens
This commit is contained in:
parent
6f6a00cb45
commit
3fe2b3df6d
@ -4,25 +4,33 @@
|
||||
import Loading from './Loading.svelte'
|
||||
import {CheckPrerequisites} from '../wailsjs/go/main/App.js'
|
||||
import { onMount } from 'svelte'
|
||||
import { loading, testPage, navMargin } from './global'
|
||||
import { loading, testPage, } from './global'
|
||||
import { slide } from 'svelte/transition'
|
||||
import Navbar from './Navbar.svelte'
|
||||
import Testpage from './Testpage.svelte'
|
||||
import { set_attributes, set_style } from 'svelte/internal';
|
||||
|
||||
let width: int = 10
|
||||
let navMargin = document.getElementById("body") as HTMLElement;
|
||||
|
||||
onMount(() => {
|
||||
CheckPrerequisites().then(() => $loading = false)
|
||||
})
|
||||
function setMargin(){
|
||||
document.documentElement.style.setProperty('--navMargin', '17rem');
|
||||
}
|
||||
function unsetMargin(){
|
||||
document.documentElement.style.setProperty('--navMargin', '5rem');
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<main>
|
||||
<div class="navbar">
|
||||
<div class="navbar" on:mouseover={setMargin} on:focus={setMargin} on:mouseleave={unsetMargin} >
|
||||
<Navbar />
|
||||
</div>
|
||||
<body>
|
||||
<body class="body" id="body">
|
||||
<!--<img alt="Wails logo" id="logo" src="{logo}">-->
|
||||
{#if $testPage}
|
||||
<div>
|
||||
@ -49,6 +57,7 @@
|
||||
--text-secondary: #ececec;
|
||||
--bg-primary: #23232e;
|
||||
--bg-secondary: #141418;
|
||||
--navMargin: 5rem;
|
||||
background-color: var(--bg-secondary);
|
||||
}
|
||||
.navbar{
|
||||
@ -70,8 +79,8 @@
|
||||
body{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-left: 5rem;
|
||||
|
||||
margin-left: var(--navMargin);
|
||||
transition: 200ms;
|
||||
}
|
||||
|
||||
main{
|
||||
|
@ -12,7 +12,7 @@ function unextend(){
|
||||
</script>
|
||||
|
||||
<main>
|
||||
<nav class="navbar" id="navbar" on:mouseover={extend} on:focus={extend} on:mouseleave={unextend}>
|
||||
<nav class="navbar" id="navbar">
|
||||
<ul class="navbar-nav">
|
||||
<li class="logo">
|
||||
<a href="#" class="nav-link">
|
||||
|
@ -18,7 +18,7 @@ import {instances, loading, navMargin} from './global'
|
||||
</script>
|
||||
|
||||
|
||||
<main style="margin-left: {marginScale};">
|
||||
<main>
|
||||
<div class="header">
|
||||
<div>Instances</div>
|
||||
<div class="container">
|
||||
@ -37,7 +37,7 @@ import {instances, loading, navMargin} from './global'
|
||||
</div>
|
||||
</div>
|
||||
<div class="options-container">
|
||||
<button class="launch-button" on:click={launchclick}>Launch {$navMargin}</button>
|
||||
<button class="launch-button" on:click={launchclick}>Launch {radio}</button>
|
||||
</div>
|
||||
</main>
|
||||
<style>
|
||||
|
Loading…
Reference in New Issue
Block a user