Skip to content

Commit a2277fd

Browse files
committed
feat: Replace HeroButton with AppButton component across multiple files for consistency and improved styling
1 parent 4902770 commit a2277fd

File tree

12 files changed

+157
-112
lines changed

12 files changed

+157
-112
lines changed

docs-v3/components/case-studies/CaseStudiesCta.vue

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,29 @@
1414
Start your project today and become our next case study.
1515
</p>
1616
<div class="flex flex-col sm:flex-row gap-4 justify-center">
17-
<HeroButton
18-
type="primary"
17+
<AppButton
18+
variant="primary"
1919
href="/docs"
2020
:icon="BookOpenIcon"
2121
:is-nuxt-link="true"
22+
:external="false"
2223
>
2324
Get Started with Restify
24-
</HeroButton>
25-
<HeroButton
26-
type="secondary"
25+
</AppButton>
26+
<AppButton
27+
variant="secondary"
2728
href="https://www.binarcode.com/recent-work"
2829
:icon="BriefcaseIcon"
30+
:show-external-icon="true"
2931
>
3032
Recent Projects
31-
</HeroButton>
33+
</AppButton>
3234
</div>
3335
</div>
3436
</div>
3537
</template>
3638

3739
<script setup lang="ts">
3840
import { BookOpenIcon, BriefcaseIcon } from '@heroicons/vue/24/outline'
39-
import HeroButton from '~/components/website/HeroButton.vue'
41+
import AppButton from '~/components/ui/AppButton.vue'
4042
</script>

docs-v3/components/templates/TemplatesCustomCta.vue

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,20 @@
55
<p class="text-gray-400 mb-6">
66
Our team can build a custom Laravel Restify template tailored specifically to your project needs.
77
</p>
8-
<a
8+
<AppButton
9+
variant="primary"
10+
size="md"
911
href="https://www.binarcode.com/estimate-project"
10-
target="_blank"
11-
rel="noopener noreferrer"
12-
class="inline-flex items-center px-6 py-3 bg-red-600 hover:bg-red-700 text-white font-medium rounded-lg transition-all duration-200"
12+
:icon="WrenchScrewdriverIcon"
13+
:show-external-icon="true"
1314
>
1415
Get Your Custom Template
15-
<ArrowTopRightOnSquareIcon class="w-4 h-4 ml-2" />
16-
</a>
16+
</AppButton>
1717
</div>
1818
</div>
1919
</template>
2020

2121
<script setup lang="ts">
22-
import { ArrowTopRightOnSquareIcon } from '@heroicons/vue/24/outline'
22+
import { WrenchScrewdriverIcon } from '@heroicons/vue/24/outline'
23+
import AppButton from '~/components/ui/AppButton.vue'
2324
</script>

docs-v3/components/templates/TemplatesHeader.vue

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,29 @@
88
</p>
99

1010
<div class="flex flex-col sm:flex-row gap-4 justify-center items-center">
11-
<a
11+
<AppButton
12+
variant="primary"
13+
size="md"
1214
href="https://restifytemplates.com/"
13-
target="_blank"
14-
rel="noopener noreferrer"
15-
class="inline-flex items-center px-6 py-3 bg-red-600 hover:bg-red-700 text-white font-medium rounded-lg transition-all duration-200"
15+
:icon="RocketLaunchIcon"
16+
:show-external-icon="true"
1617
>
1718
Browse All Templates
18-
<ArrowTopRightOnSquareIcon class="w-4 h-4 ml-2" />
19-
</a>
20-
<a
19+
</AppButton>
20+
<AppButton
21+
variant="secondary"
22+
size="md"
2123
href="https://www.binarcode.com/estimate-project"
22-
target="_blank"
23-
rel="noopener noreferrer"
24-
class="inline-flex items-center px-6 py-3 bg-gray-100 dark:bg-gray-800/50 border border-gray-300 dark:border-gray-700 text-gray-700 dark:text-gray-300 hover:border-gray-400 dark:hover:border-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800 font-medium rounded-lg transition-all duration-200"
24+
:icon="WrenchScrewdriverIcon"
25+
:show-external-icon="true"
2526
>
26-
Get Your Custom Template
27-
<ArrowTopRightOnSquareIcon class="w-4 h-4 ml-2" />
28-
</a>
27+
Get Custom Template
28+
</AppButton>
2929
</div>
3030
</div>
3131
</template>
3232

