Created
April 7, 2022 14:36
-
-
Save supermamon/f663c97a86eda3899c9880d1d1032843 to your computer and use it in GitHub Desktop.
Rickies Chairmen - https://rickies.co
This file contains hidden or 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
// Variables used by Scriptable. | |
// These must be at the very top of the file. Do not edit. | |
// icon-color: orange; icon-glyph: award; | |
// https://twitter.com/simonbs/status/1512069641102790673 | |
const data = await (new Request('https://rickies.co/api/chairmen.json')).loadJSON() | |
const img = await (new Request('https://rickies.co/images/rickies-trophy-glow.png')).loadImage() | |
const w = new ListWidget() | |
const bg = new LinearGradient() | |
bg.colors = [new Color('#ffa300'), new Color('#f7dc66'),new Color('#f7dc66'),new Color('#ffa300'),] | |
bg.locations = [0,0.25,0.75,1] | |
const textColor = new Color('#1c394c') | |
const nameFont = Font.headline() | |
const titleFont = Font.regularSystemFont(9) | |
w.backgroundGradient = bg | |
w.addSpacer() | |
const imgStack = w.addImage(img) | |
imgStack.centerAlignImage() | |
w.addSpacer(4) | |
const kc = w.addText(data.keynote_chairman.name) | |
kc.centerAlignText() | |
kc.font = nameFont | |
kc.textColor = textColor | |
const kct = w.addText('Keynote Chairman') | |
kct.centerAlignText() | |
kct.font = titleFont | |
kct.textColor = textColor | |
w.addSpacer(8) | |
const ac = w.addText(data.annual_chairman.name) | |
ac.centerAlignText() | |
ac.font = nameFont | |
ac.textColor = textColor | |
const act = w.addText('Annual Chairman') | |
act.centerAlignText() | |
act.font = titleFont | |
act.textColor = textColor | |
w.addSpacer() | |
Script.setWidget(w) | |
// by @supermamon | 2022-04-07 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment