-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
7 changed files
with
121 additions
and
4 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
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,46 @@ | ||
import { Sticker } from '../src' | ||
;(async () => { | ||
console.log('\n---\n') | ||
console.log('Rounded example') | ||
console.log('---\n') | ||
const images = { | ||
static: { | ||
potrait: 'https://i.pinimg.com/originals/3a/53/d6/3a53d68345b56241a875595b21ec2a59.jpg', | ||
landscape: 'https://chasinganime.com/wp-content/uploads/2021/02/0_YgtEypuJ2QfMPCbn.jpg' | ||
}, | ||
animated: { | ||
potrait: 'https://c.tenor.com/-1mtmQgH5eYAAAAC/watson-amelia-vtuber.gif', | ||
landscape: 'https://c.tenor.com/2RdLoyV5VPsAAAAC/ayame-nakiri.gif' | ||
} | ||
} | ||
const type = 'rounded' | ||
const getOptions = (pack = '', author = '') => ({ | ||
pack, | ||
type, | ||
author: `${author}-${type}` | ||
}) | ||
await (async () => { | ||
console.log('Static Potrait') | ||
const sticker = new Sticker(images.static.potrait, getOptions('static', 'potrait')) | ||
await sticker.toFile() | ||
console.log(`Saved to ${sticker.defaultFilename}`) | ||
})() | ||
await (async () => { | ||
console.log('Static Landscape') | ||
const sticker = new Sticker(images.static.landscape, getOptions('static', 'landscape')) | ||
await sticker.toFile() | ||
console.log(`Saved to ${sticker.defaultFilename}`) | ||
})() | ||
await (async () => { | ||
console.log('Animated Potrait') | ||
const sticker = new Sticker(images.animated.potrait, getOptions('animated', 'potrait')) | ||
await sticker.toFile() | ||
console.log(`Saved to ${sticker.defaultFilename}`) | ||
})() | ||
await (async () => { | ||
console.log('Animated Landscape') | ||
const sticker = new Sticker(images.animated.landscape, getOptions('animated', 'landscape')) | ||
await sticker.toFile() | ||
console.log(`Saved to ${sticker.defaultFilename}`) | ||
})() | ||
})() |
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