timeline-theming.html 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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. <link href='../packages-premium/bundle/main.css' rel='stylesheet' />
  10. <script src='../packages-premium/bundle/main.js'></script>
  11. <script src='js/theme-chooser.js'></script>
  12. <script>
  13. document.addEventListener('DOMContentLoaded', function() {
  14. var calendarEl = document.getElementById('calendar');
  15. var calendar;
  16. initThemeChooser({
  17. init: function(themeSystem) {
  18. calendar = new FullCalendar.Calendar(calendarEl, {
  19. themeSystem: themeSystem,
  20. now: '2020-09-07',
  21. editable: true, // enable draggable events
  22. selectable: true,
  23. nowIndicator: true,
  24. aspectRatio: 1.8,
  25. scrollTime: '00:00', // undo default 6am scrollTime
  26. headerToolbar: {
  27. left: 'today prev,next',
  28. center: 'title',
  29. right: 'resourceTimelineDay,resourceTimelineThreeDays,timeGridWeek,dayGridMonth,listWeek'
  30. },
  31. initialView: 'resourceTimelineDay',
  32. views: {
  33. resourceTimelineThreeDays: {
  34. type: 'resourceTimeline',
  35. duration: { days: 3 },
  36. buttonText: '3 days'
  37. }
  38. },
  39. resourceAreaHeaderContent: 'Rooms',
  40. resources: [
  41. { id: 'a', title: 'Auditorium A' },
  42. { id: 'b', title: 'Auditorium B', eventColor: 'green' },
  43. { id: 'c', title: 'Auditorium C', eventColor: 'orange' },
  44. { id: 'd', title: 'Auditorium D', children: [
  45. { id: 'd1', title: 'Room D1' },
  46. { id: 'd2', title: 'Room D2' }
  47. ] },
  48. { id: 'e', title: 'Auditorium E' },
  49. { id: 'f', title: 'Auditorium F', eventColor: 'red' },
  50. { id: 'g', title: 'Auditorium G' },
  51. { id: 'h', title: 'Auditorium H' },
  52. { id: 'i', title: 'Auditorium I' },
  53. { id: 'j', title: 'Auditorium J' },
  54. { id: 'k', title: 'Auditorium K' },
  55. { id: 'l', title: 'Auditorium L' },
  56. { id: 'm', title: 'Auditorium M' },
  57. { id: 'n', title: 'Auditorium N' },
  58. { id: 'o', title: 'Auditorium O' },
  59. { id: 'p', title: 'Auditorium P' },
  60. { id: 'q', title: 'Auditorium Q' },
  61. { id: 'r', title: 'Auditorium R' },
  62. { id: 's', title: 'Auditorium S' },
  63. { id: 't', title: 'Auditorium T' },
  64. { id: 'u', title: 'Auditorium U' },
  65. { id: 'v', title: 'Auditorium V' },
  66. { id: 'w', title: 'Auditorium W' },
  67. { id: 'x', title: 'Auditorium X' },
  68. { id: 'y', title: 'Auditorium Y' },
  69. { id: 'z', title: 'Auditorium Z' }
  70. ],
  71. events: [
  72. { id: '1', resourceId: 'b', start: '2020-09-07T02:00:00', end: '2020-09-07T07:00:00', title: 'event 1' },
  73. { id: '2', resourceId: 'c', start: '2020-09-07T05:00:00', end: '2020-09-07T22:00:00', title: 'event 2' },
  74. { id: '3', resourceId: 'd', start: '2020-09-06', end: '2020-09-08', title: 'event 3' },
  75. { id: '4', resourceId: 'e', start: '2020-09-07T03:00:00', end: '2020-09-07T08:00:00', title: 'event 4' },
  76. { id: '5', resourceId: 'f', start: '2020-09-07T00:30:00', end: '2020-09-07T02:30:00', title: 'Click for Google', url: 'https://google.com' }
  77. ]
  78. });
  79. calendar.render();
  80. },
  81. change: function(themeSystem) {
  82. calendar.setOption('themeSystem', themeSystem);
  83. }
  84. });
  85. });
  86. </script>
  87. <style>
  88. body {
  89. margin: 0;
  90. padding: 0;
  91. font-size: 14px;
  92. }
  93. #top,
  94. #calendar.fc-theme-standard {
  95. font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  96. }
  97. #top {
  98. background: #eee;
  99. border-bottom: 1px solid #ddd;
  100. padding: 0 10px;
  101. line-height: 40px;
  102. font-size: 12px;
  103. color: #000;
  104. }
  105. #top .selector {
  106. display: inline-block;
  107. margin-right: 10px;
  108. }
  109. #top select {
  110. font: inherit; /* mock what Boostrap does, don't compete */
  111. }
  112. .left { float: left }
  113. .right { float: right }
  114. .clear { clear: both }
  115. #calendar {
  116. max-width: 1100px;
  117. margin: 40px auto;
  118. padding: 0 10px;
  119. }
  120. </style>
  121. </head>
  122. <body>
  123. <div id='top'>
  124. <div class='left'>
  125. <div id='theme-system-selector' class='selector'>
  126. Theme System:
  127. <select>
  128. <option value='bootstrap5' selected>Bootstrap 5</option>
  129. <option value='bootstrap'>Bootstrap 4</option>
  130. <option value='standard'>unthemed</option>
  131. </select>
  132. </div>
  133. <div data-theme-system="bootstrap,bootstrap5" class='selector' style='display:none'>
  134. Theme Name:
  135. <select>
  136. <option value='' selected>Default</option>
  137. <option value='cerulean'>Cerulean</option>
  138. <option value='cosmo'>Cosmo</option>
  139. <option value='cyborg'>Cyborg</option>
  140. <option value='darkly'>Darkly</option>
  141. <option value='flatly'>Flatly</option>
  142. <option value='journal'>Journal</option>
  143. <option value='litera'>Litera</option>
  144. <option value='lumen'>Lumen</option>
  145. <option value='lux'>Lux</option>
  146. <option value='materia'>Materia</option>
  147. <option value='minty'>Minty</option>
  148. <option value='pulse'>Pulse</option>
  149. <option value='sandstone'>Sandstone</option>
  150. <option value='simplex'>Simplex</option>
  151. <option value='sketchy'>Sketchy</option>
  152. <option value='slate'>Slate</option>
  153. <option value='solar'>Solar</option>
  154. <option value='spacelab'>Spacelab</option>
  155. <option value='superhero'>Superhero</option>
  156. <option value='united'>United</option>
  157. <option value='yeti'>Yeti</option>
  158. </select>
  159. </div>
  160. <span id='loading' style='display:none'>loading theme...</span>
  161. </div>
  162. <div class='right'>
  163. <span class='credits' data-credit-id='bootstrap-standard' style='display:none'>
  164. <a href='https://getbootstrap.com/docs/3.3/' target='_blank'>Theme by Bootstrap</a>
  165. </span>
  166. <span class='credits' data-credit-id='bootstrap-custom' style='display:none'>
  167. <a href='https://bootswatch.com/' target='_blank'>Theme by Bootswatch</a>
  168. </span>
  169. </div>
  170. <div class='clear'></div>
  171. </div>
  172. <div id='calendar'></div>
  173. </body>
  174. </html>