-
Notifications
You must be signed in to change notification settings - Fork 3
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
Showing
6 changed files
with
324 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script> | ||
import { onMount } from 'svelte' | ||
import Cropper from 'cropperjs' | ||
const init = () => { | ||
const image = new Image() | ||
image.src = '/rouge-ticket-black.png' | ||
image.alt = 'Picture' | ||
const cropper = new Cropper(image, { | ||
container: '.cropper-container' | ||
}) | ||
console.log(cropper) | ||
} | ||
onMount(init) | ||
</script> | ||
|
||
<div class="cropper-container">XXX</div> |
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,5 @@ | ||
<script> | ||
import Cropper from '$components/Cropper.svelte' | ||
</script> | ||
|
||
<Cropper /> |
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,34 @@ | ||
import { promisify } from 'util' | ||
import fs from 'fs' | ||
|
||
import { exec as execCallback } from 'child_process' | ||
|
||
const exec = promisify(execCallback) | ||
|
||
const run = async () => { | ||
const names = [] | ||
let output = '' | ||
|
||
const { stdout } = await exec(`find src -type f -name *.svelte | xargs cat `) | ||
|
||
for await (const line of stdout.split('\n')) { | ||
// non tablers icons | ||
if (/<Icon name="([a-z][a-zA-Z-]*)"/.test(line)) continue | ||
const match = line.match(/<Icon name="([A-Z][a-zA-Z]*)"/) | ||
if (match) { | ||
if (names.includes('Icon' + match[1])) continue | ||
output += `import { Icon${match[1]} } from '@tabler/icons-svelte'\n` | ||
names.push('Icon' + match[1]) | ||
} else if (/<Icon/.test(line)) { | ||
if (/{(entry.icon|selector|channel.amount) ?/.test(line)) continue | ||
|
||
console.warn('potential unformatted Icon', line) | ||
} | ||
} | ||
|
||
output += `\nexport {\n ${names.join(',\n ')}\n}\n` | ||
|
||
fs.writeFileSync('src/icons/tabler-icons.js', output) | ||
} | ||
|
||
run() |