mirror of
https://github.com/soconnor0919/beenvoice.git
synced 2025-12-13 01:24:44 -05:00
Use transition-colors for brand buttons
Adjust PDF export pagination for better orphan handling Increase dense header space to 300px for PDF export Prevent orphan pages with fewer than 2 items in PDF export
This commit is contained in:
@@ -87,7 +87,7 @@ export default function HomePage() {
|
||||
<Link href="/auth/register">
|
||||
<Button
|
||||
size="lg"
|
||||
className="btn-brand-secondary group w-full px-6 py-3 text-base font-semibold shadow-xl transition-all duration-300 sm:w-auto sm:px-8 sm:py-4 sm:text-lg"
|
||||
className="btn-brand-secondary group w-full px-6 py-3 text-base font-semibold shadow-xl transition-colors duration-300 sm:w-auto sm:px-8 sm:py-4 sm:text-lg"
|
||||
>
|
||||
Get Started
|
||||
<ArrowRight className="ml-2 h-4 w-4 transition-transform group-hover:translate-x-1 sm:h-5 sm:w-5" />
|
||||
@@ -381,7 +381,7 @@ export default function HomePage() {
|
||||
<Button
|
||||
size="lg"
|
||||
variant="secondary"
|
||||
className="btn-brand-secondary group w-full px-6 py-3 text-base font-semibold shadow-xl transition-all duration-300 sm:w-auto sm:px-8 sm:py-4 sm:text-lg"
|
||||
className="btn-brand-secondary group w-full px-6 py-3 text-base font-semibold shadow-xl transition-colors duration-300 sm:w-auto sm:px-8 sm:py-4 sm:text-lg"
|
||||
>
|
||||
Start Free Today
|
||||
<Rocket className="ml-2 h-4 w-4 transition-transform group-hover:translate-x-1 sm:h-5 sm:w-5" />
|
||||
|
||||
@@ -623,7 +623,7 @@ function calculateItemsForPage(
|
||||
|
||||
if (isFirstPage) {
|
||||
// Dense header takes significant space
|
||||
availableHeight -= 200; // Dense header space
|
||||
availableHeight -= 300; // Dense header space
|
||||
} else {
|
||||
// Abridged header is smaller
|
||||
availableHeight -= 60; // Abridged header space
|
||||
@@ -675,7 +675,7 @@ function calculateItemsPerPage(
|
||||
|
||||
if (isFirstPage) {
|
||||
// Dense header takes significant space
|
||||
availableHeight -= 200; // Dense header space
|
||||
availableHeight -= 300; // Dense header space
|
||||
} else {
|
||||
// Abridged header is smaller
|
||||
availableHeight -= 60; // Abridged header space
|
||||
@@ -717,36 +717,35 @@ function paginateItems(
|
||||
const isFirstPage = pageIndex === 0;
|
||||
const remainingItems = validItems.length - currentIndex;
|
||||
|
||||
// Check if this is the last page to determine if we need space for notes
|
||||
const couldBeLastPage =
|
||||
currentIndex + calculateItemsPerPage(isFirstPage, false) >=
|
||||
validItems.length;
|
||||
// Determine if this could be the last page with simple calculation
|
||||
const maxPossibleItems = calculateItemsPerPage(isFirstPage, false);
|
||||
const wouldBeLastPage =
|
||||
currentIndex + maxPossibleItems >= validItems.length;
|
||||
|
||||
// Calculate items per page using dynamic calculation
|
||||
// Calculate items per page, accounting for notes space if this is likely the last page
|
||||
let itemsPerPage = calculateItemsForPage(
|
||||
validItems,
|
||||
currentIndex,
|
||||
isFirstPage,
|
||||
couldBeLastPage && hasNotes,
|
||||
wouldBeLastPage && hasNotes,
|
||||
);
|
||||
|
||||
// Fallback to old method if dynamic calculation fails
|
||||
// Fallback to conservative calculation if dynamic fails
|
||||
if (itemsPerPage === 0) {
|
||||
itemsPerPage = calculateItemsPerPage(
|
||||
isFirstPage,
|
||||
couldBeLastPage && hasNotes,
|
||||
wouldBeLastPage && hasNotes,
|
||||
);
|
||||
}
|
||||
|
||||
// Check if this would create orphans (< 3 items on next page)
|
||||
if (remainingItems > itemsPerPage && remainingItems - itemsPerPage < 3) {
|
||||
// Try to fit a few more items or split more evenly
|
||||
const potentialItemsPerPage = Math.floor(remainingItems / 2);
|
||||
if (potentialItemsPerPage > 0) {
|
||||
itemsPerPage = potentialItemsPerPage;
|
||||
}
|
||||
// Ensure we don't have tiny orphan pages
|
||||
if (remainingItems > itemsPerPage && remainingItems - itemsPerPage < 2) {
|
||||
itemsPerPage = Math.max(1, itemsPerPage - 1);
|
||||
}
|
||||
|
||||
// Never take more items than we have
|
||||
itemsPerPage = Math.min(itemsPerPage, remainingItems);
|
||||
|
||||
const pageItems = validItems.slice(
|
||||
currentIndex,
|
||||
currentIndex + itemsPerPage,
|
||||
|
||||
@@ -671,7 +671,7 @@
|
||||
|
||||
/* Additional Brand Utility Classes */
|
||||
.btn-brand-primary {
|
||||
@apply bg-gradient-to-r from-teal-500 to-teal-700 text-white shadow-lg shadow-teal-500/25 transition-all duration-300 hover:from-teal-600 hover:to-teal-800 hover:shadow-xl hover:shadow-teal-500/30;
|
||||
@apply bg-gradient-to-r from-teal-500 to-teal-700 text-white shadow-lg shadow-teal-500/25 transition-colors duration-300 hover:from-teal-600 hover:to-teal-800;
|
||||
}
|
||||
|
||||
.btn-brand-secondary {
|
||||
|
||||
Reference in New Issue
Block a user