theme.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <title>layDate 日期组件功能演示</title>
  2. <style>
  3. .test-laydate-theme-box .layui-inline{margin: 0 20px 20px 0;}
  4. /* 定制 laydate 皮肤:gbw(由社区提供) */
  5. .layui-laydate-hint.laydate-theme-gbw,.layui-laydate.laydate-theme-gbw{border:1px solid #FFF;-webkit-box-shadow:0 2px 8px rgba(0,0,0,.15);-moz-box-shadow:0 2px 8px rgba(0,0,0,.15);box-shadow:0 2px 8px rgba(0,0,0,.15)}
  6. .layui-laydate.laydate-theme-gbw{border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;font-family:"Helvetica Neue For Number",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.5;color:rgba(0,0,0,.65);-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;list-style:none;position:absolute;z-index:19850126}
  7. .laydate-theme-gbw .layui-laydate-header{border-bottom:1px solid #e8e8e8;padding-top:5px}
  8. .laydate-theme-gbw .layui-laydate-header i{font-size:12px;color:rgba(0,0,0,.45)}
  9. .laydate-theme-gbw .layui-laydate-header span{color:rgba(0,0,0,.85);font-weight:500}
  10. .laydate-theme-gbw .layui-laydate-header i:hover,.laydate-theme-gbw .layui-laydate-header span:hover{color:#40a9ff}
  11. .laydate-theme-gbw .layui-laydate-footer{border-top:0;padding-top:0;height:36px}
  12. .laydate-theme-gbw .layui-laydate-footer span:hover{color:#40a9ff}
  13. .laydate-theme-gbw .laydate-footer-btns{top:0}
  14. .laydate-theme-gbw .layui-laydate-content th{color:rgba(0,0,0,.65)}
  15. .laydate-theme-gbw .layui-laydate-content td{color:rgba(0,0,0,.65);border-radius:2px;-webkit-transition:background .3s ease;-o-transition:background .3s ease;transition:background .3s ease}
  16. .laydate-theme-gbw .layui-laydate-content .laydate-day-next,.laydate-theme-gbw .layui-laydate-content .laydate-day-prev{color:rgba(0,0,0,.25)}
  17. .layui-laydate.laydate-theme-gbw td.layui-this{background-color:transparent!important;border:1px solid #1890ff;border-radius:3px;font-weight:700;color:#1890ff!important}
  18. .layui-laydate.laydate-theme-gbw li.layui-this{background-color:#1890ff!important;color:#fff!important;border-radius:0;border:0}
  19. </style>
  20. <div class="layui-card layadmin-header">
  21. <div class="layui-breadcrumb" lay-filter="breadcrumb">
  22. <a lay-href="">主页</a>
  23. <a><cite>组件</cite></a>
  24. <a><cite>日期时间</cite></a>
  25. </div>
  26. </div>
  27. <div class="layui-fluid">
  28. <div class="layui-row layui-col-space15">
  29. <div class="layui-col-md12">
  30. <div class="layui-card">
  31. <div class="layui-card-header">自定义按钮主题</div>
  32. <div class="layui-card-body" pad15>
  33. <div class="layui-form" wid100>
  34. <div class="layui-form-item">
  35. <div class="layui-inline">
  36. <label class="layui-form-label">墨绿主题</label>
  37. <div class="layui-input-inline">
  38. <input type="text" class="layui-input" id="test-laydate-theme-molv" placeholder="yyyy-MM-dd">
  39. </div>
  40. </div>
  41. <div class="layui-inline">
  42. <label class="layui-form-label">格子主题</label>
  43. <div class="layui-input-inline">
  44. <input type="text" class="layui-input" id="test-laydate-theme-grid" placeholder="yyyy-MM-dd">
  45. </div>
  46. </div>
  47. <div class="layui-inline">
  48. <label class="layui-form-label">蓝色主题</label>
  49. <div class="layui-input-inline">
  50. <input type="text" class="layui-input" id="test-laydate-theme-blue" placeholder="yyyy-MM-dd">
  51. </div>
  52. </div>
  53. <div class="layui-inline">
  54. <label class="layui-form-label">大红主题</label>
  55. <div class="layui-input-inline">
  56. <input type="text" class="layui-input" id="test-laydate-theme-red" placeholder="yyyy-MM-dd">
  57. </div>
  58. </div>
  59. <div class="layui-inline">
  60. <label class="layui-form-label">自定义其它颜色</label>
  61. <div class="layui-input-inline">
  62. <input type="text" class="layui-input" id="test-laydate-theme-other" placeholder="yyyy-MM-dd">
  63. </div>
  64. </div>
  65. <div class="layui-inline">
  66. <label class="layui-form-label">定制主题</label>
  67. <div class="layui-input-inline">
  68. <input type="text" class="layui-input" id="test-laydate-theme-custom" placeholder="yyyy-MM-dd">
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. <div class="layui-col-md12">
  77. <div class="layui-card">
  78. <div class="layui-card-header">直接嵌套显示</div>
  79. <div class="layui-card-body" pad15>
  80. <div class="test-laydate-theme-box">
  81. <div class="layui-inline" id="test-laydate-static-n1"></div>
  82. <div class="layui-inline" id="test-laydate-static-n2"></div>
  83. <div class="layui-inline" id="test-laydate-static-n3"></div>
  84. <div class="layui-inline" id="test-laydate-static-n4"></div>
  85. <div class="layui-inline" id="test-laydate-static-n5"></div>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. <script>
  93. layui.use(['admin', 'laydate'], function(){
  94. var laydate = layui.laydate;
  95. //示例代码
  96. //墨绿主题
  97. laydate.render({
  98. elem: '#test-laydate-theme-molv'
  99. ,theme: 'molv'
  100. });
  101. //格子主题
  102. laydate.render({
  103. elem: '#test-laydate-theme-grid'
  104. ,theme: 'grid'
  105. });
  106. //蓝色主题
  107. laydate.render({
  108. elem: '#test-laydate-theme-blue'
  109. ,theme: '#1E9FFF'
  110. });
  111. //大红主题
  112. laydate.render({
  113. elem: '#test-laydate-theme-red'
  114. ,theme: '#c00'
  115. });
  116. //自定义其它颜色
  117. laydate.render({
  118. elem: '#test-laydate-theme-other'
  119. ,theme: '#393D49'
  120. });
  121. //定制主题
  122. laydate.render({
  123. elem: '#test-laydate-theme-custom'
  124. ,theme: 'gbw'
  125. });
  126. //直接嵌套显示
  127. laydate.render({
  128. elem: '#test-laydate-static-n1'
  129. ,position: 'static'
  130. });
  131. laydate.render({
  132. elem: '#test-laydate-static-n2'
  133. ,position: 'static'
  134. ,lang: 'en'
  135. });
  136. laydate.render({
  137. elem: '#test-laydate-static-n3'
  138. ,type: 'year'
  139. ,position: 'static'
  140. });
  141. laydate.render({
  142. elem: '#test-laydate-static-n4'
  143. ,type: 'month'
  144. ,position: 'static'
  145. });
  146. laydate.render({
  147. elem: '#test-laydate-static-n4'
  148. ,type: 'time'
  149. ,position: 'static'
  150. });
  151. });
  152. </script>