theming.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset='utf-8' />
  5. <!-- for Bootstrap 5 -->
  6. <link href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css" rel="stylesheet">
  7. <!-- for Bootstrap 4 -->
  8. <link href='https://use.fontawesome.com/releases/v5.0.6/css/all.css' rel='stylesheet'>
  9. <script src='../../packages/core/dist/index.global.js'></script>
  10. <script src='../../packages/interaction/dist/index.global.js'></script>
  11. <script src='../../packages/daygrid/dist/index.global.js'></script>
  12. <script src='../../packages/timegrid/dist/index.global.js'></script>
  13. <script src='../../packages/list/dist/index.global.js'></script>
  14. <script src='../../packages/bootstrap5/dist/index.global.js'></script>
  15. <script src='js/theme-chooser.js'></script>
  16. <script>
  17. document.addEventListener('DOMContentLoaded', function() {
  18. var calendarEl = document.getElementById('calendar');
  19. var calendar;
  20. initThemeChooser({
  21. init: function(themeSystem) {
  22. calendar = new FullCalendar.Calendar(calendarEl, {
  23. themeSystem: themeSystem,
  24. headerToolbar: {
  25. left: 'prev,next today',
  26. center: 'title',
  27. right: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth'
  28. },
  29. initialDate: '2020-09-12',
  30. weekNumbers: true,
  31. navLinks: true, // can click day/week names to navigate views
  32. editable: true,
  33. selectable: true,
  34. nowIndicator: true,
  35. dayMaxEvents: true, // allow "more" link when too many events
  36. // showNonCurrentDates: false,
  37. events: [
  38. {
  39. title: 'All Day Event',
  40. start: '2020-09-01'
  41. },
  42. {
  43. title: 'Long Event',
  44. start: '2020-09-07',
  45. end: '2020-09-10'
  46. },
  47. {
  48. groupId: 999,
  49. title: 'Repeating Event',
  50. start: '2020-09-09T16:00:00'
  51. },
  52. {
  53. groupId: 999,
  54. title: 'Repeating Event',
  55. start: '2020-09-16T16:00:00'
  56. },
  57. {
  58. title: 'Conference',
  59. start: '2020-09-11',
  60. end: '2020-09-13'
  61. },
  62. {
  63. title: 'Meeting',
  64. start: '2020-09-12T10:30:00',
  65. end: '2020-09-12T12:30:00'
  66. },
  67. {
  68. title: 'Lunch',
  69. start: '2020-09-12T12:00:00'
  70. },
  71. {
  72. title: 'Meeting',
  73. start: '2020-09-12T14:30:00'
  74. },
  75. {
  76. title: 'Happy Hour',
  77. start: '2020-09-12T17:30:00'
  78. },
  79. {
  80. title: 'Dinner',
  81. start: '2020-09-12T20:00:00'
  82. },
  83. {
  84. title: 'Birthday Party',
  85. start: '2020-09-13T07:00:00'
  86. },
  87. {
  88. title: 'Click for Google',
  89. url: 'http://google.com/',
  90. start: '2020-09-28'
  91. }
  92. ]
  93. });
  94. calendar.render();
  95. },
  96. change: function(themeSystem) {
  97. calendar.setOption('themeSystem', themeSystem);
  98. }
  99. });
  100. });
  101. </script>
  102. <style>
  103. body {
  104. margin: 0;
  105. padding: 0;
  106. font-size: 14px;
  107. }
  108. #top,
  109. #calendar.fc-theme-standard {
  110. font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  111. }
  112. #calendar.fc-theme-bootstrap {
  113. font-size: 14px;
  114. }
  115. #top {
  116. background: #eee;
  117. border-bottom: 1px solid #ddd;
  118. padding: 0 10px;
  119. line-height: 40px;
  120. font-size: 12px;
  121. color: #000;
  122. }
  123. #top .selector {
  124. display: inline-block;
  125. margin-right: 10px;
  126. }
  127. #top select {
  128. font: inherit; /* mock what Boostrap does, don't compete */
  129. }
  130. .left { float: left }
  131. .right { float: right }
  132. .clear { clear: both }
  133. #calendar {
  134. max-width: 1100px;
  135. margin: 40px auto;
  136. padding: 0 10px;
  137. }
  138. </style>
  139. </head>
  140. <body>
  141. <div id='top'>
  142. <div class='left'>
  143. <div id='theme-system-selector' class='selector'>
  144. Theme System:
  145. <select>
  146. <option value='bootstrap5' selected>Bootstrap 5</option>
  147. <option value='bootstrap'>Bootstrap 4</option>
  148. <option value='standard'>unthemed</option>
  149. </select>
  150. </div>
  151. <div data-theme-system="bootstrap,bootstrap5" class='selector' style='display:none'>
  152. Theme Name:
  153. <select>
  154. <option value='' selected>Default</option>
  155. <option value='cerulean'>Cerulean</option>
  156. <option value='cosmo'>Cosmo</option>
  157. <option value='cyborg'>Cyborg</option>
  158. <option value='darkly'>Darkly</option>
  159. <option value='flatly'>Flatly</option>
  160. <option value='journal'>Journal</option>
  161. <option value='litera'>Litera</option>
  162. <option value='lumen'>Lumen</option>
  163. <option value='lux'>Lux</option>
  164. <option value='materia'>Materia</option>
  165. <option value='minty'>Minty</option>
  166. <option value='pulse'>Pulse</option>
  167. <option value='sandstone'>Sandstone</option>
  168. <option value='simplex'>Simplex</option>
  169. <option value='sketchy'>Sketchy</option>
  170. <option value='slate'>Slate</option>
  171. <option value='solar'>Solar</option>
  172. <option value='spacelab'>Spacelab</option>
  173. <option value='superhero'>Superhero</option>
  174. <option value='united'>United</option>
  175. <option value='yeti'>Yeti</option>
  176. </select>
  177. </div>
  178. <span id='loading' style='display:none'>loading theme...</span>
  179. </div>
  180. <div class='right'>
  181. <span class='credits' data-credit-id='bootstrap-standard' style='display:none'>
  182. <a href='https://getbootstrap.com/docs/3.3/' target='_blank'>Theme by Bootstrap</a>
  183. </span>
  184. <span class='credits' data-credit-id='bootstrap-custom' style='display:none'>
  185. <a href='https://bootswatch.com/' target='_blank'>Theme by Bootswatch</a>
  186. </span>
  187. </div>
  188. <div class='clear'></div>
  189. </div>
  190. <div id='calendar'></div>
  191. </body>
  192. </html>