Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions resources/json-database/faqs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"question": "Can you help with upgrade of PHP 5.3 code?",
"answer": "Yes, we handle any code from PHP 5.3 onward. Open-source framework, internal one or spaghetti code."
},
{
"question": "What's the typical timeframe for an upgrade?",
"answer": "An average project upgrade is completed within 6-12 months. We approach each project individually and deliver the detailed estimate in the intro analysis."
},
{
"question": "We're in a hurry. Can you start today?",
"answer": "We begin with a 3-week intro analysis, followed by an upgrade work."
},
{
"question": "Can we continue developing new features during the upgrade?",
"answer": "Absolutely. Our upgrade process runs parallel to your ongoing development, ensuring no slowdown in your business growth."
},
{
"question": "Will we need to re-hire your team for future upgrades?",
"answer": "No. Part of our work is to make your team self-sufficient. We get your code quality the highest possible level, get Rector to your CI working for you and then, next upgrade will be a matter of days on your own."
},
{
"question": "We have a custom framework we want get rid off.<br>Can you migrate it to an open-source one?",
"answer": "Yes. We specialize in framework migration, mostly to Symfony or Laravel frameworks."
}
]
128 changes: 77 additions & 51 deletions resources/views/homepage/_parts/faq.blade.php
Original file line number Diff line number Diff line change
@@ -1,52 +1,78 @@
<div class="row" id="faq">
<div class="col-12">
<h3>Can you help with upgrade of PHP 5.3 code?</h3>
<p>Yes, we handle any code from PHP 5.3 onward. Open-source framework, internal one or spaghetti code.</p>
</div>

<br>

<div class="col-12">
<h3>What's the typical timeframe for an upgrade?</h3>
<p>
An average project upgrade is completed within 6-12 months. We approach each project individually and deliver the detailed estimate in the intro analysis.
</p>
</div>

<br>

<div class="col-12">
<h3>We're in a hurry. Can you start today?</h3>
<p>
We begin with a 3-week <a href="{{ action(\App\Controller\HireTeamController::class) }}">intro analysis</a>, followed by an upgrade work.
</p>
</div>

<br>

<div class="col-12">
<h3>Can we continue developing new features during the upgrade?</h3>
<p>
Absolutely. Our upgrade process runs parallel to your ongoing development, ensuring no
slowdown in your business growth.
</p>
</div>

<br>

<div class="col-12">
<h3>Will we need to re-hire your team for future upgrades?</h3>
<p>
No. Part of our work is to make your team self-sufficient. We get your code quality the
highest possible level, get Rector to your CI working for you and then, next upgrade
will be a matter of days on your own.
</p>
</div>

<br>

<div class="col-12">
<h3>We have a custom framework. Can you migrate it to an open-source one?</h3>
<p>Yes. We specialize in framework migration, mostly to Symfony or Laravel frameworks.</p>
</div>
<style>
.faq-container {
max-width: 50em;
margin:auto;
}

.faq-item {
border-bottom: 1px solid #ddd;
}

.faq-question {
display: flex;
justify-content: space-between;
align-items: center;
cursor: pointer;
font-weight: 300;
font-size: 1.7em;
}

.faq-answer {
max-height: 0;
opacity: 0;
overflow: hidden;
padding: 0;
color: #34495e;
transition: max-height 0.5s ease, opacity 0.5s ease, padding 0.5s ease;
}

.faq-answer.open {
max-height: 200px; /* Adjust based on content size */
opacity: 1;
padding: 10px 0;
}

.faq-toggle {
font-size: 1.5em;
font-weight: 200;
/*font-weight: bold;*/
transition: transform 0.5s ease;
color: #aaa;
}

.faq-toggle::before {
content: '\2715'; /* Unicode for cross (×) */
display: inline-block;
}

.faq-toggle.open {
transform: rotate(45deg);
}
</style>

<div class="faq-container" id="faq">
@foreach($faqs as $faq)
<div class="faq-item">
<h3 class="faq-question">
<span>{!! $faq['question'] !!}</span>
<span class="faq-toggle"></span>
</h3>
<p class="faq-answer">
{{ $faq['answer'] }}
</p>
</div>
@endforeach
</div>


<script>
document.querySelectorAll('.faq-question').forEach(item => {
item.addEventListener('click', () => {
const answer = item.nextElementSibling;
const toggle = item.querySelector('.faq-toggle');

answer.classList.toggle('open');
toggle.classList.toggle('open');
});
});
</script>
1 change: 1 addition & 0 deletions resources/views/livewire/find-rule-component.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
class="form-control d-inline"
style="width: 18em"
wire:model.live.debounce.300ms="query"
autofocus="true"
>
<!-- @see https://livewire.laravel.com/docs/wire-model#customizing-the-debounce -->

Expand Down
23 changes: 13 additions & 10 deletions src/Controller/HomepageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,16 @@ public function __invoke(): View
'page_title' => "We'll Speed Up Your Development Process by 300%",
'recentPosts' => $this->postRepository->fetchLast(5),

'references' => $this->loadReferences(),
'upcomingTalks' => $this->loadUpcomingTalks(),

// seo
'metaTitle' => 'Rector: Fast PHP Code Upgrades & Refactoring',
'metaDescription' => 'Automate PHP code upgrades and refactoring with Rector. Save time, reduce errors, and modernize your codebase instantly. Try it now!',
]);
}

/**
* @return array{string, mixed}
*/
private function loadReferences(): array
{
$fileContents = FileSystem::read(__DIR__ . '/../../resources/json-database/references.json');
return Json::decode($fileContents, forceArrays: true);
// data
'references' => $this->loadJsonFileToArray(__DIR__ . '/../../resources/json-database/references.json'),
'faqs' => $this->loadJsonFileToArray(__DIR__ . '/../../resources/json-database/faqs.json'),
]);
}

/**
Expand All @@ -52,4 +46,13 @@ private function loadUpcomingTalks(): array
// remove past talks
return array_filter($upcomingTalks, static fn (array $talk): bool => $talk['date'] > date('Y-m-d'));
}

/**
* @return array<string, mixed>
*/
private function loadJsonFileToArray(string $filePath): array
{
$fileContents = FileSystem::read($filePath);
return Json::decode($fileContents, forceArrays: true);
}
}