mirror of
https://github.com/danbulant/Mangades
synced 2026-07-07 20:10:36 +00:00
better toggle between list and grid
This commit is contained in:
parent
e2c35a624a
commit
d1d1d1f08e
2 changed files with 32 additions and 5 deletions
30
src/components/listOrGrid.svelte
Normal file
30
src/components/listOrGrid.svelte
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
<script>
|
||||||
|
export var list = false;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<button on:click={() => list = !list} class:active={list == false}>Grid</button><!--
|
||||||
|
--><button on:click={() => list = !list} class:active={list == true}>List</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
div {
|
||||||
|
margin-left: auto;
|
||||||
|
width: max-content;
|
||||||
|
}
|
||||||
|
button {
|
||||||
|
border-radius: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
button:first-child {
|
||||||
|
border-top-left-radius: 5px;
|
||||||
|
border-bottom-left-radius: 5px;
|
||||||
|
}
|
||||||
|
button:last-child {
|
||||||
|
border-top-right-radius: 5px;
|
||||||
|
border-bottom-right-radius: 5px;
|
||||||
|
}
|
||||||
|
button.active {
|
||||||
|
background: rgb(202, 202, 202);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
import { goto } from '@roxi/routify/runtime/helpers';
|
import { goto } from '@roxi/routify/runtime/helpers';
|
||||||
import { getUserDetails, getUserManga, isLogedIn } from "../util/anilist";
|
import { getUserDetails, getUserManga, isLogedIn } from "../util/anilist";
|
||||||
import Items from "../components/items.svelte";
|
import Items from "../components/items.svelte";
|
||||||
|
import ListOrGrid from "../components/listOrGrid.svelte";
|
||||||
|
|
||||||
var name = "";
|
var name = "";
|
||||||
|
|
||||||
|
|
@ -61,11 +62,7 @@
|
||||||
<a href="https://mangadex.org">Mangadex.org</a>
|
<a href="https://mangadex.org">Mangadex.org</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<ListOrGrid bind:list={listStyle} />
|
||||||
<label for="list-style">Show as list</label>
|
|
||||||
<input type="checkbox" name="list-style" id="list-style" bind:checked={listStyle}>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
{#if isLogedIn()}
|
{#if isLogedIn()}
|
||||||
<div>
|
<div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue