palette.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup UnaCoreSamples Samples
  7. * @{
  8. */
  9. /**
  10. * @page samples
  11. * @section palette Palette
  12. */
  13. /**
  14. * This sample shows default palette colors.
  15. * Palette colors are defined as css classes.
  16. */
  17. require_once('./../inc/header.inc.php');
  18. require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
  19. $oTemplate = BxDolTemplate::getInstance();
  20. $oTemplate->setPageNameIndex (BX_PAGE_DEFAULT);
  21. $oTemplate->setPageHeader ("Palette");
  22. $oTemplate->setPageContent ('page_main_code', PageCompMainCode());
  23. $oTemplate->getPageCode();
  24. /**
  25. * page code function
  26. */
  27. function PageCompMainCode()
  28. {
  29. ob_start();
  30. $aColors = array ('red1', 'red1-dark', 'red2', 'red2-dark', 'red3', 'red3-dark', 'green1', 'green1-dark', 'green2', 'green2-dark', 'green3', 'green3-dark', 'blue1', 'blue1-dark', 'blue2', 'blue2-dark', 'blue3', 'blue3-dark', 'gray', 'gray-dark');
  31. $aDefBg = array ('bx-def-color-bg-page', 'bx-def-color-bg-block', 'bx-def-color-bg-box', 'bx-def-color-bg-sec', 'bx-def-color-bg-active', 'bx-def-color-bg-hl', 'bx-def-color-bg-hl-hover');
  32. $sStyle = 'width:300px; height:100px; line-height:100px; display:inline-block; font-size:20px; font-weight:bold; text-align:center;';
  33. foreach ($aColors as $sColor) {
  34. $sClass = 'bx-def-round-corners bx-def-margin-right bx-def-margin-bottom';
  35. $sClassFt = 'col-'.$sColor;
  36. $sClassBg = 'bg-col-'.$sColor;
  37. ?>
  38. <div>
  39. <div class="<?php echo $sClass;?> <?php echo $sClassBg;?>" style="<?php echo $sStyle;?> color:#fff;">.<?php echo $sClassBg;?></div>
  40. <div class="<?php echo $sClass;?> <?php echo $sClassFt;?>" style="<?php echo $sStyle;?> border:1px solid #ccc;">.<?php echo $sClassFt;?></div>
  41. </div>
  42. <?php
  43. }
  44. ?>
  45. <hr class="bx-def-hr bx-def-margin-top bx-def-margin-bottom" />
  46. <?php
  47. foreach ($aDefBg as $sClassBg) {
  48. $sClass = 'bx-def-round-corners bx-def-margin-right bx-def-margin-bottom';
  49. ?>
  50. <div>
  51. <div class="<?php echo $sClass;?> <?php echo $sClassBg;?> bx-def-border" style="<?php echo $sStyle;?>">.<?php echo $sClassBg;?></div>
  52. </div>
  53. <?php
  54. }
  55. $s = ob_get_clean();
  56. return DesignBoxContent("Palette", $s, BX_DB_PADDING_DEF);
  57. }
  58. /** @} */