$content = [System.IO.File]::ReadAllText("index.html", [System.Text.Encoding]::UTF8)

# Replace all .jpg and .png with .webp for floorplan, amenities, and gallery
$content = $content -replace 'imgs/floorplan/([^"''\s]+)\.(jpg|png)', 'imgs/floorplan/$1.webp'
$content = $content -replace 'imgs/amenities/([^"''\s]+)\.(jpg|png)', 'imgs/amenities/$1.webp'
$content = $content -replace 'imgs/gallery/([^"''\s]+)\.(jpg|png)', 'imgs/gallery/$1.webp'

# Replace hero image
$content = $content -replace 'src="The-view-Slider-banner.webp"', 'src="imgs/Elevation.webp"'

[System.IO.File]::WriteAllText("index.html", $content, [System.Text.Encoding]::UTF8)
Write-Host "Updated index.html"
