Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
used in /cv to sort repos/papers by date/title/commits/stars/author
- Loading branch information
Showing
9 changed files
with
153 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,9 @@ | |
border-radius: 50%; | ||
transform: scale(1.4); | ||
} | ||
@media print { | ||
:is(button, footer) { | ||
display: none; | ||
} | ||
} | ||
</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,47 @@ | ||
<script lang="ts"> | ||
export let label: string = `Sort by` | ||
export { className as class } | ||
export let sort_by: string | undefined = undefined | ||
export let sort_keys: readonly string[] = [] | ||
export let sort_order: 'asc' | 'desc' = `asc` | ||
export let as: string = `small` | ||
export let style: string | null = null | ||
let className: string | null = null | ||
</script> | ||
|
||
<svelte:element this={as} class="sort-buttons {className}" {style}> | ||
{label} | ||
{#each sort_keys as key} | ||
<button on:click={() => (sort_by = key)} class:active={sort_by === key}> | ||
{key} | ||
</button> | ||
{/each} | ||
<button on:click={() => (sort_order = sort_order === `asc` ? `desc` : `asc`)}> | ||
{sort_order === `asc` ? `↓` : `↑`} | ||
</button> | ||
</svelte:element> | ||
|
||
<style> | ||
.sort-buttons { | ||
display: flex; | ||
gap: 2pt; | ||
position: absolute; | ||
right: 0; | ||
bottom: 4pt; | ||
font-weight: 100; | ||
font-size: 9pt; | ||
} | ||
.sort-buttons button { | ||
font-size: 9pt; | ||
padding: 1pt 2pt; | ||
border: none; | ||
color: gray; | ||
background-color: #f0f0f0; | ||
} | ||
@media print { | ||
.sort-buttons { | ||
display: none; | ||
} | ||
} | ||
</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,5 +1,6 @@ | ||
export { default as DocsGrid } from './DocsGrid.svelte' | ||
export { default as Footer } from './Footer.svelte' | ||
export { default as Nav } from './Nav.svelte' | ||
export { default as SortButtons } from './SortButtons.svelte' | ||
|
||
export type * from './types' |
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
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