Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Rickies Chairmen - https://rickies.co
// 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