#!/bin/sh
# Re-ports every design from the Claude Design export folder and regenerates the widget themes.
#   sh tools/port-all-tsites.sh "C:/Users/Personal/Desktop/all-getaway-sites/getaway-sites" ["<folder with the seven bundled redesigns: travel6/index.html …>"]
B="${2:-C:/Users/Personal/Downloads/export}"  # the bundled travel6–12 redesigns (travelN-v2), if that folder exists
S="${1:-C:/Users/Personal/Desktop/all-getaway-sites/getaway-sites}"
cd "$(dirname "$0")/.." || exit 1
while read -r dir key veil accent anim; do
  node tools/port-tsite.js "$S/$dir" "$dir" "$key" "$veil" "$accent" "$anim"
done <<'EOF'
buffelsfontein bf rgba(12,8,5,.78) #d98e3a iris
buffelsfontein2 bf2 rgba(12,8,5,.78) #d98e3a iris
travel6 t6 rgba(4,5,10,.82) #5cc8f5 iris
travel7 t7 rgba(26,25,22,.8) #b4532a curtain
travel8 t8 rgba(30,22,48,.72) #c79bff fade
travel10 t10 rgba(20,17,13,.8) #dcb572 curtain
travel12 t12 rgba(16,18,13,.8) #d9a441 fade
travel14 t14 rgba(2,26,36,.78) #5fe3d6 curtain
travel15 t15 rgba(11,37,69,.6) #1f7ae0 fade
travel17 t17 rgba(29,15,34,.78) #ffb067 fade
travel18 t18 rgba(15,39,66,.8) #d6402b iris
EOF
# buffelsfontein3 / 4: the same two designs again, with the booking flow dressed as part of the site (tsites/page-flow.css, like all five)
node tools/port-tsite.js "$S/buffelsfontein" buffelsfontein3 bf3 'rgb(13,9,5)' '#d98e3a' fade
node tools/port-tsite.js "$S/buffelsfontein2" buffelsfontein4 bf4 'rgb(13,9,5)' '#d98e3a' fade
node tools/port-tsite.js "$S/buffelsfontein" buffelsfontein5 bf5 'rgb(233,223,198)' '#b8322a' fade
node tools/bf-page.js          # buffelsfontein5: the booking flow is a page of the site
# travel9, travel11 and travel11-v2 are rebuilt in-house (assets/site.css + site.js): never re-ported over
for n in 6 7 8 9 10 12; do
  [ -f "$B/travel$n/index.html" ] || continue
  case $n in 6) a='rgba(4,5,10,.82) #5cc8f5 iris';; 7) a='rgba(26,25,22,.8) #b4532a curtain';; 8) a='rgba(30,22,48,.72) #c79bff fade';; 9) a='rgba(10,10,10,.8) #f0c36a blinds';; 10) a='rgba(20,17,13,.8) #dcb572 curtain';; 11) a='rgba(15,42,46,.8) #c8664a curtain';; 12) a='rgba(16,18,13,.8) #d9a441 fade';; esac
  set -- $a
  node tools/port-bundle.js "$B/travel$n/index.html" "travel$n-v2" "t${n}v2" "$1" "$2" "$3"
done
node tools/bf-page.js --others   # the redesigned exports (travelN-v2) are ported just above: page mode for them too
node tools/lighten-bf.js   # the Buffelsfontein photographs are dimmed half as much
node tools/bf-bushveld.js   # bushveld palette: browns, khaki and green instead of near-black; reds instead of orange
node tools/bf-scenery.js    # landscape backgrounds, windmill / 4x4 / brandy-and-Coke / farmer blocks
node tools/bf-readable.js   # Buffelsfontein 1-5: button words readable at rest and on hover
node tools/t10-medium.js     # travel10 in a medium-dark palette (no black backgrounds)
node tools/mobile-fixes.js   # phone-width fixes for travel9 / travel15
node tools/theme-tsite.js
node tools/stamp-sites.js   # the hand-built corporate sites (travel19-21): cache-busting stamps
