Event Calendar

.monthly829024 { border: 2px solid #009491; position: relative; z-index: 0; } .monthly829024 { box-shadow: 0px 0px 30px#009491; -moz-box-shadow: 0px 0px 30px#009491; -webkit-box-shadow: 0px 0px 30px#009491; } .desc { max-width: 250px; text-align: left; font-size: 14px; padding-top: 30px; line-height: 1.4em; } .resize { background: #222; display: inline-block; padding: 6px 15px; border-radius: 22px; font-size: 13px; } @media (max-height: 700px) { .sticky { position: relative; } } @media (max-width: 600px) { .resize { display: none; } } .monthly-header{ position: relative; text-align: center; padding: 10px; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; } .monthly-header *{ text-align: center !important; } .monthly-header829024 .monthly-next,.monthly-prev{ padding:0px; justify-content: center; color: #009491; } .monthly-header829024 { position: relative; text-align: center; padding: 10px; background: #ffffff; color: #009491; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; } .monthly-header829024 .monthly-cal:before { color: #009491; content: ""; } .monthly-header829024 .monthly-cal:after { border: 1px solid#ffffff; background: #009491; } .monthly-header829024 .monthly-cal div { background: #ffffff; } .monthly-header-title829024 { font-size: 15px; } .monthly-day-title-wrap829024 { display: table; table-layout: fixed; width: 100%; background: #009491; color: #ffffff; border-bottom: 0pxnone #ffffff; } .monthly-day-title-wrap829024 div { font-size: 11px; } .monthly-day829024, .monthly-day-blank829024 { box-shadow: 0 0 0 1px #009491 !important; -moz-box-shadow: 0 0 0 1px #009491 !important; -webkit-box-shadow: 0 0 0 1px #009491 !important; background: #ffffff; color: #009491 !important; } .monthly-day-blank829024 { background: #efefef; } .monthly-day-event829024 > .monthly-day-number829024 { font-size: 15px; left: 2 px; } .monthly-today829024 .monthly-day-number829024 { color: #009491; background: #ffffff; font-size: 15px; left: 2 px; } .monthly-today829024 { background: #009491; } @media (min-width: 400px) { .monthly-day-number829024 { top: 5px; left: 5 px; font-size: 13px; } } .TotalSoftRefresh829024 { font-size: 20px; color: #009491; } .TotalSoftArrow829024 { font-size: 17px !important; color: #009491; } .monthly-day829024:hover { background-color: #009491; color: #ffffff !important; border-bottom: 0px !important; } .TotalSoftcalEvent_1_Media829024 { width: 70%; height: auto; display: inline !important; margin: 0 auto !important; } .TotalSoftcalEvent_1_Mediadiv829024 { width: 70%; position: relative; display: inline-block; } .TotalSoftcalEvent_1_Mediadiv829024:after { padding-top: 56.25% !important; display: block; content: ''; } .TotalSoftcalEvent_1_Mediaiframe { width: 100% !important; height: 100% !important; left: 0; position: absolute; } .monthly-event-list829024 .listed-event-title829024 { color: #ffffff !important; font-size: 14px !important; text-align: left !important; } .monthly-event-list829024 .listed-event-title829024:hover { color: #ffffff !important; } .monthly-day829024 .monthly-event-indicator { color: #ffffff !important; } @media screen and (max-width: 400px) { .TotalSoftcalEvent_1_Media829024, .TotalSoftcalEvent_1_Mediadiv829024 { width: 100% !important; } } @media screen and (max-width: 700px) { .TotalSoftcalEvent_1_Media829024, .TotalSoftcalEvent_1_Mediadiv829024 { width: 100% !important; } } .TS_Calendar_loading_829024 { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(195, 195, 195, 0.5); z-index: 1; display: none; } .TS_Calendar_loading_829024 img { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); -moz-transform: translate(-50%, -50%); -webkit-transform: translate(-50%, -50%); } .monthly a{ text-underline-offset: 0px !important; text-decoration: none !important; } .monthly a:not(.btn) { transition:none !important; } .monthly a:not(.btn):hover { opacity:1 !important; } .ts_calendar_div_829024 div:before, .ts_calendar_div_829024 div:after{ display:inline !important; } .monthly-header-title829024 { font-size: 15px; order:1 !important; margin: -2px auto; } .monthly-header829024{ position: relative !important; display: flex !important; justify-content: space-between !important; padding: 4.5px !important; line-height: 35.5px !important; background: #ffffff; color: #009491; height: 100%; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; }

(function ($) { $.fn.extend({ monthly829024: function (options) { var defaults = { weekStart: 'Mon', mode: '', xmlUrl: '', target: '', eventList: true, maxWidth: false, setWidth: false, startHidden: false, showTrigger: '', stylePast: false, disablePast: false } var options = $.extend(defaults, options), that = this, uniqueId = $(this).attr('id'), d = new Date(), currentMonth = d.getMonth() + 1, currentYear = d.getFullYear(), currentDay = d.getDate(), monthNames = options.monthNames || ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], dayNames = options.dayNames || ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; if (options.maxWidth != false) { $('#' + uniqueId).css('maxWidth', options.maxWidth); } if (options.setWidth != false) { $('#' + uniqueId).css('width', options.setWidth); } if (options.startHidden == true) { $('#' + uniqueId).addClass('monthly-pop').css({'position': 'absolute', 'display': 'none'}); $(document).on('focus', '' + options.showTrigger + '', function (e) { $('#' + uniqueId).show(); e.preventDefault(); }); $(document).on('click', '' + options.showTrigger + ', .monthly-pop', function (e) { e.stopPropagation(); e.preventDefault(); }); $(document).on('click', function (e) { $('#' + uniqueId).hide(); }); } $('#' + uniqueId).append('
'); if (options.weekStart == 'Sun') { $('#' + uniqueId).append('
' + dayNames[0] + '
' + dayNames[1] + '
' + dayNames[2] + '
' + dayNames[3] + '
' + dayNames[4] + '
' + dayNames[5] + '
' + dayNames[6] + '
'); } else { $('#' + uniqueId).append('
' + dayNames[1] + '
' + dayNames[2] + '
' + dayNames[3] + '
' + dayNames[4] + '
' + dayNames[5] + '
' + dayNames[6] + '
' + dayNames[0] + '
'); } var TotalSoftCal_ArrowLeft = jQuery('#TotalSoftCal_ArrowLeft').val(); var TotalSoftCal_ArrowRight = jQuery('#TotalSoftCal_ArrowRight').val(); $('#' + uniqueId).prepend('
').append('
'); function daysInMonth(m, y) { return m === 2 ? y & 3 || !(y % 25) && y & 15 ? 28 : 29 : 30 + (m + (m >> 3) & 1); } function setMonthly(m, y) { $('#' + uniqueId).data('setMonth', m).data('setYear', y); var dayQty = daysInMonth(m, y), mZeroed = m - 1, firstDay = new Date(y, mZeroed, 1, 0, 0, 0, 0).getDay(); $('#' + uniqueId + ' .monthly-day829024, #' + uniqueId + ' .monthly-day-blank829024').remove(); $('#' + uniqueId + ' .monthly-event-list.monthly-event-list829024').empty(); $('#' + uniqueId + ' .monthly-day-wrap').empty(); if (options.mode == 'event') { for (var i = 0; i < dayQty; i++) { var day = i + 1; var dayNamenum = new Date(y, mZeroed, day, 0, 0, 0, 0).getDay() $('#' + uniqueId + ' .monthly-day-wrap').append('
' + day + '
'); $('#' + uniqueId + ' .monthly-event-list829024').append('
' + dayNames[dayNamenum] + '
' + day + '
'); } } else { for (var i = 0; i day && m === currentMonth) || currentYear > y || (currentMonth > m && y == currentYear)){ $('#' + uniqueId + ' .monthly-day-wrap').append('
' + day + '
'); } } else { $('#' + uniqueId + ' .monthly-day-wrap').append('
' + day + '
'); } } } var setMonth = $('#' + uniqueId).data('setMonth'), setYear = $('#' + uniqueId).data('setYear'); if (setMonth == currentMonth) { if(setYear == currentYear){ $('#' + uniqueId + ' *[data-number="' + currentDay + '"]').addClass('monthly-today monthly-today829024'); } } if (setMonth == currentMonth) { if(setYear == currentYear){ $('#' + uniqueId + ' .monthly-header-title').html(monthNames[m - 1] + ' ' + y); } } else { $('#' + uniqueId + ' .monthly-header-title').html(monthNames[m - 1] + ' ' + y + ' '); } if (options.weekStart == 'Sun') { if(firstDay != 7){ for (var i = 0; i < firstDay; i++) { $('#' + uniqueId + ' .monthly-day-wrap').prepend('
'); } } } else if (options.weekStart == 'Mon') { if(firstDay == 0){ for (var i = 0; i < 6; i++) { $('#' + uniqueId + ' .monthly-day-wrap').prepend('
'); } }else if(firstDay != 1){ for (var i = 0; i < (firstDay - 1); i++) { $('#' + uniqueId + ' .monthly-day-wrap').prepend('
'); } } } var numdays = $('#' + uniqueId + ' .monthly-day829024').length, numempty = $('#' + uniqueId + ' .monthly-day-blank').length, totaldays = numdays + numempty, roundup = Math.ceil(totaldays / 7) * 7, daysdiff = roundup - totaldays; if (totaldays % 7 != 0) { for (var i = 0; i < daysdiff; i++) { $('#' + uniqueId + ' .monthly-day-wrap').append('
'); } } if (options.mode == 'event') { $.get('' + options.xmlUrl + '', function (d) { Event_Calendar(`2024-4-16TSCEv2024-4-16TSCEvhttps://lichess.org/tournament/czwzCzmGTSCEvSwiss Teams BlitzTSCEv#8224e3TSCEv1TSCEv19:30TSCEv21:00TSCEvTSCEvTSCEvhttps://fikrisami.com/wp-content/uploads/2024/01/Falcon_head_logo-300x300.jpgTSCEvTSCEvafterTSCEv24TSCEvnoneTSCEv#ffffff`, uniqueId, setMonth, setYear, dayQty); }).fail(function () { console.error('Error Data...'); }); } var divs = $("#" + uniqueId + " .m-d"); for (var i = 0; i < divs.length; i += 7) { divs.slice(i, i + 7).wrapAll("
"); } } setMonthly(currentMonth, currentYear); function viewToggleButton() { if ($('#' + uniqueId + ' .monthly-event-list').is(":visible")) { $('#' + uniqueId + ' .monthly-cal').remove(); $('#' + uniqueId + ' .monthly-header-title').prepend('
'); } } $(document.body).on('click', '#' + uniqueId + ' .monthly-next', function (e) { $('.TS_Calendar_loading_829024').css('display', 'block'); var setMonth = $('#' + uniqueId).data('setMonth'), setYear = $('#' + uniqueId).data('setYear'); if (setMonth == 12) { var newMonth = 1, newYear = setYear + 1; setMonthly(newMonth, newYear); } else { var newMonth = setMonth + 1, newYear = setYear; setMonthly(newMonth, newYear); } viewToggleButton(); e.preventDefault(); setTimeout(function () { $('.TS_Calendar_loading_829024').css('display', 'none'); }, 1000) }); $(document.body).on('click', '#' + uniqueId + ' .monthly-prev', function (e) { $('.TS_Calendar_loading_829024').css('display', 'block'); var setMonth = $('#' + uniqueId).data('setMonth'), setYear = $('#' + uniqueId).data('setYear'); if (setMonth == 1) { var newMonth = 12, newYear = setYear - 1; setMonthly(newMonth, newYear); } else { var newMonth = setMonth - 1, newYear = setYear; setMonthly(newMonth, newYear); } viewToggleButton(); e.preventDefault(); setTimeout(function () { $('.TS_Calendar_loading_829024').css('display', 'none'); }, 1000) }); $(document.body).on('click', '#' + uniqueId + ' .monthly-reset', function (e) { $('.TS_Calendar_loading_829024').css('display', 'block'); setMonthly(currentMonth, currentYear); viewToggleButton(); e.preventDefault(); e.stopPropagation(); setTimeout(function () { $('.TS_Calendar_loading_829024').css('display', 'none'); }, 1000) }); $(document.body).on('click', '#' + uniqueId + ' .monthly-cal', function (e) { $('.TS_Calendar_loading_829024').css('display', 'block'); $(this).remove(); $('#' + uniqueId + ' .monthly-event-list').css('transform', 'scale(0)').delay('800').hide(); e.preventDefault(); setTimeout(function () { $('.TS_Calendar_loading_829024').css('display', 'none'); }, 1000) }); $(document.body).on('click', '#' + uniqueId + ' a.monthly-day', function (e) { if (options.mode == 'event' && options.eventList == true) { var whichDay = $(this).data('number'); if ($('#' + uniqueId + ' .monthly-list-item[data-number="' + whichDay + '"]').hasClass('item-has-event')) { $('#' + uniqueId + ' .monthly-event-list').show(); $('#' + uniqueId + ' .monthly-event-list').css('transform'); $('#' + uniqueId + ' .monthly-event-list').css('transform', 'scale(1)'); $('#' + uniqueId + ' .monthly-list-item[data-number="' + whichDay + '"]').show(); var myElement = document.getElementById(uniqueId + 'day' + whichDay); var topPos = myElement.offsetTop; $('#' + uniqueId + ' .monthly-event-list').scrollTop(topPos); viewToggleButton(); } } e.preventDefault(); }); $(document.body).on('click', '#' + uniqueId + ' .listed-event', function (e) { var href = $(this).attr('href'); if (!href) { e.preventDefault(); } }); } }); })(jQuery); jQuery(window).load(function () { jQuery('#totalsoftcal_829024').monthly829024({ mode: 'event', weekStart: 'Mon', }); });