ipx on a wide screen is the feed list down the left, the item table across the top right, and the item you are reading underneath it, with a bar between them. The native interface pushed the item over the list instead, which is what the page does under 820px and right there, but on a Mac it meant losing the list to read one item and navigating back. The table was wrong too: the page has columns that each sort, and this had a stack of rows with the same facts run together underneath the title. Both now follow the width, and at the same 820px the page draws the line at. Sorting a column asks the server, as the list already did. Sorting the rows on screen would only order the fifty that arrived. The wash (#12) drew straight seams down the window and was loud enough to make the selected row read as bright magenta. Each gradient had been sized into a box and then moved, and a box has edges; they fill the view and are placed by their centre now. And they were composited with plusLighter, which adds -- the stylesheet layers them with ordinary alpha, so its values are for colour sitting on what is behind it rather than added to it, and three of them added came out far brighter than Glass has ever looked in a browser. There was a wash per pane as well, so two met at the split and the join was another seam; there is one now, for the window. A SwiftUI Table with a sort order needs a comparator on every column -- a mix of sortable and plain does not compile -- so the status column sorts by read rather than being the one that cannot. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -56,34 +56,38 @@ enum Glass {
|
||||
|
||||
/// The three radial gradients ipx lays under everything, so the frosting has colour to pick
|
||||
/// up. Without it a material over a flat background is just grey.
|
||||
///
|
||||
/// Each gradient fills the whole view and is placed by its centre, rather than being sized
|
||||
/// into a box and then moved: a box has edges, and they showed as straight seams down the
|
||||
/// window. They composite normally, as the CSS does. Blending them plusLighter added the
|
||||
/// three together into something far louder than the theme -- it is a wash, not a light show.
|
||||
struct Wash: View {
|
||||
@Environment(\.colorScheme) private var scheme
|
||||
|
||||
private var base: Color { scheme == .dark ? Color(hex: 0x0b0d14) : Color(hex: 0xeef1f7) }
|
||||
/// The stylesheet's alphas are for colour seen through a frosted panel. Most of this is
|
||||
/// seen in the open, where the same values are too much.
|
||||
private var strength: Double { scheme == .dark ? 0.5 : 0.3 }
|
||||
|
||||
var body: some View {
|
||||
GeometryReader { geo in
|
||||
let w = geo.size.width, h = geo.size.height
|
||||
let reach = max(geo.size.width, geo.size.height)
|
||||
ZStack {
|
||||
base
|
||||
// Positions and sizes as the stylesheet has them: 8% 0%, 92% 18%, 60% 100%.
|
||||
blob(Color(hex: 0x4078ff).opacity(scheme == .dark ? 0.30 : 0.18),
|
||||
at: CGPoint(x: w * 0.08, y: 0), size: CGSize(width: w * 1.2, height: h * 1.1))
|
||||
blob(Color(hex: 0xaf52de).opacity(scheme == .dark ? 0.24 : 0.14),
|
||||
at: CGPoint(x: w * 0.92, y: h * 0.18), size: CGSize(width: w, height: h))
|
||||
blob(Color(hex: 0x30b0c7).opacity(scheme == .dark ? 0.20 : 0.12),
|
||||
at: CGPoint(x: w * 0.60, y: h), size: CGSize(width: w * 1.2, height: h * 1.2))
|
||||
blob(0x4078ff, 0.30, at: UnitPoint(x: 0.08, y: 0.00), reach * 0.75)
|
||||
blob(0xaf52de, 0.24, at: UnitPoint(x: 0.92, y: 0.18), reach * 0.65)
|
||||
blob(0x30b0c7, 0.20, at: UnitPoint(x: 0.60, y: 1.00), reach * 0.75)
|
||||
}
|
||||
.ignoresSafeArea()
|
||||
}
|
||||
.ignoresSafeArea()
|
||||
}
|
||||
|
||||
private func blob(_ colour: Color, at centre: CGPoint, size: CGSize) -> some View {
|
||||
RadialGradient(colors: [colour, colour.opacity(0)],
|
||||
center: .center, startRadius: 0, endRadius: max(size.width, size.height) / 2)
|
||||
.frame(width: size.width, height: size.height)
|
||||
.position(centre)
|
||||
.blendMode(.plusLighter)
|
||||
private func blob(_ hex: UInt32, _ alpha: Double,
|
||||
at centre: UnitPoint, _ radius: Double) -> some View {
|
||||
RadialGradient(
|
||||
gradient: Gradient(colors: [Color(hex: hex).opacity(alpha * strength),
|
||||
Color(hex: hex).opacity(0)]),
|
||||
center: centre, startRadius: 0, endRadius: radius)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user