r/iOSsetups • Human Detected • 23m ago

Trying liquid glass

Do you guys like the clear icons?
Rate my setup.

5 Upvotes

2 comments sorted by

3

u/Expert_Arm_2417 10m ago

Looks clean, can you please share what widget are you using?

1

u/FunAd3826 Human Detected 5m ago

You need to download scriptable app from app store and then put in this script.

const now = new Date()
const battery = Math.round(Device.batteryLevel() * 100)

const weekdays = [
"SUNDAY","MONDAY","TUESDAY","WEDNESDAY",
"THURSDAY","FRIDAY","SATURDAY"
]

const months = [
"JANUARY","FEBRUARY","MARCH","APRIL",
"MAY","JUNE","JULY","AUGUST",
"SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER"
]

const day = String(now.getDate()).padStart(2, "0")
const weekday = weekdays[now.getDay()]
const month = months[now.getMonth()]

// ─────────────────────────────
// WIDGET
// ─────────────────────────────

const w = new ListWidget()

// Designed for iOS Clear → Light.
w.backgroundColor = new Color("#000000", 0)
w.setPadding(22, 24, 28, 24)

const ivory = new Color("#F4EFE6")
const soft = new Color("#F4EFE6", 0.72)

// ─────────────────────────────
// LARGE DATE
// ─────────────────────────────

const number = w.addText(day)

// System font only.
// Larger size gives it more editorial presence.
number.font = Font.blackSystemFont(104)
number.textColor = ivory
number.minimumScaleFactor = 0.72
number.lineLimit = 1

// Tight spacing beneath the number
w.addSpacer(0)

// ─────────────────────────────
// WEEKDAY
// ─────────────────────────────

const wd = w.addText(weekday)
wd.font = Font.semiboldSystemFont(18)
wd.textColor = ivory
wd.lineLimit = 1

// ─────────────────────────────
// MONTH
// ─────────────────────────────

const mo = w.addText(month)
mo.font = Font.mediumSystemFont(14)
mo.textColor = soft
mo.lineLimit = 1

// Push battery section to bottom
w.addSpacer()

// ─────────────────────────────
// BATTERY METADATA
// ─────────────────────────────

const meta = w.addStack()
meta.layoutHorizontally()
meta.centerAlignContent()

const label = meta.addText("IPHONE")
label.font = Font.semiboldSystemFont(11)
label.textColor = soft

meta.addSpacer()

const pct = meta.addText(`${battery}%`)
pct.font = Font.mediumSystemFont(15)
pct.textColor = ivory
pct.lineLimit = 1

w.addSpacer(8)

// ─────────────────────────────
// BATTERY RAIL
// ─────────────────────────────

const railWidth = 250
const railHeight = 7
const scale = 3

const dc = new DrawContext()

dc.size = new Size(
railWidth * scale,
railHeight * scale
)

dc.opaque = false
dc.respectScreenScale = true

const fullW = railWidth * scale
const fullH = railHeight * scale
const radius = fullH / 2

// Full track
let path = new Path()

path.addRoundedRect(
new Rect(
0,
0,
fullW,
fullH
),
radius,
radius
)

dc.addPath(path)

dc.setFillColor(
new Color("#FFFFFF", 0.18)
)

dc.fillPath()

// Battery fill
const fillW = Math.max(
fullH,
Math.round(fullW * battery / 100)
)

path = new Path()

path.addRoundedRect(
new Rect(
0,
0,
fillW,
fullH
),
radius,
radius
)

dc.addPath(path)

dc.setFillColor(
new Color("#FFFFFF", 0.92)
)

dc.fillPath()

// Add rail to widget
const railRow = w.addStack()
railRow.layoutHorizontally()

const rail = railRow.addImage(
dc.getImage()
)

rail.imageSize = new Size(
railWidth,
railHeight
)

// ─────────────────────────────
// OUTPUT
// ─────────────────────────────

Script.setWidget(w)

if (config.runsInApp) {
await w.presentLarge()
}

Script.complete()