File tree Expand file tree Collapse file tree
swiss-german-teacher/utils Expand file tree Collapse file tree Load diff This file was deleted.
Load diff This file was deleted.
Original file line number Diff line number Diff line change 1+ /**
2+ * Shared UI constants
3+ *
4+ * This file centralizes UI string constants to:
5+ * - Maintain visual consistency across components
6+ * - Simplify future UI updates (change in one place)
7+ * - Reduce duplication of lengthy Tailwind class strings
8+ */
9+
10+ // Button styles
11+ export const btnPrimary =
12+ 'px-6 py-3 bg-green-500 text-white font-medium rounded-md hover:bg-green-600 transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2' ;
13+ export const btnSecondary =
14+ 'px-6 py-3 bg-white text-gray-700 font-medium rounded-md border border-gray-300 hover:bg-gray-50 transition-colors focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2' ;
15+
16+ // Card styles
17+ export const cardStyle = 'p-6 bg-white rounded-xl shadow-sm border border-gray-200 relative' ;
18+
19+ // Badge styles
20+ export const comingSoonBadge =
21+ 'absolute top-4 right-4 bg-amber-100 text-amber-800 text-xs font-semibold px-2.5 py-0.5 rounded-full border border-amber-200' ;
22+
23+ // Feature number styles
24+ export const featureNumberBadge =
25+ 'flex-shrink-0 w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center text-blue-600 font-semibold' ;
26+ export const featureNumberText = 'text-lg font-medium text-gray-900 mb-2' ;
27+
28+ // Section styles
29+ export const sectionHeading = 'text-3xl font-semibold text-gray-900 mb-4' ;
30+ export const sectionSubheading = 'text-lg text-gray-600 mb-8' ;
31+
32+ // Common CSS classes
33+ export const cardHeading = 'text-xl font-semibold mb-2' ;
34+ export const cardText = 'text-gray-600 mb-4' ;
Original file line number Diff line number Diff line change 1+ /**
2+ * Opens the Heidi bot in a new tab with an optional query
3+ * @param query Optional query to append to the URL
4+ */
5+ export const openHeidiBot = ( query ?: string ) => {
6+ const baseUrl = 'https://chatgpt.com/g/g-rni41WTSh-heidi-tell' ;
7+ const url = query ? `${ baseUrl } ?q=${ encodeURIComponent ( query ) } ` : baseUrl ;
8+
9+ // Ensure the window opens properly
10+ const newWindow = window . open ( url , '_blank' ) ;
11+
12+ // Fallback if window.open is blocked
13+ if ( ! newWindow || newWindow . closed || typeof newWindow . closed === 'undefined' ) {
14+ // Show a message to the user
15+ alert ( 'Please allow pop-ups to open Heidi in a new tab, or click this link: ' + url ) ;
16+
17+ // Copy the URL to clipboard as another fallback
18+ navigator . clipboard . writeText ( url ) . catch ( ( ) => {
19+ // Clipboard write failed - user already alerted
20+ } ) ;
21+ }
22+ } ;
You can’t perform that action at this time.
0 commit comments