demo.rml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917
  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. left: 80dp;
  33. right: 80dp;
  34. top: 50dp;
  35. bottom: 50dp;
  36. min-width: 1040dp;
  37. min-height: 300dp;
  38. max-width: none;
  39. max-height: none;
  40. }
  41. div#title_bar div#icon
  42. {
  43. display: none;
  44. }
  45. div#content
  46. {
  47. position: relative;
  48. /* background-color: #bbb; */
  49. }
  50. tabset
  51. {
  52. display: block;
  53. }
  54. tabs
  55. {
  56. display: block;
  57. position: fixed;
  58. clip: none;
  59. text-align: right;
  60. top: -47dp;
  61. left: 205dp;
  62. right: 10dp;
  63. }
  64. tab
  65. {
  66. width: 90dp;
  67. padding: 0 20dp;
  68. line-height: 40dp;
  69. display: inline-block;
  70. font-size: 15dp;
  71. color: #ddd;
  72. text-align: center;
  73. decorator: tiled-horizontal( tableheader-l, tableheader-c, tableheader-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: 30dp;
  94. margin-left: auto;
  95. margin-right: auto;
  96. max-width: 500dp;
  97. }
  98. panel#welcome
  99. {
  100. display: inline-block;
  101. }
  102. h1
  103. {
  104. margin: 1.4em 0 0.7em;
  105. font-size: 18dp;
  106. }
  107. p.title
  108. {
  109. font-size: 35dp;
  110. color: #b33;
  111. font-effect: glow(2dp #ed5);
  112. }
  113. .center {
  114. text-align: center;
  115. }
  116. .clickable
  117. {
  118. cursor: pointer;
  119. }
  120. /*** Decorators ***/
  121. #decorators {
  122. text-align: left;
  123. }
  124. #decorators p
  125. {
  126. margin: 0.5em 0;
  127. }
  128. #decorators button.gradient
  129. {
  130. decorator: vertical-gradient( #415857 #5990A3 );
  131. border: 3dp #415857;
  132. border-radius: 8dp;
  133. margin-right: 12dp;
  134. }
  135. #decorators button.gradient.horizontal
  136. {
  137. decorator: horizontal-gradient( #DB6565 #F1B58A );
  138. border-color: #DB6565;
  139. }
  140. #decorators button.gradient:hover
  141. {
  142. border-color: #F9EFA3;
  143. }
  144. #decorators .image-alien
  145. {
  146. width: 64dp;
  147. height: 64dp;
  148. decorator: image( /assets/high_scores_alien_1.tga );
  149. }
  150. #decorators .image-invader
  151. {
  152. width: 51dp;
  153. height: 39dp;
  154. decorator: image( icon-invader );
  155. }
  156. .side-by-side
  157. {
  158. display: inline-block;
  159. width: 120dp;
  160. vertical-align: middle;
  161. text-align: center;
  162. }
  163. .tiled-box
  164. {
  165. height: 200dp;
  166. decorator: tiled-box(
  167. window-tl, window-t, window-tr,
  168. window-l, window-c, window-r,
  169. window-bl, window-b, window-br
  170. );
  171. }
  172. .image-mode
  173. {
  174. text-align: center;
  175. margin-top: 30dp;
  176. }
  177. .image-mode > div
  178. {
  179. display: inline-block;
  180. width: 120dp;
  181. height: 50dp;
  182. padding: 5dp 10dp;
  183. margin: 10dp 10dp;
  184. background-color: #c662;
  185. border: 1dp #777;
  186. font-effect: shadow( 1dp 1dp #333 );
  187. }
  188. .image-mode.repeat > div {
  189. height: 120dp;
  190. }
  191. #decorators .image-mode > div > p
  192. {
  193. margin: -2em 0 0 0;
  194. text-align: center;
  195. }
  196. .image-mode.small { margin-top: -20dp; }
  197. .image-mode.small > div
  198. {
  199. width: 40dp;
  200. height: 20dp;
  201. padding: 0;
  202. margin-left: 60dp;
  203. margin-right: 60dp;
  204. }
  205. .align-default { decorator: image( icon-invader scale-none ); }
  206. .align-right { decorator: image( icon-invader scale-none right ); }
  207. .align-left-bottom { decorator: image( icon-invader scale-none left bottom ); }
  208. .align-percent { decorator: image( icon-invader scale-none 70% 30% ); }
  209. .align-pixel { decorator: image( icon-invader scale-none 100px -15px ); }
  210. .fit-fill { decorator: image( icon-invader fill ); }
  211. .fit-contain { decorator: image( icon-invader contain ); }
  212. .fit-cover { decorator: image( icon-invader cover ); }
  213. .fit-scale-none { decorator: image( icon-invader scale-none ); }
  214. .fit-scale-down { decorator: image( icon-invader scale-down ); }
  215. .fit-repeat { decorator: image( /assets/alien_small.tga repeat ); }
  216. .fit-repeat-x { decorator: image( /assets/alien_small.tga repeat-x ); }
  217. .fit-repeat-y { decorator: image( /assets/alien_small.tga repeat-y ); }
  218. .orientation-vertical { decorator: image( icon-invader flip-vertical scale-none ); }
  219. .orientation-horizontal { decorator: image( icon-invader flip-horizontal scale-none ); }
  220. .orientation-rotate { decorator: image( icon-invader rotate-180 scale-none ); }
  221. /*** Font effects ***/
  222. #font_effects div
  223. {
  224. display: inline-block;
  225. width: 180dp;
  226. margin: 0 30dp 30dp;
  227. text-align: center;
  228. font-size: 35dp;
  229. color: #b33;
  230. }
  231. #font_effects h1
  232. {
  233. margin: 15dp 0 10dp 0;
  234. }
  235. #font_effects .glow
  236. {
  237. font-effect: glow(3dp #ed5);
  238. }
  239. #font_effects .glow_sharper
  240. {
  241. font-effect: glow(3dp 1dp #ed5);
  242. }
  243. #font_effects .glow_blurry
  244. {
  245. font-effect: glow(2dp 7dp #ed5);
  246. }
  247. #font_effects .glow_shadow
  248. {
  249. color: #ed5;
  250. font-effect: glow(2dp 4dp 2dp 3dp #644);
  251. }
  252. #font_effects .outline_small
  253. {
  254. font-effect: outline(2dp #ed5);
  255. }
  256. #font_effects .outline_big
  257. {
  258. font-effect: outline(4dp #ed5);
  259. }
  260. #font_effects .blur_small
  261. {
  262. color: #fff2;
  263. font-effect: blur(3dp #ed5);
  264. }
  265. #font_effects .blur_big
  266. {
  267. color: #fff1;
  268. font-effect: blur(10dp #ed5);
  269. }
  270. #font_effects .shadow_up
  271. {
  272. font-weight: bold;
  273. font-effect: shadow(3dp -3dp #ed5);
  274. }
  275. #font_effects .shadow_down
  276. {
  277. font-weight: bold;
  278. font-effect: shadow(0px 2dp #333);
  279. }
  280. /*** Animations ***/
  281. #tweening_area
  282. {
  283. position: relative;
  284. margin: 30dp auto;
  285. width: 400dp;
  286. height: 250dp;
  287. border: 1dp #777;
  288. background-color: #ccc2;
  289. cursor: cross;
  290. }
  291. #tweening_area img
  292. {
  293. position: absolute;
  294. cursor: pointer;
  295. transform: translate(190dp, 100dp);
  296. }
  297. #transition
  298. {
  299. margin: 20dp auto 30dp;
  300. width: 400dp;
  301. height: 250dp;
  302. border: 1dp #777;
  303. background-color: #ccc2;
  304. position: relative;
  305. overflow: hidden;
  306. }
  307. #transition > img
  308. {
  309. position: absolute;
  310. top: -50dp;
  311. left: 50%;
  312. margin-left: -32dp;
  313. transition: top left 0.6s back-out, opacity 0.4s, image-color 0.4s 0.3s quadratic-out;
  314. opacity: 0;
  315. image-color: #fff;
  316. }
  317. #transition:hover > img
  318. {
  319. top: 50dp;
  320. opacity: 1;
  321. image-color: #f61;
  322. }
  323. #transition:hover .alien1 { left: 30%; top: 75dp; }
  324. #transition:hover .alien3 { left: 70%; top: 75dp; }
  325. #transition .defender
  326. {
  327. transition: image-color 0.3s 0.0s quadratic-out;
  328. position: absolute;
  329. left: -44dp;
  330. top: 150dp; opacity: 1;
  331. }
  332. #transition:hover .defender { image-color: #acf; }
  333. #transition .ray {
  334. transition: top 0.4s back-out, opacity 0.4s cubic-in;
  335. position: absolute;
  336. top: -130dp;
  337. left: 50%;
  338. opacity: 0;
  339. margin-left: -20dp;
  340. width: 40dp;
  341. height: 200dp;
  342. decorator: vertical-gradient( #daf0 #fef6 );
  343. }
  344. #transition:hover .ray
  345. {
  346. opacity: 1;
  347. top: 0px;
  348. }
  349. @keyframes cube-rotate {
  350. from { transform: rotate3d(1, -1, 0.3, 0deg); }
  351. to { transform: rotate3d(1, -1, 0.3, 360deg); }
  352. }
  353. .cube_container {
  354. width: 200dp;
  355. height: 200dp;
  356. margin: 20dp auto;
  357. perspective: 500dp;
  358. }
  359. .cube {
  360. width: 100%;
  361. height: 100%;
  362. position: relative;
  363. animation: 3s cube-rotate infinite back-in-out;
  364. }
  365. .face {
  366. left: 50dp; top: 50dp;
  367. display: block;
  368. position: absolute;
  369. width: 100dp;
  370. height: 100dp;
  371. line-height: 100dp;
  372. font-size: 60dp;
  373. color: white;
  374. text-align: center;
  375. }
  376. /* Define each face based on direction */
  377. .face.front {
  378. background: rgba(0, 0, 0, 160);
  379. transform: translateZ(50dp);
  380. }
  381. .face.front:hover {
  382. background: rgba(255, 255, 0, 120);
  383. }
  384. .face.back {
  385. background: rgba(0, 255, 0, 255);
  386. color: black;
  387. transform: rotateY(180deg) translateZ(50dp);
  388. }
  389. .face.right {
  390. background: rgba(196, 0, 0, 200);
  391. transform: rotateY(90deg) translateZ(50dp);
  392. }
  393. .face.left {
  394. background: rgba(0, 0, 196, 200);
  395. transform: rotateY(-90deg) translateZ(50dp);
  396. }
  397. .face.top {
  398. background: rgba(196, 196, 0, 200);
  399. transform: rotateX(90deg) translateZ(50dp);
  400. }
  401. .face.bottom {
  402. background: rgba(196, 0, 196, 200);
  403. transform: rotateX(-90deg) translateZ(50dp);
  404. }
  405. /*** Forms ***/
  406. form {
  407. display: block;
  408. text-align: left;
  409. }
  410. form input, form select {
  411. margin-left: 0;
  412. }
  413. input.text, input.password {
  414. width: 35%;
  415. }
  416. input.text.two-wide {
  417. width: 70%;
  418. }
  419. form h2 {
  420. display: block;
  421. font-size: 16dp;
  422. font-weight: bold;
  423. margin-top: 0.6em;
  424. margin-bottom: 0.4em;
  425. }
  426. #rating {
  427. display: inline-block;
  428. width: 40dp;
  429. padding-left: 1em;
  430. }
  431. #rating_emoji {
  432. color: #ffd40f;
  433. font-size: 1.7em;
  434. }
  435. progress {
  436. margin: 10dp 20dp;
  437. display: inline-block;
  438. vertical-align: middle;
  439. }
  440. #gauge {
  441. decorator: image( gauge );
  442. width: 100dp;
  443. height: 86dp;
  444. fill-image: gauge-fill;
  445. }
  446. #progress_horizontal {
  447. decorator: tiled-horizontal( progress-l, progress-c, progress-r );
  448. width: 150dp;
  449. height: 34dp;
  450. }
  451. #progress_horizontal fill {
  452. decorator: tiled-horizontal( progress-fill-l, progress-fill-c, progress-fill-r );
  453. margin: 0 7dp;
  454. padding-left: 14dp;
  455. }
  456. #progress_label {
  457. font-size: 18dp;
  458. color: #ceb;
  459. margin-left: 1em;
  460. margin-bottom: 0;
  461. }
  462. #gauge_value, #progress_value {
  463. font-size: 16dp;
  464. color: #4ADB2D;
  465. text-align: right;
  466. width: 53dp;
  467. font-effect: outline( 2dp #555 );
  468. }
  469. #gauge_value {
  470. margin: 34dp 0 0 18dp;
  471. }
  472. #progress_value {
  473. margin-left: -20dp;
  474. display: inline-block;
  475. }
  476. #form_output
  477. {
  478. border: 1dp #666;
  479. font-size: 0.9em;
  480. background-color: #ddd;
  481. min-height: 180dp;
  482. margin-top: 10dp;
  483. padding: 5dp 8dp;
  484. color: #222;
  485. white-space: pre-wrap;
  486. overflow: hidden auto;
  487. }
  488. #controls textarea
  489. {
  490. font-size: 18dp;
  491. font-effect: outline(2dp #060);
  492. color: #ddd;
  493. caret-color: #060;
  494. }
  495. #controls textarea selection
  496. {
  497. background-color: #aca;
  498. color: #999;
  499. }
  500. /*** Sandbox ***/
  501. #sandbox
  502. {
  503. position: absolute;
  504. top: 20dp;
  505. right: 30dp;
  506. bottom: 20dp;
  507. left: 30dp;
  508. padding: 0;
  509. max-width: none;
  510. }
  511. #sandbox table
  512. {
  513. height: 100%;
  514. gap: 5dp;
  515. }
  516. #sandbox tr
  517. {
  518. background-color: transparent;
  519. }
  520. #sandbox textarea
  521. {
  522. font-size: 13dp;
  523. color: #222;
  524. font-family: rmlui-debugger-font;
  525. box-sizing: border-box;
  526. width: 100%;
  527. height: 100%;
  528. }
  529. #sandbox_target
  530. {
  531. box-sizing: border-box;
  532. background-color: #fff;
  533. border: 1px #000;
  534. height: 100%;
  535. color: #000;
  536. text-align: left;
  537. position: relative;
  538. }
  539. #col_rml_source
  540. {
  541. min-width: 15%;
  542. max-width: 85%;
  543. }
  544. #row_source
  545. {
  546. height: 40%;
  547. min-height: 15%;
  548. max-height: 85%;
  549. }
  550. .slider
  551. {
  552. display: block;
  553. height: 100%;
  554. background: #3332;
  555. cursor: move;
  556. box-sizing: border-box;
  557. border: 4dp transparent;
  558. }
  559. .slider:hover, .slider:active
  560. {
  561. background: #dda;
  562. }
  563. #vertical_slider
  564. {
  565. width: 12dp;
  566. margin-left: 3dp;
  567. padding-top: 5dp;
  568. }
  569. #horizontal_slider
  570. {
  571. height: 12dp;
  572. }
  573. form input, form textarea, form select
  574. {
  575. nav: vertical;
  576. }
  577. form .nav-auto, form input.checkbox, form input.radio
  578. {
  579. nav: auto;
  580. }
  581. </style>
  582. </head>
  583. <body template="window">
  584. <tabset id="menu">
  585. <tab>Welcome</tab>
  586. <panel id="welcome">
  587. <p class="title" style="margin-top: 1.8em;">RmlUi 😍</p>
  588. <p>Have fun fiddling about in this demo.</p>
  589. <p>Press 'F8' to open up the debugger.</p>
  590. <p class="title" style="margin-top: 1em;">🎉</p>
  591. </panel>
  592. <tab>Decorators</tab>
  593. <panel id="decorators">
  594. <h1>Gradient decorator</h1>
  595. <p>The 'gradient' decorator renders a color gradient in the vertical or horizontal direction.</p>
  596. <div class="center">
  597. <button class="gradient">Gradient</button>
  598. <button class="gradient horizontal">Gradient</button>
  599. </div>
  600. <h1>Image decorator</h1>
  601. <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>
  602. <div class="center">
  603. <div class="side-by-side">
  604. <div class="image-alien clickable" onclick="change_color"/>
  605. </div>
  606. <div class="side-by-side">
  607. <div class="image-invader"/>
  608. </div>
  609. <div class="side-by-side">
  610. <button>Button</button>
  611. </div>
  612. </div>
  613. <h1>Tiled-horizontal decorator</h1>
  614. <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>
  615. <div class="side-by-side">
  616. <div style="width: 30dp; height: 30dp; decorator: image( radio );"/>
  617. <div style="width: 120dp; height: 30dp; decorator: tiled-horizontal( demo-radio-l, demo-radio-m, demo-radio-r );"/>
  618. </div>
  619. <div class="side-by-side">
  620. <div style="width: 30dp; height: 30dp; decorator: image( checkbox );"/>
  621. <div style="width: 120dp; height: 30dp; decorator: tiled-horizontal( demo-checkbox-l, demo-checkbox-m, demo-checkbox-r );"/>
  622. </div>
  623. <div class="side-by-side" width="250dp;">
  624. <div style="width: 96dp; height: 85dp; decorator: image( demo-title-bar );"/>
  625. <div style="width: 250dp; height: 85dp; decorator: tiled-horizontal( title-bar-l, title-bar-c, title-bar-r );"/>
  626. </div>
  627. <p>In the third example we show the same title bar that is used to style the sample windows.</p>
  628. <h1>Tiled-vertical decorator</h1>
  629. <p>The 'tiled-vertical' decorator behaves like tiled-horizontal, but this time it is stretched vertically.</p>
  630. <div class="side-by-side">
  631. <div style="width: 30dp; height: 30dp; decorator: image( radio );"/>
  632. <div style="width: 30dp; height: 80dp; decorator: tiled-vertical( demo-radio-t, demo-radio-c, demo-radio-b );"/>
  633. </div>
  634. <div class="side-by-side">
  635. <div style="width: 30dp; height: 30dp; decorator: image( checkbox );"/>
  636. <div style="width: 30dp; height: 80dp; decorator: tiled-vertical( demo-checkbox-t, demo-checkbox-c, demo-checkbox-b );"/>
  637. </div>
  638. <div class="side-by-side">
  639. <div style="width: 30dp; height: 30dp; decorator: image( checkbox-checked );"/>
  640. <div style="width: 30dp; height: 80dp; decorator: tiled-vertical( demo-checked-t, demo-checked-c, demo-checked-b );"/>
  641. </div>
  642. <div class="side-by-side">
  643. <div style="width: 51dp; height: 39dp; decorator: image( icon-help );"/>
  644. <div style="width: 51dp; height: 80dp; decorator: tiled-vertical( demo-help-t, demo-help-c, demo-help-b );"/>
  645. </div>
  646. <p>Clearly, not all images are designed to stretch like this. However, one can certainly envision a usage for the first two examples.</p>
  647. <h1>Tiled-box decorator</h1>
  648. <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>
  649. <p>The following image displays the region used to define the background of the window in this sample.</p>
  650. <img sprite="window-outer"/>
  651. <p>The decorator's element can then gracefully be sized in any direction, keeping the corners and edges at a proper size.</p>
  652. <div class="tiled-box"/>
  653. <h1>Ninepatch decorator</h1>
  654. <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>
  655. <p>Let us define the outer sprite by the following image, and the inner sprite as the part within the displayed border.</p>
  656. <div style="position: relative; text-align: left; width: 145dp;">
  657. <img sprite="textarea"/><img sprite="textarea-inner" style="position: absolute; left: 10dp; top: 13dp; border: 1dp #f0f;"/>
  658. </div>
  659. <p>When the ninepatch decorator is applied and the element is stretched, the following is rendered.</p>
  660. <div style="width: 240dp; height: 50dp; decorator: ninepatch(textarea, textarea-inner, 1.0);"/>
  661. <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>
  662. <div style="width: 240dp; height: 50dp; decorator: ninepatch(textarea, textarea-inner, .5 .5 .5 1);"/>
  663. <p>If we instead compare this to the image decorator, we see the following.</p>
  664. <div style="width: 240dp; height: 50dp; decorator: image(textarea);"/>
  665. <p>With the image decorator it looks blurry and its borders are stretched.</p>
  666. <div style="width: 850dp; margin-left: -175dp;">
  667. <h1>Image decorator fit modes</h1>
  668. <div class="image-mode">
  669. <div class="fit-fill"><p>fill</p></div>
  670. <div class="fit-contain"><p>contain</p></div>
  671. <div class="fit-cover"><p>cover</p></div>
  672. <div class="fit-scale-none"><p>scale-none</p></div>
  673. <div class="fit-scale-down"><p>scale-down</p></div>
  674. </div>
  675. <div class="image-mode small">
  676. <div class="fit-fill"></div>
  677. <div class="fit-contain"></div>
  678. <div class="fit-cover"></div>
  679. <div class="fit-scale-none"></div>
  680. <div class="fit-scale-down"></div>
  681. </div>
  682. <div class="image-mode repeat">
  683. <div class="fit-repeat"><p>repeat</p></div>
  684. <div class="fit-repeat-x"><p>repeat-x</p></div>
  685. <div class="fit-repeat-y"><p>repeat-y</p></div>
  686. </div>
  687. <h1>Image decorator alignment modes</h1>
  688. <div class="image-mode">
  689. <div class="align-default"><p style="font-style: italic;">default</p></div>
  690. <div class="align-right"><p>right</p></div>
  691. <div class="align-left-bottom"><p>left bottom</p></div>
  692. <div class="align-percent"><p>70% 30%</p></div>
  693. <div class="align-pixel"><p>100px -15px</p></div>
  694. <p class="center" style="margin: 0.3em 0 0 0;">Using fit mode 'scale-none'.</p>
  695. </div>
  696. <h1>Tiled decorators orientation</h1>
  697. <p>Orientation can be applied to every tile individually in the 'image', 'tiled-horizontal', 'tiled-vertical', and 'tiled-box' decorators.</p>
  698. <div class="image-mode">
  699. <div class="orientation-vertical"><p>flip-vertical</p></div>
  700. <div class="orientation-horizontal"><p>flip-horizontal</p></div>
  701. <div class="orientation-rotate"><p>rotate-180</p></div>
  702. </div>
  703. </div>
  704. <h1>Image elements</h1>
  705. <div class="center">
  706. <img src="../../../assets/high_scores_defender.tga" class="clickable" onclick="change_color"/>
  707. <img sprite="icon-game" style="vertical-align: 10dp;"/>
  708. <img src="../../../assets/high_scores_defender.tga" style="image-color: #fc5;" rect="0 0 64 64"/>
  709. <img src="../../../assets/high_scores_defender.tga" style="image-color: #9c5;" rect="64 0 64 64"/>
  710. </div>
  711. <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>
  712. <h1>Sprite sheets</h1>
  713. <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>
  714. <img src="../../../assets/invader.tga" rect="0 0 500 435" style="margin-top: 10dp; margin-bottom: 10dp;"/>
  715. <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>
  716. </panel>
  717. <tab>Font effects</tab>
  718. <panel id="font_effects">
  719. <h1>None</h1>
  720. <div class="original">RmlUi 😍</div>
  721. <h1>Glow</h1>
  722. <div class="glow">RmlUi 😍</div>
  723. <div class="glow_sharper">RmlUi 😍</div>
  724. <div class="glow_blurry">RmlUi 😍</div>
  725. <div class="glow_shadow">RmlUi 😍</div>
  726. <h1>Outline</h1>
  727. <div class="outline_small">RmlUi 😍</div>
  728. <div class="outline_big">RmlUi 😍</div>
  729. <h1>Shadow</h1>
  730. <div class="shadow_up">RmlUi 😍</div>
  731. <div class="shadow_down">RmlUi 😍</div>
  732. <h1>Blur</h1>
  733. <div class="blur_small">RmlUi 😍</div>
  734. <div class="blur_big">RmlUi 😍</div>
  735. </panel>
  736. <tab>Animations</tab>
  737. <panel id="animations">
  738. <h1>Transitions</h1>
  739. <p>Hover over the following to see an animation performed by the transition property in RCSS.</p>
  740. <div id="transition">
  741. <img class="alien alien1" src="../../../assets/high_scores_alien_1.tga"/>
  742. <img class="alien alien2" src="../../../assets/high_scores_alien_2.tga"/>
  743. <img class="alien alien3" src="../../../assets/high_scores_alien_3.tga"/>
  744. <div class="ray"><img class="defender" src="../../../assets/high_scores_defender.tga"/></div>
  745. <div style="height: 110%;"/>
  746. </div>
  747. <h1>Tweening functions</h1>
  748. <p>Set animation parameters below and click on the background or the flag.</p>
  749. <div id="tweening_area" onclick="move_child">
  750. <img sprite="icon-flag" onclick="change_color"/>
  751. </div>
  752. <select name="tween_function" onchange="tween_function">
  753. <option value="linear" selected>Tweening function</option>
  754. <option value="back">Back</option>
  755. <option value="bounce">Bounce</option>
  756. <option value="circular">Circular</option>
  757. <option value="cubic">Cubic</option>
  758. <option value="elastic">Elastic</option>
  759. <option value="exponential">Exponential</option>
  760. <option value="linear">Linear</option>
  761. <option value="quadratic">Quadratic</option>
  762. <option value="quartic">Quartic</option>
  763. <option value="quintic">Quintic</option>
  764. <option value="sine">Sine</option>
  765. </select>
  766. <select name="tween_direction" onchange="tween_direction">
  767. <option value="out" selected>Direction</option>
  768. <option value="in">In</option>
  769. <option value="out">Out</option>
  770. <option value="in-out">In-Out</option>
  771. </select>
  772. <div>
  773. <input type="range" style="width: 150dp; margin-right: 1em;" min="0" max="2" step="0.05" value="0.5" onchange="tween_duration"/>
  774. Duration <span id="duration">0.50</span> s
  775. </div>
  776. <h1>Cube</h1>
  777. <p>The cube is transformed and animated entirely in RCSS using the @keyframes at-rule.</p>
  778. <div class="cube_container">
  779. <div class="cube">
  780. <div class="face back">6</div>
  781. <div class="face top">5</div>
  782. <div class="face left">4</div>
  783. <div class="face bottom">3</div>
  784. <div class="face right">2</div>
  785. <div class="face front">1</div>
  786. </div>
  787. </div>
  788. </panel>
  789. <tab>Forms</tab>
  790. <panel id="controls">
  791. <form onsubmit="submit_form">
  792. <h2>Full name</h2>
  793. <div>
  794. <input class="two-wide" type="text" name="name"/>
  795. </div>
  796. <h2>Email and password</h2>
  797. <div>
  798. <input type="text" name="email" class="nav-auto"/>
  799. <input type="password" name="password" class="nav-auto"/>
  800. </div>
  801. <h2>Favorite animal</h2>
  802. <div>
  803. <label><input type="radio" name="animal" value="dog" checked/> Dog </label>
  804. <label><input type="radio" name="animal" value="cat"/> Cat </label>
  805. <label><input type="radio" name="animal" value="narwhal"/> Narwhal </label>
  806. <label><input type="radio" name="animal" value="no" style="nav-down: #lasagne"/> I don't like animals </label>
  807. </div>
  808. <h2>Favorite meals</h2>
  809. <div>
  810. <label><input type="checkbox" name="meals" value="pizza" checked/> Pizza </label>
  811. <label><input type="checkbox" name="meals" value="pasta" checked/> Pasta </label>
  812. <label><input type="checkbox" name="meals" value="lasagne" id="lasagne" checked/> Lasagne </label>
  813. </div>
  814. <h2>Rating</h2>
  815. <div>
  816. <input type="range" name="rating" min="0" max="100" step="1" value="50" onchange="rating"/> <span id="rating"/><span id="rating_emoji">&nbsp;</span>
  817. </div>
  818. <h2>Subject</h2>
  819. <div>
  820. <select name="subject">
  821. <option value="none" selected>Choose your subject</option>
  822. <option value="feature">Feature request</option>
  823. <option value="bug">Bug report</option>
  824. <option value="praise">Praise</option>
  825. <option value="criticism">Criticism</option>
  826. </select>
  827. </div>
  828. <h2>Message</h2>
  829. <div>
  830. <textarea cols="25" rows="4" name="message">😍 Hello 🌐 World! 😎</textarea>
  831. </div>
  832. <div style="margin-bottom: 15dp;">
  833. <input type="submit">Submit</input>
  834. </div>
  835. <div id="submit_progress" style="display: none;">
  836. <p id="progress_label">&nbsp;</p>
  837. <progress id="gauge" direction="clockwise" start-edge="bottom" value="0.0">
  838. <div id="gauge_value">50%</div>
  839. </progress>
  840. <progress id="progress_horizontal" direction="right" value="0.0"/>
  841. <div id="progress_value">50%</div>
  842. <h2>Form output</h2>
  843. <div id="form_output"></div>
  844. </div>
  845. </form>
  846. </panel>
  847. <tab>Sandbox</tab>
  848. <panel id="sandbox">
  849. <table>
  850. <col id="col_rml_source"/>
  851. <col/>
  852. <col/>
  853. <tr id="row_source">
  854. <td><textarea id="sandbox_rml_source" wrap="nowrap" onchange="set_sandbox_body"></textarea></td>
  855. <td id="vertical_slider"><handle class="slider"size_target="col_rml_source"/></td>
  856. <td><textarea id="sandbox_rcss_source" wrap="nowrap" onchange="set_sandbox_style"></textarea></td>
  857. </tr>
  858. <tr>
  859. <td colspan=3 id="horizontal_slider"><handle class="slider" size_target="row_source"/></td>
  860. </tr>
  861. <tr style="height: 100%">
  862. <td colspan=3><div id="sandbox_target"/></td>
  863. </tr>
  864. </table>
  865. </panel>
  866. </tabset>
  867. </body>
  868. </rml>