Browse Source

More mobile friendly

mj-deploy
Standa Lukeš 4 years ago
parent
commit
94b7b817fd
  1. 14
      frontend/src/App.svelte
  2. 19
      frontend/src/TaskPanel.svelte

14
frontend/src/App.svelte

@ -22,23 +22,9 @@ import type { detach } from "svelte/internal";
<style> <style>
main { main {
text-align: center; text-align: center;
max-width: 240px;
margin: 0 auto; margin: 0 auto;
min-height: 420px; min-height: 420px;
} }
h1 {
color: #ff3e00;
text-transform: uppercase;
font-size: 4em;
font-weight: 100;
}
@media (min-width: 640px) {
main {
max-width: none;
}
}
</style> </style>
<main> <main>

19
frontend/src/TaskPanel.svelte

@ -28,18 +28,33 @@ import TaskDisplay from "./TaskDisplay.svelte";
selectedTask = task selectedTask = task
heightClass = "full" heightClass = "full"
} }
function close() {
heightClass = "collapsed"
window.setTimeout(() => window.scrollTo({
top: 0,
left: 0,
behavior: 'smooth'
}), 100)
}
</script> </script>
<style> <style>
.panel { .panel {
position: relative; position: relative;
width: 100%; width: calc(min(100%, 100vw - 16px));
background-color: #222; background-color: #222;
overflow: hidden; overflow: hidden;
padding: 0 100px 0 100px; padding: 0 100px 0 100px;
box-sizing: border-box; box-sizing: border-box;
z-index: 120; z-index: 120;
} }
@media only screen and (max-width: 600px) {
.panel {
padding: 0 10px 10px 10px;
}
}
.panel.collapsed:not(:hover) { .panel.collapsed:not(:hover) {
display: none; display: none;
} }
@ -56,7 +71,7 @@ import TaskDisplay from "./TaskDisplay.svelte";
<div class="panel {heightClass}" <div class="panel {heightClass}"
on:click={() => selectedTask && select(selectedTask)}> on:click={() => selectedTask && select(selectedTask)}>
<TaskDisplay taskId={selectedTask?.id} /> <TaskDisplay taskId={selectedTask?.id} />
<button type=button class="closeButton" on:click|stopPropagation={() => heightClass = "collapsed"}> <button type=button class="closeButton" on:click|stopPropagation={close}>
Zavřít Zavřít
</button> </button>
</div> </div>