{"id":149,"date":"2024-07-17T19:27:37","date_gmt":"2024-07-17T19:27:37","guid":{"rendered":"https:\/\/wimtachdev.centennialcollege.ca\/?page_id=149"},"modified":"2024-12-09T21:57:24","modified_gmt":"2024-12-09T21:57:24","slug":"customized-training","status":"publish","type":"page","link":"https:\/\/wimtach.centennialcollege.ca\/?page_id=149","title":{"rendered":"Customized Training"},"content":{"rendered":"\n<div class=\"wp-block-cover ticss-4eb8302c has-small-font-size\"><span aria-hidden=\"true\" class=\"wp-block-cover__background has-background-dim\" style=\"background-color:#433f3c\"><\/span><img loading=\"lazy\" decoding=\"async\" width=\"1440\" height=\"466\" class=\"wp-block-cover__image-background wp-image-7157\" alt=\"\" src=\"https:\/\/wimtachdev.centennialcollege.ca\/wp-content\/uploads\/2024\/08\/services-image.png\" data-object-fit=\"cover\" srcset=\"https:\/\/wimtach.centennialcollege.ca\/wp-content\/uploads\/2024\/08\/services-image.png 1440w, https:\/\/wimtach.centennialcollege.ca\/wp-content\/uploads\/2024\/08\/services-image-300x97.png 300w, https:\/\/wimtach.centennialcollege.ca\/wp-content\/uploads\/2024\/08\/services-image-1024x331.png 1024w, https:\/\/wimtach.centennialcollege.ca\/wp-content\/uploads\/2024\/08\/services-image-768x249.png 768w\" sizes=\"auto, (max-width: 1440px) 100vw, 1440px\" \/><div class=\"wp-block-cover__inner-container is-layout-flow wp-block-cover-is-layout-flow\">\n<p class=\"has-text-align-center ticss-075befab has-open-sans-font-family has-xx-large-font-size\">Customized Training<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-columns ticss-5f882b60 is-layout-flex wp-container-core-columns-is-layout-d74743eb wp-block-columns-is-layout-flex\" style=\"padding-right:0;padding-left:0\">\n<div class=\"wp-block-column customer-training-container is-layout-flow wp-container-core-column-is-layout-81f1c81f wp-block-column-is-layout-flow\" style=\"padding-top:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--30)\">\n<button id=\"category-dropdown\">Select<\/button>\n\n\n\n<div id=\"category-buttons\"><\/div>\n\n\n\n<div id=\"training-accordion\"><\/div>\n<\/div>\n<\/div>\n\n\n<script>\n  function load_training_events(category) {\n    jQuery.ajax({\n        url: '\/wp-admin\/admin-ajax.php',\n        type: 'POST',\n        data: {\n            action: 'load_training_events_json',\n            category: category\n        },\n        success: function(response) {\n            jQuery('#training-accordion').html('');\n            jQuery.each(response, function(date, data) {\n                let events = data.events; \/\/ Access the \"events\" array under the date\n                jQuery.each(events, function(index, event) {\n                    \/\/ Construct HTML for each event\n                    let item = `\n                        <details class=\"wp-block-themeisle-blocks-accordion-item\">\n                            <summary class=\"wp-block-themeisle-blocks-accordion-item__title\">\n                                <div>\n                                    <div>\n                                        <div>${date.split('-')[2]}<\/div>\n                                        <div>${date.split('-')[1]}<\/div>\n                                    <\/div>\n                                    <div>${event.title}<\/div>\n                                    <div><\/div>\n                                <\/div>\n                            <\/summary>\n                            <div class=\"wp-block-themeisle-blocks-accordion-item__content event-content\">\n                                <div>\n                                    <div><\/div>\n                                    <div>\n                                        <img decoding=\"async\" src=\"${event.thumbnail_url}\" alt=\"${event.title}\" style=\"width: 100%;\">\n                                    <\/div>\n                                    <div>\n                                        ${event.content}\n                                    <\/div>\n                                <\/div>\n                            <\/div>\n                        <\/details>\n                    `;\n                    jQuery('#training-accordion').append(item); \/\/ Append each event to the accordion\n                });\n            });\n        },\n          error: function(error) {\n              console.log(error)\n              jQuery('#training-accordion').html('<p>Error loading events<\/p>');\n          }\n      });\n  }\n  \n  function load_training_category_buttons() {\n      jQuery.ajax({\n          url: '\/wp-admin\/admin-ajax.php',\n          type: 'POST',\n          data: {\n              action: 'load_training_category_buttons_json'\n          },\n          success: function(response) {\n              jQuery('#category-buttons').html('');\n              jQuery('#category-buttons').append(`<button class=\"category-btn mr-1 mb-1\" data-category=\"all\">All<\/button>`);\n              jQuery.each(response, function(index, category) {\n                  let button = `<button class=\"category-btn mr-1 mb-1\" data-category=\"${category.slug}\">${category.name}<\/button>`;\n                  jQuery('#category-buttons').append(button);\n              });\n              jQuery('#category-buttons button[data-category=\"all\"]').addClass('active');\n              jQuery('#category-buttons button').click(function() {\n                  jQuery('#category-buttons button').removeClass('active');\n                  jQuery(this).addClass('active');\n                  const category = jQuery(this).data('category');\n                  load_training_events(category);\n              });\n          },\n          error: function(error) {\n              console.log(error)\n              jQuery('#category-buttons').html('<p>Error loading categories<\/p>');\n          }\n      });\n  }\n  jQuery(document).ready(function() {\n      load_training_category_buttons();\n      load_training_events('all');\n      let isMenuOpen = false;\n      jQuery(\"#category-dropdown\").on(\"click\", function() {\n        isMenuOpen = !isMenuOpen;\n        jQuery(\"#category-buttons\").toggle();\n        jQuery(\"#category-dropdown\").toggleClass(\"on\", isMenuOpen);\n      });\n      jQuery(window).on(\"resize\", function() {\n        if (jQuery(window).width() > 600) {\n          jQuery(\"#category-buttons\").show();\n        } \n      });\n  })\n<\/script>\n\n<script>\nconst circles = [\n    { size: 200, top: 620, left: 50 },\n    { size: 200, top: 700, left: null, right: 50 },\n    { size: 120, top: 780, left: 120 }\n];\ncircles.forEach(circle => {\n    const div = document.createElement('div');\n    div.className = 'circle';\n    div.style.backgroundColor = 'rgb(210, 222, 56)';\n    div.style.width = `${circle.size}px`;\n    div.style.height = `${circle.size}px`;\n    div.style.position = 'absolute';\n    div.style.top = `${circle.top}px`;\n    div.style.left = (circle.left) ? `${circle.left}px` : undefined;\n    div.style.right = (circle.right) ? `${circle.right}px` : undefined;\n    div.style.borderRadius = '50%';\n    div.style.opacity = '0.3'; \n    div.style.zIndex = '-1';\n    document.body.appendChild(div);\n});\n<\/script>","protected":false},"excerpt":{"rendered":"<p>Select<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_themeisle_gutenberg_block_has_review":false,"footnotes":""},"class_list":["post-149","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/wimtach.centennialcollege.ca\/index.php?rest_route=\/wp\/v2\/pages\/149","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wimtach.centennialcollege.ca\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/wimtach.centennialcollege.ca\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/wimtach.centennialcollege.ca\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/wimtach.centennialcollege.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=149"}],"version-history":[{"count":161,"href":"https:\/\/wimtach.centennialcollege.ca\/index.php?rest_route=\/wp\/v2\/pages\/149\/revisions"}],"predecessor-version":[{"id":10592,"href":"https:\/\/wimtach.centennialcollege.ca\/index.php?rest_route=\/wp\/v2\/pages\/149\/revisions\/10592"}],"wp:attachment":[{"href":"https:\/\/wimtach.centennialcollege.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}