3333
<script setup lang="ts">
34-
import { ArrowTopRightOnSquareIcon } from '@heroicons/vue/24/outline'
34+
import { RocketLaunchIcon, WrenchScrewdriverIcon } from '@heroicons/vue/24/outline'
35+
import AppButton from '~/components/ui/AppButton.vue'
3536
</script>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<template>
2+
<NuxtLink
3+
v-if="isNuxtLink"
4+
:to="href"
5+
:class="buttonClasses"
6+
>
7+
<div v-if="variant === 'primary'" class="absolute inset-0 bg-gradient-to-r from-blue-600 to-cyan-700 opacity-0 group-hover:opacity-100 transition-opacity duration-300"></div>
8+
<component v-if="icon" :is="icon" class="relative z-10 w-5 h-5 group-hover:rotate-12 transition-transform duration-300" />
9+
<span class="relative z-10"><slot /></span>
10+
<ArrowTopRightOnSquareIcon v-if="showExternalIcon && !isNuxtLink" class="relative z-10 w-4 h-4 ml-1" />
11+
</NuxtLink>
12+
<a
13+
v-else
14+
:href="href"
15+
:target="external ? '_blank' : undefined"
16+
:rel="external ? 'noopener noreferrer' : undefined"
17+
:class="buttonClasses"
18+
>
19+
<div v-if="variant === 'primary'" class="absolute inset-0 bg-gradient-to-r from-blue-600 to-cyan-700 opacity-0 group-hover:opacity-100 transition-opacity duration-300"></div>
20+
<component v-if="icon" :is="icon" class="relative z-10 w-5 h-5 group-hover:rotate-12 transition-transform duration-300" />
21+
<span class="relative z-10"><slot /></span>
22+
</a>
23+
</template>
24+
25+
<script setup lang="ts">
26+
import type { Component } from 'vue'
27+
import { ArrowTopRightOnSquareIcon } from '@heroicons/vue/24/outline'
28+
29+
type ButtonVariant = 'primary' | 'secondary'
30+
type ButtonSize = 'sm' | 'md' | 'lg'
31+
32+
interface Props {
33+
variant?: ButtonVariant
34+
size?: ButtonSize
35+
href: string
36+
icon?: Component
37+
isNuxtLink?: boolean
38+
external?: boolean
39+
showExternalIcon?: boolean
40+
}
41+
42+
const props = withDefaults(defineProps<Props>(), {
43+
variant: 'primary',
44+
size: 'lg',
45+
isNuxtLink: false,
46+
external: true,
47+
showExternalIcon: false
48+
})
49+
50+
const SIZE_CLASSES: Record<ButtonSize, string> = {
51+
sm: 'px-4 py-2 text-sm min-h-[40px]',
52+
md: 'px-5 py-3 text-base min-h-[48px]',
53+
lg: 'px-6 sm:px-8 py-4 text-base sm:text-lg min-h-[56px]'
54+
}
55+
56+
const BASE_CLASSES = 'cursor-pointer group relative inline-flex items-center justify-center gap-3 font-semibold rounded-full overflow-hidden transition-all duration-300 hover:scale-105'
57+
58+
const VARIANT_STYLES: Record<ButtonVariant, string> = {
59+
primary: 'text-white bg-gradient-to-r from-blue-500 to-cyan-600 hover:shadow-2xl hover:shadow-blue-500/25',
60+
secondary: 'text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-white/5 border border-gray-300 dark:border-white/10 backdrop-blur-sm hover:bg-gray-200 dark:hover:bg-white/10 hover:border-gray-400 dark:hover:border-white/20'
61+
}
62+
63+
const buttonClasses = computed(() => `${BASE_CLASSES} ${SIZE_CLASSES[props.size]} ${VARIANT_STYLES[props.variant]}`)
64+
</script>

docs-v3/components/ui/AppLogo.vue

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<template>
2+
<NuxtLink v-if="linkable" to="/" class="flex items-center group">
3+
<span class="text-2xl font-bold tracking-tight">
4+
<span class="bg-gradient-to-r from-gray-700 via-gray-500 to-gray-700 dark:from-white dark:via-gray-200 dark:to-white bg-clip-text text-transparent drop-shadow-sm">
5+
Laravel Restify
6+
</span>
7+
<span class="inline-block w-2 h-2 ml-0.5 mb-1 rounded-full bg-gradient-to-br from-red-500 to-red-600 shadow-lg shadow-red-500/50 group-hover:shadow-red-500/70 group-hover:scale-110 transition-all duration-300"></span>
8+
</span>
9+
</NuxtLink>
10+
<div v-else class="flex items-center">
11+
<span class="text-2xl font-bold tracking-tight">
12+
<span class="bg-gradient-to-r from-gray-700 via-gray-500 to-gray-700 dark:from-white dark:via-gray-200 dark:to-white bg-clip-text text-transparent drop-shadow-sm">
13+
Laravel Restify
14+
</span>
15+
<span class="inline-block w-2 h-2 ml-0.5 mb-1 rounded-full bg-gradient-to-br from-red-500 to-red-600 shadow-lg shadow-red-500/50"></span>
16+
</span>
17+
</div>
18+
</template>
19+
20+
<script setup lang="ts">
21+
interface Props {
22+
linkable?: boolean
23+
}
24+
25+
withDefaults(defineProps<Props>(), {
26+
linkable: false
27+
})
28+
</script>

docs-v3/components/website/CtaSection.vue

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,23 @@
6565
</div>
6666

6767
<div class="flex flex-col sm:flex-row gap-4 justify-center px-4 md:px-0">
68-
<HeroButton
69-
type="primary"
68+
<AppButton
69+
variant="primary"
7070
href="/docs"
7171
:icon="BoltIcon"
7272
:is-nuxt-link="true"
73+
:external="false"
7374
>
7475
Start Building
75-
</HeroButton>
76+
</AppButton>
7677

