|
23 | 23 | <meta property="og:type" content="website"/> |
24 | 24 | <meta property="og:site_name" content="Fractalwrench"/> |
25 | 25 | </head> |
26 | | -<body> |
27 | | -<div class="container" style="text-align:center"> |
28 | | - <div class="j2kcontainer"> |
29 | | - <h1 id="home">Convert JSON to Kotlin Data Class</h1> |
30 | | - <form id="jsonForm" action="#" th:action="@{/}" th:object="${conversionForm}" |
31 | | - method="post" onsubmit="return validateForm()"> |
32 | | - <textarea maxlength="10000" placeholder="Paste JSON here..." th:field="*{json}"></textarea> |
33 | | - <p><input type="reset" value="Reset"/> <input type="submit" value="Convert"/></p> |
34 | | - </form> |
35 | | - </div> |
36 | | - <div class="j2kcontainer" th:if="${kotlin != null}"> |
37 | | - <h2 id="results">Generated Kotlin</h2> |
38 | 26 |
|
39 | | - <input type="hidden" id="filename" th:value="${filename}"/> |
40 | | - <textarea id="kotlinText" th:text="${kotlin}"></textarea> |
| 27 | +<!-- Slightly ashamed of this JavaScript/CSS but it works ¯\_(ツ)_/¯ --> |
41 | 28 |
|
| 29 | +<body> |
| 30 | +<h1 class="title" id="home">Convert JSON to Kotlin Data Class</h1> |
| 31 | +<div class="j2kcontainer" style="background:#3F51B5"> |
| 32 | + <form id="jsonForm" action="#" th:action="@{/}" th:object="${conversionForm}" |
| 33 | + method="post" onsubmit="return validateForm()"> |
| 34 | + <textarea maxlength="10000" placeholder="Paste JSON here..." th:field="*{json}"></textarea> |
42 | 35 | <p> |
43 | | - <input id="copyBtn" type="button" value="Copy to Clipboard" |
44 | | - onclick="copyToClipboard()" /> |
45 | | - <input type="button" value="Download" onclick="downloadAsFile()"/> |
| 36 | + <input class="button" type="reset" value="Reset"/> |
| 37 | + <input class="button" type="submit" value="Convert"/> |
46 | 38 | </p> |
| 39 | + </form> |
| 40 | +</div> |
| 41 | +<h2 th:if="${kotlin != null}" class="title" id="results">Generated Kotlin Data Classes</h2> |
| 42 | +<div class="j2kcontainer" style="background:#4CAF50" th:if="${kotlin != null}"> |
| 43 | + |
| 44 | + <input type="hidden" id="filename" th:value="${filename}"/> |
| 45 | + <textarea id="kotlinText" th:text="${kotlin}"></textarea> |
| 46 | + |
| 47 | + <p> |
| 48 | + <input class="button" id="copyBtn" type="button" value="Copy to Clipboard" |
| 49 | + onclick="copyToClipboard()"/> |
| 50 | + <input class="button" type="button" value="Download" onclick="downloadAsFile()"/> |
| 51 | + </p> |
47 | 52 |
|
48 | | - </div> |
49 | | - <div class="j2kcontainer"> |
50 | | - <h2 id="about">About</h2> |
51 | | - <p>TODO WORDS from README, link to blog post, github, twitter</p> |
52 | | - </div> |
| 53 | +</div> |
| 54 | +<h2 class="title" id="about">About</h2> |
| 55 | +<div class="j2kcontainer" style="padding-top:0px;"> |
| 56 | + <p>As you've probably guessed by now, this project automatically converts JSON to Kotlin source files. |
| 57 | + The <a href="https://github.com/fractalwrench/json-2-kotlin">tool itself</a> is implemented 100% in Kotlin, |
| 58 | + and makes heavy use of Square's excellent |
| 59 | + <a href="https://github.com/square/kotlinpoet">KotlinPoet</a> library.</p> |
| 60 | + <br></br> |
| 61 | + |
| 62 | + <p>Read the blog post which covers how this multi-platform tool was written.</p> <!-- TODO link it! --> |
| 63 | + <p>View <a href="https://github.com/fractalwrench/json-2-kotlin">the source on Github</a> to grab the command line tool, or suggest improvements.</p> |
| 64 | + <p>Get in touch <a href="https://twitter.com/fractalwrench">on Twitter</a> if you have questions, comments, or simply enjoy high-quality cat gifs.</p> |
53 | 65 | </div> |
54 | 66 | <footer> |
55 | 67 | <div> |
@@ -81,8 +93,7 @@ <h2 id="about">About</h2> |
81 | 93 |
|
82 | 94 | <script type="text/javascript" th:if="${kotlin != null}"> |
83 | 95 | window.location = '#results'; // autoscroll to results |
84 | | - |
85 | 96 | </script> |
| 97 | + |
86 | 98 | </body> |
87 | 99 | </html> |
88 | | -<!-- TODO GA --> |
|
0 commit comments