diff --git a/gallery/aurora-flow-field/audit.json b/gallery/aurora-flow-field/audit.json index 457b3da..4387b42 100644 --- a/gallery/aurora-flow-field/audit.json +++ b/gallery/aurora-flow-field/audit.json @@ -3,11 +3,11 @@ "title": "Arctic Currents (Flow Field)", "mode": "ambient", "pass": true, - "seamScore": 1.013, + "seamScore": 1.037, "duplicateFrames": 0, - "flickerScore": 0.025, + "flickerScore": 0.028, "legiblePass": true, "sourcesPass": true, - "gifKB": 1674.1, + "gifKB": 3076.4, "totalFrames": 80 } diff --git a/gallery/aurora-flow-field/loop.gif b/gallery/aurora-flow-field/loop.gif index c21884f..0ece294 100644 Binary files a/gallery/aurora-flow-field/loop.gif and b/gallery/aurora-flow-field/loop.gif differ diff --git a/gallery/aurora-flow-field/poster.png b/gallery/aurora-flow-field/poster.png index 7240b22..73d8fdf 100644 Binary files a/gallery/aurora-flow-field/poster.png and b/gallery/aurora-flow-field/poster.png differ diff --git a/gallery/aurora-flow-field/seam.json b/gallery/aurora-flow-field/seam.json index 72d413e..5f9b6a5 100644 --- a/gallery/aurora-flow-field/seam.json +++ b/gallery/aurora-flow-field/seam.json @@ -1,95 +1,95 @@ { "pass": true, "totalFrames": 80, - "seamScore": 1.013, + "seamScore": 1.037, "maxSeamScore": 1.5, "duplicateFrames": 0, "duplicatePairs": [], - "flickerScore": 0.025, + "flickerScore": 0.028, "maxFlickerScore": 2.5, - "medianStepDelta": 0.235275, - "seamStepDelta": 0.238384, + "medianStepDelta": 0.199618, + "seamStepDelta": 0.207054, "normalizedSteps": [ - 1.014, - 1.015, - 1.007, - 1.004, - 0.99, - 0.998, - 1.005, - 1.006, - 1.014, - 0.989, - 0.973, - 0.989, - 1, + 1.042, + 1.051, + 1.033, 1.023, - 1.044, - 1.059, - 1.046, - 1.04, - 1.018, - 0.999, 0.993, - 0.989, - 0.968, - 0.969, - 0.987, + 1.002, + 1.002, 1, - 0.992, - 0.985, - 0.989, - 1.014, + 1.001, + 0.979, + 0.964, + 0.986, + 0.994, + 1.015, + 1.028, + 1.04, + 1.019, + 1.024, + 1.002, + 0.99, + 0.987, + 0.979, + 0.966, + 0.97, + 0.99, + 1.011, 0.995, - 0.981, 0.984, - 0.982, - 0.991, - 0.974, - 0.972, - 0.96, - 0.961, - 0.971, - 0.981, 0.989, - 0.976, - 0.969, - 0.964, - 0.971, - 0.976, - 0.993, - 1.012, - 1.012, - 1.015, 1.017, - 1.01, - 1.021, - 1.045, - 1.021, - 1.024, - 1.041, - 1.065, - 1.066, - 1.033, - 1.04, - 1.04, - 1.037, - 1.031, - 1.007, - 0.993, - 0.991, - 1.001, - 1.005, - 0.997, + 1, + 0.987, + 0.979, + 0.972, 0.983, - 0.98, - 0.971, - 0.999, - 1.021, - 1.036, + 0.957, + 0.947, + 0.948, + 0.945, + 0.96, + 0.965, + 0.968, + 0.957, + 0.947, + 0.954, + 0.965, + 0.979, + 1.006, + 1.034, + 1.035, + 1.034, 1.031, + 1.025, + 1.036, + 1.061, + 1.036, + 1.048, + 1.052, + 1.061, + 1.058, + 1.034, + 1.028, + 1.027, 1.023, - 1.013 + 1.024, + 0.997, + 0.974, + 0.968, + 0.98, + 0.986, + 0.981, + 0.968, + 0.968, + 0.967, + 1.003, + 1.034, + 1.054, + 1.055, + 1.044, + 1.037 ], "reasons": [] } diff --git a/gallery/aurora-flow-field/sheet.png b/gallery/aurora-flow-field/sheet.png index 836d054..2ecb38e 100644 Binary files a/gallery/aurora-flow-field/sheet.png and b/gallery/aurora-flow-field/sheet.png differ diff --git a/gallery/cad-planetary/audit.json b/gallery/cad-planetary/audit.json index 6e2f34f..64c2637 100644 --- a/gallery/cad-planetary/audit.json +++ b/gallery/cad-planetary/audit.json @@ -3,11 +3,11 @@ "title": "Epicyclic Telemetry (Blueprint CAD)", "mode": "ambient", "pass": true, - "seamScore": 1.016, + "seamScore": 1.023, "duplicateFrames": 0, "flickerScore": 0.031, "legiblePass": true, "sourcesPass": true, - "gifKB": 762.6, + "gifKB": 1193.9, "totalFrames": 80 } diff --git a/gallery/cad-planetary/legible.json b/gallery/cad-planetary/legible.json index 06f4df6..bcd5604 100644 --- a/gallery/cad-planetary/legible.json +++ b/gallery/cad-planetary/legible.json @@ -5,14 +5,14 @@ "captions": [ { "text": "CAD // HARMONIC-3X", - "contrastRatio": 14.93, - "minMarginPx": 18, + "contrastRatio": 11.34, + "minMarginPx": 13, "passContrast": true }, { "text": "THETA: 0 DEG", - "contrastRatio": 10.36, - "minMarginPx": 15, + "contrastRatio": 7.86, + "minMarginPx": 13, "passContrast": true } ], diff --git a/gallery/cad-planetary/loop.gif b/gallery/cad-planetary/loop.gif index 2855cf4..c265556 100644 Binary files a/gallery/cad-planetary/loop.gif and b/gallery/cad-planetary/loop.gif differ diff --git a/gallery/cad-planetary/poster.png b/gallery/cad-planetary/poster.png index d5f395a..9e0445b 100644 Binary files a/gallery/cad-planetary/poster.png and b/gallery/cad-planetary/poster.png differ diff --git a/gallery/cad-planetary/seam.json b/gallery/cad-planetary/seam.json index 444a68d..04a2d9f 100644 --- a/gallery/cad-planetary/seam.json +++ b/gallery/cad-planetary/seam.json @@ -1,95 +1,95 @@ { "pass": true, "totalFrames": 80, - "seamScore": 1.016, + "seamScore": 1.023, "maxSeamScore": 1.5, "duplicateFrames": 0, "duplicatePairs": [], "flickerScore": 0.031, "maxFlickerScore": 2.5, - "medianStepDelta": 0.115335, - "seamStepDelta": 0.117167, + "medianStepDelta": 0.094522, + "seamStepDelta": 0.096689, "normalizedSteps": [ - 1.024, - 1.036, - 1.027, - 1.007, - 1.009, + 1.01, + 1.02, + 1.035, + 1, + 1.006, 0.998, + 1.002, + 0.994, 1.004, - 0.985, - 0.992, - 0.986, - 0.999, + 0.993, + 0.998, 1.001, - 1.009, + 1.007, 1.008, - 1.006, - 1.037, + 0.999, 1.028, - 1.017, - 0.988, + 1.011, + 1.008, + 0.978, + 0.954, 0.964, - 0.977, + 0.956, + 0.987, + 0.959, + 0.952, 0.974, - 0.985, - 0.983, - 0.977, + 1, + 1.014, + 1.027, + 1.001, + 1.01, + 1.006, + 1.003, + 1.001, + 0.993, + 1, 0.988, + 1.005, + 0.998, 1.012, - 1.03, - 1.033, - 1.01, + 1.004, 1.007, + 1.023, 1.005, - 1.001, - 1.001, - 0.988, - 0.995, - 0.986, - 1.003, - 0.997, - 1.008, - 1.008, - 1.02, - 1.039, - 1.027, - 1.013, - 0.973, - 0.974, - 0.977, - 0.971, - 0.972, - 0.972, - 0.962, - 0.99, + 0.991, + 0.959, + 0.957, + 0.964, + 0.96, + 0.959, + 0.959, + 0.955, + 0.98, + 1.005, + 1.015, + 1.019, + 0.996, 1.017, - 1.031, - 1.03, - 1.002, - 1.007, - 1, + 1.004, + 1.016, + 0.997, + 0.991, + 0.997, + 0.991, + 1.004, 1.003, - 0.985, + 1.019, + 1.001, + 1.02, + 1.018, + 1.005, 0.983, - 0.988, - 0.993, - 1.003, - 0.999, - 1.007, - 1, - 1.026, - 1.033, - 1.021, - 0.994, + 0.952, + 0.959, + 0.956, + 0.959, 0.962, - 0.974, - 0.97, - 0.97, - 0.977, - 0.976, - 0.971, - 1.016 + 0.964, + 0.957, + 1.023 ], "reasons": [] } diff --git a/gallery/cad-planetary/sheet.png b/gallery/cad-planetary/sheet.png index ca8edfe..5e38cb1 100644 Binary files a/gallery/cad-planetary/sheet.png and b/gallery/cad-planetary/sheet.png differ diff --git a/gallery/cli-audit-session/audit.json b/gallery/cli-audit-session/audit.json index f0c8f51..7c8ea8c 100644 --- a/gallery/cli-audit-session/audit.json +++ b/gallery/cli-audit-session/audit.json @@ -3,11 +3,11 @@ "title": "Loop CLI Audit Showcase (Terminal)", "mode": "showcase", "pass": true, - "seamScore": 0.998, + "seamScore": 0.989, "duplicateFrames": 0, - "flickerScore": 1.366, + "flickerScore": 0.89, "legiblePass": true, "sourcesPass": true, - "gifKB": 805, + "gifKB": 1371.6, "totalFrames": 160 } diff --git a/gallery/cli-audit-session/legible.json b/gallery/cli-audit-session/legible.json index 9148b20..a6c2f38 100644 --- a/gallery/cli-audit-session/legible.json +++ b/gallery/cli-audit-session/legible.json @@ -16,7 +16,7 @@ "passReadingTime": true, "contrastRatio": 16.56, "passContrast": true, - "minEdgeMarginPx": 38, + "minEdgeMarginPx": 37, "phoneFontPx": 6.5, "passMobileWidth": true, "pass": true @@ -31,7 +31,7 @@ "passReadingTime": true, "contrastRatio": 16.56, "passContrast": true, - "minEdgeMarginPx": 38, + "minEdgeMarginPx": 37, "phoneFontPx": 6.5, "passMobileWidth": true, "pass": true @@ -46,7 +46,7 @@ "passReadingTime": true, "contrastRatio": 16.56, "passContrast": true, - "minEdgeMarginPx": 38, + "minEdgeMarginPx": 37, "phoneFontPx": 6.5, "passMobileWidth": true, "pass": true @@ -61,7 +61,7 @@ "passReadingTime": true, "contrastRatio": 16.56, "passContrast": true, - "minEdgeMarginPx": 38, + "minEdgeMarginPx": 37, "phoneFontPx": 6.5, "passMobileWidth": true, "pass": true diff --git a/gallery/cli-audit-session/loop.gif b/gallery/cli-audit-session/loop.gif index 19f9eae..6511cf9 100644 Binary files a/gallery/cli-audit-session/loop.gif and b/gallery/cli-audit-session/loop.gif differ diff --git a/gallery/cli-audit-session/poster.png b/gallery/cli-audit-session/poster.png index 0b8a4e6..6ec2d72 100644 Binary files a/gallery/cli-audit-session/poster.png and b/gallery/cli-audit-session/poster.png differ diff --git a/gallery/cli-audit-session/seam.json b/gallery/cli-audit-session/seam.json index a99491c..2182486 100644 --- a/gallery/cli-audit-session/seam.json +++ b/gallery/cli-audit-session/seam.json @@ -1,175 +1,175 @@ { "pass": true, "totalFrames": 160, - "seamScore": 0.998, + "seamScore": 0.989, "maxSeamScore": 1.5, "duplicateFrames": 0, "duplicatePairs": [], - "flickerScore": 1.366, + "flickerScore": 0.89, "maxFlickerScore": 2.5, - "medianStepDelta": 0.009208, - "seamStepDelta": 0.009187, + "medianStepDelta": 0.009432, + "seamStepDelta": 0.009329, "normalizedSteps": [ - 0.998, - 0.994, + 0.989, + 0.997, + 1.009, + 0.995, + 1, + 1, + 0.995, + 0.996, + 0.99, + 1.003, + 0.987, + 0.988, + 0.997, + 1.004, + 1.141, + 1.313, + 1.298, + 1.31, + 1.245, + 2.136, + 1.004, + 1.271, + 1.343, + 1.33, + 1.346, + 1.159, + 1.004, + 0.997, + 0.988, + 0.987, + 1.003, + 0.99, + 0.996, + 0.995, + 1, + 1, + 0.995, + 1.009, + 0.997, + 0.989, + 0.989, + 0.997, + 1.009, + 0.995, + 1, + 1, + 0.995, + 0.996, + 0.99, + 1.003, + 0.987, + 0.988, + 0.997, + 1.004, + 1.159, + 1.346, + 1.33, + 1.343, + 1.271, + 2.599, 1.004, - 1.002, - 0.998, - 0.998, - 0.995, - 0.994, - 0.992, - 1, - 0.986, - 0.994, - 0.995, - 1.005, - 1.238, - 1.529, - 1.51, - 1.526, - 1.42, - 2.857, - 1.006, - 1.479, - 1.598, - 1.579, - 1.601, - 1.274, - 1.005, - 0.995, - 0.994, - 0.986, - 1, - 0.992, - 0.994, - 0.995, - 0.998, - 0.998, - 1.002, + 1.252, + 1.319, + 1.306, + 1.322, + 1.146, 1.004, - 0.994, - 0.998, - 0.998, - 0.994, + 0.997, + 0.988, + 0.987, + 1.003, + 0.99, + 0.996, + 0.995, + 1, + 1, + 0.995, + 1.009, + 0.997, + 0.989, + 0.989, + 0.997, + 1.009, + 0.995, + 1, + 1, + 0.995, + 0.996, + 0.99, + 1.003, + 0.987, + 0.988, + 0.997, 1.004, - 1.002, - 0.998, - 0.998, - 0.995, - 0.994, - 0.992, - 1, - 0.986, - 0.994, - 0.995, - 1.005, - 1.274, - 1.601, - 1.579, - 1.598, - 1.479, - 3.598, - 1.006, - 1.454, - 1.568, - 1.549, - 1.57, - 1.258, - 1.005, - 0.995, - 0.994, - 0.986, - 1, - 0.992, - 0.994, - 0.995, - 0.998, - 0.998, - 1.002, + 1.146, + 1.322, + 1.306, + 1.319, + 1.252, + 2.634, 1.004, - 0.994, - 0.998, - 0.998, - 0.994, + 1.27, + 1.341, + 1.328, + 1.344, + 1.156, 1.004, - 1.002, - 0.998, - 0.998, - 0.995, - 0.994, - 0.992, - 1, - 0.986, - 0.994, - 0.995, - 1.005, - 1.258, - 1.57, - 1.549, - 1.568, - 1.454, - 3.624, - 1.006, - 1.464, - 1.58, - 1.561, - 1.582, - 1.264, - 1.005, - 0.995, - 0.994, - 0.986, - 1, - 0.992, - 0.994, - 0.995, - 0.998, - 0.998, - 1.002, + 0.997, + 0.988, + 0.987, + 1.003, + 0.99, + 0.996, + 0.995, + 1, + 1, + 0.995, + 1.009, + 0.997, + 0.989, + 0.989, + 0.997, + 1.009, + 0.995, + 1, + 1, + 0.995, + 0.996, + 0.99, + 1.003, + 0.987, + 0.988, + 0.997, 1.004, - 0.994, - 0.998, - 0.998, - 0.994, + 1.156, + 1.344, + 1.328, + 1.341, + 1.27, + 2.16, 1.004, - 1.002, - 0.998, - 0.998, - 0.995, - 0.994, - 0.992, - 1, - 0.986, - 0.994, - 0.995, - 1.005, - 1.264, - 1.582, - 1.561, - 1.58, - 1.464, - 2.83, - 1.006, - 1.42, - 1.526, - 1.51, - 1.529, - 1.238, - 1.005, - 0.995, - 0.994, - 0.986, - 1, - 0.992, - 0.994, - 0.995, - 0.998, - 0.998, - 1.002, + 1.245, + 1.31, + 1.298, + 1.313, + 1.141, 1.004, - 0.994, - 0.998 + 0.997, + 0.988, + 0.987, + 1.003, + 0.99, + 0.996, + 0.995, + 1, + 1, + 0.995, + 1.009, + 0.997, + 0.989 ], "reasons": [] } diff --git a/gallery/cli-audit-session/sheet.png b/gallery/cli-audit-session/sheet.png index eb53893..dcc4aaa 100644 Binary files a/gallery/cli-audit-session/sheet.png and b/gallery/cli-audit-session/sheet.png differ diff --git a/gallery/cli-audit-session/showcase.gif b/gallery/cli-audit-session/showcase.gif index 19f9eae..6511cf9 100644 Binary files a/gallery/cli-audit-session/showcase.gif and b/gallery/cli-audit-session/showcase.gif differ diff --git a/gallery/cli-audit-session/storyboard.png b/gallery/cli-audit-session/storyboard.png index 4f9650a..a615eed 100644 Binary files a/gallery/cli-audit-session/storyboard.png and b/gallery/cli-audit-session/storyboard.png differ diff --git a/gallery/deep-sea-orbits/audit.json b/gallery/deep-sea-orbits/audit.json index 5568293..b806cb4 100644 --- a/gallery/deep-sea-orbits/audit.json +++ b/gallery/deep-sea-orbits/audit.json @@ -3,11 +3,11 @@ "title": "Abyssal Bioluminescence (Particle Orbit)", "mode": "ambient", "pass": true, - "seamScore": 0.974, + "seamScore": 0.972, "duplicateFrames": 0, "flickerScore": 0.024, "legiblePass": true, "sourcesPass": true, - "gifKB": 1173.2, + "gifKB": 1247.8, "totalFrames": 80 } diff --git a/gallery/deep-sea-orbits/loop.gif b/gallery/deep-sea-orbits/loop.gif index 35c8ff0..cb945b7 100644 Binary files a/gallery/deep-sea-orbits/loop.gif and b/gallery/deep-sea-orbits/loop.gif differ diff --git a/gallery/deep-sea-orbits/poster.png b/gallery/deep-sea-orbits/poster.png index f0d90cf..4414e28 100644 Binary files a/gallery/deep-sea-orbits/poster.png and b/gallery/deep-sea-orbits/poster.png differ diff --git a/gallery/deep-sea-orbits/seam.json b/gallery/deep-sea-orbits/seam.json index ee63085..d7defbc 100644 --- a/gallery/deep-sea-orbits/seam.json +++ b/gallery/deep-sea-orbits/seam.json @@ -1,95 +1,95 @@ { "pass": true, "totalFrames": 80, - "seamScore": 0.974, + "seamScore": 0.972, "maxSeamScore": 1.5, "duplicateFrames": 0, "duplicatePairs": [], "flickerScore": 0.024, "maxFlickerScore": 2.5, - "medianStepDelta": 0.125274, - "seamStepDelta": 0.121981, + "medianStepDelta": 0.128576, + "seamStepDelta": 0.125015, "normalizedSteps": [ - 0.971, - 0.948, 0.969, - 0.962, - 0.965, + 0.945, 0.967, - 0.982, - 0.971, - 0.955, - 0.989, - 0.985, + 0.96, + 0.963, + 0.965, 0.98, - 0.999, - 0.986, - 0.995, - 1.001, + 0.97, + 0.954, + 0.987, + 0.983, + 0.98, + 0.998, + 0.984, + 0.994, + 1, 1.014, - 1.009, + 1.008, 0.993, - 1.022, - 1.019, + 1.021, + 1.018, 1.013, - 1.028, - 1.015, - 1.029, - 1.02, - 1.035, - 1.028, - 1.023, 1.029, + 1.016, + 1.03, + 1.021, 1.037, 1.03, + 1.024, + 1.031, 1.039, - 1.029, - 1.036, - 1.035, - 1.042, - 1.036, - 1.034, - 1.042, - 1.046, - 1.044, - 1.047, - 1.034, - 1.036, + 1.032, 1.041, - 1.042, - 1.036, - 1.019, - 1.019, - 1.027, 1.03, + 1.038, + 1.037, + 1.044, + 1.039, + 1.037, + 1.046, + 1.049, + 1.048, + 1.05, + 1.036, + 1.038, + 1.044, + 1.046, + 1.039, 1.022, - 0.998, - 0.995, - 1.01, 1.021, + 1.029, + 1.032, + 1.023, 0.999, - 0.983, 0.996, + 1.011, + 1.022, 1, - 1, - 0.993, - 0.987, - 0.988, + 0.984, + 0.996, + 1.001, + 0.999, 0.992, - 1, + 0.987, + 0.987, + 0.991, + 0.998, + 0.974, + 0.964, + 0.984, 0.975, - 0.965, - 0.985, - 0.976, - 0.957, - 0.961, + 0.956, 0.961, 0.96, + 0.96, + 0.961, + 0.974, 0.962, - 0.975, - 0.963, - 0.941, - 0.974 + 0.939, + 0.972 ], "reasons": [] } diff --git a/gallery/deep-sea-orbits/sheet.png b/gallery/deep-sea-orbits/sheet.png index 40c947a..15b5a82 100644 Binary files a/gallery/deep-sea-orbits/sheet.png and b/gallery/deep-sea-orbits/sheet.png differ diff --git a/gallery/loop-studio/audit.json b/gallery/loop-studio/audit.json index 40d20f2..7915885 100644 --- a/gallery/loop-studio/audit.json +++ b/gallery/loop-studio/audit.json @@ -3,11 +3,11 @@ "title": "Loop Studio Showcase (Flow Pipeline)", "mode": "showcase", "pass": true, - "seamScore": 1.066, + "seamScore": 1.032, "duplicateFrames": 0, - "flickerScore": 0.307, + "flickerScore": 0.745, "legiblePass": true, "sourcesPass": true, - "gifKB": 779.9, + "gifKB": 3924.5, "totalFrames": 160 } diff --git a/gallery/loop-studio/legible.json b/gallery/loop-studio/legible.json index 4b33cf0..f624d5f 100644 --- a/gallery/loop-studio/legible.json +++ b/gallery/loop-studio/legible.json @@ -1,7 +1,7 @@ { "pass": true, "width": 800, - "height": 320, + "height": 360, "phoneWidth": 400, "frame0ShowsAllStageLabels": true, "stageLabelsChecked": 4, @@ -14,9 +14,9 @@ "windowSeconds": 2.5, "requiredSeconds": 2.3, "passReadingTime": true, - "contrastRatio": 14.25, + "contrastRatio": 14.23, "passContrast": true, - "minEdgeMarginPx": 44, + "minEdgeMarginPx": 39, "phoneFontPx": 6.5, "passMobileWidth": true, "pass": true @@ -29,9 +29,9 @@ "windowSeconds": 2.5, "requiredSeconds": 2.3, "passReadingTime": true, - "contrastRatio": 14.25, + "contrastRatio": 14.23, "passContrast": true, - "minEdgeMarginPx": 44, + "minEdgeMarginPx": 39, "phoneFontPx": 6.5, "passMobileWidth": true, "pass": true @@ -44,9 +44,9 @@ "windowSeconds": 2.5, "requiredSeconds": 2, "passReadingTime": true, - "contrastRatio": 14.25, + "contrastRatio": 14.23, "passContrast": true, - "minEdgeMarginPx": 44, + "minEdgeMarginPx": 39, "phoneFontPx": 6.5, "passMobileWidth": true, "pass": true @@ -59,9 +59,9 @@ "windowSeconds": 2.5, "requiredSeconds": 2, "passReadingTime": true, - "contrastRatio": 14.25, + "contrastRatio": 14.23, "passContrast": true, - "minEdgeMarginPx": 44, + "minEdgeMarginPx": 39, "phoneFontPx": 6.5, "passMobileWidth": true, "pass": true diff --git a/gallery/loop-studio/loop.gif b/gallery/loop-studio/loop.gif index 8203325..4bec59b 100644 Binary files a/gallery/loop-studio/loop.gif and b/gallery/loop-studio/loop.gif differ diff --git a/gallery/loop-studio/poster.png b/gallery/loop-studio/poster.png index 15c2a64..292ee22 100644 Binary files a/gallery/loop-studio/poster.png and b/gallery/loop-studio/poster.png differ diff --git a/gallery/loop-studio/seam.json b/gallery/loop-studio/seam.json index 3f535ea..98c23e9 100644 --- a/gallery/loop-studio/seam.json +++ b/gallery/loop-studio/seam.json @@ -1,175 +1,175 @@ { "pass": true, "totalFrames": 160, - "seamScore": 1.066, + "seamScore": 1.032, "maxSeamScore": 1.5, "duplicateFrames": 0, "duplicatePairs": [], - "flickerScore": 0.307, + "flickerScore": 0.745, "maxFlickerScore": 2.5, - "medianStepDelta": 0.017591, - "seamStepDelta": 0.018748, + "medianStepDelta": 0.027129, + "seamStepDelta": 0.028011, "normalizedSteps": [ - 1.349, - 1.069, - 1.032, 1.02, - 1, - 1.009, - 0.974, - 0.955, + 1.032, + 1.023, + 1.011, + 1.019, + 1.013, + 1.001, + 0.987, + 1.001, + 0.97, + 0.959, + 0.956, + 0.917, + 0.895, 0.929, - 0.918, - 0.869, - 0.835, - 0.795, - 0.756, - 0.772, - 0.882, - 0.835, - 0.804, - 0.651, - 0.82, - 0.365, - 0.712, - 0.791, + 0.942, + 0.907, + 0.889, + 0.846, + 0.981, 0.84, - 0.877, - 0.803, - 0.774, - 0.803, - 0.855, - 0.908, - 0.911, - 0.932, - 0.955, - 0.985, - 0.984, - 0.999, - 1.068, - 1.085, - 1.355, - 1.07, - 1.08, - 1.387, - 1.09, - 1.093, - 1.035, - 1.044, + 0.868, + 0.913, + 0.922, + 0.953, + 0.921, + 0.931, + 0.966, + 0.962, + 0.976, + 1, + 1, + 1.011, + 1.016, + 1.021, + 1.018, + 1.034, + 1.779, + 1.028, + 1.124, + 1.139, + 1.028, + 1.784, + 1.026, + 1.026, + 1.008, + 1.002, 1.012, - 0.995, + 0.992, + 0.982, 0.965, - 0.958, - 0.913, - 0.88, - 0.836, - 0.812, - 0.775, - 0.869, - 0.831, - 0.812, - 0.676, - 0.787, - 0.356, - 0.733, - 0.814, - 0.852, - 0.887, - 0.812, - 0.785, - 0.836, - 0.877, - 0.936, - 0.944, + 0.968, + 0.949, + 0.94, + 0.914, + 0.928, + 0.925, + 0.922, + 0.87, + 0.966, + 0.85, + 0.871, + 0.926, + 0.928, + 0.927, + 0.916, + 0.929, + 0.949, + 0.97, 0.971, 0.985, - 1.03, - 1.028, - 1.039, - 1.097, - 1.102, - 1.369, - 1.08, - 1.073, - 1.37, - 1.063, - 1.071, 1, - 1.008, - 0.97, - 0.947, - 0.934, - 0.928, - 0.881, - 0.867, - 0.861, - 0.891, + 1, + 1.013, + 1.02, + 1.016, + 1.025, + 1.657, + 1.025, + 1.104, + 1.126, + 1.034, + 1.78, + 1.024, + 1.031, + 1.021, + 1.002, + 0.989, + 0.99, + 0.958, + 0.95, + 1.032, + 0.936, 0.93, - 1.075, - 1.01, - 0.994, + 0.953, + 0.975, + 0.962, + 0.952, + 0.903, + 1.02, 0.857, - 0.941, - 0.543, - 0.862, - 0.974, + 0.896, + 0.945, + 0.96, + 0.992, + 0.969, + 0.994, + 1.003, + 1.004, + 1.011, + 1.032, + 1.03, + 1.039, 1.041, - 1.092, - 1.073, - 1.058, - 1.079, - 1.12, - 1.157, - 1.149, - 1.169, - 1.192, - 1.215, - 1.221, - 1.221, - 1.267, - 1.292, - 1.522, - 1.277, - 1.288, - 1.547, - 1.308, - 1.296, - 1.244, - 1.259, - 1.22, - 1.224, - 1.207, - 1.213, - 1.176, - 1.139, - 1.103, - 1.082, - 1.061, - 1.096, - 1.034, + 1.047, + 1.048, + 1.054, + 1.771, + 1.052, + 1.144, + 1.142, + 1.053, + 1.674, + 1.056, + 1.055, + 1.043, + 1.035, + 1.047, + 1.031, + 1.023, + 1.012, + 1.014, + 0.999, + 0.98, 0.977, - 0.839, - 0.884, - 0.657, - 1.219, - 1.42, - 1.559, - 1.648, - 1.626, - 1.569, - 1.765, - 1.495, - 1.434, - 1.288, - 1.091, - 0.964, - 0.808, - 0.767, - 0.941, - 1.092, - 1.109, - 1.075, - 1.066 + 0.98, + 0.972, + 0.961, + 0.898, + 0.983, + 0.869, + 0.973, + 1.043, + 1.055, + 1.096, + 1.094, + 1.097, + 1.078, + 1.074, + 1.137, + 1.76, + 1.035, + 0.986, + 0.969, + 1.739, + 0.987, + 1.115, + 1.03, + 1.013, + 1.032 ], "reasons": [] } diff --git a/gallery/loop-studio/sheet.png b/gallery/loop-studio/sheet.png index 12a60cf..8279bf3 100644 Binary files a/gallery/loop-studio/sheet.png and b/gallery/loop-studio/sheet.png differ diff --git a/gallery/loop-studio/showcase.gif b/gallery/loop-studio/showcase.gif index 8203325..4bec59b 100644 Binary files a/gallery/loop-studio/showcase.gif and b/gallery/loop-studio/showcase.gif differ diff --git a/gallery/loop-studio/showcase.json b/gallery/loop-studio/showcase.json index 8706363..8bcbbfc 100644 --- a/gallery/loop-studio/showcase.json +++ b/gallery/loop-studio/showcase.json @@ -4,7 +4,7 @@ "seconds": 10, "fps": 16, "width": 800, - "height": 320, + "height": 360, "palette": "studio-dark", "scene": "flow", "stage": [ diff --git a/gallery/loop-studio/sketch.js b/gallery/loop-studio/sketch.js index ddf886e..a7e26a6 100644 --- a/gallery/loop-studio/sketch.js +++ b/gallery/loop-studio/sketch.js @@ -1,11 +1,11 @@ -// Scene Pack: flow — Fixed stage boxes with continuous rail handover +// Scene Pack: flow — Visual 4-Stage Studio Pipeline with Live Mini-Canvas, Seam Chart & Rail Handover export const meta = { mode: "showcase", scene: "flow", seconds: 10, fps: 16, width: 800, - height: 320, + height: 360, seed: 11, palette: "studio-dark" }; @@ -27,33 +27,31 @@ function ease(x) { return x <= 0 ? 0 : x >= 1 ? 1 : x * x * (3 - 2 * x); } -// Smooth continuous item travel + slow drift through each node so motion never freezes function placeItem(age, xs, W) { - const left = -0.06 * W; - const right = 1.06 * W; - const pad = 12; + const left = -0.05 * W; + const right = 1.05 * W; let x = left; let alpha = 1; if (age < 2.5) { x = left + (xs[0] - left) * ease(age / 2.5); } else if (age < 5.0) { const u = (age - 2.5) / 2.5; - x = xs[0] + (xs[1] - xs[0]) * (0.15 * u + 0.85 * ease(u)); + x = xs[0] + (xs[1] - xs[0]) * (0.18 * u + 0.82 * ease(u)); } else if (age < 7.5) { const u = (age - 5.0) / 2.5; - x = xs[1] + (xs[2] - xs[1]) * (0.15 * u + 0.85 * ease(u)); + x = xs[1] + (xs[2] - xs[1]) * (0.18 * u + 0.82 * ease(u)); } else if (age < 10.0) { const u = (age - 7.5) / 2.5; - x = xs[2] + (xs[3] - xs[2]) * (0.15 * u + 0.85 * ease(u)); + x = xs[2] + (xs[3] - xs[2]) * (0.18 * u + 0.82 * ease(u)); } else { const e = ease((age - 10.0) / 1.25); - x = xs[3] + (right - xs[3] + pad) * e; + x = xs[3] + (right - xs[3]) * e; alpha = 1 - e; } return { x, alpha, - checked: ease((age - 6.8) / 0.8) + checked: ease((age - 6.6) / 0.8) }; } @@ -67,102 +65,289 @@ export function render(ctx, phase, kit) { const SECONDS = S.seconds || meta.seconds; const t = phase * SECONDS; const TAU = Math.PI * 2; + const cyan = "#00E5B0"; + // 1. Depth Layer 1: Radial gradient ground + harmonic wave dot lattice ctx.globalAlpha = 1; - ctx.fillStyle = C.ground; + if (ctx.createRadialGradient) { + const bgGrad = ctx.createRadialGradient(W * 0.5, H * 0.42, 20, W * 0.5, H * 0.5, W * 0.65); + bgGrad.addColorStop(0, "#131930"); + bgGrad.addColorStop(1, C.ground); + ctx.fillStyle = bgGrad; + } else { + ctx.fillStyle = C.ground; + } ctx.fillRect(0, 0, W, H); - const count = labels.length; - const margin = W * 0.055; - const gap = W * 0.032; - const bw = Math.min(W * 0.195, (W - 2 * margin - (count - 1) * gap) / count); - const bh = Math.round(H * 0.17); - const totalW = count * bw + (count - 1) * gap; - const x0 = (W - totalW) / 2; - const by = Math.round(H * 0.29); - const railY = Math.round(H * 0.58); - const capY = Math.round(H * 0.84); - - const xs = labels.map((_, i) => x0 + i * (bw + gap) + bw / 2); + const gCols = 20; + const gRows = 9; + const cellW = W / gCols; + const cellH = H / gRows; + for (let r = 0; r < gRows; r++) { + for (let c = 0; c < gCols; c++) { + const gx = (c + 0.5) * cellW; + const gy = (r + 0.5) * cellH; + const dx = (gx - W * 0.5) / (W * 0.5); + const dy = (gy - H * 0.42) / (H * 0.5); + const dist = Math.sqrt(dx * dx + dy * dy); + const wave = 0.5 + 0.5 * Math.sin(TAU * (phase - dist * 1.2)); + ctx.globalAlpha = 0.08 + 0.16 * wave; + ctx.fillStyle = wave > 0.72 ? C.spark : C.line; + ctx.beginPath(); + ctx.arc(gx, gy, 1.2 + 1.4 * wave, 0, TAU); + ctx.fill(); + } + } + + // 2. Depth Layer 2: 4 Visual Studio Stage Cards + const count = 4; + const margin = W * 0.042; + const gap = W * 0.024; + const bw = (W - 2 * margin - (count - 1) * gap) / count; + const bh = Math.round(H * 0.48); + const by = Math.round(H * 0.30); + const railY = Math.round(H * 0.68); + const capY = Math.round(H * 0.87); + + const xs = [0, 1, 2, 3].map((i) => margin + i * (bw + gap) + bw / 2); const items = [placeItem(t + 1.25, xs, W)]; if (t >= 8.75) items.push(placeItem(t - 8.75, xs, W)); - // Transport rail + subtle travelling carrier ticks (keeps frame-to-frame delta steady) + // Transport rail + glowing carrier stream ctx.globalAlpha = 1; ctx.strokeStyle = C.line; - ctx.lineWidth = 2; + ctx.lineWidth = 2.5; ctx.beginPath(); ctx.moveTo(0, railY); ctx.lineTo(W, railY); ctx.stroke(); - const tickCount = 16; - const tickSpacing = W / tickCount; - const tickShift = (phase * 4 * tickSpacing) % tickSpacing; - ctx.fillStyle = C.muted; - ctx.globalAlpha = 0.35; - for (let i = 0; i <= tickCount; i++) { - const tx = i * tickSpacing + tickShift; - ctx.fillRect(tx - 2, railY - 2, 4, 4); + const streamCount = 18; + const streamSpace = W / streamCount; + const streamShift = (phase * 3 * streamSpace) % streamSpace; + for (let i = 0; i <= streamCount; i++) { + const sx = i * streamSpace + streamShift; + ctx.globalAlpha = 0.45; + ctx.fillStyle = i % 2 === 0 ? C.spark : C.accent; + ctx.beginPath(); + ctx.arc(sx, railY, 2.2, 0, TAU); + ctx.fill(); } - // Stage boxes & vertical stems - ctx.font = "600 13px monospace"; - ctx.textAlign = "center"; - ctx.textBaseline = "middle"; + const stepHeaders = ["01 BRIEF", "02 SKETCH", "03 SEAM", "04 EXPORT"]; xs.forEach((cx, i) => { let near = 0; items.forEach((it) => { - near = Math.max(near, it.alpha * Math.max(0, 1 - Math.abs(it.x - cx) / (bw * 0.75))); + near = Math.max(near, it.alpha * Math.max(0, 1 - Math.abs(it.x - cx) / (bw * 0.78))); }); + const cardLeft = cx - bw / 2; + const cardTop = by - bh / 2; + const activeColor = i === 2 ? cyan : i === 3 ? C.spark : C.accent; + + // Vertical connector stem from card to rail ctx.globalAlpha = 1; - ctx.strokeStyle = near > 0.3 ? C.accent : C.line; - ctx.lineWidth = 2; + ctx.strokeStyle = near > 0.25 ? activeColor : C.line; + ctx.lineWidth = near > 0.25 ? 2.5 : 1.5; ctx.beginPath(); - ctx.moveTo(cx, by + bh / 2); + ctx.moveTo(cx, cardTop + bh); ctx.lineTo(cx, railY); ctx.stroke(); - kit.roundRect(ctx, cx - bw / 2, by - bh / 2, bw, bh, 8); - ctx.globalAlpha = 1; + // Node socket on rail + ctx.fillStyle = near > 0.25 ? activeColor : C.surface; + ctx.beginPath(); + ctx.arc(cx, railY, 4.5, 0, TAU); + ctx.fill(); + ctx.strokeStyle = activeColor; + ctx.lineWidth = 1.5; + ctx.stroke(); + + // Card surface + kit.roundRect(ctx, cardLeft, cardTop, bw, bh, 10); + ctx.globalAlpha = 0.96; ctx.fillStyle = C.surface; ctx.fill(); - if (near > 0.01) { - ctx.globalAlpha = 0.22 * near; - ctx.fillStyle = i >= 2 ? C.spark : C.accent; + // Subtle active header tint + if (near > 0.02) { + ctx.globalAlpha = 0.16 * near; + ctx.fillStyle = activeColor; ctx.fill(); } ctx.globalAlpha = 1; + ctx.strokeStyle = near > 0.15 ? activeColor : C.line; + ctx.lineWidth = near > 0.15 ? 2.2 : 1.4; + ctx.stroke(); + + // Card header bar divider + const headH = Math.round(bh * 0.24); ctx.strokeStyle = C.line; - ctx.lineWidth = 1.5; + ctx.lineWidth = 1; + ctx.beginPath(); + ctx.moveTo(cardLeft + 1, cardTop + headH); + ctx.lineTo(cardLeft + bw - 1, cardTop + headH); ctx.stroke(); - if (near > 0.01) { - ctx.globalAlpha = near; - ctx.strokeStyle = i >= 2 ? C.spark : C.accent; + // Card header step tag + primary stage label (kept for Frame-0 legibility check) + ctx.font = "600 10px monospace"; + ctx.fillStyle = activeColor; + ctx.textAlign = "left"; + ctx.textBaseline = "middle"; + ctx.fillText(stepHeaders[i], cardLeft + 10, cardTop + headH * 0.5); + + ctx.font = "700 12px monospace"; + ctx.fillStyle = C.body; + ctx.textAlign = "right"; + ctx.fillText(labels[i], cardLeft + bw - 10, cardTop + headH * 0.5); + + // Rich visual interior per stage card! + const innerY = cardTop + headH + (bh - headH) * 0.5; + + if (i === 0) { + // Card 1: Prompt lines + live rotating Phase Ring (0 -> 1) + const ringX = cardLeft + bw * 0.28; + const ringR = Math.min(bw, bh) * 0.19; + ctx.strokeStyle = C.line; + ctx.lineWidth = 2; + ctx.beginPath(); + ctx.arc(ringX, innerY, ringR, 0, TAU); + ctx.stroke(); + + const pAng = phase * TAU - Math.PI / 2; + ctx.strokeStyle = C.accent; + ctx.lineWidth = 2.5; + ctx.beginPath(); + ctx.arc(ringX, innerY, ringR, pAng - 1.8, pAng); + ctx.stroke(); + + ctx.fillStyle = C.spark; + ctx.beginPath(); + ctx.arc(ringX + Math.cos(pAng) * ringR, innerY + Math.sin(pAng) * ringR, 3.8, 0, TAU); + ctx.fill(); + + // Prompt spec bars on right half of Card 1 + const tx0 = cardLeft + bw * 0.52; + ctx.font = "500 10px monospace"; + ctx.fillStyle = C.muted; + ctx.textAlign = "left"; + ctx.fillText("4s · 30fps", tx0, innerY - 14); + ctx.fillStyle = C.body; + ctx.fillText("phase 0→1", tx0, innerY + 3); + ctx.fillStyle = cyan; + ctx.fillText("seed: 7", tx0, innerY + 19); + } else if (i === 1) { + // Card 2: Live Miniature Bioluminescent Particle-Orbit Sketch Viewport! + const vpW = bw - 20; + const vpH = bh - headH - 16; + const vpX = cardLeft + 10; + const vpY = cardTop + headH + 8; + kit.roundRect(ctx, vpX, vpY, vpW, vpH, 6); + ctx.fillStyle = "#060913"; + ctx.fill(); + + // 2 nested glowing orbits inside mini canvas + for (let ring = 1; ring <= 2; ring++) { + const rx = vpW * (0.18 * ring); + const ry = vpH * (0.21 * ring); + const dots = 6 + ring * 4; + const dir = ring === 1 ? 1 : -2; + for (let d = 0; d < dots; d++) { + const a = TAU * ((phase * dir + d / dots) % 1); + const px = cx + Math.cos(a) * rx; + const py = innerY + Math.sin(a) * ry; + ctx.globalAlpha = 0.45 + 0.55 * (0.5 + 0.5 * Math.sin(a)); + ctx.fillStyle = d % 3 === 0 ? cyan : d % 2 === 0 ? C.spark : C.accent; + ctx.beginPath(); + ctx.arc(px, py, d % 3 === 0 ? 3.2 : 2.2, 0, TAU); + ctx.fill(); + } + } + ctx.globalAlpha = 1; + ctx.fillStyle = cyan; + ctx.beginPath(); + ctx.arc(cx, innerY, 4.5 + 1.5 * Math.sin(TAU * phase * 2), 0, TAU); + ctx.fill(); + } else if (i === 2) { + // Card 3: Live Seam Check Bar Chart (1.02x PASS) + const bars = [1.0, 0.94, 1.05, 0.98, 1.02, 0.96, 1.04, 0.99, 1.03]; + const chartLeft = cardLeft + 14; + const chartBase = cardTop + bh - 14; + const barStep = (bw - 28) / bars.length; + const unitH = (bh - headH - 36) * 0.55; + + bars.forEach((v, bIdx) => { + const isLast = bIdx === bars.length - 1; + const wave = 1 + 0.08 * Math.sin(TAU * (phase * 2 - bIdx / bars.length)); + const hBar = v * unitH * wave; + ctx.globalAlpha = isLast ? 1 : 0.65; + ctx.fillStyle = isLast ? cyan : C.spark; + ctx.fillRect(chartLeft + bIdx * barStep, chartBase - hBar, Math.max(4, barStep - 4), hBar); + }); + + // Median 1.0x reference line + ctx.globalAlpha = 0.9; + ctx.strokeStyle = C.accent; + ctx.lineWidth = 1.2; + ctx.beginPath(); + ctx.moveTo(chartLeft, chartBase - unitH); + ctx.lineTo(cardLeft + bw - 14, chartBase - unitH); + ctx.stroke(); + + ctx.globalAlpha = 1; + ctx.font = "600 10px monospace"; + ctx.fillStyle = cyan; + ctx.textAlign = "left"; + ctx.fillText("1.02x PASS", chartLeft, cardTop + headH + 14); + } else if (i === 3) { + // Card 4: Verified Infinite Loop Lissajous Figure + Format Badges + const lissY = innerY - 8; + const rx = bw * 0.30; + const ry = (bh - headH) * 0.24; + ctx.strokeStyle = C.spark; ctx.lineWidth = 2.2; + ctx.beginPath(); + for (let s = 0; s <= 40; s++) { + const u = (s / 40) * TAU; + const lx = cx + Math.sin(u) * rx; + const ly = lissY + Math.sin(u * 2) * ry; + if (s === 0) ctx.moveTo(lx, ly); + else ctx.lineTo(lx, ly); + } ctx.stroke(); - } - ctx.globalAlpha = 1; - ctx.fillStyle = C.body; - ctx.fillText(labels[i], cx, by); + // Travelling spark along the infinity loop + const sparkU = phase * TAU; + const sx = cx + Math.sin(sparkU) * rx; + const sy = lissY + Math.sin(sparkU * 2) * ry; + ctx.fillStyle = cyan; + ctx.beginPath(); + ctx.arc(sx, sy, 4.5, 0, TAU); + ctx.fill(); + + ctx.font = "600 10px monospace"; + ctx.fillStyle = C.body; + ctx.textAlign = "center"; + ctx.fillText("GIF · MP4 · PNG", cx, cardTop + bh - 14); + } }); - // Moving payload orbs along rail + // 3. Depth Layer 3: Moving payload orbs along the transport rail items.forEach((it) => { - const r = Math.max(7, Math.round(H * 0.036)); - const pulse = 1 + 0.15 * Math.sin(TAU * phase * 2); - ctx.globalAlpha = it.alpha * 0.26; - ctx.fillStyle = it.checked > 0.5 ? C.spark : C.accent; + const r = Math.max(8, Math.round(H * 0.036)); + const pulse = 1 + 0.16 * Math.sin(TAU * phase * 2); + const col = it.checked > 0.5 ? cyan : C.accent; + + // Outer glow halo + ctx.globalAlpha = it.alpha * 0.28; + ctx.fillStyle = col; ctx.beginPath(); - ctx.arc(it.x, railY, r * 1.45 * pulse, 0, TAU); + ctx.arc(it.x, railY, r * 1.65 * pulse, 0, TAU); ctx.fill(); + // Inner orb ctx.globalAlpha = it.alpha; ctx.fillStyle = C.accent; ctx.beginPath(); @@ -171,31 +356,48 @@ export function render(ctx, phase, kit) { if (it.checked > 0) { ctx.globalAlpha = it.alpha * it.checked; - ctx.fillStyle = C.spark; + ctx.fillStyle = cyan; ctx.beginPath(); ctx.arc(it.x, railY, r, 0, TAU); ctx.fill(); ctx.strokeStyle = C.ground; - ctx.lineWidth = 2; + ctx.lineWidth = 2.2; ctx.beginPath(); ctx.moveTo(it.x - r * 0.42, railY); - ctx.lineTo(it.x - r * 0.1, railY + r * 0.35); - ctx.lineTo(it.x + r * 0.48, railY - r * 0.35); + ctx.lineTo(it.x - r * 0.08, railY + r * 0.36); + ctx.lineTo(it.x + r * 0.48, railY - r * 0.36); ctx.stroke(); } }); - // Caption bar at bottom (fixed pill + smooth text fade) - const pillW = Math.round(W * 0.62); - kit.roundRect(ctx, W / 2 - pillW / 2, capY - 16, pillW, 32, 6); - ctx.globalAlpha = 0.95; + // 4. Bottom Caption Pill + Step Progress Dots + const pillW = Math.round(W * 0.64); + const pillH = 34; + kit.roundRect(ctx, W / 2 - pillW / 2, capY - pillH / 2, pillW, pillH, 8); + ctx.globalAlpha = 0.96; ctx.fillStyle = C.surface; ctx.fill(); ctx.strokeStyle = C.line; - ctx.lineWidth = 1; + ctx.lineWidth = 1.5; ctx.stroke(); + let activeStepIdx = 0; + steps.forEach((c, idx) => { + const len = ((c.to - c.from) % SECONDS + SECONDS) % SECONDS || SECONDS; + const u = ((t - c.from) % SECONDS + SECONDS) % SECONDS; + if (u < len) activeStepIdx = idx; + }); + + // Step indicator dots on left of pill + for (let d = 0; d < steps.length; d++) { + ctx.globalAlpha = 1; + ctx.fillStyle = d === activeStepIdx ? cyan : C.line; + ctx.beginPath(); + ctx.arc(W / 2 - pillW / 2 + 18 + d * 11, capY, d === activeStepIdx ? 3.8 : 2.6, 0, TAU); + ctx.fill(); + } + ctx.font = "500 13px monospace"; ctx.textAlign = "center"; ctx.textBaseline = "middle"; @@ -204,10 +406,10 @@ export function render(ctx, phase, kit) { const len = ((c.to - c.from) % SECONDS + SECONDS) % SECONDS || SECONDS; const u = ((t - c.from) % SECONDS + SECONDS) % SECONDS; if (u >= len) return; - const fade = Math.max(0.2, Math.min(1, u / 0.35, (len - u) / 0.35)); + const fade = Math.max(0.25, Math.min(1, u / 0.35, (len - u) / 0.35)); ctx.globalAlpha = fade; ctx.fillStyle = C.body; - ctx.fillText(c.caption, W / 2, capY); + ctx.fillText(c.caption, W / 2 + 16, capY); }); ctx.globalAlpha = 1; diff --git a/gallery/loop-studio/storyboard.png b/gallery/loop-studio/storyboard.png index d3cd776..8c6a4f4 100644 Binary files a/gallery/loop-studio/storyboard.png and b/gallery/loop-studio/storyboard.png differ diff --git a/gallery/manifest.json b/gallery/manifest.json index fe7bbbc..744227f 100644 --- a/gallery/manifest.json +++ b/gallery/manifest.json @@ -1,17 +1,17 @@ { - "generatedAt": "2026-11-18T16:19:41.106Z", + "generatedAt": "2026-11-18T16:52:10.718Z", "items": [ { "id": "loop-studio", "title": "Loop Studio Showcase (Flow Pipeline)", "mode": "showcase", "pass": true, - "seamScore": 1.066, + "seamScore": 1.032, "duplicateFrames": 0, - "flickerScore": 0.307, + "flickerScore": 0.745, "legiblePass": true, "sourcesPass": true, - "gifKB": 779.9, + "gifKB": 3924.5, "totalFrames": 160 }, { @@ -19,12 +19,12 @@ "title": "Loop CLI Audit Showcase (Terminal)", "mode": "showcase", "pass": true, - "seamScore": 0.998, + "seamScore": 0.989, "duplicateFrames": 0, - "flickerScore": 1.366, + "flickerScore": 0.89, "legiblePass": true, "sourcesPass": true, - "gifKB": 805, + "gifKB": 1371.6, "totalFrames": 160 }, { @@ -32,12 +32,12 @@ "title": "Abyssal Bioluminescence (Particle Orbit)", "mode": "ambient", "pass": true, - "seamScore": 0.974, + "seamScore": 0.972, "duplicateFrames": 0, "flickerScore": 0.024, "legiblePass": true, "sourcesPass": true, - "gifKB": 1173.2, + "gifKB": 1247.8, "totalFrames": 80 }, { @@ -45,12 +45,12 @@ "title": "Arctic Currents (Flow Field)", "mode": "ambient", "pass": true, - "seamScore": 1.013, + "seamScore": 1.037, "duplicateFrames": 0, - "flickerScore": 0.025, + "flickerScore": 0.028, "legiblePass": true, "sourcesPass": true, - "gifKB": 1674.1, + "gifKB": 3076.4, "totalFrames": 80 }, { @@ -58,12 +58,12 @@ "title": "Harmonic Architecture (Isometric Grid)", "mode": "ambient", "pass": true, - "seamScore": 0.946, + "seamScore": 0.927, "duplicateFrames": 0, - "flickerScore": 0.1, + "flickerScore": 0.169, "legiblePass": true, "sourcesPass": true, - "gifKB": 326.7, + "gifKB": 786.9, "totalFrames": 80 }, { @@ -71,12 +71,12 @@ "title": "Epicyclic Telemetry (Blueprint CAD)", "mode": "ambient", "pass": true, - "seamScore": 1.016, + "seamScore": 1.023, "duplicateFrames": 0, "flickerScore": 0.031, "legiblePass": true, "sourcesPass": true, - "gifKB": 762.6, + "gifKB": 1193.9, "totalFrames": 80 } ] diff --git a/gallery/nordic-isometric/audit.json b/gallery/nordic-isometric/audit.json index c05aceb..a9471ff 100644 --- a/gallery/nordic-isometric/audit.json +++ b/gallery/nordic-isometric/audit.json @@ -3,11 +3,11 @@ "title": "Harmonic Architecture (Isometric Grid)", "mode": "ambient", "pass": true, - "seamScore": 0.946, + "seamScore": 0.927, "duplicateFrames": 0, - "flickerScore": 0.1, + "flickerScore": 0.169, "legiblePass": true, "sourcesPass": true, - "gifKB": 326.7, + "gifKB": 786.9, "totalFrames": 80 } diff --git a/gallery/nordic-isometric/loop.gif b/gallery/nordic-isometric/loop.gif index 3d634ce..2823495 100644 Binary files a/gallery/nordic-isometric/loop.gif and b/gallery/nordic-isometric/loop.gif differ diff --git a/gallery/nordic-isometric/poster.png b/gallery/nordic-isometric/poster.png index f51498e..39cd807 100644 Binary files a/gallery/nordic-isometric/poster.png and b/gallery/nordic-isometric/poster.png differ diff --git a/gallery/nordic-isometric/seam.json b/gallery/nordic-isometric/seam.json index 1239877..e477267 100644 --- a/gallery/nordic-isometric/seam.json +++ b/gallery/nordic-isometric/seam.json @@ -1,95 +1,95 @@ { "pass": true, "totalFrames": 80, - "seamScore": 0.946, + "seamScore": 0.927, "maxSeamScore": 1.5, "duplicateFrames": 0, "duplicatePairs": [], - "flickerScore": 0.1, + "flickerScore": 0.169, "maxFlickerScore": 2.5, - "medianStepDelta": 0.09538, - "seamStepDelta": 0.090264, + "medianStepDelta": 0.06643, + "seamStepDelta": 0.061572, "normalizedSteps": [ - 0.92, - 0.908, - 0.902, - 1.002, - 0.911, - 0.941, - 0.931, - 0.921, - 0.932, - 0.959, - 0.977, - 0.935, + 0.898, + 0.886, + 0.891, + 1.06, + 0.905, + 0.919, 0.945, - 1, - 1.055, + 0.927, + 0.933, 0.948, - 0.964, + 0.981, + 0.921, + 0.93, + 1, + 1.13, 0.955, - 0.988, - 1.039, - 1.033, - 1.018, - 1.02, - 1.01, - 1.092, + 0.968, + 0.964, + 0.995, + 1.084, + 1.067, + 1.029, + 1.037, + 1.03, + 1.175, + 1.157, + 1.09, + 1.088, + 1.157, + 1.157, + 1.107, + 1.102, 1.089, - 1.036, - 1.051, - 1.081, - 1.097, - 1.068, - 1.071, - 1.054, - 1.076, - 1.071, - 1.134, - 1.078, - 1.145, - 1.118, + 1.094, + 1.09, + 1.197, + 1.086, + 1.169, 1.13, - 1.066, - 1.05, - 1.049, - 1.005, - 1.034, - 0.992, - 0.976, - 0.935, - 0.959, - 1.011, - 0.987, - 0.994, - 1.055, - 1.018, - 1.017, - 1, - 1.02, - 1.013, - 1.071, - 1.044, - 1.075, - 0.969, - 0.949, - 0.958, - 0.935, - 0.887, - 0.889, - 0.89, - 0.886, - 1.042, - 0.958, - 0.933, - 0.933, - 0.958, - 0.98, - 0.948, + 1.16, + 1.092, + 1.076, + 1.087, + 0.995, + 1.062, + 0.983, + 0.963, + 0.945, + 0.947, + 1.045, 0.958, - 0.999, + 0.983, + 1.083, + 1.001, + 1.024, + 1.028, + 1.034, + 1.021, + 1.101, + 1.036, + 1.132, 0.939, - 0.946 + 0.931, + 0.937, + 0.963, + 0.877, + 0.883, + 0.885, + 0.89, + 1.12, + 0.956, + 0.95, + 0.946, + 0.981, + 0.998, + 0.928, + 0.932, + 1.002, + 0.899, + 0.927 ], "reasons": [] } diff --git a/gallery/nordic-isometric/sheet.png b/gallery/nordic-isometric/sheet.png index 8e0c1b9..2b2d1b8 100644 Binary files a/gallery/nordic-isometric/sheet.png and b/gallery/nordic-isometric/sheet.png differ diff --git a/skills/scenes/flow/template.js b/skills/scenes/flow/template.js index 145bc86..63806f0 100644 --- a/skills/scenes/flow/template.js +++ b/skills/scenes/flow/template.js @@ -1,11 +1,11 @@ -// Scene Pack: flow — Fixed stage boxes with continuous rail handover +// Scene Pack: flow — Visual 4-Stage Studio Pipeline with Live Mini-Canvas, Seam Chart & Rail Handover export const meta = { mode: "showcase", scene: "flow", seconds: 10, - fps: 24, + fps: 20, width: 800, - height: 320, + height: 360, seed: 11, palette: "studio-dark" }; @@ -27,33 +27,31 @@ function ease(x) { return x <= 0 ? 0 : x >= 1 ? 1 : x * x * (3 - 2 * x); } -// Smooth continuous item travel + slow drift through each node so motion never freezes function placeItem(age, xs, W) { - const left = -0.06 * W; - const right = 1.06 * W; - const pad = 12; + const left = -0.05 * W; + const right = 1.05 * W; let x = left; let alpha = 1; if (age < 2.5) { x = left + (xs[0] - left) * ease(age / 2.5); } else if (age < 5.0) { const u = (age - 2.5) / 2.5; - x = xs[0] + (xs[1] - xs[0]) * (0.15 * u + 0.85 * ease(u)); + x = xs[0] + (xs[1] - xs[0]) * (0.18 * u + 0.82 * ease(u)); } else if (age < 7.5) { const u = (age - 5.0) / 2.5; - x = xs[1] + (xs[2] - xs[1]) * (0.15 * u + 0.85 * ease(u)); + x = xs[1] + (xs[2] - xs[1]) * (0.18 * u + 0.82 * ease(u)); } else if (age < 10.0) { const u = (age - 7.5) / 2.5; - x = xs[2] + (xs[3] - xs[2]) * (0.15 * u + 0.85 * ease(u)); + x = xs[2] + (xs[3] - xs[2]) * (0.18 * u + 0.82 * ease(u)); } else { const e = ease((age - 10.0) / 1.25); - x = xs[3] + (right - xs[3] + pad) * e; + x = xs[3] + (right - xs[3]) * e; alpha = 1 - e; } return { x, alpha, - checked: ease((age - 6.8) / 0.8) + checked: ease((age - 6.6) / 0.8) }; } @@ -67,102 +65,289 @@ export function render(ctx, phase, kit) { const SECONDS = S.seconds || meta.seconds; const t = phase * SECONDS; const TAU = Math.PI * 2; + const cyan = "#00E5B0"; + // 1. Depth Layer 1: Radial gradient ground + harmonic wave dot lattice ctx.globalAlpha = 1; - ctx.fillStyle = C.ground; + if (ctx.createRadialGradient) { + const bgGrad = ctx.createRadialGradient(W * 0.5, H * 0.42, 20, W * 0.5, H * 0.5, W * 0.65); + bgGrad.addColorStop(0, "#131930"); + bgGrad.addColorStop(1, C.ground); + ctx.fillStyle = bgGrad; + } else { + ctx.fillStyle = C.ground; + } ctx.fillRect(0, 0, W, H); - const count = labels.length; - const margin = W * 0.055; - const gap = W * 0.032; - const bw = Math.min(W * 0.195, (W - 2 * margin - (count - 1) * gap) / count); - const bh = Math.round(H * 0.17); - const totalW = count * bw + (count - 1) * gap; - const x0 = (W - totalW) / 2; - const by = Math.round(H * 0.29); - const railY = Math.round(H * 0.58); - const capY = Math.round(H * 0.84); - - const xs = labels.map((_, i) => x0 + i * (bw + gap) + bw / 2); + const gCols = 20; + const gRows = 9; + const cellW = W / gCols; + const cellH = H / gRows; + for (let r = 0; r < gRows; r++) { + for (let c = 0; c < gCols; c++) { + const gx = (c + 0.5) * cellW; + const gy = (r + 0.5) * cellH; + const dx = (gx - W * 0.5) / (W * 0.5); + const dy = (gy - H * 0.42) / (H * 0.5); + const dist = Math.sqrt(dx * dx + dy * dy); + const wave = 0.5 + 0.5 * Math.sin(TAU * (phase - dist * 1.2)); + ctx.globalAlpha = 0.08 + 0.16 * wave; + ctx.fillStyle = wave > 0.72 ? C.spark : C.line; + ctx.beginPath(); + ctx.arc(gx, gy, 1.2 + 1.4 * wave, 0, TAU); + ctx.fill(); + } + } + + // 2. Depth Layer 2: 4 Visual Studio Stage Cards + const count = 4; + const margin = W * 0.042; + const gap = W * 0.024; + const bw = (W - 2 * margin - (count - 1) * gap) / count; + const bh = Math.round(H * 0.48); + const by = Math.round(H * 0.30); + const railY = Math.round(H * 0.68); + const capY = Math.round(H * 0.87); + + const xs = [0, 1, 2, 3].map((i) => margin + i * (bw + gap) + bw / 2); const items = [placeItem(t + 1.25, xs, W)]; if (t >= 8.75) items.push(placeItem(t - 8.75, xs, W)); - // Transport rail + subtle travelling carrier ticks (keeps frame-to-frame delta steady) + // Transport rail + glowing carrier stream ctx.globalAlpha = 1; ctx.strokeStyle = C.line; - ctx.lineWidth = 2; + ctx.lineWidth = 2.5; ctx.beginPath(); ctx.moveTo(0, railY); ctx.lineTo(W, railY); ctx.stroke(); - const tickCount = 16; - const tickSpacing = W / tickCount; - const tickShift = (phase * 4 * tickSpacing) % tickSpacing; - ctx.fillStyle = C.muted; - ctx.globalAlpha = 0.35; - for (let i = 0; i <= tickCount; i++) { - const tx = i * tickSpacing + tickShift; - ctx.fillRect(tx - 2, railY - 2, 4, 4); + const streamCount = 18; + const streamSpace = W / streamCount; + const streamShift = (phase * 3 * streamSpace) % streamSpace; + for (let i = 0; i <= streamCount; i++) { + const sx = i * streamSpace + streamShift; + ctx.globalAlpha = 0.45; + ctx.fillStyle = i % 2 === 0 ? C.spark : C.accent; + ctx.beginPath(); + ctx.arc(sx, railY, 2.2, 0, TAU); + ctx.fill(); } - // Stage boxes & vertical stems - ctx.font = "600 13px monospace"; - ctx.textAlign = "center"; - ctx.textBaseline = "middle"; + const stepHeaders = ["01 BRIEF", "02 SKETCH", "03 SEAM", "04 EXPORT"]; xs.forEach((cx, i) => { let near = 0; items.forEach((it) => { - near = Math.max(near, it.alpha * Math.max(0, 1 - Math.abs(it.x - cx) / (bw * 0.75))); + near = Math.max(near, it.alpha * Math.max(0, 1 - Math.abs(it.x - cx) / (bw * 0.78))); }); + const cardLeft = cx - bw / 2; + const cardTop = by - bh / 2; + const activeColor = i === 2 ? cyan : i === 3 ? C.spark : C.accent; + + // Vertical connector stem from card to rail ctx.globalAlpha = 1; - ctx.strokeStyle = near > 0.3 ? C.accent : C.line; - ctx.lineWidth = 2; + ctx.strokeStyle = near > 0.25 ? activeColor : C.line; + ctx.lineWidth = near > 0.25 ? 2.5 : 1.5; ctx.beginPath(); - ctx.moveTo(cx, by + bh / 2); + ctx.moveTo(cx, cardTop + bh); ctx.lineTo(cx, railY); ctx.stroke(); - kit.roundRect(ctx, cx - bw / 2, by - bh / 2, bw, bh, 8); - ctx.globalAlpha = 1; + // Node socket on rail + ctx.fillStyle = near > 0.25 ? activeColor : C.surface; + ctx.beginPath(); + ctx.arc(cx, railY, 4.5, 0, TAU); + ctx.fill(); + ctx.strokeStyle = activeColor; + ctx.lineWidth = 1.5; + ctx.stroke(); + + // Card surface + kit.roundRect(ctx, cardLeft, cardTop, bw, bh, 10); + ctx.globalAlpha = 0.96; ctx.fillStyle = C.surface; ctx.fill(); - if (near > 0.01) { - ctx.globalAlpha = 0.22 * near; - ctx.fillStyle = i >= 2 ? C.spark : C.accent; + // Subtle active header tint + if (near > 0.02) { + ctx.globalAlpha = 0.16 * near; + ctx.fillStyle = activeColor; ctx.fill(); } ctx.globalAlpha = 1; + ctx.strokeStyle = near > 0.15 ? activeColor : C.line; + ctx.lineWidth = near > 0.15 ? 2.2 : 1.4; + ctx.stroke(); + + // Card header bar divider + const headH = Math.round(bh * 0.24); ctx.strokeStyle = C.line; - ctx.lineWidth = 1.5; + ctx.lineWidth = 1; + ctx.beginPath(); + ctx.moveTo(cardLeft + 1, cardTop + headH); + ctx.lineTo(cardLeft + bw - 1, cardTop + headH); ctx.stroke(); - if (near > 0.01) { - ctx.globalAlpha = near; - ctx.strokeStyle = i >= 2 ? C.spark : C.accent; + // Card header step tag + primary stage label (kept for Frame-0 legibility check) + ctx.font = "600 10px monospace"; + ctx.fillStyle = activeColor; + ctx.textAlign = "left"; + ctx.textBaseline = "middle"; + ctx.fillText(stepHeaders[i], cardLeft + 10, cardTop + headH * 0.5); + + ctx.font = "700 12px monospace"; + ctx.fillStyle = C.body; + ctx.textAlign = "right"; + ctx.fillText(labels[i], cardLeft + bw - 10, cardTop + headH * 0.5); + + // Rich visual interior per stage card! + const innerY = cardTop + headH + (bh - headH) * 0.5; + + if (i === 0) { + // Card 1: Prompt lines + live rotating Phase Ring (0 -> 1) + const ringX = cardLeft + bw * 0.28; + const ringR = Math.min(bw, bh) * 0.19; + ctx.strokeStyle = C.line; + ctx.lineWidth = 2; + ctx.beginPath(); + ctx.arc(ringX, innerY, ringR, 0, TAU); + ctx.stroke(); + + const pAng = phase * TAU - Math.PI / 2; + ctx.strokeStyle = C.accent; + ctx.lineWidth = 2.5; + ctx.beginPath(); + ctx.arc(ringX, innerY, ringR, pAng - 1.8, pAng); + ctx.stroke(); + + ctx.fillStyle = C.spark; + ctx.beginPath(); + ctx.arc(ringX + Math.cos(pAng) * ringR, innerY + Math.sin(pAng) * ringR, 3.8, 0, TAU); + ctx.fill(); + + // Prompt spec bars on right half of Card 1 + const tx0 = cardLeft + bw * 0.52; + ctx.font = "500 10px monospace"; + ctx.fillStyle = C.muted; + ctx.textAlign = "left"; + ctx.fillText("4s · 30fps", tx0, innerY - 14); + ctx.fillStyle = C.body; + ctx.fillText("phase 0→1", tx0, innerY + 3); + ctx.fillStyle = cyan; + ctx.fillText("seed: 7", tx0, innerY + 19); + } else if (i === 1) { + // Card 2: Live Miniature Bioluminescent Particle-Orbit Sketch Viewport! + const vpW = bw - 20; + const vpH = bh - headH - 16; + const vpX = cardLeft + 10; + const vpY = cardTop + headH + 8; + kit.roundRect(ctx, vpX, vpY, vpW, vpH, 6); + ctx.fillStyle = "#060913"; + ctx.fill(); + + // 2 nested glowing orbits inside mini canvas + for (let ring = 1; ring <= 2; ring++) { + const rx = vpW * (0.18 * ring); + const ry = vpH * (0.21 * ring); + const dots = 6 + ring * 4; + const dir = ring === 1 ? 1 : -2; + for (let d = 0; d < dots; d++) { + const a = TAU * ((phase * dir + d / dots) % 1); + const px = cx + Math.cos(a) * rx; + const py = innerY + Math.sin(a) * ry; + ctx.globalAlpha = 0.45 + 0.55 * (0.5 + 0.5 * Math.sin(a)); + ctx.fillStyle = d % 3 === 0 ? cyan : d % 2 === 0 ? C.spark : C.accent; + ctx.beginPath(); + ctx.arc(px, py, d % 3 === 0 ? 3.2 : 2.2, 0, TAU); + ctx.fill(); + } + } + ctx.globalAlpha = 1; + ctx.fillStyle = cyan; + ctx.beginPath(); + ctx.arc(cx, innerY, 4.5 + 1.5 * Math.sin(TAU * phase * 2), 0, TAU); + ctx.fill(); + } else if (i === 2) { + // Card 3: Live Seam Check Bar Chart (1.02x PASS) + const bars = [1.0, 0.94, 1.05, 0.98, 1.02, 0.96, 1.04, 0.99, 1.03]; + const chartLeft = cardLeft + 14; + const chartBase = cardTop + bh - 14; + const barStep = (bw - 28) / bars.length; + const unitH = (bh - headH - 36) * 0.55; + + bars.forEach((v, bIdx) => { + const isLast = bIdx === bars.length - 1; + const wave = 1 + 0.08 * Math.sin(TAU * (phase * 2 - bIdx / bars.length)); + const hBar = v * unitH * wave; + ctx.globalAlpha = isLast ? 1 : 0.65; + ctx.fillStyle = isLast ? cyan : C.spark; + ctx.fillRect(chartLeft + bIdx * barStep, chartBase - hBar, Math.max(4, barStep - 4), hBar); + }); + + // Median 1.0x reference line + ctx.globalAlpha = 0.9; + ctx.strokeStyle = C.accent; + ctx.lineWidth = 1.2; + ctx.beginPath(); + ctx.moveTo(chartLeft, chartBase - unitH); + ctx.lineTo(cardLeft + bw - 14, chartBase - unitH); + ctx.stroke(); + + ctx.globalAlpha = 1; + ctx.font = "600 10px monospace"; + ctx.fillStyle = cyan; + ctx.textAlign = "left"; + ctx.fillText("1.02x PASS", chartLeft, cardTop + headH + 14); + } else if (i === 3) { + // Card 4: Verified Infinite Loop Lissajous Figure + Format Badges + const lissY = innerY - 8; + const rx = bw * 0.30; + const ry = (bh - headH) * 0.24; + ctx.strokeStyle = C.spark; ctx.lineWidth = 2.2; + ctx.beginPath(); + for (let s = 0; s <= 40; s++) { + const u = (s / 40) * TAU; + const lx = cx + Math.sin(u) * rx; + const ly = lissY + Math.sin(u * 2) * ry; + if (s === 0) ctx.moveTo(lx, ly); + else ctx.lineTo(lx, ly); + } ctx.stroke(); - } - ctx.globalAlpha = 1; - ctx.fillStyle = C.body; - ctx.fillText(labels[i], cx, by); + // Travelling spark along the infinity loop + const sparkU = phase * TAU; + const sx = cx + Math.sin(sparkU) * rx; + const sy = lissY + Math.sin(sparkU * 2) * ry; + ctx.fillStyle = cyan; + ctx.beginPath(); + ctx.arc(sx, sy, 4.5, 0, TAU); + ctx.fill(); + + ctx.font = "600 10px monospace"; + ctx.fillStyle = C.body; + ctx.textAlign = "center"; + ctx.fillText("GIF · MP4 · PNG", cx, cardTop + bh - 14); + } }); - // Moving payload orbs along rail + // 3. Depth Layer 3: Moving payload orbs along the transport rail items.forEach((it) => { - const r = Math.max(7, Math.round(H * 0.036)); - const pulse = 1 + 0.15 * Math.sin(TAU * phase * 2); - ctx.globalAlpha = it.alpha * 0.26; - ctx.fillStyle = it.checked > 0.5 ? C.spark : C.accent; + const r = Math.max(8, Math.round(H * 0.036)); + const pulse = 1 + 0.16 * Math.sin(TAU * phase * 2); + const col = it.checked > 0.5 ? cyan : C.accent; + + // Outer glow halo + ctx.globalAlpha = it.alpha * 0.28; + ctx.fillStyle = col; ctx.beginPath(); - ctx.arc(it.x, railY, r * 1.45 * pulse, 0, TAU); + ctx.arc(it.x, railY, r * 1.65 * pulse, 0, TAU); ctx.fill(); + // Inner orb ctx.globalAlpha = it.alpha; ctx.fillStyle = C.accent; ctx.beginPath(); @@ -171,31 +356,48 @@ export function render(ctx, phase, kit) { if (it.checked > 0) { ctx.globalAlpha = it.alpha * it.checked; - ctx.fillStyle = C.spark; + ctx.fillStyle = cyan; ctx.beginPath(); ctx.arc(it.x, railY, r, 0, TAU); ctx.fill(); ctx.strokeStyle = C.ground; - ctx.lineWidth = 2; + ctx.lineWidth = 2.2; ctx.beginPath(); ctx.moveTo(it.x - r * 0.42, railY); - ctx.lineTo(it.x - r * 0.1, railY + r * 0.35); - ctx.lineTo(it.x + r * 0.48, railY - r * 0.35); + ctx.lineTo(it.x - r * 0.08, railY + r * 0.36); + ctx.lineTo(it.x + r * 0.48, railY - r * 0.36); ctx.stroke(); } }); - // Caption bar at bottom (fixed pill + smooth text fade) - const pillW = Math.round(W * 0.62); - kit.roundRect(ctx, W / 2 - pillW / 2, capY - 16, pillW, 32, 6); - ctx.globalAlpha = 0.95; + // 4. Bottom Caption Pill + Step Progress Dots + const pillW = Math.round(W * 0.64); + const pillH = 34; + kit.roundRect(ctx, W / 2 - pillW / 2, capY - pillH / 2, pillW, pillH, 8); + ctx.globalAlpha = 0.96; ctx.fillStyle = C.surface; ctx.fill(); ctx.strokeStyle = C.line; - ctx.lineWidth = 1; + ctx.lineWidth = 1.5; ctx.stroke(); + let activeStepIdx = 0; + steps.forEach((c, idx) => { + const len = ((c.to - c.from) % SECONDS + SECONDS) % SECONDS || SECONDS; + const u = ((t - c.from) % SECONDS + SECONDS) % SECONDS; + if (u < len) activeStepIdx = idx; + }); + + // Step indicator dots on left of pill + for (let d = 0; d < steps.length; d++) { + ctx.globalAlpha = 1; + ctx.fillStyle = d === activeStepIdx ? cyan : C.line; + ctx.beginPath(); + ctx.arc(W / 2 - pillW / 2 + 18 + d * 11, capY, d === activeStepIdx ? 3.8 : 2.6, 0, TAU); + ctx.fill(); + } + ctx.font = "500 13px monospace"; ctx.textAlign = "center"; ctx.textBaseline = "middle"; @@ -204,10 +406,10 @@ export function render(ctx, phase, kit) { const len = ((c.to - c.from) % SECONDS + SECONDS) % SECONDS || SECONDS; const u = ((t - c.from) % SECONDS + SECONDS) % SECONDS; if (u >= len) return; - const fade = Math.max(0.2, Math.min(1, u / 0.35, (len - u) / 0.35)); + const fade = Math.max(0.25, Math.min(1, u / 0.35, (len - u) / 0.35)); ctx.globalAlpha = fade; ctx.fillStyle = C.body; - ctx.fillText(c.caption, W / 2, capY); + ctx.fillText(c.caption, W / 2 + 16, capY); }); ctx.globalAlpha = 1; diff --git a/tool/lib/soft-canvas.js b/tool/lib/soft-canvas.js index 59bb78c..355f5ca 100644 --- a/tool/lib/soft-canvas.js +++ b/tool/lib/soft-canvas.js @@ -1,112 +1,234 @@ -// Loop Studio — Pure-JS Deterministic 2D Software Canvas Engine -// Provides zero-dependency 2D Canvas rendering for Node.js, CI, and sandboxed environments, -// plus telemetry hooks for `loop legible` contrast and bounding-box verification. +// Loop Studio — Pure-JS Deterministic 2D Software Canvas Engine (v2) +// Features: +// - Sub-pixel anti-aliased Vector SDF Font Engine (smooth curves & diagonals, cached glyph atlas) +// - Linear & Radial Gradient support (createLinearGradient, createRadialGradient) +// - Anti-aliased discs, rings, thick capsule strokes, and scanline polygon fills +// - Pre-blend background contrast & bounding-box telemetry for `loop legible` import { color as colorUtil } from "./loop-kit.js"; -// Compact 5x7 bitmap font for printable ASCII (each char is 7 rows of 5-bit integers, MSB on left) -const GLYPHS = { - " ": [0, 0, 0, 0, 0, 0, 0], - "!": [4, 4, 4, 4, 4, 0, 4], - "\"": [10, 10, 4, 0, 0, 0, 0], - "#": [10, 31, 10, 10, 31, 10, 0], - "$": [4, 15, 20, 14, 5, 30, 4], - "%": [25, 26, 4, 8, 19, 0, 0], - "&": [12, 18, 20, 8, 21, 18, 13], - "'": [4, 4, 0, 0, 0, 0, 0], - "(": [2, 4, 8, 8, 8, 4, 2], - ")": [8, 4, 2, 2, 2, 4, 8], - "*": [0, 4, 21, 14, 21, 4, 0], - "+": [0, 4, 4, 31, 4, 4, 0], - ",": [0, 0, 0, 0, 4, 4, 8], - "-": [0, 0, 0, 31, 0, 0, 0], - ".": [0, 0, 0, 0, 0, 12, 12], - "/": [1, 2, 4, 4, 8, 16, 0], - "0": [14, 17, 19, 21, 25, 17, 14], - "1": [4, 12, 4, 4, 4, 4, 14], - "2": [14, 17, 1, 6, 8, 16, 31], - "3": [31, 2, 4, 6, 1, 17, 14], - "4": [2, 6, 10, 18, 31, 2, 2], - "5": [31, 16, 30, 1, 1, 17, 14], - "6": [6, 8, 16, 30, 17, 17, 14], - "7": [31, 1, 2, 4, 8, 8, 8], - "8": [14, 17, 17, 14, 17, 17, 14], - "9": [14, 17, 17, 15, 1, 2, 12], - ":": [0, 12, 12, 0, 12, 12, 0], - ";": [0, 12, 12, 0, 12, 4, 8], - "<": [2, 4, 8, 16, 8, 4, 2], - "=": [0, 0, 31, 0, 31, 0, 0], - ">": [8, 4, 2, 1, 2, 4, 8], - "?": [14, 17, 1, 6, 4, 0, 4], - "@": [14, 17, 23, 21, 23, 16, 14], - "A": [14, 17, 17, 31, 17, 17, 17], - "B": [30, 17, 17, 30, 17, 17, 30], - "C": [14, 17, 16, 16, 16, 17, 14], - "D": [28, 18, 17, 17, 17, 18, 28], - "E": [31, 16, 16, 30, 16, 16, 31], - "F": [31, 16, 16, 30, 16, 16, 16], - "G": [14, 17, 16, 23, 17, 17, 15], - "H": [17, 17, 17, 31, 17, 17, 17], - "I": [14, 4, 4, 4, 4, 4, 14], - "J": [7, 2, 2, 2, 2, 18, 12], - "K": [17, 18, 20, 24, 20, 18, 17], - "L": [16, 16, 16, 16, 16, 16, 31], - "M": [17, 27, 21, 21, 17, 17, 17], - "N": [17, 25, 21, 19, 17, 17, 17], - "O": [14, 17, 17, 17, 17, 17, 14], - "P": [30, 17, 17, 30, 16, 16, 16], - "Q": [14, 17, 17, 17, 21, 18, 13], - "R": [30, 17, 17, 30, 20, 18, 17], - "S": [15, 16, 16, 14, 1, 1, 30], - "T": [31, 4, 4, 4, 4, 4, 4], - "U": [17, 17, 17, 17, 17, 17, 14], - "V": [17, 17, 17, 17, 17, 10, 4], - "W": [17, 17, 17, 21, 21, 27, 17], - "X": [17, 17, 10, 4, 10, 17, 17], - "Y": [17, 17, 10, 4, 4, 4, 4], - "Z": [31, 1, 2, 4, 8, 16, 31], - "[": [14, 8, 8, 8, 8, 8, 14], - "\\": [16, 8, 4, 4, 2, 1, 0], - "]": [14, 2, 2, 2, 2, 2, 14], - "^": [4, 10, 17, 0, 0, 0, 0], - "_": [0, 0, 0, 0, 0, 0, 31], - "`": [8, 4, 0, 0, 0, 0, 0], - "a": [0, 0, 14, 1, 15, 17, 15], - "b": [16, 16, 22, 25, 17, 17, 30], - "c": [0, 0, 14, 16, 16, 17, 14], - "d": [1, 1, 13, 19, 17, 17, 15], - "e": [0, 0, 14, 17, 31, 16, 14], - "f": [6, 9, 8, 28, 8, 8, 8], - "g": [0, 15, 17, 17, 15, 1, 14], - "h": [16, 16, 22, 25, 17, 17, 17], - "i": [4, 0, 12, 4, 4, 4, 14], - "j": [2, 0, 6, 2, 2, 18, 12], - "k": [16, 16, 18, 20, 24, 20, 18], - "l": [12, 4, 4, 4, 4, 4, 14], - "m": [0, 0, 26, 21, 21, 17, 17], - "n": [0, 0, 22, 25, 17, 17, 17], - "o": [0, 0, 14, 17, 17, 17, 14], - "p": [0, 0, 30, 17, 30, 16, 16], - "q": [0, 0, 15, 17, 15, 1, 1], - "r": [0, 0, 22, 25, 16, 16, 16], - "s": [0, 0, 15, 16, 14, 1, 30], - "t": [8, 8, 28, 8, 8, 9, 6], - "u": [0, 0, 17, 17, 17, 19, 13], - "v": [0, 0, 17, 17, 17, 10, 4], - "w": [0, 0, 17, 17, 21, 21, 10], - "x": [0, 0, 17, 10, 4, 10, 17], - "y": [0, 0, 17, 17, 15, 1, 14], - "z": [0, 0, 31, 2, 4, 8, 31], - "{": [2, 4, 4, 8, 4, 4, 2], - "|": [4, 4, 4, 4, 4, 4, 4], - "}": [8, 4, 4, 2, 4, 4, 8], - "~": [0, 0, 8, 21, 2, 0, 0], - "→": [0, 4, 2, 31, 2, 4, 0], - "·": [0, 0, 0, 6, 6, 0, 0], - "—": [0, 0, 0, 31, 0, 0, 0], - "×": [0, 17, 10, 4, 10, 17, 0] +// Vector stroke definitions on a [0..8, 0..12] grid (baseline at y=10, cap-height y=1, x-height y=4, descender y=12) +// Commands: ["L", x0, y0, x1, y1] or ["A", cx, cy, rx, ry, startDeg, endDeg] or ["P", x0, y0, x1, y1, ...] +const VECTOR_GLYPHS = { + " ": [], + "!": [["L", 4, 1, 4, 7.5], ["A", 4, 10, 0.4, 0.4, 0, 360]], + "\"": [["L", 2.8, 1, 2.8, 3.8], ["L", 5.2, 1, 5.2, 3.8]], + "#": [["L", 2.8, 1.5, 2.2, 10], ["L", 5.8, 1.5, 5.2, 10], ["L", 1.2, 4.2, 6.8, 4.2], ["L", 1.0, 7.2, 6.6, 7.2]], + "$": [["A", 4, 3.8, 2.3, 1.8, 110, 350], ["L", 2.2, 4.5, 5.8, 6.8], ["A", 4, 8.0, 2.3, 1.8, -70, 170], ["L", 4, 0.6, 4, 11]], + "%": [["A", 2.3, 2.8, 1.3, 1.3, 0, 360], ["L", 6.4, 1.2, 1.6, 10], ["A", 5.7, 8.5, 1.3, 1.3, 0, 360]], + "&": [["A", 3.8, 3.0, 1.7, 1.6, 0, 360], ["A", 3.6, 7.6, 2.3, 2.2, 40, 320], ["L", 2.2, 4.2, 6.8, 10]], + "'": [["L", 4, 1, 3.6, 3.8]], + "(": [["A", 5.5, 5.6, 2.8, 5.2, 115, 245]], + ")": [["A", 2.5, 5.6, 2.8, 5.2, -65, 65]], + "*": [["L", 4, 2.2, 4, 7.8], ["L", 1.5, 3.6, 6.5, 6.4], ["L", 6.5, 3.6, 1.5, 6.4]], + "+": [["L", 4, 2.8, 4, 8.8], ["L", 1.2, 5.8, 6.8, 5.8]], + ",": [["L", 4.2, 9.2, 3.2, 11.6]], + "-": [["L", 1.5, 5.8, 6.5, 5.8]], + ".": [["A", 4, 9.6, 0.5, 0.5, 0, 360]], + "/": [["L", 6.2, 1, 1.8, 10.4]], + "0": [["A", 4, 5.5, 2.6, 4.4, 0, 360], ["L", 2.2, 8.4, 5.8, 2.6]], + "1": [["L", 2.2, 2.8, 4.2, 1.1], ["L", 4.2, 1.1, 4.2, 10], ["L", 2.0, 10, 6.4, 10]], + "2": [["A", 4, 3.3, 2.3, 2.1, 195, 405], ["L", 6.0, 4.7, 1.5, 10], ["L", 1.5, 10, 6.6, 10]], + "3": [["A", 3.9, 3.2, 2.2, 2.0, 200, 450], ["A", 4.0, 7.6, 2.4, 2.3, -90, 160]], + "4": [["L", 5.2, 1.1, 1.3, 7.2], ["L", 1.3, 7.2, 6.8, 7.2], ["L", 5.2, 1.1, 5.2, 10]], + "5": [["L", 6.2, 1.2, 2.0, 1.2], ["L", 2.0, 1.2, 1.8, 5.2], ["A", 4.0, 7.3, 2.5, 2.6, -135, 155]], + "6": [["A", 4.2, 5.5, 2.6, 4.3, 140, 260], ["A", 4.0, 7.4, 2.4, 2.5, 0, 360]], + "7": [["L", 1.4, 1.2, 6.6, 1.2], ["L", 6.6, 1.2, 2.8, 10]], + "8": [["A", 4, 3.2, 2.1, 2.0, 0, 360], ["A", 4, 7.6, 2.4, 2.3, 0, 360]], + "9": [["A", 4.0, 3.6, 2.4, 2.4, 0, 360], ["A", 3.8, 5.5, 2.6, 4.3, -40, 80]], + ":": [["A", 4, 4.4, 0.5, 0.5, 0, 360], ["A", 4, 9.4, 0.5, 0.5, 0, 360]], + ";": [["A", 4, 4.4, 0.5, 0.5, 0, 360], ["L", 4.2, 9.0, 3.2, 11.4]], + "<": [["L", 6.2, 2.4, 1.8, 5.8], ["L", 1.8, 5.8, 6.2, 9.2]], + "=": [["L", 1.4, 4.3, 6.6, 4.3], ["L", 1.4, 7.3, 6.6, 7.3]], + ">": [["L", 1.8, 2.4, 6.2, 5.8], ["L", 6.2, 5.8, 1.8, 9.2]], + "?": [["A", 4, 3.3, 2.3, 2.1, 195, 425], ["L", 4, 5.3, 4, 7.4], ["A", 4, 9.8, 0.45, 0.45, 0, 360]], + "@": [["A", 4, 5.6, 3.1, 3.8, 35, 330], ["A", 4, 5.8, 1.4, 1.6, 0, 360], ["L", 5.4, 4.2, 5.4, 7.3]], + "A": [["L", 1.2, 10, 4.0, 1.1], ["L", 4.0, 1.1, 6.8, 10], ["L", 2.1, 7.0, 5.9, 7.0]], + "B": [["L", 1.6, 1.2, 1.6, 10], ["L", 1.6, 1.2, 4.4, 1.2], ["L", 1.6, 5.4, 4.5, 5.4], ["L", 1.6, 10, 4.5, 10], ["A", 4.4, 3.3, 1.9, 2.1, -90, 90], ["A", 4.5, 7.7, 2.1, 2.3, -90, 90]], + "C": [["A", 4.2, 5.6, 2.7, 4.4, 42, 318]], + "D": [["L", 1.6, 1.2, 1.6, 10], ["L", 1.6, 1.2, 3.8, 1.2], ["L", 1.6, 10, 3.8, 10], ["A", 3.8, 5.6, 2.8, 4.4, -90, 90]], + "E": [["L", 1.6, 1.2, 1.6, 10], ["L", 1.6, 1.2, 6.4, 1.2], ["L", 1.6, 5.5, 5.6, 5.5], ["L", 1.6, 10, 6.4, 10]], + "F": [["L", 1.6, 1.2, 1.6, 10], ["L", 1.6, 1.2, 6.4, 1.2], ["L", 1.6, 5.5, 5.6, 5.5]], + "G": [["A", 4.2, 5.6, 2.7, 4.4, 35, 330], ["L", 4.2, 6.0, 6.8, 6.0], ["L", 6.8, 6.0, 6.8, 9.6]], + "H": [["L", 1.6, 1.2, 1.6, 10], ["L", 6.4, 1.2, 6.4, 10], ["L", 1.6, 5.5, 6.4, 5.5]], + "I": [["L", 2.2, 1.2, 5.8, 1.2], ["L", 4.0, 1.2, 4.0, 10], ["L", 2.2, 10, 5.8, 10]], + "J": [["L", 2.4, 1.2, 6.2, 1.2], ["L", 5.2, 1.2, 5.2, 7.6], ["A", 3.4, 7.6, 1.8, 2.3, 0, 170]], + "K": [["L", 1.6, 1.2, 1.6, 10], ["L", 6.4, 1.2, 1.6, 6.0], ["L", 3.2, 4.5, 6.5, 10]], + "L": [["L", 1.8, 1.2, 1.8, 10], ["L", 1.8, 10, 6.4, 10]], + "M": [["L", 1.3, 10, 1.3, 1.2], ["L", 1.3, 1.2, 4.0, 6.4], ["L", 4.0, 6.4, 6.7, 1.2], ["L", 6.7, 1.2, 6.7, 10]], + "N": [["L", 1.5, 10, 1.5, 1.2], ["L", 1.5, 1.2, 6.5, 10], ["L", 6.5, 10, 6.5, 1.2]], + "O": [["A", 4, 5.6, 2.7, 4.4, 0, 360]], + "P": [["L", 1.6, 1.2, 1.6, 10], ["L", 1.6, 1.2, 4.4, 1.2], ["L", 1.6, 5.8, 4.4, 5.8], ["A", 4.4, 3.5, 2.1, 2.3, -90, 90]], + "Q": [["A", 4, 5.4, 2.7, 4.2, 0, 360], ["L", 4.4, 7.2, 6.8, 10.4]], + "R": [["L", 1.6, 1.2, 1.6, 10], ["L", 1.6, 1.2, 4.4, 1.2], ["L", 1.6, 5.6, 4.4, 5.6], ["A", 4.4, 3.4, 2.1, 2.2, -90, 90], ["L", 4.2, 5.6, 6.5, 10]], + "S": [["A", 4.1, 3.3, 2.3, 2.0, 145, 350], ["L", 2.1, 4.2, 5.9, 6.8], ["A", 3.9, 7.8, 2.4, 2.1, -35, 165]], + "T": [["L", 1.2, 1.2, 6.8, 1.2], ["L", 4.0, 1.2, 4.0, 10]], + "U": [["L", 1.6, 1.2, 1.6, 7.2], ["L", 6.4, 1.2, 6.4, 7.2], ["A", 4.0, 7.2, 2.4, 2.8, 0, 180]], + "V": [["L", 1.3, 1.2, 4.0, 10], ["L", 4.0, 10, 6.7, 1.2]], + "W": [["L", 1.0, 1.2, 2.4, 10], ["L", 2.4, 10, 4.0, 4.8], ["L", 4.0, 4.8, 5.6, 10], ["L", 5.6, 10, 7.0, 1.2]], + "X": [["L", 1.4, 1.2, 6.6, 10], ["L", 6.6, 1.2, 1.4, 10]], + "Y": [["L", 1.4, 1.2, 4.0, 5.6], ["L", 6.6, 1.2, 4.0, 5.6], ["L", 4.0, 5.6, 4.0, 10]], + "Z": [["L", 1.4, 1.2, 6.6, 1.2], ["L", 6.6, 1.2, 1.4, 10], ["L", 1.4, 10, 6.6, 10]], + "[": [["L", 5.2, 1, 2.6, 1], ["L", 2.6, 1, 2.6, 10.6], ["L", 2.6, 10.6, 5.2, 10.6]], + "\\": [["L", 1.8, 1, 6.2, 10.4]], + "]": [["L", 2.8, 1, 5.4, 1], ["L", 5.4, 1, 5.4, 10.6], ["L", 5.4, 10.6, 2.8, 10.6]], + "^": [["L", 1.8, 4.2, 4.0, 1.2], ["L", 4.0, 1.2, 6.2, 4.2]], + "_": [["L", 1.0, 10.8, 7.0, 10.8]], + "`": [["L", 3.2, 1.0, 4.6, 3.2]], + "a": [["A", 3.8, 7.2, 2.2, 2.7, 50, 310], ["L", 6.0, 4.2, 6.0, 10], ["A", 3.9, 5.2, 2.0, 1.4, 200, 350]], + "b": [["L", 1.7, 1.0, 1.7, 10], ["A", 4.0, 7.0, 2.3, 2.9, -115, 115]], + "c": [["A", 4.3, 7.0, 2.4, 2.9, 45, 315]], + "d": [["L", 6.3, 1.0, 6.3, 10], ["A", 4.0, 7.0, 2.3, 2.9, 65, 295]], + "e": [["L", 1.6, 6.8, 6.4, 6.8], ["A", 4.0, 7.0, 2.4, 2.9, 35, 360]], + "f": [["A", 4.8, 2.6, 1.5, 1.5, 180, 330], ["L", 3.3, 2.6, 3.3, 10], ["L", 1.8, 4.6, 5.4, 4.6]], + "g": [["A", 4.0, 6.8, 2.2, 2.6, 0, 360], ["L", 6.2, 4.2, 6.2, 10.2], ["A", 3.9, 10.2, 2.3, 1.8, 0, 165]], + "h": [["L", 1.7, 1.0, 1.7, 10], ["A", 4.0, 6.0, 2.2, 2.0, 180, 360], ["L", 6.2, 6.0, 6.2, 10]], + "i": [["A", 4.0, 1.8, 0.5, 0.5, 0, 360], ["L", 2.6, 4.2, 4.2, 4.2], ["L", 4.2, 4.2, 4.2, 10], ["L", 2.4, 10, 5.8, 10]], + "j": [["A", 4.8, 1.8, 0.5, 0.5, 0, 360], ["L", 4.8, 4.2, 4.8, 10.2], ["A", 3.2, 10.2, 1.6, 1.6, 0, 165]], + "k": [["L", 1.8, 1.0, 1.8, 10], ["L", 6.0, 4.2, 1.8, 7.2], ["L", 3.4, 6.0, 6.2, 10]], + "l": [["L", 2.6, 1.0, 4.2, 1.0], ["L", 4.2, 1.0, 4.2, 10], ["L", 2.4, 10, 5.8, 10]], + "m": [["L", 1.2, 4.2, 1.2, 10], ["A", 2.6, 5.6, 1.4, 1.5, 180, 360], ["L", 4.0, 5.6, 4.0, 10], ["A", 5.4, 5.6, 1.4, 1.5, 180, 360], ["L", 6.8, 5.6, 6.8, 10]], + "n": [["L", 1.7, 4.2, 1.7, 10], ["A", 4.0, 6.0, 2.2, 1.9, 180, 360], ["L", 6.2, 6.0, 6.2, 10]], + "o": [["A", 4.0, 7.0, 2.4, 2.9, 0, 360]], + "p": [["L", 1.7, 4.2, 1.7, 11.8], ["A", 4.0, 7.0, 2.3, 2.9, -115, 115]], + "q": [["L", 6.3, 4.2, 6.3, 11.8], ["A", 4.0, 7.0, 2.3, 2.9, 65, 295]], + "r": [["L", 2.2, 4.2, 2.2, 10], ["A", 4.4, 5.8, 2.1, 1.7, 180, 330]], + "s": [["A", 4.0, 5.5, 2.0, 1.4, 140, 345], ["L", 2.2, 6.2, 5.8, 7.6], ["A", 4.0, 8.5, 2.1, 1.4, -35, 165]], + "t": [["L", 3.6, 1.8, 3.6, 8.6], ["L", 1.8, 4.2, 5.8, 4.2], ["A", 4.8, 8.6, 1.2, 1.3, 90, 180]], + "u": [["L", 1.7, 4.2, 1.7, 8.0], ["A", 4.0, 8.0, 2.2, 1.9, 0, 180], ["L", 6.2, 4.2, 6.2, 10]], + "v": [["L", 1.5, 4.2, 4.0, 10], ["L", 4.0, 10, 6.5, 4.2]], + "w": [["L", 1.0, 4.2, 2.4, 10], ["L", 2.4, 10, 4.0, 6.0], ["L", 4.0, 6.0, 5.6, 10], ["L", 5.6, 10, 7.0, 4.2]], + "x": [["L", 1.6, 4.2, 6.4, 10], ["L", 6.4, 4.2, 1.6, 10]], + "y": [["L", 1.6, 4.2, 4.0, 9.6], ["L", 6.4, 4.2, 2.4, 11.8]], + "z": [["L", 1.6, 4.2, 6.4, 4.2], ["L", 6.4, 4.2, 1.6, 10], ["L", 1.6, 10, 6.4, 10]], + "{": [["L", 5.0, 1, 3.6, 1.6], ["L", 3.6, 1.6, 3.6, 4.8], ["L", 3.6, 4.8, 2.2, 5.8], ["L", 2.2, 5.8, 3.6, 6.8], ["L", 3.6, 6.8, 3.6, 10], ["L", 3.6, 10, 5.0, 10.6]], + "|": [["L", 4.0, 0.8, 4.0, 10.8]], + "}": [["L", 3.0, 1, 4.4, 1.6], ["L", 4.4, 1.6, 4.4, 4.8], ["L", 4.4, 4.8, 5.8, 5.8], ["L", 5.8, 5.8, 4.4, 6.8], ["L", 4.4, 6.8, 4.4, 10], ["L", 4.4, 10, 3.0, 10.6]], + "~": [["A", 2.6, 5.8, 1.4, 1.2, 180, 360], ["A", 5.4, 5.8, 1.4, 1.2, 0, 180]], + "→": [["L", 1.0, 5.8, 6.6, 5.8], ["L", 4.4, 3.4, 6.8, 5.8], ["L", 4.4, 8.2, 6.8, 5.8]], + "·": [["A", 4.0, 5.8, 0.7, 0.7, 0, 360]], + "—": [["L", 0.8, 5.8, 7.2, 5.8]], + "×": [["L", 1.8, 3.6, 6.2, 8.0], ["L", 6.2, 3.6, 1.8, 8.0]], + "✓": [["L", 1.4, 6.2, 3.3, 8.8], ["L", 3.3, 8.8, 6.8, 2.4]], + "π": [["L", 1.4, 4.2, 6.6, 4.2], ["L", 2.8, 4.2, 2.4, 10], ["L", 5.2, 4.2, 5.4, 10]] }; +const GLYPH_ATLAS_CACHE = new Map(); + +function distToSegment(px, py, x0, y0, x1, y1) { + const dx = x1 - x0; + const dy = y1 - y0; + const len2 = dx * dx + dy * dy; + if (len2 < 1e-6) return Math.hypot(px - x0, py - y0); + const t = Math.max(0, Math.min(1, ((px - x0) * dx + (py - y0) * dy) / len2)); + return Math.hypot(px - (x0 + t * dx), py - (y0 + t * dy)); +} + +function getGlyphBitmap(ch, pxSize, bold) { + const key = `${ch}|${pxSize}|${bold ? 1 : 0}`; + let cached = GLYPH_ATLAS_CACHE.get(key); + if (cached) return cached; + + const ops = VECTOR_GLYPHS[ch] || VECTOR_GLYPHS[ch.toUpperCase()] || VECTOR_GLYPHS["?"]; + const scale = pxSize / 11.5; + const w = Math.max(4, Math.ceil(8.0 * scale)); + const h = Math.max(6, Math.ceil(12.5 * scale)); + const alpha = new Uint8Array(w * h); + + if (ops.length === 0) { + cached = { w, h, alpha }; + GLYPH_ATLAS_CACHE.set(key, cached); + return cached; + } + + // Convert arcs into fine polyline segments in pixel coordinates + const segs = []; + for (const op of ops) { + if (op[0] === "L") { + segs.push([op[1] * scale, op[2] * scale, op[3] * scale, op[4] * scale]); + } else if (op[0] === "A") { + const [, cx, cy, rx, ry, sDeg, eDeg] = op; + const steps = 14; + for (let i = 0; i < steps; i++) { + const a0 = ((sDeg + ((eDeg - sDeg) * i) / steps) * Math.PI) / 180; + const a1 = ((sDeg + ((eDeg - sDeg) * (i + 1)) / steps) * Math.PI) / 180; + segs.push([ + (cx + Math.cos(a0) * rx) * scale, + (cy + Math.sin(a0) * ry) * scale, + (cx + Math.cos(a1) * rx) * scale, + (cy + Math.sin(a1) * ry) * scale + ]); + } + } + } + + const strokeRadius = Math.max(0.58, (bold ? 0.88 : 0.70) * scale); + const feather = 0.72; + + for (let py = 0; py < h; py++) { + const cy = py + 0.5; + for (let px = 0; px < w; px++) { + const cx = px + 0.5; + let minDist = Infinity; + for (let s = 0; s < segs.length; s++) { + const seg = segs[s]; + const d = distToSegment(cx, cy, seg[0], seg[1], seg[2], seg[3]); + if (d < minDist) minDist = d; + } + const cov = Math.max(0, Math.min(1, (strokeRadius + feather * 0.5 - minDist) / feather)); + if (cov > 0) { + alpha[py * w + px] = Math.round(cov * 255); + } + } + } + + cached = { w, h, alpha }; + GLYPH_ATLAS_CACHE.set(key, cached); + return cached; +} + +class SoftGradient { + constructor(type, coords) { + this.type = type; + this.coords = coords; + this.stops = []; + } + addColorStop(offset, color) { + this.stops.push({ offset: Math.max(0, Math.min(1, offset)), rgba: colorUtil.parseHex(color) }); + this.stops.sort((a, b) => a.offset - b.offset); + } + sample(px, py) { + if (this.stops.length === 0) return [0, 0, 0, 255]; + if (this.stops.length === 1) return this.stops[0].rgba; + let t = 0; + if (this.type === "linear") { + const [x0, y0, x1, y1] = this.coords; + const dx = x1 - x0; + const dy = y1 - y0; + const len2 = dx * dx + dy * dy || 1; + t = Math.max(0, Math.min(1, ((px - x0) * dx + (py - y0) * dy) / len2)); + } else { + const [x0, y0, r0, x1, y1, r1] = this.coords; + const d = Math.hypot(px - x1, py - y1); + t = Math.max(0, Math.min(1, (d - r0) / Math.max(1, r1 - r0))); + } + for (let i = 0; i < this.stops.length - 1; i++) { + const s0 = this.stops[i]; + const s1 = this.stops[i + 1]; + if (t >= s0.offset && t <= s1.offset) { + const u = (t - s0.offset) / Math.max(1e-5, s1.offset - s0.offset); + return [ + Math.round(s0.rgba[0] + (s1.rgba[0] - s0.rgba[0]) * u), + Math.round(s0.rgba[1] + (s1.rgba[1] - s0.rgba[1]) * u), + Math.round(s0.rgba[2] + (s1.rgba[2] - s0.rgba[2]) * u), + 255 + ]; + } + } + return this.stops[this.stops.length - 1].rgba; + } +} + export class SoftCanvas2D { constructor(width, height) { this.width = Math.max(1, Math.round(width)); @@ -139,6 +261,21 @@ export class SoftCanvas2D { return this; } + createLinearGradient(x0, y0, x1, y1) { + return new SoftGradient("linear", [this._mapX(x0), this._mapY(y0), this._mapX(x1), this._mapY(y1)]); + } + + createRadialGradient(x0, y0, r0, x1, y1, r1) { + return new SoftGradient("radial", [ + this._mapX(x0), + this._mapY(y0), + r0 * this._sx, + this._mapX(x1), + this._mapY(y1), + r1 * this._sx + ]); + } + save() { this._stack.push({ fillStyle: this.fillStyle, @@ -196,7 +333,12 @@ export class SoftCanvas2D { return y * this._sy + this._ty; } - _parseColor(style) { + _parseColor(style, px = 0, py = 0) { + if (style instanceof SoftGradient) { + const rgba = style.sample(px, py); + const a = Math.max(0, Math.min(1, this.globalAlpha)); + return [rgba[0], rgba[1], rgba[2], Math.round(rgba[3] * a)]; + } const rgba = colorUtil.parseHex(style); const a = Math.max(0, Math.min(1, this.globalAlpha)); return [rgba[0], rgba[1], rgba[2], Math.round(rgba[3] * a)]; @@ -236,14 +378,16 @@ export class SoftCanvas2D { } fillRect(x, y, w, h) { - const [r, g, b, a] = this._parseColor(this.fillStyle); - if (a <= 0) return; + const isGrad = this.fillStyle instanceof SoftGradient; + const base = isGrad ? null : this._parseColor(this.fillStyle); + if (!isGrad && base[3] <= 0) return; const x0 = Math.max(0, Math.round(this._mapX(x))); const y0 = Math.max(0, Math.round(this._mapY(y))); const x1 = Math.min(this.width, Math.round(this._mapX(x + w))); const y1 = Math.min(this.height, Math.round(this._mapY(y + h))); for (let py = y0; py < y1; py++) { for (let px = x0; px < x1; px++) { + const [r, g, b, a] = isGrad ? this._parseColor(this.fillStyle, px, py) : base; this._blendPixel(px, py, r, g, b, a); } } @@ -286,7 +430,7 @@ export class SoftCanvas2D { let delta = endAngle - startAngle; if (!ccw && delta < 0) delta += Math.PI * 2; - const steps = Math.max(12, Math.min(64, Math.ceil(Math.abs(delta) * mr * 0.45))); + const steps = Math.max(16, Math.min(72, Math.ceil(Math.abs(delta) * mr * 0.55))); for (let i = 0; i <= steps; i++) { const a = startAngle + (delta * i) / steps; const px = mcx + Math.cos(a) * mr; @@ -310,7 +454,6 @@ export class SoftCanvas2D { this._path.push({ type: "L", x: mx1, y: my1 }); return; } - // Smooth corner approximation with 4 segments const x0 = last.x; const y0 = last.y; const dx0 = x0 - mx1; @@ -324,8 +467,8 @@ export class SoftCanvas2D { const sy = my1 + (dy0 / len0) * t; const ex = mx1 + (dx2 / len2) * t; const ey = my1 + (dy2 / len2) * t; - for (let i = 1; i <= 4; i++) { - const u = i / 4; + for (let i = 1; i <= 6; i++) { + const u = i / 6; const iu = 1 - u; const qx = iu * iu * sx + 2 * iu * u * mx1 + u * u * ex; const qy = iu * iu * sy + 2 * iu * u * my1 + u * u * ey; @@ -344,7 +487,7 @@ export class SoftCanvas2D { const y2 = this._mapY(cp2y); const x3 = this._mapX(x); const y3 = this._mapY(y); - const steps = 16; + const steps = 20; for (let i = 1; i <= steps; i++) { const u = i / steps; const iu = 1 - u; @@ -363,7 +506,7 @@ export class SoftCanvas2D { const y1 = this._mapY(cpy); const x2 = this._mapX(x); const y2 = this._mapY(y); - const steps = 12; + const steps = 14; for (let i = 1; i <= steps; i++) { const u = i / steps; const iu = 1 - u; @@ -380,10 +523,10 @@ export class SoftCanvas2D { } fill() { - const [r, g, b, a] = this._parseColor(this.fillStyle); - if (a <= 0) return; + const isGrad = this.fillStyle instanceof SoftGradient; + const base = isGrad ? null : this._parseColor(this.fillStyle); + if (!isGrad && base[3] <= 0) return; - // Fast anti-aliased disc rasterizer for full circles if (this._circleFastPath) { const { cx, cy, r: rad } = this._circleFastPath; const x0 = Math.max(0, Math.floor(cx - rad - 1)); @@ -395,8 +538,9 @@ export class SoftCanvas2D { for (let px = x0; px <= x1; px++) { const dx = px - cx; const d = Math.sqrt(dx * dx + dy * dy); - if (d <= rad + 0.5) { - const cov = Math.max(0, Math.min(1, rad + 0.5 - d)); + if (d <= rad + 0.65) { + const cov = Math.max(0, Math.min(1, rad + 0.65 - d)); + const [r, g, b, a] = isGrad ? this._parseColor(this.fillStyle, px, py) : base; this._blendPixel(px, py, r, g, b, Math.round(a * cov)); } } @@ -429,9 +573,10 @@ export class SoftCanvas2D { } nodes.sort((u, v) => u - v); for (let k = 0; k < nodes.length - 1; k += 2) { - const x0 = Math.max(0, Math.round(nodes[k])); - const x1 = Math.min(this.width - 1, Math.round(nodes[k + 1])); + const x0 = Math.max(0, Math.floor(nodes[k])); + const x1 = Math.min(this.width - 1, Math.ceil(nodes[k + 1])); for (let x = x0; x <= x1; x++) { + const [r, g, b, a] = isGrad ? this._parseColor(this.fillStyle, x, y) : base; this._blendPixel(x, y, r, g, b, a); } } @@ -441,40 +586,53 @@ export class SoftCanvas2D { stroke() { const [r, g, b, a] = this._parseColor(this.strokeStyle); if (a <= 0 || this._path.length < 2) return; - const hw = Math.max(0.5, (this.lineWidth * this._sx) / 2); + const hw = Math.max(0.55, (this.lineWidth * this._sx) / 2); + + // Anti-aliased circle ring fast path + if (this._circleFastPath) { + const { cx, cy, r: rad } = this._circleFastPath; + const pad = Math.ceil(hw + 1.5); + const x0 = Math.max(0, Math.floor(cx - rad - pad)); + const x1 = Math.min(this.width - 1, Math.ceil(cx + rad + pad)); + const y0 = Math.max(0, Math.floor(cy - rad - pad)); + const y1 = Math.min(this.height - 1, Math.ceil(cy + rad + pad)); + for (let py = y0; py <= y1; py++) { + const dy = py - cy; + for (let px = x0; px <= x1; px++) { + const dx = px - cx; + const dist = Math.abs(Math.sqrt(dx * dx + dy * dy) - rad); + if (dist <= hw + 0.7) { + const cov = Math.max(0, Math.min(1, hw + 0.7 - dist)); + this._blendPixel(px, py, r, g, b, Math.round(a * cov)); + } + } + } + return; + } for (let i = 1; i < this._path.length; i++) { const p0 = this._path[i - 1]; const p1 = this._path[i]; if (p1.type === "M") continue; - this._drawSegment(p0.x, p0.y, p1.x, p1.y, hw, r, g, b, a); + this._drawAntiAliasedSegment(p0.x, p0.y, p1.x, p1.y, hw, r, g, b, a); } } - _drawSegment(x0, y0, x1, y1, hw, r, g, b, a) { - const dx = x1 - x0; - const dy = y1 - y0; - const len = Math.sqrt(dx * dx + dy * dy); - if (len < 0.001) return; - - const steps = Math.ceil(len * 1.5); - const rad = Math.max(0.5, hw); - const ir = Math.ceil(rad); - for (let s = 0; s <= steps; s++) { - const u = s / steps; - const cx = x0 + dx * u; - const cy = y0 + dy * u; - const ix0 = Math.round(cx); - const iy0 = Math.round(cy); - if (rad <= 0.85) { - this._blendPixel(ix0, iy0, r, g, b, a); - } else { - for (let oy = -ir; oy <= ir; oy++) { - for (let ox = -ir; ox <= ir; ox++) { - if (ox * ox + oy * oy <= rad * rad + 0.35) { - this._blendPixel(ix0 + ox, iy0 + oy, r, g, b, a); - } - } + _drawAntiAliasedSegment(x0, y0, x1, y1, hw, r, g, b, a) { + const pad = Math.ceil(hw + 1.2); + const minX = Math.max(0, Math.floor(Math.min(x0, x1) - pad)); + const maxX = Math.min(this.width - 1, Math.ceil(Math.max(x0, x1) + pad)); + const minY = Math.max(0, Math.floor(Math.min(y0, y1) - pad)); + const maxY = Math.min(this.height - 1, Math.ceil(Math.max(y0, y1) + pad)); + + for (let py = minY; py <= maxY; py++) { + const cy = py + 0.5; + for (let px = minX; px <= maxX; px++) { + const cx = px + 0.5; + const d = distToSegment(cx, cy, x0, y0, x1, y1); + if (d <= hw + 0.65) { + const cov = Math.max(0, Math.min(1, hw + 0.65 - d)); + this._blendPixel(px, py, r, g, b, Math.round(a * cov)); } } } @@ -484,11 +642,9 @@ export class SoftCanvas2D { const m = String(this.font || "13px monospace").match(/(\d+(?:\.\d+)?)px/); const px = m ? parseFloat(m[1]) : 13; const bold = /bold|[6789]00/i.test(String(this.font)); - const effPx = px * this._sx; - const scale = effPx >= 12.5 ? Math.max(2, Math.round(effPx / 7.5)) : 1; - const charW = 5 * scale + Math.max(1, scale - 1); - const charH = 7 * scale; - return { px, bold, scale, charW, charH }; + const effPx = Math.max(9, Math.round(px * this._sx)); + const sample = getGlyphBitmap("M", effPx, bold); + return { px, effPx, bold, charW: sample.w, charH: sample.h }; } measureText(text) { @@ -503,7 +659,7 @@ export class SoftCanvas2D { const [r, g, b, a] = this._parseColor(this.fillStyle); if (a <= 0) return; - const { px, scale, charW, charH } = this._parseFont(); + const { px, effPx, bold, charW, charH } = this._parseFont(); const totalW = str.length * charW; let startX = this._mapX(x); let startY = this._mapY(y); @@ -511,9 +667,9 @@ export class SoftCanvas2D { if (this.textAlign === "center") startX -= totalW / 2; else if (this.textAlign === "right" || this.textAlign === "end") startX -= totalW; - if (this.textBaseline === "middle") startY -= charH / 2; - else if (this.textBaseline === "bottom") startY -= charH; - else if (this.textBaseline === "alphabetic") startY -= charH * 0.8; + if (this.textBaseline === "middle") startY -= charH * 0.46; + else if (this.textBaseline === "bottom") startY -= charH * 0.9; + else if (this.textBaseline === "alphabetic") startY -= charH * 0.78; startX = Math.round(startX); startY = Math.round(startY); @@ -538,18 +694,13 @@ export class SoftCanvas2D { for (let c = 0; c < str.length; c++) { const ch = str[c]; - const rows = GLYPHS[ch] || GLYPHS[ch.toUpperCase()] || GLYPHS["?"]; + const bmp = getGlyphBitmap(ch, effPx, bold); const cx0 = startX + c * charW; - for (let ry = 0; ry < 7; ry++) { - const rowBits = rows[ry]; - if (!rowBits) continue; - for (let rx = 0; rx < 5; rx++) { - if ((rowBits >> (4 - rx)) & 1) { - for (let sy = 0; sy < scale; sy++) { - for (let sx = 0; sx < scale; sx++) { - this._blendPixel(cx0 + rx * scale + sx, startY + ry * scale + sy, r, g, b, a); - } - } + for (let gy = 0; gy < bmp.h; gy++) { + for (let gx = 0; gx < bmp.w; gx++) { + const ga = bmp.alpha[gy * bmp.w + gx]; + if (ga > 0) { + this._blendPixel(cx0 + gx, startY + gy, r, g, b, (a * ga) >> 8); } } } diff --git a/tool/scripts/build-gallery.js b/tool/scripts/build-gallery.js index 7bb9910..ca76b42 100644 --- a/tool/scripts/build-gallery.js +++ b/tool/scripts/build-gallery.js @@ -28,7 +28,7 @@ const GALLERY_ITEMS = [ seconds: 10, fps: 16, width: 800, - height: 320, + height: 360, palette: "studio-dark", scene: "flow", stage: ["request", "sketch", "check", "loop.gif"],