-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
277 additions
and
304 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,48 @@ | ||
<script> | ||
import { onDestroy } from 'svelte'; | ||
import AppBar from './AppBar.svelte'; | ||
import WebView from './WebView.svelte'; | ||
let appBarIsShowing = true; | ||
import { onDestroy } from 'svelte'; | ||
import AppBar from './AppBar.svelte'; | ||
import WebView from './WebView.svelte'; | ||
const companion = window.__COMPANION__; | ||
const showAppBarInterval = setInterval(showAppBar, 1000); | ||
const hideAppBarInterval = setInterval(hideAppBar, 3000); | ||
let appBarIsShowing = true; | ||
onDestroy(() => { | ||
clearInterval(showAppBarInterval); | ||
clearInterval(hideAppBarInterval); | ||
}); | ||
const companion = window.__COMPANION__; | ||
const showAppBarInterval = setInterval(showAppBar, 1000); | ||
const hideAppBarInterval = setInterval(hideAppBar, 3000); | ||
function hideAppBar() { | ||
const mouseIsInsideWindow = companion.insideWindow(); | ||
const isFullscreen = companion.isFullscreen(); | ||
onDestroy(() => { | ||
clearInterval(showAppBarInterval); | ||
clearInterval(hideAppBarInterval); | ||
}); | ||
if ((!mouseIsInsideWindow && appBarIsShowing) || isFullscreen) { | ||
appBarIsShowing = false; | ||
} | ||
function hideAppBar() { | ||
const mouseIsInsideWindow = companion.insideWindow(); | ||
const isFullscreen = companion.isFullscreen(); | ||
if ((!mouseIsInsideWindow && appBarIsShowing) || isFullscreen) { | ||
appBarIsShowing = false; | ||
} | ||
} | ||
function showAppBar() { | ||
const mouseIsInsideWindow = companion.insideWindow(); | ||
const mouseIsIdle = companion.mouseIsIdle(); | ||
const isFullscreen = companion.isFullscreen(); | ||
function showAppBar() { | ||
const mouseIsInsideWindow = companion.insideWindow(); | ||
const mouseIsIdle = companion.mouseIsIdle(); | ||
const isFullscreen = companion.isFullscreen(); | ||
if ((mouseIsInsideWindow && !appBarIsShowing && !mouseIsIdle) && !isFullscreen) { | ||
appBarIsShowing = true; | ||
} | ||
if ((mouseIsInsideWindow && !appBarIsShowing && !mouseIsIdle) && !isFullscreen) { | ||
appBarIsShowing = true; | ||
} | ||
} | ||
</script> | ||
|
||
<main> | ||
<main class="app"> | ||
<AppBar show={appBarIsShowing} /> | ||
<WebView expand={!appBarIsShowing} /> | ||
</main> | ||
|
||
<style> | ||
main { | ||
height: 100%; | ||
} | ||
</style> | ||
.app { | ||
height: 100%; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,25 @@ | ||
<script> | ||
import ClientBar from './ClientBar.svelte'; | ||
import SearchBar from './SearchBar.svelte'; | ||
export let show; | ||
import ClientBar from './ClientBar.svelte'; | ||
import SearchBar from './SearchBar.svelte'; | ||
export let show; | ||
</script> | ||
|
||
<div class={ show ? 'app-bar' : 'app-bar app-bar--hidden' }> | ||
<div class="app-bar { show ? '' : 'hide' }"> | ||
<ClientBar /> | ||
<SearchBar /> | ||
</div> | ||
|
||
<style> | ||
.app-bar { | ||
height: 65px; | ||
transition: margin 0.5s ease; | ||
margin-top: 0; | ||
} | ||
.hide { | ||
margin-top: -65px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,57 @@ | ||
<script> | ||
const companion = window.__COMPANION__; | ||
let pinned = companion.isAlwaysOnTop(); | ||
let maximized = companion.isMaximized(); | ||
import IconButton from "./IconButton.svelte"; | ||
function pinToggle() { | ||
companion.setAlwaysOnTop(); | ||
pinned = companion.isAlwaysOnTop(); | ||
} | ||
const companion = window.__COMPANION__; | ||
let pinned = companion.isAlwaysOnTop(); | ||
let maximized = companion.isMaximized(); | ||
function pinToggle() { | ||
companion.setAlwaysOnTop(); | ||
pinned = companion.isAlwaysOnTop(); | ||
} | ||
function maximizeToggle() { | ||
companion.maximizeToggle(); | ||
maximized = companion.isMaximized(); | ||
} | ||
function maximizeToggle() { | ||
companion.maximizeToggle(); | ||
maximized = companion.isMaximized(); | ||
} | ||
</script> | ||
|
||
<div class="client-bar"> | ||
<nav class="client-m drag"> | ||
<div class="client-m__btns--left"> | ||
<span class="client-m__btn click" on:click={pinToggle}> | ||
<i class="fa {pinned ? 'fa-lock' : 'fa-unlock'}"></i> | ||
</span> | ||
<nav> | ||
<div class="buttons-list"> | ||
<IconButton onClick={pinToggle} icons={pinned ? 'fa-lock' : 'fa-unlock'} /> | ||
</div> | ||
<div class="client-m__btns--right"> | ||
<span class="client-m__btn click" on:click={companion.minimize}> | ||
<i class="fa fa-window-minimize"></i> | ||
</span> | ||
<span class="client-m__btn click" on:click={maximizeToggle}> | ||
<i class="fa {maximized ? 'fa-window-restore' : 'fa-window-maximize'}"></i> | ||
</span> | ||
<span class="client-m__btn click" on:click={companion.close}> | ||
<i class="fa fa-times"></i> | ||
</span> | ||
<div class="buttons-list"> | ||
<IconButton onClick={companion.minimize} icons="fa-window-minimize" /> | ||
<IconButton onClick={maximizeToggle} icons={maximized ? 'fa-window-restore' : 'fa-window-maximize'} /> | ||
<IconButton onClick={companion.close} icons="fa-times" /> | ||
</div> | ||
</nav> | ||
</div> | ||
</div> | ||
|
||
<style> | ||
.client-bar { | ||
height: 30px; | ||
padding: 5px; | ||
background-color: rgb(40, 40, 40); | ||
transition: height 0.5s ease 0s; | ||
transition: padding 0.25s ease 0s; | ||
} | ||
.buttons-list { | ||
display: flex; | ||
-webkit-app-region: no-drag; | ||
} | ||
nav { | ||
width: 100%; | ||
height: 17px; | ||
padding: 0 5px; | ||
-webkit-app-region: drag; | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<script> | ||
export let icons; | ||
export let onClick; | ||
export let inactive = false; | ||
</script> | ||
|
||
<div class="icon-button {inactive ? 'inactive' : ''}" on:click={onClick}> | ||
<i class="fa {icons}" /> | ||
</div> | ||
|
||
<style> | ||
.icon-button { | ||
cursor: pointer; | ||
margin-left: 10px; | ||
color: rgba(245, 245, 245, 0.3); | ||
} | ||
.icon-button:first-child { | ||
margin-left: 0; | ||
} | ||
.icon-button:hover { | ||
color: rgba(247, 247, 247, 0.6); | ||
} | ||
.inactive { | ||
opacity: 0.2; | ||
cursor: default; | ||
pointer-events: none; | ||
} | ||
</style> |
Oops, something went wrong.