Site: isometric geometry; comment checks scan JS, TS and CSS by tokens

This commit is contained in:
ZacharyZhang-NY committed 2026-10-08 23:26:32 -04:00
1 parent 570bb176e8
commit b991d59b21
12 files changed
+292 -41

No files matched your search

+11 -7
View File
@@ -42,9 +42,9 @@ launch() {
rm -rf "$home"
local data="$home/Library/Application Support/ElyOffice/$app"
mkdir -p "$data"
printf '{"version":1,"window":{"mode":"windowed","x":%s,"y":%s,"width":%s,"height":%s}}\n' \
"$win_x" "$win_y" "$win_w" "$win_h" >"$data/settings.json"
HOME=$home ELY_APPEARANCE=light ELY_LOCALE=en ELY_NO_DIALOG=1 ELY_LOG=info ELY_REDUCE_MOTION=0 \
printf '{"version":1,"window":{"mode":"windowed","x":%s,"y":%s,"width":%s,"height":%s}%s}\n' \
"$win_x" "$win_y" "$win_w" "$win_h" "${PANEL_LEFT:+,\"panels\":{\"left\":$PANEL_LEFT}}" >"$data/settings.json"
env HOME="$home" ELY_APPEARANCE=light ELY_LOCALE=en ELY_NO_DIALOG=1 ELY_LOG=info ELY_REDUCE_MOTION=0 \
${EXTRA_ENV:-} "$root/target/release/$app" "$@" >"$out/logs/$app.out" 2>"$out/logs/$app.err" &
app_pid=$!
}
@@ -72,7 +72,7 @@ wait_ax() {
return 1
}
# Center of the first AX element whose line has $1, as "x y".
# Center "x y" of the first AX line matching $1.
where() {
local i at
for i in $(seq 20); do
@@ -140,11 +140,15 @@ print(next(round(x / scale) for x in range(start, im.size[0]) if im.getpixel((x,
PY
}
# Starts capturing the window region of the main screen.
# Captures the window, or a given region in points.
record_start() {
local x y w h
read -r x y w h < <(frame)
[ "$w" = "$win_w" ] && [ "$h" = "$win_h" ] || echo "note: window is ${w}x${h}, not ${win_w}x${win_h}" >&2
if [ $# -eq 5 ]; then
x=$2 y=$3 w=$4 h=$5
else
read -r x y w h < <(frame)
[ "$w" = "$win_w" ] && [ "$h" = "$win_h" ] || echo "note: window is ${w}x${h}" >&2
fi
rm -f "$out/rec/$1.mov"
cap_name=$1
ffmpeg -hide_banner -loglevel error -f avfoundation -capture_cursor 1 -framerate 60 -pixel_format nv12 -i "0:none" \
+14 -1
View File
@@ -1,4 +1,4 @@
// Human-paced mouse: move, click, double, drag, scroll.
// Human-paced mouse: move, click, double, drag, path, scroll.
import CoreGraphics
import Foundation
@@ -55,6 +55,19 @@ case "drag":
glide(to: b, seconds: n.count > 4 ? n[4] : 0.7, dragging: true)
usleep(120_000)
post(.leftMouseUp, b)
case "path":
// Seconds, then x y pairs; drags through them.
let seconds = n[0]
let points = stride(from: 1, to: n.count - 1, by: 2).map { CGPoint(x: n[$0], y: n[$0 + 1]) }
glide(to: points[0], seconds: pace(points[0]))
usleep(150_000)
post(.leftMouseDown, points[0])
for p in points.dropFirst() {
post(.leftMouseDragged, p)
usleep(useconds_t(seconds / Double(points.count) * 1_000_000))
}
usleep(100_000)
post(.leftMouseUp, points[points.count - 1])
case "scroll":
// Pixel deltas, spread over time; negative scrolls down.
let total = n[0], seconds = n.count > 1 ? n[1] : 1.0
+44
View File
@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# ElyPDF: scroll pages, highlight, draw and place a signature.
source "$(dirname "$0")/lib.sh"
us_input
launch ely-pdf "$demo/Coastal Trails Guide.pdf"
wait_log "pdf: first tile drawn" 60
front
sleep 4
x=$win_x
y=$win_y
menu() {
osascript -e "tell application \"System Events\" to tell (first process whose unix id is $app_pid) to click menu item \"$2\" of menu \"$1\" of menu bar 1" >/dev/null
}
record_start pdf
pause 0.6
mark "scroll from page 1 to page 2"
mouse move $((x + 900)) $((y + 520)) 0.5
mouse scroll -2200 2.4
pause 0.4
menu View "Fit Page"
mark "Fit Page: whole page 2"
pause 0.8
menu Annotate Highlight
mark "highlight tool; drag over two lines"
mouse drag $((x + 688)) $((y + 522)) $((x + 1118)) $((y + 538)) 1.0
mark "highlight added"
pause 0.8
keys "key code 53"
menu Document "Add Visible Signature…"
mark "Visible signature dialog"
pause 0.6
mouse path 1.8 $(python3 "$video/record/signature.py" $((x + 770)) $((y + 495)) 280)
mark "signature drawn"
pause 0.5
read -r gx gy < <(where "title=Place on Page")
mouse click "$gx" "$gy"
pause 0.5
mouse click $((x + 960)) $((y + 710))
mark "signature placed on page"
pause 0.6
mouse move $((x + 1350)) $((y + 640)) 0.6
pause 1.4
record_stop pdf
+63
View File
@@ -0,0 +1,63 @@
#!/usr/bin/env bash
# ElyShow: add animations, preview them, then present.
source "$(dirname "$0")/lib.sh"
us_input
launch ely-show "$demo/Coastal Trails 2027.pptx"
wait_log "lok: first tile drawn" 60
front
sleep 4
x=$win_x
y=$win_y
# Picks effect $1 rows above the Add Animation button.
animate() {
local ax ay
read -r ax ay < <(where "title=Add Animation")
mouse click "$ax" "$ay"
pause 0.6
mouse click $((ax - 19)) $((ay - $1))
}
record_start show
pause 0.8
mark "select the title"
mouse click $((x + 750)) $((y + 352))
pause 0.6
mouse move $((x + 1440)) $((y + 600)) 0.5
mouse scroll -900 0.8
pause 0.4
mark "Add Animation > Fly In"
animate 359
pause 0.8
mark "select the subtitle"
mouse click $((x + 750)) $((y + 430))
pause 0.6
mark "Add Animation > Fade In"
animate 387
pause 0.8
read -r px py < <(where "title=Preview Animations")
mark "Preview Animations"
mouse click "$px" "$py"
pause 4.0
record_stop show
# The slide show fills the screen; record its middle.
mouse move 250 1100 0.4
keys "key code 96"
sleep 3
record_start show-play 491 30 2027 1140
pause 0.8
mark "Space: title flies in"
keys "key code 49"
pause 1.6
mark "Space: subtitle fades in"
keys "key code 49"
pause 1.6
mark "Right: slide 2"
keys "key code 124"
pause 2.0
mark "Right: slide 3"
keys "key code 124"
pause 2.0
record_stop show-play
keys "key code 53"
pause 1
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env python3
"""Prints a looping signature stroke as x y pairs."""
import math
import sys
cx, cy, w = float(sys.argv[1]), float(sys.argv[2]), float(sys.argv[3])
turns = 6
a = 0.8 * w / (turns * 2 * math.pi)
b = 1.6 * a
left = cx - w / 2
points = []
for i in range(301):
t = i / 300 * turns * 2 * math.pi
lift = (2.6 if i < 50 else 1.4) * (1 + 0.35 * math.sin(t / 3))
rise = lift * b * (1 - math.cos(t))
points.append((left + a * t - b * math.sin(t) + 0.35 * rise, cy - rise + 0.04 * w * (i / 300)))
end_x, end_y = points[-1]
for i in range(1, 61):
s = i / 60
points.append((end_x - s * 0.95 * w * 0.9, end_y + 0.07 * w * math.sin(s * math.pi) + 0.03 * w * s))
print(" ".join(f"{x:.0f} {y:.0f}" for x, y in points))
+21 -21
View File
@@ -15,52 +15,52 @@ menu() {
osascript -e "tell application \"System Events\" to tell (first process whose unix id is $app_pid) to click menu item \"$2\" of menu \"$1\" of menu bar 1" >/dev/null
}
record_start table
pause 0.8
pause 0.6
mark "click B9"
mouse click $(cell 242 357)
pause 0.4
pause 0.2
mark "typing =SUM(B2:B7)"
typed "=SUM(B2:B7)"
pause 0.4
keys "key code 36"
mark "formula entered"
pause 0.5
pause 0.3
mouse click $(cell 242 357)
pause 0.4
pause 0.2
mark "fill handle drag B9 to H9"
mouse drag $(cell 295 370) $(cell 880 362) 1.0
pause 0.8
mouse drag $(cell 295 370) $(cell 880 362) 0.8
pause 0.6
mark "select A1:H7"
mouse drag $(cell 118 145) $(cell 880 305) 0.8
pause 0.4
mouse drag $(cell 118 145) $(cell 880 305) 0.6
pause 0.2
menu Data AutoFilter
mark "AutoFilter on"
pause 0.7
pause 0.5
mouse click $(cell 921 147)
mark "Total filter menu open"
pause 0.8
pause 0.6
read -r sx sy < <(where $'title=Sort Z to A\t')
mouse click "$sx" "$sy"
mark "sorted Z to A by Total"
pause 1.2
mouse click $(cell 1100 600)
pause 0.3
pause 1.0
mouse click $(cell 1000 420)
pause 0.2
mark "select A1:G7"
mouse drag $(cell 118 145) $(cell 774 305) 0.8
pause 0.4
mouse drag $(cell 118 145) $(cell 774 305) 0.6
pause 0.2
menu Insert "Chart…"
mark "Insert Chart dialog"
pause 0.8
pause 0.5
read -r ix iy < <(where $'AXButton\tvalue=\ttitle=Insert\t')
mouse click $((ix - 87)) $((iy - 185))
typed "Sales by product"
pause 0.4
pause 0.3
mouse click "$ix" "$iy"
mark "chart inserted"
pause 1.0
mouse drag $(cell 520 300) $(cell 520 610) 0.9
pause 0.8
mouse drag $(cell 520 300) $(cell 520 610) 0.8
mark "chart moved below the table"
pause 0.6
mouse click $(cell 1100 700)
pause 0.4
mouse click $(cell 1050 520)
pause 1.5
record_stop table
+40
View File
@@ -0,0 +1,40 @@
#!/usr/bin/env bash
# ElyTree: diff, stage a hunk, commit, then the history graph.
source "$(dirname "$0")/lib.sh"
repo=/Users/Shared/Projects/field-notes
bash "$video/demo/repo.sh" "$repo"
us_input
PANEL_LEFT=540 EXTRA_ENV="ELY_GIT=/usr/bin/git" launch ely-tree "$repo"
wait_log "tree: watching" 30
front
sleep 3
x=$win_x
y=$win_y
record_start tree
pause 0.8
mark "open the changed file's diff"
mouse click $((x + 92)) $((y + 157))
pause 1.4
mark "Stage Hunk (first hunk only)"
mouse click $((x + 1544)) $((y + 150))
pause 1.0
mark "type commit summary"
mouse click $((x + 250)) $((y + 736))
pause 0.3
typed "Harbor Loop: best at low tide"
pause 0.5
mark "Commit to main"
mouse click $((x + 477)) $((y + 855))
pause 1.2
mark "History tab: graph"
mouse click $((x + 145)) $((y + 85))
pause 1.2
mark "open the new commit"
mouse click $((x + 260)) $((y + 220))
pause 1.0
mouse move $((x + 1000)) $((y + 700)) 0.8
pause 1.5
record_stop tree
rm -rf "$repo"
rmdir /Users/Shared/Projects 2>/dev/null || true