• Participant Registration Form

    Please fill the form below keenly and let us know if you give go ahead for this participation
    • Participant Information 
    • Has your child cheered/danced/tumbled before?*
    • Primary Contact Information 
    • Format: (000) 000-0000.
    • Format: (000) 000-0000.
    • Format: (000) 000-0000.
    • Format: (000) 000-0000.
    • Liability Information 
    • CONSENT FOR MEDICAL TREATMENT | As the parent or legal guardian of the above-named participant, I hereby give my consent for emergency medical care prescribed by a duly licensed Doctor. This care may be given under whatever conditions are necessary to preserve the life, limb, or well-being of my dependent.

    • Signature & Payment 
    • By signing and submitting this registraiton form, you understand and agree to all policies.

      Once you click "Register" you will be redirected to pay the registration fee. You may use your credit/debit card or PayPal account to pay the fee.

    • Today's Date*
       - -
    •  
    • Should be Empty:
prevnext( X )
    Select theme:
    • Default
    • Blue
    • Red
    • Brown
    • Green
    • Black
    • Pink
    • Dark Blue
    • Purple
    <\/head>\n
    <\/td>\n <\/tr>
    <\/td>\n \"jotform.com\"<\/td>\n <\/td>\n <\/tr><\/table>
    <\/td>\n \n
    Question<\/b><\/td>\n Answer<\/b><\/td>\n <\/tr>
    Participant Name<\/td>{participantName}<\/td><\/tr>
    Gender<\/td>{gender}<\/td><\/tr>
    Age<\/td>{age}<\/td><\/tr>
    Date of Birth<\/td>{dateOf}<\/td><\/tr>
    School Attending<\/td>{schoolAttending}<\/td><\/tr>
    Grade<\/td>{grade}<\/td><\/tr>
    Has your child cheered\/danced\/tumbled before?<\/td>{hasYour}<\/td><\/tr>
    If yes, how many years?<\/td>{howMany}<\/td><\/tr>
    Medical Problems\/ Allergies<\/td>{medicalProblems}<\/td><\/tr>
    Mother's Name<\/td>{mothersName}<\/td><\/tr>
    Mobile Phone<\/td>{mobilePhone}<\/td><\/tr>
    Home Phone<\/td>{homePhone}<\/td><\/tr>
    E-mail<\/td>{email19}<\/td><\/tr>
    Address<\/td>{address16}<\/td><\/tr>
    Father's Name<\/td>{fathersName}<\/td><\/tr>
    Mobile Phone<\/td>{mobilePhone21}<\/td><\/tr>
    Home Phone<\/td>{homePhone22}<\/td><\/tr>
    E-mail<\/td>{email23}<\/td><\/tr>
    Address<\/td>{address24}<\/td><\/tr>
    Parent\/Guardian Signature<\/td>{parentguardianSignature}<\/td><\/tr>
    Today's Date<\/td>{todaysDate}<\/td><\/tr>
    Pay Registration Fee<\/td>{payRegistration}<\/td><\/tr><\/table><\/td>\n <\/td>\n <\/tr>
    <\/td>\n <\/td>\n <\/td>\n <\/tr><\/table><\/td>\n <\/tr>
    <\/td>\n <\/tr><\/table>

    <\/p>

    <\/pre><\/body><\/html>\n","dirty":"","disabled":"","from":"default|none","html":"1","lastQuestionID":"35","name":"Notification","replyto":"none","subject":"New submission: {form_title}","to":"formgallery@interlogy.com","type":"notification"}],"form_formStrings":[{"confirmClearForm":"Are you sure you want to clear the form","lessThan":"Your score should be less than"}],"form_payment":[{"gateway":"control_paypal","isAdditionalSettingsCompleted":"1","isConnected":"1","isPaymentForm":"1","isProduct":"1"}],"form_products":[{"icon":"","name":"Registration Fee","paymentUUID":"019743d52d8473649c7052ecf1c926cb7154","period":"Monthly","pid":"1001","price":"20.00","setupfee":"","trial":"None"}],"form_welcomePage":[{"buttonText":"START","isActive":"1","logo":"https:\/\/icons.jotfor.ms\/cardforms\/assets\/icons\/icon-sets\/default\/jotform.svg","showQuestionCount":"No","subTitle":"It is great tool to register your children to participant in an event. It captures all key areas including consent for minors to participate in an event.","title":"Participant Registration Form"}],"form_title":"Participant Registration Form","form_status":"Enabled","form_type":"LEGACY","form_slug":"21193662413550","34_alt":"","34_headerImage":"","34_headerType":"Large","34_imageAlign":"Left","34_name":"clickTo34","34_nextButtonText":"Next","34_order":"1","34_previousButtonText":"Previous","34_qid":"34","34_showQuestionCount":"Yes","34_subHeader":"Please fill the form below keenly and let us know if you give go ahead for this participation ","34_text":"Participant Registration Form","34_textAlign":"Left","34_type":"control_head","34_verticalTextAlign":"Middle","34_width":"","4_name":"clickTo4","4_order":"2","4_qid":"4","4_status":"Open","4_text":"Participant Information","4_type":"control_collapse","4_visibility":"Visible","5_compoundHint":"","5_description":"","5_labelAlign":"Auto","5_middle":"No","5_name":"participantName","5_order":"3","5_prefix":"No","5_prefixChoices":"","5_qid":"5","5_readonly":"No","5_required":"Yes","5_sublabels":{"prefix":"Prefix","first":"First Name","middle":"Middle Name","last":"Last Name","suffix":"Suffix"},"5_suffix":"No","5_text":"Participant Name","5_type":"control_fullname","6_calcValues":"","6_description":"","6_emptyText":"Please Select","6_labelAlign":"Auto","6_multipleSelections":"No","6_name":"gender","6_options":"Option 1|Option 2|Option 3","6_order":"4","6_qid":"6","6_required":"Yes","6_searchText":"Search","6_selected":"","6_shrink":"Yes","6_shuffle":"No","6_size":"0","6_special":"Gender","6_subLabel":"","6_text":"Gender","6_type":"control_dropdown","6_visibleOptions":"1","6_width":"310","7_defaultValue":"","7_description":"","7_hint":" ","7_inputTextMask":"","7_labelAlign":"Auto","7_maxsize":"2","7_name":"age","7_order":"5","7_qid":"7","7_readonly":"No","7_required":"Yes","7_shrink":"Yes","7_size":"310","7_subLabel":"","7_text":"Age","7_type":"control_textbox","7_validation":"None","8_description":"","8_format":"mmddyyyy","8_labelAlign":"Auto","8_months":["January","February","March","April","May","June","July","August","September","October","November","December"],"8_name":"dateOf","8_order":"6","8_qid":"8","8_required":"Yes","8_sublabels":{"month":"Month","day":"Day","year":"Year"},"8_text":"Date of Birth","8_type":"control_birthdate","8_yearFrom":"","8_yearTo":"","10_defaultValue":"","10_description":"","10_hint":" ","10_inputTextMask":"","10_labelAlign":"Auto","10_maxsize":"","10_name":"schoolAttending","10_order":"7","10_qid":"10","10_readonly":"No","10_required":"Yes","10_shrink":"Yes","10_size":"310","10_subLabel":"","10_text":"School Attending","10_type":"control_textbox","10_validation":"None","11_calcValues":"","11_description":"","11_emptyText":"Please Select","11_labelAlign":"Auto","11_multipleSelections":"No","11_name":"grade","11_options":"1st|2nd|3rd|4th|5th|6th|7th|8th|9th|10th|11th|12th","11_order":"8","11_qid":"11","11_required":"Yes","11_searchText":"Search","11_selected":"","11_shrink":"Yes","11_shuffle":"No","11_size":"0","11_special":"None","11_subLabel":"","11_text":"Grade","11_type":"control_dropdown","11_visibleOptions":"1","11_width":"310","35_allowOther":"No","35_calcValues":"","35_description":"","35_labelAlign":"Auto","35_name":"hasYour35","35_options":"Yes|No","35_order":"9","35_otherText":"Other","35_qid":"35","35_readonly":"No","35_required":"Yes","35_selected":"","35_shuffle":"No","35_special":"None","35_spreadCols":"2","35_text":"Has your child cheered\/danced\/tumbled before?","35_type":"control_radio","13_defaultValue":"","13_description":"","13_hint":" ","13_inputTextMask":"","13_labelAlign":"Top","13_maxsize":"","13_name":"howMany","13_order":"10","13_qid":"13","13_readonly":"No","13_required":"No","13_size":"310","13_subLabel":"","13_text":"How many years?","13_type":"control_textbox","13_validation":"None","9_cols":"648","9_defaultValue":"","9_description":"","9_entryLimit":"None-0","9_entryLimitMin":"None-0","9_hint":"","9_labelAlign":"Top","9_maxsize":"","9_mde":"No","9_name":"medicalProblems","9_order":"11","9_qid":"9","9_readonly":"No","9_required":"Yes","9_rows":"163","9_subLabel":"","9_text":"Medical Problems\/ Allergies","9_type":"control_textarea","9_validation":"None","9_wysiwyg":"Disable","14_name":"clickTo","14_order":"12","14_qid":"14","14_status":"Open","14_text":"Primary Contact Information","14_type":"control_collapse","14_visibility":"Visible","15_compoundHint":"","15_description":"","15_labelAlign":"Auto","15_middle":"No","15_name":"mothersName","15_order":"13","15_prefix":"No","15_prefixChoices":"","15_qid":"15","15_readonly":"No","15_required":"No","15_sublabels":{"prefix":"Prefix","first":"First Name","middle":"Middle Name","last":"Last Name","suffix":"Suffix"},"15_suffix":"No","15_text":"Mother's Name","15_type":"control_fullname","17_compoundHint":"","17_countryCode":"No","17_description":"","17_inputMask":"enable","17_inputMaskValue":"(###) ###-####","17_labelAlign":"Auto","17_name":"mobilePhone","17_order":"14","17_qid":"17","17_readonly":"No","17_required":"No","17_shrink":"Yes","17_sublabels":{"area":"Area Code","phone":"Phone Number"},"17_text":"Mobile Phone","17_type":"control_phone","18_compoundHint":"","18_countryCode":"No","18_description":"","18_inputMask":"enable","18_inputMaskValue":"(###) ###-####","18_labelAlign":"Auto","18_name":"homePhone","18_order":"15","18_qid":"18","18_readonly":"No","18_required":"No","18_shrink":"Yes","18_sublabels":{"area":"Area Code","phone":"Phone Number"},"18_text":"Home Phone","18_type":"control_phone","19_allowCustomDomains":"No","19_allowedDomains":"","19_confirmation":"No","19_confirmationHint":"Confirm Email","19_confirmationSublabel":"Confirm Email","19_defaultValue":"","19_description":"","19_disallowFree":"No","19_domainCheck":"No","19_hint":"ex: myname@example.com","19_labelAlign":"Auto","19_maxsize":"","19_name":"email19","19_order":"16","19_qid":"19","19_readonly":"No","19_required":"No","19_size":"310","19_subLabel":"example@example.com","19_text":"E-mail","19_type":"control_email","19_validation":"Email","19_verificationCode":"No","16_compoundHint":",,,,Please Select,,Please Select,","16_countryDropdownDefaultText":"Please Select","16_customCountryDropdown":"No","16_customCountryOptions":"","16_customStateOptions":"","16_description":"","16_hasAutocomplete":"No","16_hasGeolocation":"No","16_labelAlign":"Auto","16_name":"address16","16_order":"17","16_qid":"16","16_required":"No","16_requiredInputs":"st1|state|city|zip|country","16_selectedCountry":"","16_states":"textbox","16_subfields":"state|zip|st1|city|st2","16_sublabels":{"cc_firstName":"First Name","cc_lastName":"Last Name","cc_number":"Credit Card Number","cc_ccv":"Security Code","cc_exp_month":"Expiration Month","cc_exp_year":"Expiration Year","addr_line1":"Street Address","addr_line2":"Street Address Line 2","city":"City","state":"State \/ Province","postal":"Postal \/ Zip Code","country":"Country"},"16_text":"Address","16_type":"control_address","20_compoundHint":"","20_description":"","20_labelAlign":"Auto","20_middle":"No","20_name":"fathersName","20_order":"18","20_prefix":"No","20_prefixChoices":"","20_qid":"20","20_readonly":"No","20_required":"No","20_sublabels":{"prefix":"Prefix","first":"First Name","middle":"Middle Name","last":"Last Name","suffix":"Suffix"},"20_suffix":"No","20_text":"Father's Name","20_type":"control_fullname","21_compoundHint":"","21_countryCode":"No","21_description":"","21_inputMask":"enable","21_inputMaskValue":"(###) ###-####","21_labelAlign":"Auto","21_name":"mobilePhone21","21_order":"19","21_qid":"21","21_readonly":"No","21_required":"No","21_shrink":"Yes","21_sublabels":{"area":"Area Code","phone":"Phone Number"},"21_text":"Mobile Phone","21_type":"control_phone","22_compoundHint":"","22_countryCode":"No","22_description":"","22_inputMask":"enable","22_inputMaskValue":"(###) ###-####","22_labelAlign":"Auto","22_name":"homePhone22","22_order":"20","22_qid":"22","22_readonly":"No","22_required":"No","22_shrink":"Yes","22_sublabels":{"area":"Area Code","phone":"Phone Number"},"22_text":"Home Phone","22_type":"control_phone","23_allowCustomDomains":"No","23_allowedDomains":"","23_confirmation":"No","23_confirmationHint":"Confirm Email","23_confirmationSublabel":"Confirm Email","23_defaultValue":"","23_description":"","23_disallowFree":"No","23_domainCheck":"No","23_hint":"ex: myname@example.com","23_labelAlign":"Auto","23_maxsize":"","23_name":"email23","23_order":"21","23_qid":"23","23_readonly":"No","23_required":"No","23_size":"310","23_subLabel":"example@example.com","23_text":"E-mail","23_type":"control_email","23_validation":"Email","23_verificationCode":"No","24_compoundHint":",,,,Please Select,,Please Select,","24_countryDropdownDefaultText":"Please Select","24_customCountryDropdown":"No","24_customCountryOptions":"","24_customStateOptions":"","24_description":"","24_hasAutocomplete":"No","24_hasGeolocation":"No","24_labelAlign":"Auto","24_name":"address24","24_order":"22","24_qid":"24","24_required":"No","24_requiredInputs":"st1|state|city|zip|country","24_selectedCountry":"","24_states":"textbox","24_subfields":"state|zip|st1|city|st2","24_sublabels":{"cc_firstName":"First Name","cc_lastName":"Last Name","cc_number":"Credit Card Number","cc_ccv":"Security Code","cc_exp_month":"Expiration Month","cc_exp_year":"Expiration Year","addr_line1":"Street Address","addr_line2":"Street Address Line 2","city":"City","state":"State \/ Province","postal":"Postal \/ Zip Code","country":"Country"},"24_text":"Address","24_type":"control_address","25_name":"clickTo25","25_order":"23","25_qid":"25","25_status":"Open","25_text":"Liability Information","25_type":"control_collapse","25_visibility":"Visible","26_name":"clickTo26","26_order":"24","26_qid":"26","26_text":"

    CONSENT FOR MEDICAL TREATMENT |<\/strong> As the parent or legal guardian of the above-named participant, I hereby give my consent for emergency medical care prescribed by a duly licensed Doctor. This care may be given under whatever conditions are necessary to preserve the life, limb, or well-being of my dependent.<\/p>\n","26_type":"control_text","29_name":"clickTo29","29_order":"25","29_qid":"29","29_status":"Open","29_text":"Signature & Payment","29_type":"control_collapse","29_visibility":"Visible","33_name":"clickTo33","33_order":"26","33_qid":"33","33_text":"

    By signing and submitting this registraiton form, you understand and agree to all policies.<\/p>\n

    Once you click \"Register\" you will be redirected to pay the registration fee. You may use your credit\/debit card or PayPal account to pay the fee.<\/p>","33_type":"control_text","27_compoundHint":"","27_description":"","27_labelAlign":"Auto","27_middle":"No","27_name":"parentguardianSignature","27_order":"27","27_prefix":"No","27_prefixChoices":"","27_qid":"27","27_readonly":"No","27_required":"Yes","27_sublabels":{"prefix":"Prefix","first":"First Name","middle":"Middle Name","last":"Last Name","suffix":"Suffix"},"27_suffix":"No","27_text":"Parent\/Guardian Signature","27_type":"control_fullname","28_ageVerification":"No","28_allowTime":"No","28_autoCalendar":"No","28_dateSeparator":"-","28_days":"Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday","28_defaultDate":"none","28_defaultTime":"Yes","28_description":"","28_format":"mmddyyyy","28_labelAlign":"Auto","28_limitDate":{"days":{"monday":true,"tuesday":true,"wednesday":true,"thursday":true,"friday":true,"saturday":true,"sunday":true},"future":true,"past":true,"custom":false,"ranges":false,"start":"","end":""},"28_liteMode":"Yes","28_minAge":"13","28_months":"January|February|March|April|May|June|July|August|September|October|November|December","28_name":"todaysDate","28_onlyFuture":"No","28_order":"28","28_qid":"28","28_readonly":"No","28_required":"Yes","28_startWeekOn":"Sunday","28_step":"10","28_sublabels":{"day":"Day","month":"Month","year":"Year","last":"Last Name","hour":"Hour","minutes":"Minutes"},"28_text":"Today's Date","28_timeFormat":"AM\/PM","28_today":"Today","28_type":"control_datetime","28_validateLiteDate":"Yes","30_account":"formgallery@interlogy.com","30_addToBagButtonText":"Add to Bag","30_allowCustomAmount":"1","30_authOnly":"No","30_backToListButtonText":"Back to list","30_cartColor":"#CCCCCC","30_checkoutLogo":"","30_country":"","30_currency":"USD","30_customDataField":"0","30_customValueDonationText":"+ OR enter a custom value","30_decimalMark":"point","30_description":"","30_donationAmountField":"0","30_donationOptions":[10,25,50,100],"30_donationText":"Donation","30_editButtonText":"Edit","30_emailpending":"No","30_ipnrelay":"","30_isConnected":"1","30_isPaymentStoreInBasicFields":"0","30_labelAlign":"Auto","30_multiple":"No","30_myBagButtonText":"My Bag","30_name":"payRegistration","30_nonprofit":"Yes","30_order":"29","30_orderSummary":"ORDER SUMMARY","30_pagestyle":"","30_payeraddress":"No","30_paymentCid":"0","30_paymentConnectionID":"0197d47c784874e59e2c93d771717bb0af68","30_paymentType":"product","30_qid":"30","30_removeButtonText":"Remove","30_required":"Yes","30_sandbox":"Disabled","30_showPredefinedDonationValues":"1","30_showTotal":"No","30_subscribeButtonText":"SUBSCRIBE","30_suggestedDonation":"","30_text":"Pay Registration Fee","30_totalCost":"Total cost","30_type":"control_paypal","30_updateButtonText":"Update","30_useDecimal":"Yes","2_buttonAlign":"Auto","2_buttonStyle":"navy-700","2_clear":"Yes","2_clearText":"Clear Form","2_encryptIcon":"No","2_name":"submit2","2_order":"30","2_paypalBt":"","2_print":"Yes","2_printText":"Print Form","2_qid":"2","2_text":"Register","2_type":"control_button","2_useImage":""}; const cardColorSchemesMeta = []; const colorSchemeListV3New = [{"name":"isDefault","order":0,"style":{"borderColor":"hsl(223, 100%, 97%)","backgroundColor":"hsl(0, 0%, 100%)","color":"hsl(223, 22%, 22%)"},"colors":{"clrText":"#2c3344","clrFrame":"#ffffff","clrBg":"#f3f3fe","clrActive":"#e3e5f5","clrErrorBg":"#ffd6d6","clrTextInputBg":"#ffffff"}},{"name":"isBlue","order":1,"style":{"borderColor":"hsl(196, 47%, 40%)","backgroundColor":"hsl(192, 100%, 98%)","color":"hsl(195, 100%, 23%)"},"colors":{"clrText":"#005875","clrFrame":"#f5fdff","clrBg":"#367c96","clrActive":"#dbf3fa","clrErrorBg":"#ffd6d6","clrTextInputBg":"#ffffff"}},{"name":"isRed","order":2,"style":{"borderColor":"hsl(15, 86%, 57%)","backgroundColor":"hsl(55, 100%, 87%)","color":"hsl(15, 100%, 21%)"},"colors":{"clrText":"#6b1b00","clrFrame":"#fff9bd","clrBg":"#f06233","clrActive":"#9a8f6a","clrErrorBg":"#ffd6d6","clrTextInputBg":"#ffffff"}},{"name":"isBrown","order":3,"style":{"borderColor":"hsl(19, 14%, 31%)","backgroundColor":"hsl(44, 46%, 88%)","color":"hsl(19, 39%, 14%)"},"colors":{"clrText":"#321f16","clrFrame":"#efe8d4","clrBg":"#5a4b44","clrActive":"#90827a","clrErrorBg":"#ffd6d6","clrTextInputBg":"#ffffff"}},{"name":"isGreen","order":4,"style":{"borderColor":"hsl(81, 44%, 43%)","backgroundColor":"hsl(81, 100%, 94%)","color":"hsl(81, 34%, 25%)"},"colors":{"clrText":"#46552a","clrFrame":"#f4ffe0","clrBg":"#7c9e3d","clrActive":"#d2e9aa","clrErrorBg":"#ffd6d6","clrTextInputBg":"#ffffff"}},{"name":"isBlack","order":5,"style":{"borderColor":"hsl(240, 23%, 9%)","backgroundColor":"hsl(231, 6%, 40%)","color":"hsl(0, 0%, 100%)"},"colors":{"clrText":"#ffffff","clrFrame":"#60626c","clrBg":"#12121c","clrActive":"#505b77","clrErrorBg":"#632733","clrTextInputBg":"#e3e3e3"}},{"name":"isPink","order":6,"style":{"borderColor":"hsl(338, 40%, 60%)","backgroundColor":"hsl(343, 100%, 99%)","color":"hsl(338, 54%, 38%)"},"colors":{"clrText":"#952d53","clrFrame":"#fffafb","clrBg":"#c2708e","clrActive":"#ffebf1","clrErrorBg":"#ffd6d6","clrTextInputBg":"#ffffff"}},{"name":"isDarkBlue","order":7,"style":{"borderColor":"hsl(215, 67%, 43%)","backgroundColor":"hsl(215, 100%, 92%)","color":"hsl(215, 77%, 31%)"},"colors":{"clrText":"#12458c","clrFrame":"#d6e7ff","clrBg":"#2461b7","clrActive":"#5b95e6","clrErrorBg":"#ffd6d6","clrTextInputBg":"#ffffff"}},{"name":"isPurple","order":8,"style":{"borderColor":"hsl(262, 91%, 41%)","backgroundColor":"hsl(263, 100%, 97%)","color":"hsl(262, 42%, 29%)"},"colors":{"clrText":"#422b69","clrFrame":"#f6f0ff","clrBg":"#4f09c8","clrActive":"#e6d9fc","clrErrorBg":"#ffd6d6","clrTextInputBg":"#ffffff"}}]; setTimeout(() => { const selectedColorScheme = document.querySelector(".colorScheme-list li.isSelected"); if (selectedColorScheme) { selectedColorScheme.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'nearest' }); } }, 1000); function generateThemeCSS(newValue, formProps) { const name = 'statelessColorScheme'; const formProperties = formProps || {}; let styleJSON = formProperties.form_styleJSON || formProperties.styleJSON || {}; let _injectCSS = (formProperties.form_injectCSS || formProperties.injectCSS || '/*__INSPECT_SEPERATOR__*/').replace(/((\/\*PREFERENCES STYLE\*\/)([\s\S]*?)(\/\*PREFERENCES STYLE\*\/))/g, ''); const isNewDefaultTheme = (formProperties.form_defaultTheme || formProperties.defaultTheme) === 'v2'; const isCdnColorScheme = window.location.href.indexOf('cdnColorScheme') === -1; const advancedDesingerProps = [ 'clrButtonBorder', 'clrTextInputBorder', 'clrDropdownBorder', 'okColor', 'clrButtonBg', 'clrErrorMsg', 'clrTextInputFont', 'clrDropdownBg', 'pbClrButtonBorder', 'collapseTextColor', 'collapseBgColor', 'clrDropdownFont', 'clrHeader', 'clrActive']; try { if (typeof styleJSON === typeof 'string') { styleJSON = JSON.parse(styleJSON); } } catch (e) { styleJSON = {}; } function lightenColor(color, percent) { try { let col = color; let usePound = false; if (col[0] === '#') { col = col.slice(1); usePound = true; } if (col.length === 3) { // Convert 3 digit to 6 digit hex col = `${col[0]}${col[0]}${col[1]}${col[1]}${col[2]}${col[2]}`; } const num = parseInt(col, 16); const amt = Math.round(2.55 * percent); const R = (num >> 16) + amt; const B = (num >> 8 & 0x00FF) + amt; const G = (num & 0x0000FF) + amt; const lighten = (0x1000000 + (R < 255 ? R < 1 ? 0 : R : 255) * 0x10000 + //eslint-disable-line (B < 255 ? B < 1 ? 0 : B : 255) * 0x100 + //eslint-disable-line (G < 255 ? G < 1 ? 0 : G : 255)).toString(16).slice(1); //eslint-disable-line if (usePound) { return `#${lighten}`; } return lighten; } catch (e) { return color; } } function generateAlignmentRule(name, newValue) { let value = formProperties.form_alignment ?? formProperties.alignment ?? styleJSON['@labelAlign'] ?? 'Top'; if (name === 'alignment') { value = newValue; } styleJSON['@labelAlign'] = value; const topRules = ` display: block; float: none; text-align: left; width: 100%; `; const leftRightRules = ` display: inline-block; float: left; text-align: ${value === 'Left' ? 'left' : 'right'}; `; const alignmentRule = ` .form-label.form-label-auto { ${value === 'Top' ? topRules : leftRightRules} } `; return alignmentRule; } function generateLineSpacingRule(name, newValue) { let value = formProperties.form_lineSpacing ?? formProperties.lineSpacing ?? styleJSON['@lineSpacing'] ?? 10; if (name === 'lineSpacing') { value = newValue; } styleJSON['@lineSpacing'] = value; const rule = ` .form-line { margin-top: ${value}px; margin-bottom: ${value}px; } `; return rule; } // unclosed paranthesis check for rgb, rgba function unclosedParanthesesCheck(str) { return /[()]/.test(str) && (str.match(/\(/g) || '').length === (str.match(/\)/g) || '').length; } // add missing paranthesis for rgb, rgba function addMissingParantheses(s) { let missedOpen = 0; const stack = []; for (let i = 0; i < s.length; i++) { if (s[i] === '(') { stack.push(s[i]); } else if (s[i] === ')') { if (!stack.pop()) { missedOpen++; } } } return Array(missedOpen + 1).join('(') + s + Array(stack.length + 1).join(')'); } function generateBackgroundRule(name, newValue, schemeColor) { let value = schemeColor || formProperties.form_background || formProperties.background; if (name === 'background') { value = schemeColor || newValue; } let clrFrame = typeof value === 'string' ? value.replace(new RegExp(/\"/gi), '\'') : ''; if (clrFrame.indexOf('rgb') > -1 && !unclosedParanthesesCheck(clrFrame)) { clrFrame = addMissingParantheses(clrFrame); } styleJSON['@clrFrame'] = clrFrame; const rule = ` .supernova .form-all, .form-all { background-color: ${clrFrame}; } `; return rule; } function generateFontColorRule(name, newValue, schemeColor) { let value = schemeColor || formProperties.form_fontcolor || formProperties.fontcolor; if (name === 'fontcolor') { value = schemeColor || newValue; } styleJSON['@clrText'] = value; styleJSON['@clrLabel'] = value; // If header color is specified we mustn't change it. const headerColor = (styleJSON && styleJSON['@clrHeader'] && styleJSON['@clrHeader'].length > 0) ? styleJSON['@clrHeader'] : value; const rule = ` .form-all { color: ${value}; } .form-header-group .form-header { color: ${headerColor}; } .form-header-group .form-subHeader { color: ${value}; } .form-label-top, .form-label-left, .form-label-right, .form-html, .form-checkbox-item label, .form-radio-item label, span.FITB .qb-checkbox-label, span.FITB .qb-radiobox-label, span.FITB .form-radio label, span.FITB .form-checkbox label, [data-blotid][data-type=checkbox] [data-labelid], [data-blotid][data-type=radiobox] [data-labelid], span.FITB-inptCont[data-type=checkbox] label, span.FITB-inptCont[data-type=radiobox] label { color: ${value}; } .form-sub-label { color: ${lightenColor(value, 10)}; } `; return rule; } function generateWidthRule(name, newValue) { let value = formProperties.form_formWidth ?? formProperties.formWidth ?? styleJSON['@formWidth'] ?? 700; if (name === 'formWidth') { value = newValue; } styleJSON['@formWidth'] = value; const rule = ` .form-all { max-width: ${value}px; width: 100%; } `; return rule; } function generateLabelWidthRule(name, newValue) { let value = formProperties.form_labelWidth ?? formProperties.labelWidth ?? styleJSON['@labelWidth'] ?? 150; if (name === 'labelWidth') { value = newValue; } styleJSON['@labelWidth'] = value; const rule = ` .form-label.form-label-left, .form-label.form-label-right, .form-label.form-label-left.form-label-auto, .form-label.form-label-right.form-label-auto { width: ${value}px; } `; return rule; } function generateFontLink() { const fontFamilyString = ['@font', '@headerFont', '@buttonFont', '@pbButtonFont', '@labelFont'] .filter(fontPropPrefix => ['jotform', 'google'].indexOf(styleJSON[`${fontPropPrefix}Type`]) !== -1 && styleJSON[`${fontPropPrefix}Family`]) .map(fontPropPrefix => styleJSON[`${fontPropPrefix}Family`].replace(/ /g, '+')) .join('|'); return fontFamilyString ? `//cdn.jotfor.ms/fonts/?family=${fontFamilyString}` : ''; } function generateFontRule(name, newValue) { const fontSource = formProperties.form_font ?? formProperties.font ?? styleJSON['@fontFamily'] ?? 'Arial'; let fontFamily = (typeof fontSource === 'object' && fontSource && fontSource.value) ? fontSource.value : fontSource; if (name === 'font' && newValue) { fontFamily = (typeof newValue === 'object' && newValue.value) ? newValue.value : (typeof newValue === 'string' ? newValue : fontFamily); if (typeof newValue === 'object') { styleJSON['@fontType'] = newValue.type; styleJSON['@fontFamily'] = fontFamily; styleJSON['@fontLink'] = generateFontLink() || ''; delete styleJSON['@googleFontLink']; } } // @fontFamily // @buttonFontFamily // @pbButtonFontFamily // @headerFontFamily // @labelFontFamily const rule = ` .form-all { font-family: ${fontFamily}, sans-serif; } `; return rule; } function generateFontSizeRule(name, newValue) { let value = formProperties.form_fontsize ?? formProperties.fontsize ?? styleJSON['@fontSize'] ?? 14; if (name === 'fontsize') { value = newValue; } const rule = ` .form-all { font-size: ${value}px } `; return rule; } function generateWindowBackgroundRule(name, newValue, color) { let value = color || styleJSON['@clrBg']; if (name === 'pageColor') { value = color || newValue; } styleJSON['@clrBg'] = value; const rule = ` .supernova { background-color: ${value}; } .supernova body { background: transparent; } `; return rule; } function generateTextInputBackgroundRule(name, newValue, color) { let value = color || styleJSON['@clrTextInputBg']; if (name === 'inputColor') { value = color || newValue; } styleJSON['@clrTextInputBg'] = value; const rule = ` .form-textbox, .form-textarea, .form-dropdown, .form-radio-other-input, .form-checkbox-other-input, .form-captcha input, .form-spinner input { background-color: ${value}; } `; return rule; } function generateErrorBackgroundRule(color) { styleJSON['@clrErrorBg'] = color; const rule = ` .form-line-error { overflow: hidden; transition: none; background-color: ${color}; } .form-line-error .form-error-message { background-color: #DC2626; clear: both; float: none; } .form-line-error .form-error-arrow { border-bottom-color: #FF3200; } .form-line-error input:not(#coupon-input), .form-line-error textarea, .form-line-error .form-validation-error { border: 1px solid #c61515; box-shadow: 0 0 3px #c61515; } `; return rule; } function generatePageBackgroundImageRule(name, newValue) { let backgroundUrl = styleJSON['@bgURL']; if (name === 'pageBackgroundImage') { backgroundUrl = newValue; } const repeat = (styleJSON['@bgRepeat'] ?? styleJSON['bgRepeat'] ?? 'false') === 'true' ? 'repeat' : 'no-repeat'; const fixed = (styleJSON['@bgAttach'] ?? styleJSON['bgAttach'] ?? 'true') !== 'false' ? 'fixed' : 'scroll'; const cover = (styleJSON['@bgCover'] ?? styleJSON['bgCover'] ?? 'true') !== 'false' ? 'cover' : 'auto'; styleJSON['@bgURL'] = backgroundUrl; const backgroundRules = ` .supernova { background-repeat: ${repeat}; background-size:${cover}; background-attachment: ${fixed}; background-position: center top; }`; if (!backgroundUrl || backgroundUrl === '|nobackground|') { return ` ${backgroundRules} .supernova { background-image: none; } `; } return ` ${backgroundRules} .supernova { background-image: url("${backgroundUrl}"); }`; } function generateFormBackgroundImageRule(name, newValue) { let backgroundUrl = styleJSON['@frameBgURL']; if (name === 'formBackgroundImage') { backgroundUrl = newValue; } styleJSON['@frameBgURL'] = backgroundUrl; if (!backgroundUrl || backgroundUrl === '|nobackground|') { return ` .form-all { background-image: none; } `; } const repeat = (styleJSON['@bgRepeat'] ?? styleJSON['bgRepeat'] ?? 'false') === 'true' ? 'repeat' : 'no-repeat'; const fixed = (styleJSON['@bgAttach'] ?? styleJSON['bgAttach'] ?? 'true') !== 'false' ? 'fixed' : 'scroll'; const cover = (styleJSON['@bgCover'] ?? styleJSON['bgCover'] ?? 'true') !== 'false' ? 'cover' : 'auto'; return ` .form-all { background-image: url("${backgroundUrl}"); background-repeat: ${repeat}; background-size:${cover}; background-attachment: ${fixed}; background-position: center top; } `; } function generateInjectCSS() { let result = '/*PREFERENCES STYLE*/'; result += generateFontRule(name, newValue); result += generateAlignmentRule(name, newValue); result += generateLineSpacingRule(name, newValue); result += generateWidthRule(name, newValue); result += generateLabelWidthRule(name, newValue); result += generateFontSizeRule(name, newValue); if (name === 'colorScheme' || name === 'statelessColorScheme') { result += generateWindowBackgroundRule(name, newValue, newValue.clrBg); result += generateBackgroundRule(name, newValue, newValue.clrFrame); result += generateFontColorRule(name, newValue, newValue.clrText); result += generateTextInputBackgroundRule(name, newValue, newValue.clrTextInputBg); result += generateErrorBackgroundRule(newValue.clrErrorBg); } else { result += generateBackgroundRule(name, newValue); result += generateFontColorRule(name, newValue); result += generateWindowBackgroundRule(name, newValue); result += generateTextInputBackgroundRule(name, newValue); } result += generatePageBackgroundImageRule(name, newValue); result += generateFormBackgroundImageRule(name, newValue); result += '/*PREFERENCES STYLE*/'; return result; } const generateNewColorSchemeCSS = styleJSON => { const _styleJSON = typeof styleJSON === 'string' ? JSON.parse(styleJSON) : styleJSON; let newThemeProps = _styleJSON.newThemeProps || {}; newThemeProps = typeof newThemeProps === 'string' ? JSON.parse(newThemeProps) : newThemeProps; // eslint-disable-line no-unused-vars const baseDefaults = { clrText: '#333333', clrFrame: '#ffffff', clrBg: '#f5f5f5', clrActive: '#e8e8e8', clrErrorBg: '#ffd6d6', clrTextInputBg: '#ffffff' }; Object.entries(baseDefaults).forEach(([k, v]) => { if (!newThemeProps[k]) newThemeProps[k] = v; }); const schemeProps = { 'dark-color-2x': 'input-border-color', 'label-color': 'clrText', 'light-color': 'main-light-color', 'input-bg-color': 'clrTextInputBg', 'dark-color': 'rating-item-bg-color', 'hover-color': 'rating-item-bg-hover', 'dark-600': 'label-color', 'sub-label-color': 'form-sublabel-color', 'form-bg-color': 'clrFrame', 'main-color': 'clrBg', 'active-bg-color': 'clrActive', 'error-bg-color': 'clrErrorBg', 'control-nextButton-textColor': 'clrFrame', 'white-color': 'control-nextButton-textColor', 'submit-button-bg-color': 'control-button-bg-color', 'submit-button-hover-bg': 'submit-button--hover', 'back-button-hover-bg': 'back-button--hover', 'next-button-hover-bg': 'next-button--hover', 'back-button--hover': 'back-button-hover-bg', 'next-button--hover': 'next-button-hover-bg', 'default-back-bgcolor': 'default-back-bgcolor', 'default-blue-color': 'main-color', 'default-grey-color': 'default-grey-color', 'default-grey-light-color': 'default-grey-light-color', 'empty-state-grey-color': 'empty-state-grey-color', 'empty-state-grey-light-color': 'empty-state-grey-light-color', 'default-dark-color': 'default-dark-color', 'default-blue-light-color': 'default-blue-light-color', 'default-blue-light2x-color': 'default-blue-light2x-color', 'input-border-color': 'dark-color-2x', 'input-border-color--hover': 'input-border-color', 'input-border-color--focus': 'main-color', 'input-box-shadow--hover': 'input-border-color--hover', 'input-box-shadow--focus': 'input-border-color--focus', 'next-bg-color': 'main-color', 'category-btn-color': 'main-color', 'product-item-bg': 'form-bg-color', 'a11y-fitb-label': 'label-color', 'a11y-calendarOtherDay': 'default-grey-light-color' }; if (!_styleJSON.newThemeProps) { return ''; } Object.entries(schemeProps).forEach(([key, value]) => { if (!newThemeProps[key]) newThemeProps[key] = newThemeProps[value]; }); if (!newThemeProps['default-blue-light-color']) newThemeProps['default-blue-light-color'] = newThemeProps['clrActive']; if (!newThemeProps['hover-color']) newThemeProps['hover-color'] = newThemeProps['clrActive']; if (!newThemeProps['input-border-color']) { var c = newThemeProps['clrText'] || baseDefaults.clrText; newThemeProps['input-border-color'] = (c && c.indexOf('#') === 0) ? lightenColor(c, 55) : (c || '#d8dae9'); } if (!newThemeProps['dark-color-2x']) newThemeProps['dark-color-2x'] = newThemeProps['input-border-color']; if (!newThemeProps['input-border-color--hover']) newThemeProps['input-border-color--hover'] = newThemeProps['input-border-color']; if (!newThemeProps['input-border-color--focus']) newThemeProps['input-border-color--focus'] = newThemeProps['main-color']; if (!newThemeProps['input-box-shadow--hover']) newThemeProps['input-box-shadow--hover'] = newThemeProps['input-border-color--hover']; if (!newThemeProps['input-box-shadow--focus']) newThemeProps['input-box-shadow--focus'] = newThemeProps['input-border-color--focus']; if (!newThemeProps['submit-button-bg-color']) newThemeProps['submit-button-bg-color'] = newThemeProps['main-color']; if (!newThemeProps['submit-button-hover-bg']) newThemeProps['submit-button-hover-bg'] = newThemeProps['main-color']; if (!newThemeProps['back-button--hover']) newThemeProps['back-button--hover'] = newThemeProps['main-color']; if (!newThemeProps['next-button--hover']) newThemeProps['next-button--hover'] = newThemeProps['main-color']; if (!newThemeProps['light-color']) newThemeProps['light-color'] = newThemeProps['main-color']; if (!newThemeProps['category-btn-color']) newThemeProps['category-btn-color'] = newThemeProps['main-color']; if (!newThemeProps['product-item-bg']) newThemeProps['product-item-bg'] = newThemeProps['form-bg-color']; if (!newThemeProps['next-bg-color']) newThemeProps['next-bg-color'] = newThemeProps['main-color']; if (!newThemeProps['white-color']) newThemeProps['white-color'] = newThemeProps['form-bg-color']; if (!newThemeProps['empty-state-grey-color']) newThemeProps['empty-state-grey-color'] = newThemeProps['form-bg-color']; if (!newThemeProps['empty-state-grey-light-color']) newThemeProps['empty-state-grey-light-color'] = newThemeProps['form-bg-color']; if (!newThemeProps['default-grey-light-color']) newThemeProps['default-grey-light-color'] = newThemeProps['clrActive']; if (!newThemeProps['default-grey-color']) newThemeProps['default-grey-color'] = newThemeProps['label-color']; if (!newThemeProps['default-dark-color']) newThemeProps['default-dark-color'] = newThemeProps['label-color']; if (!newThemeProps['default-blue-light2x-color']) newThemeProps['default-blue-light2x-color'] = newThemeProps['input-bg-color']; if (!newThemeProps['default-back-bgcolor']) newThemeProps['default-back-bgcolor'] = newThemeProps['main-color']; if (!newThemeProps['a11y-calendarOtherDay']) newThemeProps['a11y-calendarOtherDay'] = newThemeProps['default-grey-light-color']; if (!newThemeProps['sub-label-color']) newThemeProps['sub-label-color'] = newThemeProps['label-color']; if (!newThemeProps['placeholder-color']) newThemeProps['placeholder-color'] = newThemeProps['dark-color-2x'] || newThemeProps['input-border-color']; const safeFallback = newThemeProps['label-color'] || newThemeProps['clrText'] || baseDefaults.clrText; Object.keys(newThemeProps).forEach(k => { if (!newThemeProps[k]) newThemeProps[k] = safeFallback; }); const labelColor = newThemeProps['label-color'] || newThemeProps['clrText']; const formBgColor = newThemeProps['form-bg-color'] || newThemeProps['clrFrame']; const mainColor = newThemeProps['main-color'] || newThemeProps['clrBg']; const inputBgColor = newThemeProps['input-bg-color'] || newThemeProps['clrTextInputBg']; const errorBgColor = newThemeProps['error-bg-color'] || newThemeProps['clrErrorBg']; const activeBgColor = newThemeProps['active-bg-color'] || newThemeProps['clrActive']; if (labelColor) { _styleJSON['@clrText'] = labelColor; _styleJSON['@clrLabel'] = labelColor; } if (formBgColor) { _styleJSON['@clrFrame'] = formBgColor; } if (mainColor) { _styleJSON['@clrBg'] = mainColor; } if (inputBgColor) { _styleJSON['@clrTextInputBg'] = inputBgColor; } if (errorBgColor) { _styleJSON['@clrErrorBg'] = errorBgColor; } if (activeBgColor) { _styleJSON['@clrActive'] = activeBgColor; } return ` /*PREFERENCES STYLE*/ /* NEW THEME STYLE */ /* colors */ .calendar-new-header-withSVG .calendar-new-header .nextYear svg, .calendar-new-header-withSVG .calendar-new-header .nextMonth svg, .calendar-new-header-withSVG .calendar-new-header .previousYear svg, .calendar-new-header-withSVG .calendar-new-header .previousMonth svg, .FITB-inptCont .form-textbox, .FITB-inptCont .form-dropdown, span.FITB-inptCont[data-type=selectbox] select, span.FITB-inptCont[data-type=timebox] select, .rating-item label, .currentDate, .pickerItem select, .appointmentCalendar .calendarDay, .calendar.popup table tbody td, .calendar-new-header > *, span.form-sub-label, label.form-sub-label, div.form-header-group .form-subHeader, .rating-item-title.for-to > label:first-child, .rating-item-title.for-from > label:first-child, .rating-item-title .editor-container * { color: ${newThemeProps['label-color']}; } .rating-item input:hover+label, .appointmentSlotsContainer > *, li[data-type=control_fileupload] .qq-upload-button, li[data-type=control_fileupload] .jfUpload-heading, .form-textbox::placeholder { color: ${newThemeProps['placeholder-color'] || newThemeProps['dark-color-2x'] || newThemeProps['default-blue-color']}; } .clear-pad-btn, .appointmentCalendar .dayOfWeek, .calendar.popup th { color: ${newThemeProps['default-blue-color'] || newThemeProps['white-color'] || newThemeProps['dark-color-2x'] || newThemeProps['label-color']}; } .until-text, .form-submit-reset { color: ${newThemeProps['default-dark-color'] || newThemeProps['label-color']}; } .appointmentCalendar .calendarDay.isSelected:after { color: ${newThemeProps['input-bg-color']}; } .form-pagebreak-next, .form-pagebreak-back, .form-collapse-table, .form-matrix-column-headers, .form-matrix-row-headers, .form-spinner-button-container>* { color: ${newThemeProps['default-dark-color'] || newThemeProps['white-color']}; } .stageEmpty, .btn-barebone, .formPage-stuff, .scrollToTop .scrollToTop-text { color: ${newThemeProps['empty-state-grey-color'] || newThemeProps['white-color']}; } .scrollToTop svg { fill: ${newThemeProps['empty-state-grey-color'] || newThemeProps['white-color']}; } .form-dropdown:not(.time-dropdown):not(:required), .form-dropdown:not(:required), .form-dropdown:required:invalid, .form-spinner-input { color: ${newThemeProps['default-grey-color'] || newThemeProps['dark-600'] || newThemeProps['label-color']}; } .FITB:not(.formRender) .qb-datebox input:not([data-labelid]), .FITB:not(.formRender) .qb-selectbox input:not([data-labelid]), .FITB:not(.formRender) .qb-signaturebox input:not([data-labelid]), .FITB:not(.formRender) .qb-textbox input:not([data-labelid]), .FITB:not(.formRender) .qb-timebox input:not([data-labelid]), span.FITB-inptCont[data-type=datebox] label, span.FITB-inptCont[data-type=signaturebox] label, span.FITB-inptCont[data-type=textbox] label, span.FITB-inptCont[data-type=timebox] label, span.FITB-inptCont[data-type=datebox] input:focus~label, span.FITB-inptCont[data-type=datebox] input:valid~label, span.FITB-inptCont[data-type=signaturebox] input:focus~label, span.FITB-inptCont[data-type=signaturebox] input:valid~label, span.FITB-inptCont[data-type=textbox] input:focus~label, span.FITB-inptCont[data-type=textbox] input:valid~label, span.FITB-inptCont[data-type=timebox] input:focus~label, span.FITB-inptCont[data-type=timebox] input:valid~label { color: ${newThemeProps['default-grey-color'] || newThemeProps['next-bg-color'] || newThemeProps['a11y-fitb-label'] || newThemeProps['dark-color-2x']}; } .appointmentCalendar .calendarWeek .calendarDay.isUnavailable, .calendar tr.days td.otherDay, .calendar tr.days td:hover:not(.unselectable) { color: ${newThemeProps['default-grey-light-color'] || newThemeProps['a11y-calendarOtherDay'] || newThemeProps['light-color']}; } /* border-colors */ .form-dropdown, .form-textarea, .form-textbox, li[data-type=control_fileupload] .qq-upload-button, .rating-item label, .rating-item input:focus+label, .rating-item input:checked+label, .jf-form-buttons, .form-checkbox+label:before, .form-checkbox+span:before, .form-radio+label:before, .form-radio+span:before, .signature-pad-passive, .signature-wrapper, .appointmentCalendarContainer, .appointmentField .timezonePickerName, .appointmentDayPickerButton, .appointmentCalendarContainer .monthYearPicker .pickerItem+.pickerItem, .appointmentCalendarContainer .monthYearPicker, .appointmentCalendar .calendarDay.isActive .calendarDayEach, .appointmentCalendar .calendarDay.isToday .calendarDayEach, .appointmentCalendar .calendarDay:not(.empty):hover .calendarDayEach, .calendar.popup:before, .calendar-new-month, .form-matrix-column-headers, .form-matrix-table td, .form-matrix-table td:last-child, .form-matrix-table th, .form-matrix-table th:last-child, .form-matrix-table tr:last-child td, .form-matrix-table tr:last-child th, .form-matrix-table tr:not([role=group])+tr[role=group] th, .form-matrix-headers.form-matrix-column-headers, .isSelected .form-matrix-column-headers:nth-last-of-type(2), li[data-type=control_inline] input[type=email], li[data-type=control_inline] input[type=number], li[data-type=control_inline] input[type=tel], li[data-type=control_inline] input[type=text]:not(#productSearch-input), .form-line[data-payment=true] .form-textbox, .form-line[data-payment=true] .select-area, .form-line[data-payment=true] #coupon-input, .form-line[data-payment=true] #coupon-container input, .form-line[data-payment=true] input#productSearch-input, .form-line[data-payment=true] .form-product-category-item:after, .form-line[data-payment=true] .filter-container .dropdown-container .select-content, .form-line[data-payment=true] .form-textbox.form-product-custom_quantity, .form-line[data-payment="true"] .form-product-item .p_checkbox .select_border, .form-line[data-payment="true"] .form-product-item .form-product-container .form-sub-label-container span.select_cont, .form-line[data-payment=true] select.form-dropdown, .form-line[data-payment=true] #payment-category-dropdown .select-area, .form-line[data-payment=true] #payment-sorting-products-dropdown .select-area, .form-line[data-payment=true] .dropdown-container .select-content, .form-line[data-payment="true"] hr, .form-line[data-payment=true] .p_item_separator, .form-line[data-payment="true"] .payment_footer.new_ui, .form-line.card-3col .form-product-item.new_ui, .form-line.card-2col .form-product-item.new_ui, .form-line[data-payment=true] .form-product-category-item, .form-line[data-payment=true] .payment-form-table span.form-sub-label-container iframe, .form-line[data-type=control_square] .payment-form-table span.form-sub-label-container iframe{ border-color: ${newThemeProps['dark-color-2x']}; } .stageEmpty, .form-page-break:before, .welcome-page-break:before, .thankyou-page-break:before, .form-cover-break:before, .form-page-break:after, .welcome-page-break:after, .thankyou-page-break:after, .form-cover-break:after { border-color: ${newThemeProps['empty-state-grey-light-color'] || newThemeProps['white-color']}; } .rating-item input:hover+label, .appointmentSlot, .form-checkbox:checked+label:before, .form-checkbox:checked+span:before, .form-checkbox:checked+span label:before, .form-radio:checked+label:before, .form-radio:checked+span:before, .form-dropdown:focus, .form-textarea:focus, .form-textbox:focus, .signature-wrapper:focus, .form-line[data-payment="true"] .form-product-item .p_checkbox .checked, .form-dropdown:hover, .form-textarea:hover, .form-textbox:hover, .signature-wrapper:hover { border-color: ${newThemeProps['default-blue-color'] || newThemeProps['dark-color-2x']}; } .calendar tr.days td:hover:not(.unselectable):after { border-color: ${newThemeProps['light-color']}; } .form-header-group, .form-buttons-wrapper, .form-pagebreak, .form-submit-clear-wrapper, .form-pagebreak-next, .form-pagebreak-back, .form-checkbox:hover+label:before, .form-checkbox:hover+span:before, .form-radio:hover+label:before, .form-radio:hover+span:before, .divider { border-color: ${newThemeProps['main-color']}; } .form-pagebreak-back:focus, .form-pagebreak-next:focus, .form-submit-button:focus { border-color: ${newThemeProps['input-border-color--focus']}; } /* background-colors */ .form-matrix-values, .form-matrix-values, .signature-wrapper, .signature-pad-passive, .form-checkbox+label:before, .form-checkbox+span:before, .form-radio+label:before, .form-radio+span:before, .form-line[data-payment=true] #coupon-input, .form-line[data-payment=true] input#productSearch-input, .form-line[data-payment=true] .select-area, .form-line[data-payment=true] .custom_quantity, .form-line[data-payment=true] .filter-container .select-content, .form-line[data-payment=true] .p_checkbox .select_border, .form-line[data-payment=true] #payment-category-dropdown .select-area, .form-line[data-payment=true] #payment-sorting-products-dropdown .select-area, .form-line[data-payment=true] .dropdown-container .select-content { background-color: ${newThemeProps['input-bg-color']}; } .form-line-active { background-color: ${newThemeProps['active-bg-color']}; } .stageEmpty { background-color: ${newThemeProps['main-color'] || newThemeProps['dark-color-2x']}; } .form-matrix-column-headers, .form-matrix-row-headers, .form-spinner-button-container>*, .appointmentDayPickerButton, .form-collapse-table, .form-collapse-table:hover { background-color: ${newThemeProps['default-back-bgcolor'] || newThemeProps['dark-color-2x']}; } .calendar.popup, .calendar.popup table, .calendar.popup table tbody td:after { background-color: ${newThemeProps['form-bg-color']}; } .form-line-error { background-color: ${newThemeProps['error-bg-color']}; } .appointmentCalendar .calendarDay.isActive .calendarDayEach, .appointmentFieldRow.forSelectedDate, .calendar.popup tr.days td.selected:after, .calendar.popup:after, .submit-button, .form-checkbox:checked+label:before, .form-checkbox:checked+span:before, .form-checkbox:checked+span label:before, .form-radio+label:after, .form-radio+span:after, .rating-item input:checked+label, .appointmentCalendar .calendarDay:after, .form-line[data-payment="true"] .form-product-item .p_checkbox .checked, .rating-item input:focus+label, .formPage-removePage:hover, .btn-barebone:hover, .btn-barebone:active { background-color: ${newThemeProps['dark-color-2x']}; } .appointmentSlot.active { background-color: ${newThemeProps['dark-color-2x']} !important; } .clear-pad-btn, .appointmentCalendar .dayOfWeek, .calendar.popup th { background-color: ${newThemeProps['default-blue-light-color'] || newThemeProps['dark-600'] || newThemeProps['label-color']}; } .appointmentField .timezonePicker:hover+.timezonePickerName, .form-spinner-button-container>*:hover { background-color: ${newThemeProps['default-blue-light-color'] || newThemeProps['hover-color']}; } li[data-type=control_fileupload] .qq-upload-button { background-color: ${newThemeProps['default-blue-light2x-color'] || newThemeProps['input-bg-color']}; } .JotFormBuilder .appContainer #app li.form-line[data-type=control_matrix].isSelected .questionLine-editButton.forRemove:after, .JotFormBuilder .appContainer #app li.form-line[data-type=control_matrix].isSelected .questionLine-editButton.forRemove:before { background-color: ${newThemeProps['default-grey-color'] || newThemeProps['white-color']}; } .page-section li.form-line-active[data-type="control_button"] { background-color: ${newThemeProps['active-bg-color']}; } .appointmentDayPickerButton:after, .form-collapse-table:after { background-color: ${newThemeProps['a11y-fitb-label'] || newThemeProps['default-grey-color'] || newThemeProps['form-bg-color']}; } /* shadow */ .form-dropdown:hover, .form-textarea:hover, .form-textbox:hover, .signature-wrapper:hover, .calendar.popup:before, .jSignature:hover, li[data-type=control_fileupload] .qq-upload-button-hover, .form-line[data-payment="true"] .form-product-item .p_checkbox .checked, .form-line[data-payment="true"] .form-product-item .p_checkbox:hover .select_border, .form-checkbox:hover+label:before, .form-checkbox:hover+span:before, .form-radio:hover+label:before, .form-radio:hover+span:before, .calendar.popup:before { border-color: ${newThemeProps['input-border-color--hover']}; box-shadow: 0 0 0 1px ${newThemeProps['input-box-shadow--hover']}; } .form-dropdown:focus, .form-textarea:focus, .form-textbox:focus, .signature-wrapper:focus, li[data-type=control_fileupload] .qq-upload-button-focus, .form-checkbox:focus+label:before, .form-checkbox:focus+span:before, .form-radio:focus+label:before, .form-radio:focus+span:before, .calendar.popup:before { border-color: ${newThemeProps['input-border-color--focus']}; box-shadow: 0 0 0 1px ${newThemeProps['input-box-shadow--focus']}; } .calendar.popup table tbody td{ box-shadow: none; } .form-product-item .form-product-container .form-sub-label-container span.select_cont:focus select, .form-product-item .form-product-container .form-sub-label-container span.select_cont select:focus, .form-checkbox.form-product-input:focus ~ .select_border, .form-pagebreak-next:focus, .form-pagebreak-back:focus, .preview-submission-button:focus, .form-submit-button:focus, .form-collapse-table:focus { border-color: ${newThemeProps['input-border-color--focus']} !important; box-shadow: 0 0 1px 3px ${newThemeProps['input-box-shadow--focus']} !important; } /* button colors */ .submit-button { background-color: ${newThemeProps['submit-button-bg-color']}; border-color: ${newThemeProps['submit-button-bg-color']}; } .submit-button:hover { background-color: ${newThemeProps['submit-button-hover-bg']}; border-color: ${newThemeProps['submit-button-hover-bg']}; } .form-pagebreak-next, .form-pagebreak-back { background-color: ${newThemeProps['default-blue-color'] || newThemeProps['next-bg-color'] || newThemeProps['main-color']}; } .form-pagebreak-back:hover { background-color: ${newThemeProps['back-button--hover']}; border-color: ${newThemeProps['back-button--hover']}; } .form-pagebreak-next:hover { background-color: ${newThemeProps['next-button--hover']}; border-color: ${newThemeProps['next-button--hover']}; } .form-sacl-button, .form-submit-print { background-color: transparent; color: ${newThemeProps['default-dark-color'] || newThemeProps['input-border-color']}; border-color: ${newThemeProps['input-border-color']}; } .form-sacl-button:hover, .form-submit-print:hover, .appointmentSlot:not(.disabled):not(.active):hover, .appointmentDayPickerButton:hover, .rating-item input:hover+label { background-color: ${newThemeProps['hover-color']}; } /* payment styles */ .form-line[data-payment=true] .form-product-category-item.title_collapsed.has_selected_product .selected-items-icon { background-color: ${newThemeProps['category-btn-color']}; border-color: ${newThemeProps['category-btn-color']}; } .form-line[data-payment=true].form-line.card-3col .form-product-item, .form-line[data-payment=true].form-line.card-2col .form-product-item { background-color: ${newThemeProps['product-item-bg']}; } /* icons */ .appointmentField .timezonePickerName:before, [data-blotid][data-type=timebox]:after, span.FITB-inptCont[data-type=timebox] .FITB-inptCont-inner:after { ${newThemeProps['timezone-icon'] ? `background-image: ${newThemeProps['timezone-icon']};` : ''} } .appointmentCalendarContainer .monthYearPicker .pickerArrow.prev:after { ${newThemeProps['app-arrow-up-icon'] ? `background-image: ${newThemeProps['app-arrow-up-icon']};` : ''} } .appointmentCalendarContainer .monthYearPicker .pickerArrow.next:after { ${newThemeProps['app-arrow-down-icon'] ? `background-image: ${newThemeProps['app-arrow-down-icon']};` : ''} } .appointmentField .timezonePickerName:after { ${newThemeProps['app-arrow-icon'] ? `background-image: ${newThemeProps['app-arrow-icon']};` : ''} width: 11px; } li[data-type=control_datetime] [data-wrapper-react=true].extended>div+.form-sub-label-container .form-textbox:placeholder-shown, li[data-type=control_datetime] [data-wrapper-react=true]:not(.extended) .form-textbox:not(.time-dropdown):placeholder-shown, .appointmentCalendarContainer .currentDate, span[data-type="datebox"]:after { ${newThemeProps['calendar-icon'] ? `background-image: ${newThemeProps['calendar-icon']};` : ''} } .form-star-rating-star.Stars { ${newThemeProps['star-rating-icon'] ? `background-image: ${newThemeProps['star-rating-icon']} !important;` : ''} } .signature-pad-passive, .signature-placeholder:after { ${newThemeProps['signature-icon'] ? `background-image: ${newThemeProps['signature-icon']};` : ''} } .form-spinner-button.form-spinner-up:before { ${newThemeProps['spinner-up-icon'] ? `background-image: ${newThemeProps['spinner-up-icon']};` : ''} } .form-spinner-button.form-spinner-down:before { ${newThemeProps['spinner-down-icon'] ? `background-image: ${newThemeProps['spinner-down-icon']};` : ''} } li[data-type=control_fileupload] .qq-upload-button:before { ${newThemeProps['file-upload-icon'] ? `background-image: ${newThemeProps['file-upload-icon']};` : ''} } span[data-type=signaturebox]:after { ${newThemeProps['app-arrow-right-icon'] ? `background-image: ${newThemeProps['fitb-pencil-icon']};` : ''} } /* NEW THEME STYLE */ /*PREFERENCES STYLE*/ `; } if (!isNewDefaultTheme) { return { injectCSS: generateInjectCSS(), styleJSON: JSON.stringify(styleJSON) } } switch (true) { case name === 'buttonStyle': delete styleJSON['@pbButtonCustomTemplate']; delete styleJSON['@buttonCustomTemplate']; if (newValue.length > 0) { styleJSON['@buttonCustomTemplate'] = `form-submit-button-${newValue}`; } return { styleJSON: JSON.stringify(styleJSON) }; case name === 'colorScheme' && typeof newValue === 'object': advancedDesingerProps.forEach(key => delete styleJSON[`@${key}`]); styleJSON.newThemeProps = newValue; _injectCSS = generateNewColorSchemeCSS(styleJSON); break; case name === 'statelessColorScheme' && typeof newValue === 'object': advancedDesingerProps.forEach(key => delete styleJSON[`@${key}`]); styleJSON.newThemeProps = Object.assign({}, styleJSON.newThemeProps || {}, newValue); _injectCSS = generateNewColorSchemeCSS(styleJSON); break; case _injectCSS.indexOf('/* NEW THEME STYLE */') > -1: _injectCSS = _injectCSS.match(/((\/\*PREFERENCES STYLE\*\/)([\s\S]*?)(\/\* NEW THEME STYLE \*\/)([\s\S]*?)(\/\* NEW THEME STYLE \*\/)([\s\S]*?)([\s\S]*?)(\/\*PREFERENCES STYLE\*\/))/); _injectCSS = _injectCSS ? _injectCSS[0] : generateNewColorSchemeCSS(styleJSON); break; default: _injectCSS = ''; } let finalInjectCSS = (formProperties.form_injectCSS || formProperties.injectCSS || '/*__INSPECT_SEPERATOR__*/').replace(/((\/\*PREFERENCES STYLE\*\/)([\s\S]*?)(\/\*PREFERENCES STYLE\*\/))/g, ''); const generatedCSS = generateInjectCSS(); finalInjectCSS = finalInjectCSS.indexOf('/*__INSPECT_SEPERATOR__*/') > -1 ? finalInjectCSS.replace('/*__INSPECT_SEPERATOR__*/', generatedCSS + '/*__INSPECT_SEPERATOR__*/') : finalInjectCSS + generatedCSS; return { injectCSS: isCdnColorScheme ? finalInjectCSS : generateInjectCSS(), styleJSON: JSON.stringify(styleJSON) }; } //navigation var colorTheme = document.querySelector(".jfp-color-theme"); if (colorTheme && !colorTheme.dataset.clickBound) { colorTheme.dataset.clickBound = "1"; if (!isClassicThemeData && document.body && document.body.classList.contains("jfCardForm")) { document.documentElement.classList.add("is-color-theme-card"); } else { document.documentElement.classList.remove("is-color-theme-card"); } var allItems = colorTheme.querySelectorAll(".colorScheme-list li"); var mobileTrigger = colorTheme.querySelector(".jfp-color-theme-mobile-trigger"); var mobileTriggerSwatch = mobileTrigger && mobileTrigger.querySelector(".jfp-color-theme-mobile-swatch"); var mobileTriggerLabel = mobileTrigger && mobileTrigger.querySelector(".jfp-color-theme-mobile-label"); var defaultColorSchemeLabel = mobileTriggerLabel ? mobileTriggerLabel.textContent : "Color Scheme"; function getCurrentTemplateID() { return String((formPropsData && formPropsData.form_id) || ""); } function clearStaleCustomTheme() { try { var currentTemplateID = getCurrentTemplateID(); var customThemeTemplateID = window.top && window.top.customTheme ? String(window.top.customTheme.templateID || "") : ""; if (window.top && window.top.customTheme && (!currentTemplateID || !customThemeTemplateID || customThemeTemplateID !== currentTemplateID)) { window.top.customTheme = undefined; } } catch (e) {} } clearStaleCustomTheme(); function getTranslatedSchemeLabel(item) { if (!item) return defaultColorSchemeLabel; var fallbackLabel = item.dataset.schemeLabel || defaultColorSchemeLabel; return fallbackLabel.trim ? fallbackLabel.trim() : fallbackLabel; } function setMobileDropdownOpen(isOpen) { colorTheme.classList.toggle("is-dropdown-open", !!isOpen); if (mobileTrigger) { mobileTrigger.setAttribute("aria-expanded", isOpen ? "true" : "false"); } } function syncColorThemeOffset() { var rect = colorTheme.getBoundingClientRect(); if (!rect || !rect.height) return; document.documentElement.style.setProperty("--color-theme-footer-offset", Math.ceil(rect.height) + "px"); } function refreshMobileDropdownMode() { if (typeof window.syncColorThemeDropdownMode === "function") { window.syncColorThemeDropdownMode(); } if (window.requestAnimationFrame) { window.requestAnimationFrame(syncColorThemeOffset); } else { syncColorThemeOffset(); } if (!document.documentElement.classList.contains("is-color-theme-dropdown")) { setMobileDropdownOpen(false); } } syncColorThemeOffset(); window.addEventListener("resize", syncColorThemeOffset); try { if (window.top && window.top !== window) { window.top.addEventListener("resize", syncColorThemeOffset); } } catch (e) {} function syncMobileColorSchemeTrigger(selectedLi) { if (!mobileTrigger) return; var selected = selectedLi || colorTheme.querySelector(".colorScheme-list li.isSelected"); var triggerItem = selected || allItems[0]; if (!selected) { if (!triggerItem) { if (mobileTriggerLabel) mobileTriggerLabel.textContent = defaultColorSchemeLabel; return; } } var label = getTranslatedSchemeLabel(triggerItem); if (mobileTriggerLabel) mobileTriggerLabel.textContent = label || defaultColorSchemeLabel; if (!mobileTriggerSwatch) return; var borderColor = triggerItem.style.getPropertyValue("--scheme-border") || triggerItem.style.borderColor; var backgroundColor = triggerItem.style.getPropertyValue("--scheme-bg") || triggerItem.style.backgroundColor; var textColor = triggerItem.style.getPropertyValue("--scheme-text") || triggerItem.style.color; mobileTriggerSwatch.style.borderColor = borderColor; mobileTriggerSwatch.style.backgroundColor = backgroundColor; mobileTriggerSwatch.style.color = textColor; mobileTriggerSwatch.textContent = triggerItem.classList.contains("isClearOption") ? "" : "A"; } function syncSelectedOptionState(selectedLi) { allItems.forEach(function (item) { var isSelected = item === selectedLi; item.classList.toggle("isSelected", isSelected); item.setAttribute("aria-selected", isSelected ? "true" : "false"); }); } function trackColorSchemeClick(className) { try { var JotFormActions = window.top && window.top['for-actions']; if (!window.colorSchemeTracker && typeof JotFormActions === 'function') { window.colorSchemeTracker = JotFormActions("formTemplateColorThemeSelector"); } if (!window.colorSchemeTracker || typeof window.colorSchemeTracker.tick !== 'function') { return; } var actor = window.top && window.top.user ? window.top.user.username : ''; window.colorSchemeTracker.tick({ actor: actor, "action": 'click-theme', "target": className }); } catch (e) {} } if (mobileTrigger) { mobileTrigger.addEventListener("click", function (e) { e.preventDefault(); e.stopPropagation(); setMobileDropdownOpen(!colorTheme.classList.contains("is-dropdown-open")); if (colorTheme.classList.contains("is-dropdown-open")) { window.setTimeout(function () { var selected = colorTheme.querySelector(".colorScheme-list li.isSelected"); if (selected) selected.scrollIntoView({ block: "nearest" }); }, 0); } }); document.addEventListener("click", function (e) { if (!colorTheme.contains(e.target)) setMobileDropdownOpen(false); }); document.addEventListener("keydown", function (e) { if (e.key === "Escape") setMobileDropdownOpen(false); }); window.addEventListener("resize", refreshMobileDropdownMode); try { if (window.top && window.top !== window) { window.top.addEventListener("resize", refreshMobileDropdownMode); } } catch (e) {} } colorTheme.addEventListener("keydown", function (e) { var li = e.target.closest(".colorScheme-list li"); if (!li || (e.key !== "Enter" && e.key !== " ")) return; e.preventDefault(); li.click(); }); function findFormDesignerStyleEl() { var el = document.getElementById("form-designer-style"); if (el) return el; try { var frames = document.querySelectorAll("iframe"); for (var i = 0; i < frames.length; i++) { var doc = frames[i].contentDocument || (frames[i].contentWindow && frames[i].contentWindow.document); if (doc && (el = doc.getElementById("form-designer-style"))) return el; } if (document.body && document.body.querySelector) { el = document.querySelector("#form-designer-style"); } } catch (e) {} return el || null; } function findTemplateNewStyleEl(createIfMissing) { var el = document.getElementById("templateNewStyle"); if (el) return el; try { var frames = document.querySelectorAll("iframe"); for (var i = 0; i < frames.length; i++) { var doc = frames[i].contentDocument || (frames[i].contentWindow && frames[i].contentWindow.document); if (doc && (el = doc.getElementById("templateNewStyle"))) return el; } if (document.body && document.body.querySelector) { el = document.querySelector("#templateNewStyle"); if (el) return el; } } catch (e) {} if (createIfMissing && document.head) { el = document.createElement("style"); el.id = "templateNewStyle"; document.head.appendChild(el); return el; } return null; } var originalFormDesignerContent = null; var prefsBlockRegex = /\/\*PREFERENCES STYLE\*\/[\s\S]*\/\*PREFERENCES STYLE\*\//; var formProps = formPropsData; function applyColorSchemeStyle(css) { var formDesignerEl = findFormDesignerStyleEl(); if (!css) { if (originalFormDesignerContent !== null && formDesignerEl) { formDesignerEl.textContent = originalFormDesignerContent; } var styleEl = findTemplateNewStyleEl(false); if (styleEl) styleEl.textContent = ''; return; } if (formDesignerEl && formDesignerEl.textContent && prefsBlockRegex.test(formDesignerEl.textContent)) { if (originalFormDesignerContent === null) originalFormDesignerContent = formDesignerEl.textContent; formDesignerEl.textContent = formDesignerEl.textContent.replace(prefsBlockRegex, css); return; } var styleEl = findTemplateNewStyleEl(true); if (!styleEl) return; styleEl.textContent = css; } function removeClassicColorSchemeClasses(html) { allItems.forEach(function (item) { var c = item.dataset.className; if (c) html.classList.remove(c); }); } function applyClassicColorScheme(li) { var html = document.documentElement; var className = li ? li.dataset.className || '' : ''; var selectedColorObj = colorSchemeListV3New.find(function (item) { return item.name === className; }); removeClassicColorSchemeClasses(html); if (className) html.classList.add(className); if (!selectedColorObj || className === '') return null; var cssObject = generateThemeCSS(selectedColorObj.colors, formProps); applyColorSchemeStyle(cssObject.injectCSS); return { className: className, colors: selectedColorObj.colors, cssObject: cssObject }; } (function initSelectedState() { var fdEl = findFormDesignerStyleEl(); if (fdEl && fdEl.textContent && originalFormDesignerContent === null) originalFormDesignerContent = fdEl.textContent; if (!isClassicThemeData) return; var selected = colorTheme.querySelector(".colorScheme-list li.isSelected"); if (selected) applyClassicColorScheme(selected); })(); syncMobileColorSchemeTrigger(colorTheme.querySelector(".colorScheme-list li.isSelected")); colorTheme.addEventListener("click", function (e) { var li = e.target.closest(".colorScheme-list li"); if (!li) return; var className = li.dataset.className || ''; var themeID = li.dataset.themeId || ''; trackColorSchemeClick(className); const shouldClearSelection = li.classList.contains("isClearOption") || li.classList.contains("isSelected"); syncSelectedOptionState(shouldClearSelection ? null : li); syncMobileColorSchemeTrigger(shouldClearSelection ? null : li); setMobileDropdownOpen(false); if (!isClassicThemeData) { if (shouldClearSelection) { const cardFormStyle = document.querySelector('#cardFormStyle'); if (cardFormStyle) { cardFormStyle.textContent = ''; } window.top.customTheme = undefined; return; } fetch(`/stylebuilder/${formPropsData.form_id}/style.css?previewTheme=1&themeID=${(themeID)}`) .then(function (response) { if (!response.ok) throw new Error('Failed to load theme CSS'); return response.text(); }) .then(function (cssText) { const cardFormStyle = document.querySelector('#cardFormStyle'); if (cardFormStyle) { cardFormStyle.textContent = cssText; } else { const styleEl = document.createElement('style'); styleEl.id = 'cardFormStyle'; styleEl.textContent = cssText; document.head.appendChild(styleEl); } const selectedFromTpl = cardColorSchemesMeta.find(function (t) { return String(t.id) === String(themeID); }); if (!selectedFromTpl) return; window.top.customTheme = { templateID: getCurrentTemplateID(), isCardForm: true, styleJSON: { ...formPropsData.styleJSON, ...(selectedFromTpl.styleJSON || {}) }, defaultTheme: selectedFromTpl.defaultTheme, cardThemeID: themeID }; }); return; } if (shouldClearSelection) { removeClassicColorSchemeClasses(document.documentElement); applyColorSchemeStyle(''); window.top.customTheme = undefined; return; } var selectedClassicScheme = applyClassicColorScheme(li); var isEmpty = className === ''; if (!selectedClassicScheme || isEmpty) return; const cssObject = selectedClassicScheme.cssObject; window.top.customTheme = { templateID: getCurrentTemplateID(), injectCSS: cssObject.injectCSS, styleJSON: cssObject.styleJSON, statelessColorScheme: className, fontcolor: selectedClassicScheme.colors.clrText, background: selectedClassicScheme.colors.clrFrame }; }); (function setupColorSchemeScrollNav() { var wrap = colorTheme.querySelector('.jfp-color-theme-scroll-wrap'); var list = wrap && wrap.querySelector('.colorScheme-list'); var prev = wrap && wrap.querySelector('.jfp-color-theme-nav--prev'); var next = wrap && wrap.querySelector('.jfp-color-theme-nav--next'); if (!wrap || !list || !prev || !next) return; ['touchstart', 'touchmove', 'touchend', 'touchcancel'].forEach(function (type) { wrap.addEventListener(type, function (e) { e.stopPropagation(); }, { passive: true }); }); function getMaxScroll() { return Math.max(0, list.scrollWidth - list.clientWidth); } function isDesktopRTL() { return document.documentElement.getAttribute('dir') === 'rtl' && !document.documentElement.classList.contains('is-color-theme-dropdown'); } function sync() { var max = getMaxScroll(); var overflow = max > 2; list.classList.toggle('colorScheme-list--scroll-x', overflow); if (!overflow) { list.classList.remove('colorScheme-list--at-start', 'colorScheme-list--at-end'); prev.disabled = true; next.disabled = true; return; } var atStart = list.scrollLeft <= 1; var atEnd = list.scrollLeft >= max - 1; list.classList.toggle('colorScheme-list--at-start', atStart); list.classList.toggle('colorScheme-list--at-end', atEnd); prev.disabled = isDesktopRTL() ? atEnd : atStart; next.disabled = isDesktopRTL() ? atStart : atEnd; } function scrollByDir(dir) { var delta = Math.max(120, Math.floor(list.clientWidth * 0.65)); list.scrollBy({ left: (isDesktopRTL() ? -dir : dir) * delta, behavior: 'smooth' }); } prev.addEventListener('click', function (e) { e.preventDefault(); e.stopPropagation(); scrollByDir(-1); }); next.addEventListener('click', function (e) { e.preventDefault(); e.stopPropagation(); scrollByDir(1); }); list.addEventListener('scroll', sync); window.addEventListener('resize', sync); if (typeof ResizeObserver !== 'undefined') { var ro = new ResizeObserver(sync); ro.observe(list); } if (document.fonts && document.fonts.ready) { document.fonts.ready.then(sync).catch(sync); } sync(); window.setTimeout(sync, 100); window.setTimeout(sync, 500); })(); }