| Server IP : 38.190.208.107 / Your IP : 216.73.216.152 Web Server : nginx/1.28.1 System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64 User : root ( 0) PHP Version : 8.2.28 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/wp.9/wp-content/themes/blocksy/inc/panel-builder/footer/socials/ |
Upload File : |
import ctEvents from 'ct-events'
import { handleResponsiveSwitch } from '../../../../static/js/customizer/sync/helpers'
import {
responsiveClassesFor,
getRootSelectorFor,
assembleSelector,
mutateSelector,
getColumnSelectorFor,
} from '../../../../static/js/customizer/sync/helpers'
import { typographyOption } from '../../../../static/js/customizer/sync/variables/typography'
ctEvents.on(
'ct:footer:sync:collect-variable-descriptors',
(variableDescriptors) => {
variableDescriptors['socials'] = ({ fullItemId, itemId }) => ({
socialsIconSize: {
selector: assembleSelector(
getRootSelectorFor({
itemId,
fullItemId,
panelType: 'footer',
})
),
variable: 'theme-icon-size',
responsive: true,
unit: 'px',
},
socialsIconSpacing: {
selector: assembleSelector(
getRootSelectorFor({
itemId,
fullItemId,
panelType: 'footer',
})
),
variable: 'items-spacing',
responsive: true,
unit: 'px',
},
footerSocialsAlignment: {
selector: assembleSelector(
mutateSelector({
selector: getRootSelectorFor({
itemId,
fullItemId,
panelType: 'footer',
}),
operation: 'replace-last',
to_add: getColumnSelectorFor({
itemId: fullItemId,
}),
})
),
variable: 'horizontal-alignment',
responsive: true,
unit: '',
},
footerSocialsVerticalAlignment: {
selector: assembleSelector(
mutateSelector({
selector: getRootSelectorFor({
fullItemId,
itemId,
panelType: 'footer',
}),
operation: 'replace-last',
to_add: getColumnSelectorFor({
itemId: fullItemId,
}),
})
),
variable: 'vertical-alignment',
responsive: true,
unit: '',
},
...typographyOption({
id: 'footer_socials_label_font',
selector: assembleSelector(
mutateSelector({
selector: getRootSelectorFor({
itemId,
fullItemId,
panelType: 'footer',
}),
operation: 'suffix',
to_add: '.ct-label',
})
),
}),
footer_socials_font_color: [
{
selector: assembleSelector(
mutateSelector({
selector: getRootSelectorFor({
itemId,
fullItemId,
panelType: 'footer',
}),
operation: 'suffix',
to_add: 'a',
})
),
variable: 'theme-link-initial-color',
type: 'color:default',
responsive: true,
},
{
selector: assembleSelector(
mutateSelector({
selector: getRootSelectorFor({
itemId,
fullItemId,
panelType: 'footer',
}),
operation: 'suffix',
to_add: 'a',
})
),
variable: 'theme-link-hover-color',
type: 'color:hover',
responsive: true,
},
],
footerSocialsIconColor: [
{
selector: assembleSelector(
mutateSelector({
selector: getRootSelectorFor({
itemId,
fullItemId,
panelType: 'footer',
}),
operation: 'suffix',
to_add: '[data-color="custom"]',
})
),
variable: 'theme-icon-color',
type: 'color:default',
responsive: true,
},
{
selector: assembleSelector(
mutateSelector({
selector: getRootSelectorFor({
itemId,
fullItemId,
panelType: 'footer',
}),
operation: 'suffix',
to_add: '[data-color="custom"]',
})
),
variable: 'theme-icon-hover-color',
type: 'color:hover',
responsive: true,
},
],
footerSocialsIconBackground: [
{
selector: assembleSelector(
mutateSelector({
selector: getRootSelectorFor({
itemId,
fullItemId,
panelType: 'footer',
}),
operation: 'suffix',
to_add: '[data-color="custom"]',
})
),
variable: 'background-color',
type: 'color:default',
responsive: true,
},
{
selector: assembleSelector(
mutateSelector({
selector: getRootSelectorFor({
itemId,
fullItemId,
panelType: 'footer',
}),
operation: 'suffix',
to_add: '[data-color="custom"]',
})
),
variable: 'background-hover-color',
type: 'color:hover',
responsive: true,
},
],
footerSocialsMargin: {
selector: assembleSelector(
getRootSelectorFor({
itemId,
fullItemId,
panelType: 'footer',
})
),
type: 'spacing',
variable: 'margin',
responsive: true,
// important: true
},
footer_socials_direction: {
selector: assembleSelector(
getRootSelectorFor({
itemId,
fullItemId,
panelType: 'footer',
})
),
variable: 'items-direction',
responsive: true,
unit: '',
},
})
}
)
ctEvents.on(
'ct:footer:sync:item:socials',
({ itemId, optionId, optionValue, values }) => {
const el = document.querySelector(`.ct-footer [data-id="${itemId}"]`)
if (optionId === 'socialsType' || optionId === 'socialsFillType') {
const box = el.querySelector('.ct-social-box')
box.dataset.iconsType = `${values.socialsType}${
values.socialsType === 'simple'
? ''
: `:${values.socialsFillType || 'solid'}`
}`
}
if (optionId === 'socialsIconSize') {
el.querySelector('.ct-social-box').dataset.size =
values.socialsIconSize
}
if (optionId === 'socialsLabelVisibility') {
;[...el.querySelectorAll('.ct-label')].map((label) => {
responsiveClassesFor(optionValue, label)
})
}
if (optionId === 'footer_socials_visibility') {
responsiveClassesFor(optionValue, el)
}
}
)