77-
<HeroButton
78+
<AppButton
79+
variant="secondary"
7880
href="https://github.com/binaryk/laravel-restify"
79-
type="secondary"
8081
:icon="CodeBracketIcon"
8182
>
8283
Explore Code
83-
</HeroButton>
84+
</AppButton>
8485
</div>
8586
</div>
8687
</section>
@@ -92,7 +93,7 @@ import {
9293
CloudArrowDownIcon,
9394
CodeBracketIcon
9495
} from '@heroicons/vue/24/outline'
95-
import HeroButton from './HeroButton.vue'
96+
import AppButton from '~/components/ui/AppButton.vue'
9697
import TerminalWindow from './TerminalWindow.vue'
9798
9899
const COMPOSER_COMMAND = 'composer require binaryk/laravel-restify'

docs-v3/components/website/HeroButton.vue

Lines changed: 0 additions & 48 deletions
This file was deleted.

docs-v3/components/website/HeroSection.vue

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,23 @@
5252

5353
<!-- Action Buttons -->
5454
<div class="flex flex-col sm:flex-row gap-3 sm:gap-4 justify-center mt-6 md:mt-8 px-2 md:px-0">
55-
<HeroButton
56-
type="primary"
55+
<AppButton
56+
variant="primary"
5757
href="/docs"
5858
:icon="BoltIcon"
5959
:is-nuxt-link="true"
60+
:external="false"
6061
>
6162
Start Building
62-
</HeroButton>
63+
</AppButton>
6364

64-
<HeroButton
65-
type="secondary"
65+
<AppButton
66+
variant="secondary"
6667
href="https://github.com/binaryk/laravel-restify"
6768
:icon="CodeBracketIcon"
6869
>
6970
Explore Code
70-
</HeroButton>
71+
</AppButton>
7172
</div>
7273
</div>
7374

@@ -144,7 +145,8 @@ import {
144145
ClipboardIcon,
145146
CheckIcon
146147
} from '@heroicons/vue/24/outline'
147-
import HeroButton from './HeroButton.vue'
148+
149+
import AppButton from '~/components/ui/AppButton.vue'
148150
import HeroStat from './HeroStat.vue'
149151
import CodeSection from './CodeSection.vue'
150152

docs-v3/components/website/WebsiteFooter.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@
44
<div class="grid grid-cols-1 md:grid-cols-4 gap-8">
55
<!-- Brand and description - spans 2 columns on desktop -->
66
<div class="col-span-1 md:col-span-2">
7-
<div class="flex items-center space-x-2 mb-4">
8-
<div class="w-8 h-8 bg-gradient-to-br from-red-500 to-red-600 rounded-lg flex items-center justify-center">
9-
<span class="text-white font-bold text-lg">R</span>
10-
</div>
11-
<span class="font-semibold text-xl text-gray-900 dark:text-white">Laravel Restify</span>
7+
<div class="mb-4">
8+
<AppLogo />
129
</div>
1310
<p class="text-gray-600 dark:text-gray-400 mb-6 max-w-md">
1411
Build JSON:API compliant REST APIs and MCP servers from your Laravel Eloquent models
@@ -96,6 +93,7 @@
9693

9794
<script setup lang="ts">
9895
import { ArrowTopRightOnSquareIcon } from '@heroicons/vue/24/outline'
96+
import AppLogo from '../ui/AppLogo.vue'
9997
10098
const currentYear = new Date().getFullYear()
10199

docs-v3/components/website/WebsiteNavbar.vue

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,9 @@
1111
<Bars3Icon class="h-6 w-6" />
1212
</button>
1313

14-
<NuxtLink to="/" class="flex items-center ml-2 lg:ml-0 group">
15-
<span class="text-2xl font-bold tracking-tight">
16-
<span class="bg-gradient-to-r from-gray-700 via-gray-500 to-gray-700 dark:from-white dark:via-gray-200 dark:to-white bg-clip-text text-transparent drop-shadow-sm">
17-
Laravel Restify
18-
</span>
19-
<span class="inline-block w-2 h-2 ml-0.5 mb-1 rounded-full bg-gradient-to-br from-red-500 to-red-600 shadow-lg shadow-red-500/50 group-hover:shadow-red-500/70 group-hover:scale-110 transition-all duration-300"></span>
20-
</span>
21-
</NuxtLink>
14+
<div class="ml-2 lg:ml-0">
15+
<AppLogo :linkable="true" />
16+
</div>
2217
</div>
2318

2419
<div class="hidden lg:flex lg:items-center lg:space-x-8">
@@ -83,6 +78,7 @@
8378

8479
<script setup lang="ts">
8580
import { Bars3Icon } from '@heroicons/vue/24/outline'
81+
import AppLogo from '../ui/AppLogo.vue'
8682
8783
interface NavLink {
8884
to: string

0 commit comments

Comments
 (0)