# Elgohary Consulting - Auto Update Script # Run this from your elgoharyconsulting-v6 folder Write-Host "========================================" -ForegroundColor Cyan Write-Host "Elgohary Consulting - Auto Update" -ForegroundColor Cyan Write-Host "========================================" -ForegroundColor Cyan Write-Host "" # Step 1: Download current index.html Write-Host "[1/4] Downloading current index.html..." -ForegroundColor Yellow $url = "https://elgoharyconsulting.pages.dev/index.html" try { $content = Invoke-WebRequest -Uri $url -UseBasicParsing | Select-Object -ExpandProperty Content $content | Out-File -FilePath "public\index.html" -Encoding UTF8 Write-Host " Downloaded successfully" -ForegroundColor Green } catch { Write-Host " Download failed: $_" -ForegroundColor Red Write-Host " Using existing file instead" -ForegroundColor Yellow } # Step 2: Apply fixes Write-Host "[2/4] Applying fixes..." -ForegroundColor Yellow $file = "public\index.html" $content = Get-Content $file -Raw -Encoding UTF8 # Fix 1: Arabic name duplication $content = $content -replace 'data-en="Mohamed E." data-ar="محمد"', 'data-en="Mohamed E." data-ar="محمد"' # Fix 2: Arabic spacing $content = $content -replace 'node\.textContent = text;', 'node.textContent = text + " ";' # Fix 3: Shorter Arabic contact subtitle $content = $content.Replace('data-ar="تواصل معي عبر واتساب ودعنا نناقش كيف يمكننا إنشاء تجارب تعليمية مؤثرة لمؤسستك."', 'data-ar="تواصل معي عبر واتساب ودعنا نناقش كيف يمكننا إنشاء تجارب تعليمية مؤثرة لمؤسستك."') # Fix 4: Image expand with !important $content = $content -replace '\.deco-photo:hover\{opacity:1;width:350px;height:350px;box-shadow', '.deco-photo:hover{opacity:1;width:350px!important;height:350px!important;box-shadow' # Fix 5: Dropdown appearance $content = $content -replace '-webkit-appearance:menulist;appearance:menulist;min-height:48px', '-webkit-appearance:menulist;appearance:menulist;min-height:48px' # Fix 6: Training overflow visible $content = $content.Replace('overflow:visible;}.about-training::before', 'overflow:visible;}.about-training::before') # Fix 7: goToStep - remove recursive calls $content = $content -replace "goToStep\(1\); return;", "return;" $content | Out-File -FilePath $file -Encoding UTF8 Write-Host " All fixes applied" -ForegroundColor Green # Step 3: Deploy Write-Host "[3/4] Deploying to Cloudflare Pages..." -ForegroundColor Yellow npx wrangler pages deploy public --project-name elgoharyconsulting Write-Host " Deployed successfully" -ForegroundColor Green # Step 4: Done Write-Host "" Write-Host "[4/4] Done!" -ForegroundColor Green Write-Host "Visit: https://elgoharyconsulting.pages.dev" -ForegroundColor Cyan Write-Host "Press Ctrl+Shift+R to hard refresh" -ForegroundColor Yellow