timeline-theming.html 6.2 KB

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