default.go 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. package theme
  2. type Default struct {
  3. }
  4. func (theme *Default) Template() string {
  5. return `
  6. <!DOCTYPE html>
  7. <html lang="en">
  8. <head>
  9. <meta charset="UTF-8">
  10. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  11. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  12. <title>{{ .Page.Title }}</title>
  13. <style>
  14. html {
  15. height: 100%;
  16. }
  17. body {
  18. width: 100% !important;
  19. height: 100%;
  20. margin: 0;
  21. font-size: .96rem;
  22. line-height: 1.4;
  23. background-color: #F2F4F6;
  24. color: #64687E;
  25. -webkit-text-size-adjust: none;
  26. font-family: Helvetica Neue, Tahoma, Arial, PingFangSC-Regular, Hiragino Sans GB, Microsoft Yahei, sans-serif;
  27. -webkit-font-smoothing: antialiased;
  28. touch-action: manipulation;
  29. text-size-adjust: none;
  30. }
  31. .container {
  32. max-width: 560px;
  33. height: 100%;
  34. margin: 0 auto;
  35. background-color: white;
  36. }
  37. .container-inner {
  38. padding: 1rem;
  39. }
  40. .action-block{
  41. margin: 30px 0 20px 0;
  42. text-align: center;
  43. }
  44. .table-wrapper{
  45. margin-bottom: 1.5rem;
  46. }
  47. .text-success {
  48. color: #20c55c;
  49. }
  50. .text-danger {
  51. color: #ff0476;
  52. }
  53. .text-center {
  54. text-align: center;
  55. }
  56. article {
  57. line-height: 1.6rem
  58. }
  59. article h1,
  60. article h2,
  61. article h3,
  62. article h4 {
  63. color: #232323;
  64. margin-bottom: 1.28rem;
  65. }
  66. a {
  67. font-style: none;
  68. text-decoration: none;
  69. }
  70. article p {
  71. margin-bottom: 1rem;
  72. }
  73. .preview-label {
  74. min-width: 4em;
  75. text-align: justify;
  76. text-align-last: justify;
  77. }
  78. .preview-value {
  79. text-align: right;
  80. display: block;
  81. overflow: hidden;
  82. word-break: normal;
  83. word-wrap: break-word;
  84. color: rgba(0, 0, 0, 0.9);
  85. flex: 1 1 auto !important;
  86. }
  87. .grid {
  88. padding: 1rem 0;
  89. }
  90. .grid h4 {
  91. margin-top: 0;
  92. margin-bottom: .68rem;
  93. }
  94. .row {
  95. display: flex;
  96. justify-content: flex-start;
  97. line-height: 2;
  98. }
  99. .table {
  100. border: 1px solid #ddd;
  101. width: 100%;
  102. max-width: 100%;
  103. margin-bottom: 20px;
  104. display: table;
  105. border-collapse: separate;
  106. box-sizing: border-box;
  107. text-indent: initial;
  108. border-spacing: 2px;
  109. border-collapse: collapse;
  110. border-spacing: 0;
  111. }
  112. .table-title{
  113. box-sizing: border-box;
  114. border-left: 3px solid #727cf5;
  115. padding: .38rem 0 .38rem .5rem;
  116. margin-bottom: 1rem;
  117. }
  118. .table>thead:first-child>tr:first-child>th {
  119. border-top: 0;
  120. }
  121. .table>thead>tr>th{
  122. vertical-align: bottom;
  123. padding: 8px;
  124. line-height: 1.42857143;
  125. border-bottom-width: 2px;
  126. border: 1px solid #ddd;
  127. text-align: left;
  128. }
  129. .table>tbody>tr>td{
  130. border: 1px solid #ddd;
  131. padding: 8px;
  132. line-height: 1.42857143;
  133. vertical-align: top;
  134. text-align: left;
  135. }
  136. .button {
  137. padding: .8rem 2rem;
  138. color: white;
  139. background-color: #727cf5;
  140. border-radius: .25rem;
  141. }
  142. .invite-code {
  143. font-size: 32px;
  144. letter-spacing: .6rem;
  145. color: #454742;
  146. }
  147. .copyright {
  148. text-align: center;
  149. font-size: .9rem;
  150. color: #8c8c86;
  151. margin: 50px 0 10px 0;
  152. }
  153. .cell {
  154. flex: 1 1 auto !important;
  155. }
  156. </style>
  157. </head>
  158. <body>
  159. <div class="container">
  160. <div class="container-inner">
  161. <article>
  162. {{ if .Page.Head }}<h1>{{ .Page.Head }}</h1>{{ end }}
  163. {{ with .Page.Intros }}
  164. {{ if gt (len .) 0 }}
  165. {{ range $text := . }}
  166. {{ $text }}
  167. {{ end }}
  168. {{ end }}
  169. {{ end }}
  170. {{ with .Page.Actions }}
  171. {{ if gt (len .) 0 }}
  172. {{ range $action := . }}
  173. {{ if $action.Instructions }}
  174. {{ $action.Instructions }}
  175. {{ end }}
  176. {{ if $action.InviteCode }}
  177. <div class="action-block"><span class="invite-code">{{ $action.InviteCode }}</span></div>
  178. {{ else if $action.Button }}
  179. <div class="action-block">{{ $action.Button }}</div>
  180. {{ end }}
  181. {{ end }}
  182. {{ end }}
  183. {{ end }}
  184. {{ with .Page.Entries }}
  185. {{ if gt (len .) 0 }}
  186. {{ range $entry := . }}
  187. <div class="grid">
  188. {{if $entry.Title }}<h4>{{ $entry.Title }}</h4>{{ end }}
  189. {{ with $entry.Items }}
  190. {{ if gt (len .) 0 }}
  191. {{ range $label,$value := . }}
  192. <div class="row">
  193. <div class="preview-label">{{ $label }}</div>
  194. <div class="preview-value">{{ $value }}</div>
  195. </div>
  196. {{ end }}
  197. {{ end }}
  198. {{ end }}
  199. </div>
  200. {{ end }}
  201. {{ end }}
  202. {{ end }}
  203. {{ with .Page.Tables }}
  204. {{ if gt (len .) 0 }}
  205. {{ range $table := . }}
  206. {{ $table }}
  207. {{ end }}
  208. {{ end }}
  209. {{ end }}
  210. {{ with .Page.Outros }}
  211. {{ if gt (len .) 0 }}
  212. {{ range $text := . }}
  213. {{ $text }}
  214. {{ end }}
  215. {{ end }}
  216. {{ end }}
  217. {{ if .Page.Copyright }}<div class="copyright">{{ .Page.Copyright }}</div>{{ end }}
  218. </article>
  219. </div>
  220. </div>
  221. </body>
  222. </html>
  223. `
  224. }