-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
0fbf4e0
commit adf3eda
Showing
30 changed files
with
1,665 additions
and
1,308 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 |
---|---|---|
@@ -1,9 +1,26 @@ | ||
.utilities { | ||
padding-bottom: 3rem; | ||
} | ||
.utils .dark-mode-switch { right: 260px; } | ||
|
||
.utilities { padding-bottom: 3rem; margin-right: 240px; } | ||
|
||
|
||
.utilities h3.util { | ||
scroll-margin-top: 4.2rem; | ||
font-size: 1.1rem; | ||
color: var(--ui-color-accent); | ||
font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; | ||
} | ||
|
||
|
||
.utilities-nav { | ||
position: fixed; | ||
right: 0; | ||
top: 0; | ||
bottom: 0; | ||
z-index: 52; | ||
margin: 0; | ||
padding: 1rem 2rem; | ||
overflow-y: auto; | ||
width: 240px; | ||
border-left: 1px solid var(--ui-color-border-2); | ||
background-color: var(--ui-color-background-input); | ||
} |
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,60 +1,48 @@ | ||
<div class="sticky-block utilities"> | ||
<h2>Utility properties</h2> | ||
<div class="sticky-block utilities utilities-nav"> | ||
<h3>Utility properties</h3> | ||
<ul> | ||
{#each props as item} | ||
<li><a href="#Utils/{item}">{item}</a> | ||
{/each} | ||
</ul> | ||
|
||
<FocusableSelector/><hr> | ||
<PrefersDark/> | ||
<h3>Utility Functions</h3> | ||
<ul> | ||
{#each fns as item} | ||
<li><a href="#Utils/{item}">{item}</a> | ||
{/each} | ||
</ul> | ||
</div> | ||
|
||
<div class="sticky-block utilities" id="top"> | ||
<h2>Utility properties</h2> | ||
{#each props as item} | ||
<div class="utility"> | ||
<svelte:component this="{Properties[item]}" /><br> | ||
</div> | ||
{/each} | ||
<p> | ||
<em>*</em> <a href="https://svelte.dev/docs/svelte-components#script-4-prefix-stores-with-$-to-access-their-values"> | ||
svelte store variables</a> - when reading the value, add <em>$</em> to the name, e.g. | ||
<em>$FOCUSABLE_SELECTOR</em>. | ||
</p> | ||
</div> | ||
|
||
<div class="sticky-block utilities"> | ||
<h2>Utility Functions</h2> | ||
|
||
<Animate/><hr> | ||
<Blink/><hr> | ||
<DeepCopy/><hr> | ||
<Debounce/><hr> | ||
<Throttle/><hr> | ||
<Empty/><hr> | ||
<Fuzzy/><hr> | ||
<Guid/><hr> | ||
<GetMouseX/><hr> | ||
<GetMouseY/><hr> | ||
<GetMouseXY/><hr> | ||
<IsMobile/><hr> | ||
<Pluck/><hr> | ||
<RoundAmount/><hr> | ||
<FormatDate/><hr> | ||
<TimeAgo/><hr> | ||
<AlignItem/><hr> | ||
<IsInScrollable/> | ||
{#each fns as item} | ||
<div class="utility"> | ||
<svelte:component this="{Functions[item]}" /><br> | ||
</div> | ||
{/each} | ||
</div> | ||
docs-src/components/utils/fn-guid.svelte | ||
|
||
<p> | ||
<em>*</em> <a href="https://svelte.dev/docs/svelte-components#script-4-prefix-stores-with-$-to-access-their-values"> | ||
svelte store variables</a> - when reading the value, add <em>$</em> to the name, e.g. | ||
<em>$FOCUSABLE_SELECTOR</em>. | ||
</p> | ||
|
||
|
||
<script> | ||
import FocusableSelector from './prop-focusable-selector.svelte'; | ||
import PrefersDark from './prop-prefers-dark.svelte'; | ||
import Animate from './fn-animate.svelte'; | ||
import Blink from './fn-blink.svelte'; | ||
import DeepCopy from './fn-deep-copy.svelte'; | ||
import Debounce from './fn-debounce.svelte'; | ||
import Throttle from './fn-throttle.svelte'; | ||
import Empty from './fn-empty.svelte'; | ||
import Fuzzy from './fn-fuzzy.svelte'; | ||
import Guid from './fn-guid.svelte'; | ||
import GetMouseX from './fn-get-mouse-x.svelte'; | ||
import GetMouseY from './fn-get-mouse-y.svelte'; | ||
import GetMouseXY from './fn-get-mouse-xy.svelte'; | ||
import IsMobile from './fn-is-mobile.svelte'; | ||
import Pluck from './fn-pluck.svelte'; | ||
import RoundAmount from './fn-round-amount.svelte'; | ||
import FormatDate from './fn-format-date.svelte'; | ||
import TimeAgo from './fn-time-ago.svelte'; | ||
import AlignItem from './fn-align-item.svelte'; | ||
import IsInScrollable from './fn-is-in-scrollable.svelte'; | ||
import * as Functions from './functions'; | ||
import * as Properties from './properties'; | ||
const props = Object.keys(Properties); | ||
const fns = Object.keys(Functions); | ||
</script> |
This file was deleted.
Oops, something went wrong.
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
4 changes: 2 additions & 2 deletions
4
...rc/components/utils/fn-format-date.svelte → ...onents/utils/functions/format-date.svelte
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
4 changes: 2 additions & 2 deletions
4
...onents/utils/fn-get-mouse-x.svelte.svelte → ...utils/functions/get-mouse-x.svelte.svelte
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
19 changes: 19 additions & 0 deletions
19
docs-src/components/utils/functions/get-mouse-xy.svelte.svelte
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,19 @@ | ||
<h3 class="util" id="GetMouseXY">getMouseXY(event)</h3> | ||
<p>Returns the mouse XY position (as an array: [x, y]). Event is standardised across platforms (touch & pointer)</p> | ||
|
||
<CodeExample nohr html="{example}" /> | ||
|
||
|
||
<script> | ||
import { CodeExample } from '../../../code-example'; | ||
const example = ` | ||
<script> | ||
document.addEventListener('mousedown', e => { | ||
const [x, y] = getMouseXY(e); | ||
console.log(x, y); | ||
}); | ||
</script> | ||
`; | ||
</script> |
4 changes: 2 additions & 2 deletions
4
...onents/utils/fn-get-mouse-y.svelte.svelte → ...utils/functions/get-mouse-y.svelte.svelte
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
4 changes: 2 additions & 2 deletions
4
docs-src/components/utils/fn-guid.svelte → ...rc/components/utils/functions/guid.svelte
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export { default as AlignItem } from './align-item.svelte'; | ||
export { default as Animate } from './animate.svelte'; | ||
export { default as Blink } from './blink.svelte'; | ||
export { default as Debounce } from './debounce.svelte'; | ||
export { default as DeepCopy } from './deep-copy.svelte'; | ||
export { default as Empty } from './empty.svelte'; | ||
export { default as FormatDate } from './format-date.svelte'; | ||
export { default as Fuzzy } from './fuzzy.svelte'; | ||
export { default as GetMouseX } from './get-mouse-x.svelte.svelte'; | ||
export { default as GetMouseXY } from './get-mouse-xy.svelte.svelte'; | ||
export { default as GetMouseY } from './get-mouse-y.svelte.svelte'; | ||
export { default as Guid } from './guid.svelte'; | ||
export { default as IsInScrollable } from './is-in-scrollable.svelte'; | ||
export { default as IsMobile } from './is-mobile.svelte'; | ||
export { default as Pluck } from './pluck.svelte'; | ||
export { default as RoundAmount } from './round-amount.svelte'; | ||
export { default as Throttle } from './throttle.svelte'; | ||
export { default as TimeAgo } from './time-ago.svelte'; |
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
6 changes: 3 additions & 3 deletions
6
...-src/components/utils/fn-is-mobile.svelte → ...mponents/utils/functions/is-mobile.svelte
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
Oops, something went wrong.