|
1 | 1 | # Download Call-to-Action Component |
2 | 2 |
|
3 | | -A visually striking call-to-action component that encourages users to download gated resources. The component links to download landing pages where users fill out a form to access the content. |
4 | | - |
5 | | -## Features |
6 | | - |
7 | | -- **Theme-Aware Styling**: Adapts to site themes with CSS custom properties |
8 | | -- **Gradient Background**: Eye-catching gradient from primary to accent colors |
9 | | -- **Animated Icon**: Download icon with hover animation |
10 | | -- **Trust Indicators**: Shows "Instant Access", "No Credit Card Required", and "Expert Insights" |
11 | | -- **Responsive Design**: Mobile-first approach with responsive breakpoints |
12 | | -- **Accessible**: Semantic HTML with proper ARIA labels |
13 | | -- **Customizable**: Flexible props for title, description, and button text |
| 3 | +A call-to-action component to encourage users to download gated resources. The component links to download landing pages where users fill out a form to access the content. |
14 | 4 |
|
15 | 5 | ## Usage |
16 | 6 |
|
@@ -72,23 +62,6 @@ The `resource` prop must match the folder name of a download in `src/content/dow |
72 | 62 |
|
73 | 63 | The component will construct the URL as `/downloads/{resource}` and navigate to that landing page when the button is clicked. |
74 | 64 |
|
75 | | -## Design Elements |
76 | | - |
77 | | -### Visual Features |
78 | | - |
79 | | -- **Gradient Background**: Uses primary and accent theme colors |
80 | | -- **Decorative Blurs**: Subtle circular blur elements for depth |
81 | | -- **Icon Badge**: Large download icon with semi-transparent background |
82 | | -- **Hover Effects**: Smooth transitions and subtle lift on hover |
83 | | -- **Trust Indicators**: Three icons with benefits displayed below the CTA |
84 | | - |
85 | | -### Accessibility |
86 | | - |
87 | | -- Semantic HTML5 `<section>` element |
88 | | -- High contrast white text on colored background |
89 | | -- Focus states for keyboard navigation |
90 | | -- Screen reader friendly |
91 | | - |
92 | 65 | ## Customization |
93 | 66 |
|
94 | 67 | ### Styling |
@@ -118,80 +91,6 @@ This CTA component works seamlessly with the download system: |
118 | 91 | 4. **Access Granted**: After submission, download button appears |
119 | 92 | 5. **PDF Download**: User clicks to download the PDF in a new tab |
120 | 93 |
|
121 | | -## Example Placements |
122 | | - |
123 | | -### In an Article |
124 | | - |
125 | | -```astro |
126 | | ---- |
127 | | -// In src/pages/articles/api-strategy.astro |
128 | | -import Download from '@components/CallToAction/Download/index.astro' |
129 | | ---- |
130 | | -
|
131 | | -<article> |
132 | | - <!-- Article content --> |
133 | | -
|
134 | | - <Download |
135 | | - resource="api-tool-consolidation-whitepaper" |
136 | | - title="Want to Learn More About API Consolidation?" |
137 | | - description="Download our comprehensive whitepaper with case studies and implementation strategies." |
138 | | - /> |
139 | | -</article> |
140 | | -``` |
141 | | - |
142 | | -### In a Service Page |
143 | | - |
144 | | -```astro |
145 | | ---- |
146 | | -// In src/pages/services/security-consulting.astro |
147 | | -import Download from '@components/CallToAction/Download/index.astro' |
148 | | ---- |
149 | | -
|
150 | | -<main> |
151 | | - <!-- Service information --> |
152 | | -
|
153 | | - <Download |
154 | | - resource="ransomware-recovery-kit" |
155 | | - title="Protect Your Organization Today" |
156 | | - description="Get our complete ransomware recovery kit with prevention strategies and response protocols." |
157 | | - secondaryLink={{ |
158 | | - href: "/contact", |
159 | | - text: "Schedule Consultation" |
160 | | - }} |
161 | | - /> |
162 | | -</main> |
163 | | -``` |
164 | | - |
165 | | -## Validation |
166 | | - |
167 | | -The component includes runtime validation: |
168 | | - |
169 | | -- Throws an error if the `resource` prop is not provided |
170 | | -- Ensures the component is used correctly |
171 | | - |
172 | | -```typescript |
173 | | -if (!resource) { |
174 | | - const message = 'Download CTA component requires a "resource" prop' |
175 | | - throw new ClientScriptError({ message }) |
176 | | -} |
177 | | -``` |
178 | | - |
179 | | -## Browser Support |
180 | | - |
181 | | -Works in all modern browsers that support: |
182 | | - |
183 | | -- CSS Grid and Flexbox |
184 | | -- CSS Custom Properties (CSS Variables) |
185 | | -- CSS Backdrop Blur (graceful degradation) |
186 | | -- SVG |
187 | | - |
188 | | -## Performance |
189 | | - |
190 | | -- Static component with no client-side JavaScript |
191 | | -- Uses native HTML anchor tags for navigation |
192 | | -- CSS transitions handled by GPU |
193 | | -- Optimized SVG icons |
194 | | - |
195 | 94 | ## Related Components |
196 | 95 |
|
197 | 96 | - **DownloadForm** (`@components/Forms/Download/index.astro`): The form displayed on download landing pages |
|
0 commit comments