demo.rml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691
  1. <rml>
  2. <head>
  3. <link type="text/template" href="../../../assets/window.rml"/>
  4. <title>Demo Sample</title>
  5. <style>
  6. @spritesheet demo-sheet
  7. {
  8. src: ../../../assets/invader.tga;
  9. window-outer: 0px 0px 144px 151px;
  10. demo-radio-t: 407px 0px 30px 14px;
  11. demo-radio-c: 407px 14px 30px 2px;
  12. demo-radio-b: 407px 16px 30px 14px;
  13. demo-radio-l: 407px 0px 14px 30px;
  14. demo-radio-m: 421px 0px 2px 30px;
  15. demo-radio-r: 423px 0px 14px 30px;
  16. demo-checkbox-t: 407px 60px 30px 14px;
  17. demo-checkbox-c: 407px 74px 30px 2px;
  18. demo-checkbox-b: 407px 76px 30px 14px;
  19. demo-checkbox-l: 407px 60px 14px 30px;
  20. demo-checkbox-m: 421px 60px 2px 30px;
  21. demo-checkbox-r: 423px 60px 14px 30px;
  22. demo-checked-t: 407px 90px 30px 8px;
  23. demo-checked-c: 407px 98px 30px 14px;
  24. demo-checked-b: 407px 112px 30px 8px;
  25. demo-help-t: 128px 152px 51px 6px;
  26. demo-help-c: 128px 158px 51px 21px;
  27. demo-help-b: 128px 179px 51px 12px;
  28. demo-title-bar: 147px 0px 96px 85px;
  29. }
  30. body.window
  31. {
  32. width: 1300px;
  33. height: 750px;
  34. min-width: 940px;
  35. min-height: 300px;
  36. max-width: -1px;
  37. max-height: -1px;
  38. }
  39. div#title_bar div#icon
  40. {
  41. display: none;
  42. }
  43. div#content
  44. {
  45. position: relative;
  46. }
  47. tabset
  48. {
  49. display: block;
  50. }
  51. tabs
  52. {
  53. display: block;
  54. position: fixed;
  55. width: 100%;
  56. clip: none;
  57. pointer-events: none;
  58. text-align: right;
  59. padding-right: 10px;
  60. }
  61. tab
  62. {
  63. position: relative;
  64. width: 100px;
  65. pointer-events: auto;
  66. padding: 0px 20px;
  67. line-height: 40px;
  68. top: -47px;
  69. z-index: 2;
  70. font-size: 16px;
  71. color: #ddd;
  72. text-align: center;
  73. decorator: tiled-horizontal( datagridheader-l, datagridheader-c, datagridheader-r );
  74. image-color: #cffc;
  75. }
  76. tab:hover
  77. {
  78. image-color: #fffe;
  79. color: #fff;
  80. }
  81. tab:active, tab:selected
  82. {
  83. image-color: #fff;
  84. color: #fff;
  85. }
  86. panels
  87. {
  88. display: block;
  89. }
  90. panel
  91. {
  92. display: block;
  93. padding: 30px;
  94. margin-left: auto;
  95. margin-right: auto;
  96. max-width: 500px;
  97. }
  98. h1
  99. {
  100. margin: 1.4em 0 0.7em;
  101. font-size: 18px;
  102. }
  103. p.title
  104. {
  105. font-size: 35px;
  106. color: #b33;
  107. }
  108. .center {
  109. text-align: center;
  110. }
  111. .clickable
  112. {
  113. cursor: pointer;
  114. }
  115. /*** Decorators ***/
  116. #decorators {
  117. text-align: left;
  118. }
  119. #decorators p
  120. {
  121. margin: 0.5em 0;
  122. }
  123. #decorators button.gradient
  124. {
  125. decorator: gradient( vertical #415857 #5990A3 );
  126. border: 2px #415857;
  127. margin-right: 12px;
  128. }
  129. #decorators button.gradient.horizontal
  130. {
  131. decorator: gradient( horizontal #DB6565 #F1B58A );
  132. border: 2px #DB6565;
  133. }
  134. #decorators button.gradient:hover
  135. {
  136. border-color: #F9EFA3;
  137. }
  138. #decorators .image-alien
  139. {
  140. width: 64px;
  141. height: 64px;
  142. decorator: image( /assets/high_scores_alien_1.tga );
  143. }
  144. #decorators .image-invader
  145. {
  146. width: 51px;
  147. height: 39px;
  148. decorator: image( icon-invader );
  149. }
  150. .side-by-side
  151. {
  152. display: inline-block;
  153. width: 120px;
  154. vertical-align: middle;
  155. text-align: center;
  156. }
  157. .tiled-box
  158. {
  159. height: 200px;
  160. decorator: tiled-box(
  161. window-tl, window-t, window-tr,
  162. window-l, window-c, window-r,
  163. window-bl, window-b, window-br
  164. );
  165. }
  166. .image-mode
  167. {
  168. text-align: center;
  169. margin-top: 30px;
  170. }
  171. .image-mode > div
  172. {
  173. display: inline-block;
  174. width: 120px;
  175. height: 50px;
  176. padding: 5px 10px;
  177. margin: 10px 10px;
  178. background-color: #c662;
  179. border: 1px #777;
  180. font-effect: shadow( 1px 1px #333 );
  181. }
  182. #decorators .image-mode > div > p
  183. {
  184. margin: -2em 0 0 0;
  185. text-align: center;
  186. }
  187. .image-mode.small { margin-top: -20px; }
  188. .image-mode.small > div
  189. {
  190. width: 40px;
  191. height: 20px;
  192. padding: 0;
  193. margin-left: 60px;
  194. margin-right: 60px;
  195. }
  196. .align-default { decorator: image( icon-invader scale-none ); }
  197. .align-right { decorator: image( icon-invader scale-none right ); }
  198. .align-left-bottom { decorator: image( icon-invader scale-none left bottom ); }
  199. .align-percent { decorator: image( icon-invader scale-none 70% 30% ); }
  200. .align-pixel { decorator: image( icon-invader scale-none 100px -15px ); }
  201. .fit-fill { decorator: image( icon-invader fill ); }
  202. .fit-contain { decorator: image( icon-invader contain ); }
  203. .fit-cover { decorator: image( icon-invader cover ); }
  204. .fit-scale-none { decorator: image( icon-invader scale-none ); }
  205. .fit-scale-down { decorator: image( icon-invader scale-down ); }
  206. .orientation-vertical { decorator: image( icon-invader flip-vertical scale-none ); }
  207. .orientation-horizontal { decorator: image( icon-invader flip-horizontal scale-none ); }
  208. .orientation-rotate { decorator: image( icon-invader rotate-180 scale-none ); }
  209. /*** Animations ***/
  210. #tweening_area
  211. {
  212. position: relative;
  213. margin: 30px auto;
  214. width: 400px;
  215. height: 250px;
  216. border: 1px #777;
  217. background-color: #ccc2;
  218. cursor: cross;
  219. }
  220. #tweening_area img
  221. {
  222. position: absolute;
  223. cursor: pointer;
  224. transform: translate(190px, 100px);
  225. }
  226. #transition
  227. {
  228. margin: 20px auto 30px;
  229. width: 400px;
  230. height: 250px;
  231. border: 1px #777;
  232. background-color: #ccc2;
  233. position: relative;
  234. overflow: hidden;
  235. }
  236. #transition > img
  237. {
  238. position: absolute;
  239. top: -50px;
  240. left: 50%;
  241. margin-left: -32px;
  242. transition: top left 0.6s back-out, opacity 0.4s, image-color 0.4s 0.3s quadratic-out;
  243. opacity: 0;
  244. image-color: #fff;
  245. }
  246. #transition:hover > img
  247. {
  248. top: 50px;
  249. opacity: 1;
  250. image-color: #f61;
  251. }
  252. #transition:hover .alien1 { left: 30%; top: 75px; }
  253. #transition:hover .alien3 { left: 70%; top: 75px; }
  254. #transition .defender
  255. {
  256. transition: image-color 0.3s 0.0s quadratic-out;
  257. position: absolute;
  258. left: -44px;
  259. top: 150px; opacity: 1;
  260. }
  261. #transition:hover .defender { image-color: #acf; }
  262. #transition .ray {
  263. transition: top 0.4s back-out, opacity 0.4s cubic-in;
  264. position: absolute;
  265. top: -130px;
  266. left: 50%;
  267. opacity: 0;
  268. margin-left: -20px;
  269. width: 40px;
  270. height: 200px;
  271. decorator: gradient( vertical #daf0 #fef6 );
  272. }
  273. #transition:hover .ray
  274. {
  275. opacity: 1;
  276. top: 0px;
  277. }
  278. @keyframes cube-rotate {
  279. from { transform: rotate3d(1, -1, 0.3, 0deg); }
  280. to { transform: rotate3d(1, -1, 0.3, 360deg); }
  281. }
  282. .cube_container {
  283. width: 200px;
  284. height: 200px;
  285. margin: 20px auto;
  286. perspective: 500px;
  287. }
  288. .cube {
  289. width: 100%;
  290. height: 100%;
  291. position: relative;
  292. animation: 3s cube-rotate infinite back-in-out;
  293. }
  294. .face {
  295. left: 50px; top: 50px;
  296. display: block;
  297. position: absolute;
  298. width: 100px;
  299. height: 100px;
  300. line-height: 100px;
  301. font-size: 60px;
  302. color: white;
  303. text-align: center;
  304. }
  305. /* Define each face based on direction */
  306. .face.front {
  307. background: rgba(0, 0, 0, 160);
  308. transform: translateZ(50px);
  309. }
  310. .face.front:hover {
  311. background: rgba(255, 255, 0, 120);
  312. }
  313. .face.back {
  314. background: rgba(0, 255, 0, 255);
  315. color: black;
  316. transform: rotateY(180deg) translateZ(50px);
  317. }
  318. .face.right {
  319. background: rgba(196, 0, 0, 200);
  320. transform: rotateY(90deg) translateZ(50px);
  321. }
  322. .face.left {
  323. background: rgba(0, 0, 196, 200);
  324. transform: rotateY(-90deg) translateZ(50px);
  325. }
  326. .face.top {
  327. background: rgba(196, 196, 0, 200);
  328. transform: rotateX(90deg) translateZ(50px);
  329. }
  330. .face.bottom {
  331. background: rgba(196, 0, 196, 200);
  332. transform: rotateX(-90deg) translateZ(50px);
  333. }
  334. /*** Forms ***/
  335. form
  336. {
  337. display: block;
  338. text-align: left;
  339. }
  340. form input, form select { margin-left: 0; }
  341. form h2
  342. {
  343. display: block;
  344. font-size: 16px;
  345. font-weight: bold;
  346. margin-top: 8px;
  347. }
  348. #rating {
  349. display: inline-block;
  350. width: 40px;
  351. padding-left: 1em;
  352. }
  353. #rating_emoji {
  354. color: #ffd40f;
  355. font-size: 1.7em;
  356. }
  357. #form_output
  358. {
  359. border: 1px #666;
  360. font-size: 0.9em;
  361. background-color: #ddd;
  362. min-height: 30px;
  363. margin-top: 10px;
  364. padding: 5px 8px;
  365. color: #222;
  366. white-space: pre-wrap;
  367. overflow: hidden auto;
  368. }
  369. #controls textarea
  370. {
  371. font-size: 18px;
  372. font-effect: outline(2px #006600);
  373. color: #ddd;
  374. }
  375. /*** Sandbox ***/
  376. #sandbox
  377. {
  378. position: absolute;
  379. top: 20px;
  380. right: 30px;
  381. bottom: 20px;
  382. left: 30px;
  383. padding: 0;
  384. }
  385. #sandbox textarea
  386. {
  387. font-size: 13px;
  388. color: #222;
  389. font-family: rmlui-debugger-font;
  390. width: 50%;
  391. height: 40%;
  392. }
  393. #sandbox_target
  394. {
  395. background-color: #fff;
  396. border: 1px #000;
  397. height: 55%;
  398. margin-top: 15px;
  399. color: #000;
  400. text-align: left;
  401. position: relative;
  402. }
  403. #sandbox_rml_source { margin-left: -5px; }
  404. #sandbox_rcss_source { margin-left: 5px; }
  405. </style>
  406. </head>
  407. <body template="window">
  408. <tabset id="menu">
  409. <tab>Welcome</tab>
  410. <panel id="welcome">
  411. <p class="title" style="margin-top: 1.8em;">RmlUi 😍</p>
  412. <p>Have fun fiddling about in this demo.</p>
  413. <p>Press 'F8' to open up the debugger.</p>
  414. <p class="title" style="margin-top: 1em;">🎉</p>
  415. </panel>
  416. <tab>Decorators</tab>
  417. <panel id="decorators">
  418. <h1>Gradient decorator</h1>
  419. <p>The 'gradient' decorator renders a color gradient in the vertical or horizontal direction.</p>
  420. <div class="center">
  421. <button class="gradient">Gradient</button>
  422. <button class="gradient horizontal">Gradient</button>
  423. </div>
  424. <h1>Image decorator</h1>
  425. <p>The 'image' decorator applies an image to the background of an element. By default it stretches the image to the size of the element, but this behavior can be controlled as seen later on.</p>
  426. <div class="center">
  427. <div class="side-by-side">
  428. <div class="image-alien clickable" onclick="change_color"/>
  429. </div>
  430. <div class="side-by-side">
  431. <div class="image-invader"/>
  432. </div>
  433. <div class="side-by-side">
  434. <button>Button</button>
  435. </div>
  436. </div>
  437. <h1>Tiled-horizontal decorator</h1>
  438. <p>The 'tiled-horizontal' decorator separates an image into three parts, with the edges displayed at their native size while the middle part is stretched to cover the remaining width of the element. In each of the following examples an image is displayed at its native size first, and then the decorator is applied to it with its element stretched horizontally.</p>
  439. <div class="side-by-side">
  440. <div style="width: 30px; height: 30px; decorator: image( radio );"/>
  441. <div style="width: 120px; height: 30px; decorator: tiled-horizontal( demo-radio-l, demo-radio-m, demo-radio-r );"/>
  442. </div>
  443. <div class="side-by-side">
  444. <div style="width: 30px; height: 30px; decorator: image( checkbox );"/>
  445. <div style="width: 120px; height: 30px; decorator: tiled-horizontal( demo-checkbox-l, demo-checkbox-m, demo-checkbox-r );"/>
  446. </div>
  447. <div class="side-by-side" width="250px;">
  448. <div style="width: 96px; height: 85px; decorator: image( demo-title-bar );"/>
  449. <div style="width: 250px; height: 85px; decorator: tiled-horizontal( title-bar-l, title-bar-c, title-bar-r );"/>
  450. </div>
  451. <p>In the third example we show the same title bar that is used to style the sample windows.</p>
  452. <h1>Tiled-vertical decorator</h1>
  453. <p>The 'tiled-vertical' decorator behaves like tiled-horizontal, but this time it is stretched vertically.</p>
  454. <div class="side-by-side">
  455. <div style="width: 30px; height: 30px; decorator: image( radio );"/>
  456. <div style="width: 30px; height: 80px; decorator: tiled-vertical( demo-radio-t, demo-radio-c, demo-radio-b );"/>
  457. </div>
  458. <div class="side-by-side">
  459. <div style="width: 30px; height: 30px; decorator: image( checkbox );"/>
  460. <div style="width: 30px; height: 80px; decorator: tiled-vertical( demo-checkbox-t, demo-checkbox-c, demo-checkbox-b );"/>
  461. </div>
  462. <div class="side-by-side">
  463. <div style="width: 30px; height: 30px; decorator: image( checkbox-checked );"/>
  464. <div style="width: 30px; height: 80px; decorator: tiled-vertical( demo-checked-t, demo-checked-c, demo-checked-b );"/>
  465. </div>
  466. <div class="side-by-side">
  467. <div style="width: 51px; height: 39px; decorator: image( icon-help );"/>
  468. <div style="width: 51px; height: 80px; decorator: tiled-vertical( demo-help-t, demo-help-c, demo-help-b );"/>
  469. </div>
  470. <p>Clearly, not all images are designed to stretch like this. However, one can certainly envision a usage for the first two examples.</p>
  471. <h1>Tiled-box decorator</h1>
  472. <p>The 'tiled-box' decorator lays out a 3x3 grid within the element, each of the nine parts being filled with a separate sprite or image. The corners stay fixed in size, while the center and edges are stretched to fill the remaining size of the element.</p>
  473. <p>The following image displays the region used to define the background of the window in this sample.</p>
  474. <img sprite="window-outer"/>
  475. <p>The decorator's element can then gracefully be sized in any direction, keeping the corners and edges at a proper size.</p>
  476. <div class="tiled-box"/>
  477. <h1>Ninepatch decorator</h1>
  478. <p>The 'ninepatch' decorator is similar to the tiled-box decorator in that it splits the image into nine parts. However, only two sprites are used to define all nine tiles, an outer sprite and an inner sprite.</p>
  479. <p>Let us define the outer sprite by the following image, and the inner sprite as the part within the displayed border.</p>
  480. <div style="position: relative; text-align: left; width: 145px;">
  481. <img sprite="textarea"/><img sprite="textarea-inner" style="position: absolute; left: 10px; top: 13px; border: 1px #f0f;"/>
  482. </div>
  483. <p>When the ninepatch decorator is applied and the element is stretched, the following is rendered.</p>
  484. <div style="width: 240px; height: 50px; decorator: ninepatch(textarea, textarea-inner);"/>
  485. <p>Notice that the corners stay fixed, and the inner sprite is stretched. We can also control the rendered size of the edges, here the left edge is displayed at its native size and the others at half their size.</p>
  486. <div style="width: 240px; height: 50px; decorator: ninepatch(textarea, textarea-inner, .5 .5 .5 1);"/>
  487. <p>If we instead compare this to the image decorator, we see the following.</p>
  488. <div style="width: 240px; height: 50px; decorator: image(textarea);"/>
  489. <p>With the image decorator it looks blurry and its borders are stretched.</p>
  490. <div style="width: 850px; margin-left: -175px;">
  491. <h1>Image decorator fit modes</h1>
  492. <div class="image-mode">
  493. <div class="fit-fill"><p>fill</p></div>
  494. <div class="fit-contain"><p>contain</p></div>
  495. <div class="fit-cover"><p>cover</p></div>
  496. <div class="fit-scale-none"><p>scale-none</p></div>
  497. <div class="fit-scale-down"><p>scale-down</p></div>
  498. </div>
  499. <div class="image-mode small">
  500. <div class="fit-fill"></div>
  501. <div class="fit-contain"></div>
  502. <div class="fit-cover"></div>
  503. <div class="fit-scale-none"></div>
  504. <div class="fit-scale-down"></div>
  505. </div>
  506. <h1>Image decorator alignment modes</h1>
  507. <div class="image-mode">
  508. <div class="align-default"><p style="font-style: italic;">default</p></div>
  509. <div class="align-right"><p>right</p></div>
  510. <div class="align-left-bottom"><p>left bottom</p></div>
  511. <div class="align-percent"><p>70% 30%</p></div>
  512. <div class="align-pixel"><p>100px -15px</p></div>
  513. <p class="center" style="margin: 0.3em 0 0 0;">Using fit mode 'scale-none'.</p>
  514. </div>
  515. <h1>Tiled decorators orientation</h1>
  516. <p>Orientation can be applied to every tile individually in the 'image', 'tiled-horizontal', 'tiled-vertical', and 'tiled-box' decorators.</p>
  517. <div class="image-mode">
  518. <div class="orientation-vertical"><p>flip-vertical</p></div>
  519. <div class="orientation-horizontal"><p>flip-horizontal</p></div>
  520. <div class="orientation-rotate"><p>rotate-180</p></div>
  521. </div>
  522. </div>
  523. <h1>Image elements</h1>
  524. <div class="center">
  525. <img src="../../../assets/high_scores_defender.tga" class="clickable" onclick="change_color"/>
  526. <img sprite="icon-game" style="vertical-align: 10px;"/>
  527. <img src="../../../assets/high_scores_defender.tga" style="image-color: #fc5;" rect="0 0 64 64"/>
  528. <img src="../../../assets/high_scores_defender.tga" style="image-color: #9c5;" rect="64 0 64 64"/>
  529. </div>
  530. <p>The 'img' elements are separate from decorators, but we describe them here for completeness. They can be declared as in html. Additionally, a 'rect' attribute can be used to crop the image. The element can also display sprites declared in a sprite sheet.</p>
  531. <h1>Sprite sheets</h1>
  532. <p>Sprite sheets are defined by an image source and a collection of sprites, and can be declared in RCSS. Sprites are essentially rectangles into the given image. For example, the following image</p>
  533. <img src="../../../assets/invader.tga" rect="0 0 500 300" style="margin-top: 10px; margin-bottom: 10px;"/>
  534. <p>is used to render most sprites in this demo. Sprites can be used in decorators and image elements as if they were separate images.</p>
  535. </panel>
  536. <tab>Animations</tab>
  537. <panel id="animations">
  538. <h1>Transitions</h1>
  539. <p>Hover over the following to see an animation performed by the transition property in RCSS.</p>
  540. <div id="transition">
  541. <img class="alien alien1" src="../../../assets/high_scores_alien_1.tga"/>
  542. <img class="alien alien2" src="../../../assets/high_scores_alien_2.tga"/>
  543. <img class="alien alien3" src="../../../assets/high_scores_alien_3.tga"/>
  544. <div class="ray"><img class="defender" src="../../../assets/high_scores_defender.tga"/></div>
  545. <div style="height: 110%;"/>
  546. </div>
  547. <h1>Tweening functions</h1>
  548. <p>Set animation parameters below and click on the background or the flag.</p>
  549. <div id="tweening_area" onclick="move_child">
  550. <img sprite="icon-flag" onclick="change_color"/>
  551. </div>
  552. <select name="tween_function" onchange="tween_function">
  553. <option value="linear" selected>Tweening function</option>
  554. <option value="back">Back</option>
  555. <option value="bounce">Bounce</option>
  556. <option value="circular">Circular</option>
  557. <option value="cubic">Cubic</option>
  558. <option value="elastic">Elastic</option>
  559. <option value="exponential">Exponential</option>
  560. <option value="linear">Linear</option>
  561. <option value="quadratic">Quadratic</option>
  562. <option value="quartic">Quartic</option>
  563. <option value="quintic">Quintic</option>
  564. <option value="sine">Sine</option>
  565. </select>
  566. <select name="tween_direction" onchange="tween_direction">
  567. <option value="out" selected>Direction</option>
  568. <option value="in">In</option>
  569. <option value="out">Out</option>
  570. <option value="in-out">In-Out</option>
  571. </select>
  572. <div>
  573. <input type="range" style="width: 150px; margin-right: 1em;" min="0" max="2" step="0.05" value="0.5" onchange="tween_duration"/>
  574. Duration <span id="duration">0.50</span> s
  575. </div>
  576. <h1>Cube</h1>
  577. <p>The cube is transformed and animated entirely in RCSS using the @keyframes at-rule.</p>
  578. <div class="cube_container">
  579. <div class="cube">
  580. <div class="face back">6</div>
  581. <div class="face top">5</div>
  582. <div class="face left">4</div>
  583. <div class="face bottom">3</div>
  584. <div class="face right">2</div>
  585. <div class="face front">1</div>
  586. </div>
  587. </div>
  588. </panel>
  589. <tab>Forms</tab>
  590. <panel id="controls">
  591. <form onsubmit="submit_form">
  592. <h2>Full name</h2>
  593. <div>
  594. <input type="text" size="20" name="name"/>
  595. </div>
  596. <h2>Email and password</h2>
  597. <div>
  598. <input type="text" size="10" name="email"/>
  599. <input type="password" size="10" name="password"/>
  600. </div>
  601. <h2>Favorite animal</h2>
  602. <div>
  603. <input type="radio" name="animal" value="dog" checked/> Dog
  604. <input type="radio" name="animal" value="cat"/> Cat
  605. <input type="radio" name="animal" value="narwhal"/> Narwhal
  606. <input type="radio" name="animal" value="no"/> I don't like animals
  607. </div>
  608. <h2>Favorite meals</h2>
  609. <div>
  610. <input type="checkbox" name="meals" value="pizza" checked/> Pizza
  611. <input type="checkbox" name="meals" value="pasta" checked/> Pasta
  612. <input type="checkbox" name="meals" value="lasagne" checked/> Lasagne
  613. </div>
  614. <h2>Rating</h2>
  615. <div>
  616. <input type="range" name="rating" min="0" max="100" step="1" value="50" onchange="rating"/> <span id="rating"/><span id="rating_emoji">&nbsp;</span>
  617. </div>
  618. <h2>Subject</h2>
  619. <div>
  620. <select name="subject">
  621. <option value="none" selected>Choose your subject</option>
  622. <option value="feature">Feature request</option>
  623. <option value="bug">Bug report</option>
  624. <option value="praise">Praise</option>
  625. <option value="criticism">Criticism</option>
  626. </select>
  627. </div>
  628. <h2>Message</h2>
  629. <div>
  630. <textarea cols="30" rows="5" wrap="nowrap" name="message">😍 Hello 🌐 World! 😎</textarea>
  631. </div>
  632. <div style="margin-bottom: 15px;">
  633. <input type="submit">Submit</input>
  634. </div>
  635. <h2>Form output</h2>
  636. <div id="form_output"></div>
  637. </form>
  638. </panel>
  639. <tab>Sandbox</tab>
  640. <panel id="sandbox" style="max-width: -1px;">
  641. <textarea id="sandbox_rml_source" wrap="nowrap" onchange="set_sandbox_body"></textarea>
  642. <textarea id="sandbox_rcss_source" wrap="nowrap" onchange="set_sandbox_style"></textarea>
  643. <div id="sandbox_target"></div>
  644. </panel>
  645. </tabset>
  646. </body>
  647. </rml>