Files
TWR-Backend/tmp_fix_hovers.php
2026-03-31 12:59:03 +08:00

26 lines
1.0 KiB
PHP

<?php
$dir = new RecursiveDirectoryIterator('/Users/dvapp/Documents/TWR/TheWatchReservee/resources/views/livewire');
$iterator = new RecursiveIteratorIterator($dir);
$count = 0;
foreach ($iterator as $file) {
if ($file->isFile() && $file->getExtension() === 'php') {
$path = $file->getPathname();
$content = file_get_contents($path);
$newContent = preg_replace('/hover:bg-zinc-50(?:\s+dark:hover:bg-[a-z0-9\/]+)?\s+transition-colors/', 'hover:bg-zinc-50 dark:hover:bg-transparent transition-colors', $content);
// Try simple replace if regex missed it due to newlines
if ($content === $newContent) {
$newContent = str_replace('hover:bg-zinc-50 transition-colors', 'hover:bg-zinc-50 dark:hover:bg-transparent transition-colors', $content);
}
if ($content !== $newContent) {
file_put_contents($path, $newContent);
$count++;
echo "Updated: $path\n";
}
}
}
echo "Total updated: $count files.\n";