2
0

importmap.public.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script type='importmap'>
  5. {
  6. "imports": {
  7. "preact": "https://cdn.jsdelivr.net/npm/[email protected]/dist/preact.mjs",
  8. "preact/compat": "https://cdn.jsdelivr.net/npm/[email protected]/compat/dist/compat.mjs",
  9. "preact/hooks": "https://cdn.jsdelivr.net/npm/[email protected]/hooks/dist/hooks.mjs",
  10. "@fullcalendar/core": "https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/index.js",
  11. "@fullcalendar/core/index.js": "https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/index.js",
  12. "@fullcalendar/core/internal.js": "https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/internal.js",
  13. "@fullcalendar/core/preact.js": "https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/preact.js",
  14. "@fullcalendar/daygrid": "https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/index.js",
  15. "@fullcalendar/daygrid/internal.js": "https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/internal.js",
  16. "@fullcalendar/timegrid": "https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/index.js",
  17. "@fullcalendar/timegrid/internal.js": "https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/internal.js",
  18. "@fullcalendar/list": "https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/index.js",
  19. "@fullcalendar/list/internal.js": "https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/internal.js"
  20. }
  21. }
  22. </script>
  23. <script type='module'>
  24. import { Calendar } from '@fullcalendar/core'
  25. import dayGridPlugin from '@fullcalendar/daygrid'
  26. import timeGridPlugin from '@fullcalendar/timegrid'
  27. import listPlugin from '@fullcalendar/list'
  28. document.addEventListener('DOMContentLoaded', function() {
  29. var calendarEl = document.getElementById('calendar');
  30. var calendar = new Calendar(calendarEl, {
  31. plugins: [dayGridPlugin, timeGridPlugin, listPlugin],
  32. headerToolbar: {
  33. left: 'prev,next today',
  34. center: 'title',
  35. right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek'
  36. },
  37. initialDate: '2020-09-12',
  38. editable: true,
  39. navLinks: true, // can click day/week names to navigate views
  40. dayMaxEvents: true, // allow "more" link when too many events
  41. events: [
  42. {
  43. title: 'All Day Event',
  44. start: '2020-09-01'
  45. },
  46. {
  47. title: 'Long Event',
  48. start: '2020-09-07',
  49. end: '2020-09-10'
  50. },
  51. {
  52. groupId: 999,
  53. title: 'Repeating Event',
  54. start: '2020-09-09T16:00:00'
  55. },
  56. {
  57. groupId: 999,
  58. title: 'Repeating Event',
  59. start: '2020-09-16T16:00:00'
  60. },
  61. {
  62. title: 'Conference',
  63. start: '2020-09-11',
  64. end: '2020-09-13'
  65. },
  66. {
  67. title: 'Meeting',
  68. start: '2020-09-12T10:30:00',
  69. end: '2020-09-12T12:30:00'
  70. },
  71. {
  72. title: 'Lunch',
  73. start: '2020-09-12T12:00:00'
  74. },
  75. {
  76. title: 'Meeting',
  77. start: '2020-09-12T14:30:00'
  78. },
  79. {
  80. title: 'Happy Hour',
  81. start: '2020-09-12T17:30:00'
  82. },
  83. {
  84. title: 'Dinner',
  85. start: '2020-09-12T20:00:00'
  86. },
  87. {
  88. title: 'Birthday Party',
  89. start: '2020-09-13T07:00:00'
  90. },
  91. {
  92. title: 'Click for Google',
  93. url: 'http://google.com/',
  94. start: '2020-09-28'
  95. }
  96. ]
  97. });
  98. calendar.render();
  99. });
  100. </script>
  101. <style>
  102. body {
  103. margin: 0;
  104. padding: 0;
  105. font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  106. font-size: 14px;
  107. }
  108. #script-warning {
  109. display: none;
  110. background: #eee;
  111. border-bottom: 1px solid #ddd;
  112. padding: 0 10px;
  113. line-height: 40px;
  114. text-align: center;
  115. font-weight: bold;
  116. font-size: 12px;
  117. color: red;
  118. }
  119. #loading {
  120. display: none;
  121. position: absolute;
  122. top: 10px;
  123. right: 10px;
  124. }
  125. #calendar {
  126. max-width: 1100px;
  127. margin: 40px auto;
  128. padding: 0 10px;
  129. }
  130. </style>
  131. </head>
  132. <body>
  133. <div id='calendar'></div>
  134. </body>
  135. </html>