timeline-theming.html 6.3 KB

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