Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
jgerigmeyer committed Nov 7, 2024
1 parent 2e3cb46 commit a79e99a
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 108 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ jobs:
- name: Test
run: |
yarn install --immutable
yarn sync
yarn test
lint:
Expand All @@ -72,5 +71,4 @@ jobs:
- name: Lint
run: |
yarn install --immutable
yarn sync
yarn lint:ci
52 changes: 25 additions & 27 deletions src/lib/components/colors/Sliders.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -67,38 +67,36 @@
</script>

<div data-actions="edit-color" data-group="sliders {type}">
<form>
{#each sliders as slider (slider.id)}
<div data-field="color-slider">
<label for="{type}_{slider.id}" data-label>{slider.name}</label>
<input
id="{type}_{slider.id}"
name="{type}_{slider.id}"
type="range"
min={slider.range[0]}
max={slider.range[1]}
step={getStep(slider.range)}
style={`--stops: ${slider.gradient}`}
value={$color.coords[slider.index]}
oninput={(e) => handleInput(e, slider.index)}
/>
</div>
{/each}
{#each sliders as slider (slider.id)}
<div data-field="color-slider">
<label for="{type}_alpha" data-label>Alpha</label>
<label for="{type}_{slider.id}" data-label>{slider.name}</label>
<input
id="{type}_alpha"
name="{type}_alpha"
id="{type}_{slider.id}"
name="{type}_{slider.id}"
type="range"
min={0}
max={1}
step={getStep([0, 1])}
style={`--stops: ${alphaGradient}`}
value={$color.alpha}
oninput={(e) => handleInput(e)}
min={slider.range[0]}
max={slider.range[1]}
step={getStep(slider.range)}
style={`--stops: ${slider.gradient}`}
value={$color.coords[slider.index]}
oninput={(e) => handleInput(e, slider.index)}
/>
</div>
</form>
{/each}
<div data-field="color-slider">
<label for="{type}_alpha" data-label>Alpha</label>
<input
id="{type}_alpha"
name="{type}_alpha"
type="range"
min={0}
max={1}
step={getStep([0, 1])}
style={`--stops: ${alphaGradient}`}
value={$color.alpha}
oninput={(e) => handleInput(e)}
/>
</div>
</div>

<style lang="scss">
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/colors/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

<SupportWarning format={$format} />

<div data-form="contrast-checker" data-layout="color-form">
<form data-form="contrast-checker" data-layout="color-form">
<Header type="bg" color={bg} format={$format} />
<Sliders type="bg" color={bg} format={$format} />

<Header type="fg" color={fg} format={$format} />
<Sliders type="fg" color={fg} format={$format} />
</div>
</form>

<div data-layout="split">
<Formats type="bg" color={$bg} format={$format} />
Expand Down
9 changes: 2 additions & 7 deletions src/lib/icons/Check.svelte
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
<script lang="ts">
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
interface Props {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
}
let { ...rest }: Props = $props();
let props = $props();
</script>

<svg
xmlns="http://www.w3.org/2000/svg"
width="39"
height="27.81"
viewBox="0 0 39 27.81"
{...rest}
{...props}
>
<path
id="check"
Expand Down
9 changes: 2 additions & 7 deletions src/lib/icons/Clipboard.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
<script lang="ts">
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
interface Props {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
}
let { ...rest }: Props = $props();
let props = $props();
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24.12 24.12" {...rest}>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24.12 24.12" {...props}>
<path
id="arrow"
d="m14.37,12.26l-.55.06v-1.65c0-.27-.18-.4-.25-.44-.08-.04-.28-.13-.51,0l-5.56,3.21c-.23.13-.25.35-.25.44s.02.31.25.44l5.56,3.21c.23.13.43.04.51,0s.25-.18.25-.44v-1.26l.44-.06c.91-.12,1.76-.17,2.54-.17,3.74,0,6.02,1.2,7.32,2.28-2.06-5.77-7.38-5.89-9.74-5.63h0Z"
Expand Down
9 changes: 2 additions & 7 deletions src/lib/icons/Copy.svelte
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
<script lang="ts">
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
interface Props {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
}
let { ...rest }: Props = $props();
let props = $props();
</script>

<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24.12 24.12"
data-icon-theme="success"
{...rest}
{...props}
>
<path
id="checkmark"
Expand Down
9 changes: 2 additions & 7 deletions src/lib/icons/GitHub.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
<script lang="ts">
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
interface Props {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
}
let { ...rest }: Props = $props();
let props = $props();
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 98 96" {...rest}>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 98 96" {...props}>
<path
fill-rule="evenodd"
clip-rule="evenodd"
Expand Down
9 changes: 2 additions & 7 deletions src/lib/icons/LinkedIn.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
<script lang="ts">
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
interface Props {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
}
let { ...rest }: Props = $props();
let props = $props();
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" {...rest}>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" {...props}>
<path
d="M100.28 448H7.4V148.9h92.88zM53.79 108.1C24.09 108.1 0 83.5 0 53.8a53.79 53.79 0 0 1 107.58 0c0 29.7-24.1 54.3-53.79 54.3zM447.9 448h-92.68V302.4c0-34.7-.7-79.2-48.29-79.2-48.29 0-55.69 37.7-55.69 76.7V448h-92.78V148.9h89.08v40.8h1.3c12.4-23.5 42.69-48.3 87.88-48.3 94 0 111.28 61.9 111.28 142.3V448z"
/>
Expand Down
9 changes: 2 additions & 7 deletions src/lib/icons/Logo.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
<script lang="ts">
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
interface Props {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
}
let { ...rest }: Props = $props();
let props = $props();
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 417.82 51.3" {...rest}>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 417.82 51.3" {...props}>
<g id="oddcontrast-logo">
<path
id="logo-t2"
Expand Down
9 changes: 2 additions & 7 deletions src/lib/icons/Mastodon.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
<script lang="ts">
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
interface Props {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
}
let { ...rest }: Props = $props();
let props = $props();
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 74 79" {...rest}>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 74 79" {...props}>
<path
d="M73.7014 17.4323C72.5616 9.05152 65.1774 2.4469 56.424 1.1671C54.9472 0.950843 49.3518 0.163818 36.3901 0.163818H36.2933C23.3281 0.163818 20.5465 0.950843 19.0697 1.1671C10.56 2.41145 2.78877 8.34604 0.903306 16.826C-0.00357854 21.0022 -0.100361 25.6322 0.068112 29.8793C0.308275 35.9699 0.354874 42.0498 0.91406 48.1156C1.30064 52.1448 1.97502 56.1419 2.93215 60.0769C4.72441 67.3445 11.9795 73.3925 19.0876 75.86C26.6979 78.4332 34.8821 78.8603 42.724 77.0937C43.5866 76.8952 44.4398 76.6647 45.2833 76.4024C47.1867 75.8033 49.4199 75.1332 51.0616 73.9562C51.0841 73.9397 51.1026 73.9184 51.1156 73.8938C51.1286 73.8693 51.1359 73.8421 51.1368 73.8144V67.9366C51.1364 67.9107 51.1302 67.8852 51.1186 67.862C51.1069 67.8388 51.0902 67.8184 51.0695 67.8025C51.0489 67.7865 51.0249 67.7753 50.9994 67.7696C50.9738 67.764 50.9473 67.7641 50.9218 67.7699C45.8976 68.9569 40.7491 69.5519 35.5836 69.5425C26.694 69.5425 24.3031 65.3699 23.6184 63.6327C23.0681 62.1314 22.7186 60.5654 22.5789 58.9744C22.5775 58.9477 22.5825 58.921 22.5934 58.8965C22.6043 58.8721 22.621 58.8505 22.6419 58.8336C22.6629 58.8167 22.6876 58.8049 22.714 58.7992C22.7404 58.7934 22.7678 58.794 22.794 58.8007C27.7345 59.9796 32.799 60.5746 37.8813 60.5733C39.1036 60.5733 40.3223 60.5733 41.5447 60.5414C46.6562 60.3996 52.0437 60.1408 57.0728 59.1694C57.1983 59.1446 57.3237 59.1233 57.4313 59.0914C65.3638 57.5847 72.9128 52.8555 73.6799 40.8799C73.7086 40.4084 73.7803 35.9415 73.7803 35.4523C73.7839 33.7896 74.3216 23.6576 73.7014 17.4323ZM61.4925 47.3144H53.1514V27.107C53.1514 22.8528 51.3591 20.6832 47.7136 20.6832C43.7061 20.6832 41.6988 23.2499 41.6988 28.3194V39.3803H33.4078V28.3194C33.4078 23.2499 31.3969 20.6832 27.3894 20.6832C23.7654 20.6832 21.9552 22.8528 21.9516 27.107V47.3144H13.6176V26.4937C13.6176 22.2395 14.7157 18.8598 16.9118 16.3545C19.1772 13.8552 22.1488 12.5719 25.8373 12.5719C30.1064 12.5719 33.3325 14.1955 35.4832 17.4394L37.5587 20.8853L39.6377 17.4394C41.7884 14.1955 45.0145 12.5719 49.2765 12.5719C52.9614 12.5719 55.9329 13.8552 58.2055 16.3545C60.4017 18.8574 61.4997 22.2371 61.4997 26.4937L61.4925 47.3144Z"
/>
Expand Down
9 changes: 2 additions & 7 deletions src/lib/icons/NewTab.svelte
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
<script lang="ts">
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
interface Props {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
}
let { ...rest }: Props = $props();
let props = $props();
</script>

<svg
xmlns="http://www.w3.org/2000/svg"
width="25.43"
height="25.43"
viewBox="0 0 25.43 25.43"
{...rest}
{...props}
>
<path
id="box"
Expand Down
9 changes: 2 additions & 7 deletions src/lib/icons/OddBird.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
<script lang="ts">
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
interface Props {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
}
let { ...rest }: Props = $props();
let props = $props();
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 133.38 73.32" {...rest}>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 133.38 73.32" {...props}>
<path
d="m124.35,12.41c-4.19-1.87-16.08-7.27-21.59-5.4-3.74,1.21-8.04,10.35-10.9,13-.33.22-.66.55-1.1.88C82.94,6.14,67.85-2.23,57.83.52c-6.83,1.87-13.11,9.8-15.97,19.93-4.96-2.97-7.49-7.93-11.89-12.44-3.41-3.52-8.04-2.09-12-.22C10.03,11.42-.32,16.82,0,25.3c4.63-3.3,9.14-2.31,10.57,3.74.33,1.1,2.86-3.96,5.95-5.07,3.52-1.32,7.38,1.87,8.15,5.4.22.66,3.19-3.85,6.28-2.31,2.2.99,3.52,5.62,4.3,5.18,2.2-1.43,3.74-3.08,5.29-4.41-.55,5.18-.22,10.68,1.32,16.19.11.33.22.66.22.88,1.1-9.8,6.5-17.84,12.56-19.49,8.48-2.42,22.14,6.39,26.21,20.81,2.97,10.68.88,21.26-4.63,27.09.66-.11,1.32-.22,1.98-.44,14.43-4.07,21.59-23.57,15.97-43.5-.11-.44-.22-.77-.33-1.1,3.52,1.87,5.18,4.96,5.29,4.52,1.32-6.17,8.7-6.28,13.55-1.87.44.44.66-4.74,2.53-5.4,2.97-1.1,6.28.55,9.36,2.42.55.33.44-2.42.33-2.75-.22-1.32-.11-2.75,1.43-3.19,2.31-.66,4.96.55,7.05.99-.55-4.96-5.07-8.81-9.03-10.57h0Z"
/>
Expand Down
9 changes: 2 additions & 7 deletions src/lib/icons/Twitter.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
<script lang="ts">
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
interface Props {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
}
let { ...rest }: Props = $props();
let props = $props();
</script>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" {...rest}>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" {...props}>
<path
d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"
/>
Expand Down
9 changes: 2 additions & 7 deletions src/lib/icons/Warning.svelte
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
<script lang="ts">
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
interface Props {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
}
let { ...rest }: Props = $props();
let props = $props();
</script>

<svg
xmlns="http://www.w3.org/2000/svg"
width="26"
height="22.76"
viewBox="0 0 26 22.76"
{...rest}
{...props}
>
<path
id="warning"
Expand Down

0 comments on commit a79e99a

Please sign in to comment.