-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
7cb0c3c
commit 98bfa21
Showing
21 changed files
with
310 additions
and
169 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
File renamed without changes.
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,38 @@ | ||
<script> | ||
import onEnterOrSpace from './onEnterOrSpace' | ||
/** @type {Record<string, string>} keys to icons*/ | ||
export let options | ||
export let value | ||
let index = Object.keys(options).indexOf(value) | ||
$: entries = Object.entries(options) | ||
$: icon = entries[index][1] | ||
const rotate = () => { | ||
index = (index + 1) % entries.length | ||
value = entries[index][0] | ||
} | ||
</script> | ||
|
||
<button class={icon} on:click={rotate} on:keyup={onEnterOrSpace(rotate)} /> | ||
|
||
<style> | ||
button { | ||
background-color: var(--background-1); | ||
color: var(--text); | ||
border-radius: var(--line-height); | ||
width: var(--line-height); | ||
height: var(--line-height); | ||
line-height: var(--line-height); | ||
font-size: var(--text-size-large); | ||
transition: color var(--default-transition-behaviour); | ||
} | ||
@media (hover: hover) { | ||
button:hover { | ||
color: var(--text-highlight); | ||
} | ||
} | ||
</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,38 @@ | ||
<script> | ||
import onEnterOrSpace from './onEnterOrSpace' | ||
/** @type {Record<string, string>} keys to text*/ | ||
export let options | ||
export let value | ||
let index = Object.keys(options).indexOf(value) | ||
$: entries = Object.entries(options) | ||
$: text = entries[index][1] | ||
const rotate = () => { | ||
index = (index + 1) % entries.length | ||
value = entries[index][0] | ||
} | ||
</script> | ||
|
||
<button on:click={rotate} on:keyup={onEnterOrSpace(rotate)}>{text}</button> | ||
|
||
<style> | ||
button { | ||
background-color: var(--background-1); | ||
color: var(--text); | ||
border-radius: var(--line-height); | ||
width: var(--line-height); | ||
height: var(--line-height); | ||
line-height: var(--line-height); | ||
font-size: var(--text-size-large); | ||
transition: color var(--default-transition-behaviour); | ||
} | ||
@media (hover: hover) { | ||
button:hover { | ||
color: var(--text-highlight); | ||
} | ||
} | ||
</style> |
File renamed without changes.
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,43 +1,10 @@ | ||
<script> | ||
import { getNextModifier } from '../../types/tag-modifier/modifier' | ||
import { createEventDispatcher } from 'svelte' | ||
import onEnterOrSpace from '../common/onEnterOrSpace' | ||
import { MODIFIERS_ICONS, MODIFIERS_HINTS } from './modifierData' | ||
import { MODIFIERS_ICONS } from './modifierData' | ||
import RotatingSelection from '../common/RotatingIconSelection.svelte' | ||
import RotatingIconSelection from '../common/RotatingIconSelection.svelte' | ||
/** @type {import("../../types/tag-modifier/modifier").Modifier} */ | ||
let modifier = '+' | ||
const dispatch = createEventDispatcher() | ||
const changeModifier = () => { | ||
modifier = getNextModifier(modifier) | ||
dispatch('change', modifier) | ||
} | ||
export let modifier | ||
</script> | ||
|
||
<i | ||
tabindex="0" | ||
role="button" | ||
class={`codicon codicon-${MODIFIERS_ICONS[modifier]}`} | ||
title={MODIFIERS_HINTS[modifier]} | ||
on:click={changeModifier} | ||
on:keyup={onEnterOrSpace(changeModifier)} | ||
on:touchend|preventDefault={changeModifier} | ||
/> | ||
|
||
<style> | ||
i { | ||
width: var(--line-height); | ||
height: var(--line-height); | ||
line-height: var(--line-height); | ||
vertical-align: middle; | ||
text-align: center; | ||
font-size: var(--text-size-large); | ||
transition: color var(--default-transition-behaviour); | ||
} | ||
@media (hover: hover) { | ||
i:hover { | ||
color: var(--text-highlight); | ||
} | ||
} | ||
</style> | ||
<RotatingIconSelection bind:value={modifier} options={MODIFIERS_ICONS} /> |
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
Oops, something went wrong.