1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6+ < title > Retrosheet Wizard</ title >
7+ < style >
8+ : root {
9+ --background : hsl (0 0% 100% );
10+ --foreground : hsl (222.2 84% 4.9% );
11+ --card : hsl (0 0% 100% );
12+ --card : hsl (0 0% 100% );
13+ --card-foreground : hsl (222.2 84% 4.9% );
14+ --popover : hsl (0 0% 100% );
15+ --popover-foreground : hsl (222.2 84% 4.9% );
16+ --primary : hsl (0 , 0% , 0% );
17+ --primary-foreground : hsl (210 40% 98% );
18+ --secondary : hsl (0 , 0% , 100% );
19+ --secondary-foreground : hsl (222.2 84% 4.9% );
20+ --muted : hsl (210 40% 96% );
21+ --muted-foreground : hsl (215.4 16.3% 46.9% );
22+ --accent : hsl (0deg 0% 87.89% );
23+ --accent-foreground : hsl (222.2 84% 4.9% );
24+ --destructive : hsl (0 84.2% 60.2% );
25+ --destructive-foreground : hsl (210 40% 98% );
26+ --border : hsl (214.3 31.8% 91.4% );
27+ --input : hsl (214.3 31.8% 91.4% );
28+ --ring : hsl (221.2 83.2% 53.3% );
29+ --radius : 0.375rem ;
30+ }
31+
32+ * {
33+ box-sizing : border-box;
34+ }
35+
36+ body {
37+ margin : 0 ;
38+ padding : 20px ;
39+ font-family : -apple-system, BlinkMacSystemFont, "Segoe UI" , Roboto, "Helvetica Neue" , Arial, sans-serif;
40+ background-color : var (--background );
41+ color : var (--foreground );
42+ min-height : 100vh ;
43+ }
44+
45+ .container {
46+ max-width : 1200px ;
47+ margin : 0 auto;
48+ }
49+
50+ /* Header */
51+ .header {
52+ background-color : var (--card );
53+ padding : 24px ;
54+ border-radius : var (--radius );
55+ box-shadow : 0 2px 4px rgba (0 , 0 , 0 , 0.1 );
56+ margin-bottom : 32px ;
57+ display : flex;
58+ align-items : center;
59+ flex-wrap : wrap;
60+ gap : 16px ;
61+ }
62+
63+ .header h1 {
64+ font-size : 32px ;
65+ font-weight : 700 ;
66+ margin : 0 ;
67+ color : var (--foreground );
68+ }
69+
70+ .header-nav {
71+ display : flex;
72+ gap : 12px ;
73+ flex-wrap : wrap;
74+ }
75+
76+ /* Button */
77+ .btn {
78+ display : inline-flex;
79+ align-items : center;
80+ justify-content : center;
81+ padding : 12px 16px ;
82+ border-radius : var (--radius );
83+ font-size : 14px ;
84+ font-weight : 500 ;
85+ text-decoration : none;
86+ transition : all 0.2s ease;
87+ cursor : pointer;
88+ border : none;
89+ }
90+
91+ .btn-primary {
92+ background-color : var (--primary );
93+ color : var (--primary-foreground );
94+ }
95+
96+ .btn-primary : hover {
97+ background-color : hsl (0 , 0% , 21% );
98+ box-shadow : 0 10px 10px rgba (0 , 0 , 0 , 0.1 );
99+ }
100+
101+ .btn-secondary {
102+ background-color : var (--secondary );
103+ color : var (--secondary-foreground );
104+ border : 1px solid var (--border );
105+ }
106+
107+ .btn-secondary : hover {
108+ background-color : var (--accent );
109+ }
110+
111+ /* Form */
112+ .form-container {
113+ background-color : var (--card );
114+ padding : 24px ;
115+ border-radius : var (--radius );
116+ box-shadow : 0 2px 4px rgba (0 , 0 , 0 , 0.1 );
117+ margin-bottom : 32px ;
118+ }
119+
120+ .form-group {
121+ margin-bottom : 24px ;
122+ }
123+
124+ .form-label {
125+ display : block;
126+ font-size : 14px ;
127+ font-weight : 500 ;
128+ margin-bottom : 8px ;
129+ color : var (--foreground );
130+ }
131+
132+ .form-input {
133+ width : 100% ;
134+ padding : 12px ;
135+ border : 1px solid var (--input );
136+ border-radius : var (--radius );
137+ font-size : 14px ;
138+ background-color : var (--background );
139+ transition : border-color 0.2s ease;
140+ }
141+
142+ .form-input : focus {
143+ outline : none;
144+ border-color : var (--ring );
145+ box-shadow : 0 0 0 2px rgba (59 , 130 , 246 , 0.1 );
146+ }
147+
148+ /* Loading and Error States */
149+ .loading {
150+ text-align : center;
151+ font-size : 16px ;
152+ font-weight : 500 ;
153+ color : var (--muted-foreground );
154+ margin-top : 24px ;
155+ }
156+
157+ .error {
158+ background-color : var (--destructive );
159+ color : var (--destructive-foreground );
160+ padding : 16px ;
161+ border-radius : var (--radius );
162+ margin-top : 24px ;
163+ font-weight : 500 ;
164+ }
165+
166+ /* Code Blocks */
167+ .code-container {
168+ background-color : var (--card );
169+ border-radius : var (--radius );
170+ box-shadow : 0 2px 4px rgba (0 , 0 , 0 , 0.1 );
171+ margin-bottom : 24px ;
172+ overflow : hidden;
173+ }
174+
175+ .code-header {
176+ background-color : var (--accent );
177+ padding : 16px ;
178+ display : flex;
179+ justify-content : space-between;
180+ align-items : center;
181+ border-bottom : 1px solid var (--border );
182+ }
183+
184+ .code-title {
185+ font-size : 18px ;
186+ font-weight : 600 ;
187+ color : var (--foreground );
188+ }
189+
190+ .code-content {
191+ overflow-y : auto;
192+ }
193+
194+ /* Prism overrides for Kotlin */
195+ pre {
196+ margin : 0 ;
197+ overflow : auto;
198+ }
199+
200+ /* Display property helper */
201+ .hidden {
202+ display : none;
203+ }
204+
205+ /* Responsive */
206+ @media (max-width : 768px ) {
207+ .header {
208+ flex-direction : column;
209+ align-items : stretch;
210+ }
211+
212+ .header-nav {
213+ justify-content : center;
214+ }
215+
216+ .btn {
217+ flex : 1 ;
218+ text-align : center;
219+ }
220+ }
221+ </ style >
222+ < link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/default.min.css ">
223+ < script src ="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js "> </ script >
224+ < script src ="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/languages/kotlin.min.js "> </ script >
225+ </ head >
226+ < body >
227+ < div class ="container ">
228+ <!-- Header -->
229+ < header class ="header ">
230+ < h1 > Retrosheet Wizard</ h1 >
231+ < nav class ="header-nav ">
232+ < a class ="btn btn-secondary " href ="https://a64.in/retrosheet/wizard " target ="_blank ">
233+ HOME
234+ </ a >
235+ < a class ="btn btn-secondary " href ="https://a64.in/retrosheet " target ="_blank ">
236+ JS SAMPLE
237+ </ a >
238+ < a class ="btn btn-secondary " href ="https://github.com/theapache64/retrosheet " target ="_blank ">
239+ VIEW ON GITHUB
240+ </ a >
241+ </ nav >
242+ </ header >
243+
244+ <!-- Form Container -->
245+ < div class ="form-container " id ="formContainer ">
246+ < form id ="retrosheetForm ">
247+ < div class ="form-group ">
248+ < label class ="form-label " for ="googleSheetUrl ">
249+ Google Sheet URL:
250+ </ label >
251+ < input
252+ class ="form-input "
253+ id ="googleSheetUrl "
254+ name ="googleSheetUrl "
255+ placeholder ="https://docs.google.com/spreadsheets/d/... "
256+ type ="url "
257+ >
258+ </ div >
259+
260+ < div class ="form-group ">
261+ < label class ="form-label " for ="sheetName ">
262+ Sheet Name:
263+ </ label >
264+ < input
265+ class ="form-input "
266+ id ="sheetName "
267+ name ="sheetName "
268+ placeholder ="Sheet1 "
269+ type ="text "
270+ >
271+ </ div >
272+
273+ < div class ="form-group ">
274+ < label class ="form-label " for ="googleFormUrl ">
275+ Google Form URL:
276+ </ label >
277+ < input
278+ class ="form-input "
279+ id ="googleFormUrl "
280+ name ="googleFormUrl "
281+ placeholder ="https://docs.google.com/forms/d/e/... "
282+ type ="url "
283+ >
284+ </ div >
285+
286+ < button class ="btn btn-primary " id ="submitBtn " type ="submit ">
287+ GENERATE CODE
288+ </ button >
289+ </ form >
290+
291+ <!-- Loading State -->
292+ < div class ="loading hidden " id ="loading ">
293+ Generating your Retrosheet code...
294+ </ div >
295+
296+ <!-- Error Message -->
297+ < div class ="error hidden " id ="errorMessage ">
298+ </ div >
299+ </ div >
300+
301+ <!-- Results Container -->
302+ < div id ="resultsContainer " class ="hidden ">
303+ <!-- build.gradle.kts -->
304+ < div class ="code-container ">
305+ < div class ="code-header ">
306+ < div class ="code-title "> build.gradle.kts</ div >
307+ < button class ="btn btn-secondary " onclick ="copyToClipboard('buildGradleCode', this) ">
308+ COPY
309+ </ button >
310+ </ div >
311+ < div class ="code-content ">
312+ < pre > < code class ="language-kotlin " id ="buildGradleCode "> </ code > </ pre >
313+ </ div >
314+ </ div >
315+
316+ <!-- Sheet.kt -->
317+ < div class ="code-container ">
318+ < div class ="code-header ">
319+ < div class ="code-title " id ="sheetCodeTitle "> Sheet.kt</ div >
320+ < button class ="btn btn-secondary " onclick ="copyToClipboard('sheetCode', this) ">
321+ COPY
322+ </ button >
323+ </ div >
324+ < div class ="code-content ">
325+ < pre > < code class ="language-kotlin " id ="sheetCode "> </ code > </ pre >
326+ </ div >
327+ </ div >
328+
329+ <!-- Main.kt -->
330+ < div class ="code-container ">
331+ < div class ="code-header ">
332+ < div class ="code-title "> Main.kt</ div >
333+ < button class ="btn btn-secondary " onclick ="copyToClipboard('mainCode', this) ">
334+ COPY
335+ </ button >
336+ </ div >
337+ < div class ="code-content ">
338+ < pre > < code class ="language-kotlin " id ="mainCode "> </ code > </ pre >
339+ </ div >
340+ </ div >
341+ </ div >
342+ </ div >
343+
344+ < script src ="wizard.js " type ="text/javascript "> </ script >
345+ < script >
346+ // copyToClipboard function
347+ function copyToClipboard ( elementId , buttonElement ) {
348+ const codeElement = document . getElementById ( elementId ) ;
349+ const codeText = codeElement . innerText ;
350+
351+ navigator . clipboard . writeText ( codeText ) . then ( ( ) => {
352+ // Change onclick element content for 5 seconds
353+ buttonElement . innerHTML = '<b> COPIED!</b>' ;
354+
355+ setTimeout ( ( ) => {
356+ buttonElement . innerText = 'COPY' ;
357+ } , 5000 ) ;
358+ } ) . catch ( err => {
359+ console . error ( 'Error copying text: ' , err ) ;
360+ } ) ;
361+ }
362+ </ script >
363+ </ body >
364+ </ html >
0 commit comments