web.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. #ifndef WEB_H
  2. #define WEB_H
  3. const char* page_header = R"(
  4. <!DOCTYPE html>
  5. <html>
  6. <head>
  7. <meta charset="UTF-8">
  8. <meta name="viewport" content="width=device-width, initial-scale=1">
  9. <title>__TITLE__</title>
  10. <style>
  11. body,textarea,input,select{
  12. background:0;
  13. border-radius:0;
  14. font:16px sans-serif;
  15. margin:0
  16. }
  17. .smooth{
  18. transition:all .2s
  19. }
  20. .btn,.nav a{
  21. text-decoration:none
  22. }
  23. .container{
  24. margin:0 20px;
  25. width:auto
  26. }
  27. label>*{
  28. display:inline
  29. }
  30. form>*{
  31. display:block;
  32. margin-bottom:10px
  33. }
  34. .btn{
  35. background:#999;
  36. border-radius:6px;
  37. border:0;
  38. color:#fff;
  39. cursor:pointer;
  40. display:inline-block;
  41. margin:2px 0;
  42. padding:12px 30px 14px
  43. }
  44. .btn:hover{
  45. background:#888
  46. }
  47. .btn:active,.btn:focus{
  48. background:#777
  49. }
  50. .btn-a{
  51. background:#0ae
  52. }
  53. .btn-a:hover{
  54. background:#09d
  55. }
  56. .btn-a:active,.btn-a:focus{
  57. background:#08b
  58. }
  59. .btn-b{
  60. background:#3c5
  61. }
  62. .btn-b:hover{
  63. background:#2b4
  64. }
  65. .btn-b:active,.btn-b:focus{
  66. background:#2a4
  67. }
  68. .btn-c{
  69. background:#d33
  70. }
  71. .btn-c:hover{
  72. background:#c22
  73. }
  74. .btn-c:active,.btn-c:focus{
  75. background:#b22
  76. }
  77. .btn-sm{
  78. border-radius:4px;
  79. padding:10px 14px 11px
  80. }
  81. .row{
  82. margin:1% 0;
  83. overflow:auto
  84. }
  85. .col{
  86. float:left
  87. }
  88. .table,.c12{
  89. width:100%
  90. }
  91. .c11{
  92. width:91.66%
  93. }
  94. .c10{
  95. width:83.33%
  96. }
  97. .c9{
  98. width:75%
  99. }
  100. .c8{
  101. width:66.66%
  102. }
  103. .c7{
  104. width:58.33%
  105. }
  106. .c6{
  107. width:50%
  108. }
  109. .c5{
  110. width:41.66%
  111. }
  112. .c4{
  113. width:33.33%
  114. }
  115. .c3{
  116. width:25%
  117. }
  118. .c2{
  119. width:16.66%
  120. }
  121. .c1{
  122. width:8.33%
  123. }
  124. h1{
  125. font-size:3em
  126. }
  127. .btn,h2{
  128. font-size:2em
  129. }
  130. .ico{
  131. font:33px Arial Unicode MS,Lucida Sans Unicode
  132. }
  133. .addon,.btn-sm,.nav,textarea,input,select{
  134. outline:0;
  135. font-size:14px
  136. }
  137. textarea,input,select{
  138. padding:8px;
  139. border:1px solid #ccc
  140. }
  141. textarea:focus,input:focus,select:focus{
  142. border-color:#5ab
  143. }
  144. textarea,input[type=text]{
  145. -webkit-appearance:none;
  146. width:13em
  147. }
  148. .addon{
  149. padding:8px 12px;
  150. box-shadow:0 0 0 1px #ccc
  151. }
  152. .nav,.nav .current,.nav a:hover{
  153. background:#000;
  154. color:#fff
  155. }
  156. .nav{
  157. height:24px;
  158. padding:11px 0 15px
  159. }
  160. .nav a{
  161. color:#aaa;
  162. padding-right:1em;
  163. position:relative;
  164. top:-1px
  165. }
  166. .nav .pagename{
  167. font-size:22px;
  168. top:1px
  169. }
  170. .btn.btn-close{
  171. background:#000;
  172. float:right;
  173. font-size:25px;
  174. margin:-54px 7px;
  175. display:none
  176. }
  177. @media(min-width:1310px){
  178. .container{
  179. margin:auto;
  180. width:1270px
  181. }
  182. }
  183. @media(max-width:870px){
  184. .row .col{
  185. width:100%
  186. }
  187. }
  188. @media(max-width:500px){
  189. .btn.btn-close{
  190. display:block
  191. }
  192. .nav{
  193. overflow:hidden
  194. }
  195. .pagename{
  196. margin-top:-11px
  197. }
  198. .nav:active,.nav:focus{
  199. height:auto
  200. }
  201. .nav div:before{
  202. background:#000;
  203. border-bottom:10px double;
  204. border-top:3px solid;
  205. content:'';
  206. float:right;
  207. height:4px;
  208. position:relative;
  209. right:3px;
  210. top:14px;
  211. width:20px
  212. }
  213. .nav a{
  214. padding:.5em 0;
  215. display:block;
  216. width:50%
  217. }
  218. }
  219. .table th,.table td{
  220. padding:.5em;
  221. text-align:left
  222. }
  223. .table tbody>:nth-child(2n-1){
  224. background:#ddd
  225. }
  226. .msg{
  227. padding:1.5em;
  228. background:#def;
  229. border-left:5px solid #59d
  230. }
  231. </style>
  232. </head>
  233. <body>
  234. )";
  235. const char* page_content = "<div class=\"container\">__CONTENT__</div>";
  236. const char* page_footer = "</body>\n</html>";
  237. const char* page_nav = R"(
  238. <nav class="nav" tabindex="-1">
  239. <div class="container">
  240. <a class="pagename current" href="/">__TITLE__</a>
  241. <a href="/">Actions</a>
  242. <a href="/clients">Clients</a>
  243. <a href="/status">Status</a>
  244. </div>
  245. </nav>
  246. <button class="btn-close btn btn-sm">×</button>
  247. )";
  248. #endif