| Server IP : 38.190.208.107 / Your IP : 216.73.217.13 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.12/wp-content/themes/blocksy/static/js/options/options/background/ |
Upload File : |
import {
Fragment,
createElement,
Component,
useRef,
useEffect,
useMemo,
useCallback,
useState,
} from '@wordpress/element'
import classnames from 'classnames'
import { __ } from 'ct-i18n'
import GenericOptionType from '../../GenericOptionType'
export const patternsList = [
{
id: 'type-1',
title: __('Hideout', 'blocksy'),
src: 'patterns/hideout.svg',
},
{
id: 'type-2',
title: __('Triangles', 'blocksy'),
src: 'patterns/triangles.svg',
},
{
id: 'type-3',
title: __('Bubbles', 'blocksy'),
src: 'patterns/bubbles.svg',
},
{
id: 'type-4',
title: __('Wiggle', 'blocksy'),
src: 'patterns/wiggle.svg',
},
{
id: 'type-5',
title: __('Polka Dots', 'blocksy'),
src: 'patterns/polka-dots.svg',
},
{
id: 'type-6',
title: __('Overlaping Circles', 'blocksy'),
src: 'patterns/overlaping-circles.svg',
},
{
id: 'type-7',
title: __('Texture', 'blocksy'),
src: 'patterns/texture.svg',
},
{
id: 'type-8',
title: __('Diagonal Lines', 'blocksy'),
src: 'patterns/diagonal-lines.svg',
},
{
id: 'type-9',
title: __('Rain', 'blocksy'),
src: 'patterns/rain.svg',
},
{
id: 'type-10',
title: __('Stripes', 'blocksy'),
src: 'patterns/stripes.svg',
},
{
id: 'type-11',
title: __('Diagonal Stripes', 'blocksy'),
src: 'patterns/diagonal-stripes.svg',
},
{
id: 'type-12',
title: __('Intersecting Circles', 'blocksy'),
src: 'patterns/intersecting-circles.svg',
},
{
id: 'type-13',
title: __('Bank Note', 'blocksy'),
src: 'patterns/bank-note.svg',
},
{
id: 'type-14',
title: __('Zig Zag', 'blocksy'),
src: 'patterns/zig-zag.svg',
},
{
id: 'type-15',
title: __('Endless Clouds', 'blocksy'),
src: 'patterns/endless-clouds.svg',
},
{
id: 'type-16',
title: __('Honey Comb', 'blocksy'),
src: 'patterns/honey-comb.svg',
},
{
id: 'type-17',
title: __('Cross Stripes', 'blocksy'),
src: 'patterns/cross-stripes.svg',
},
{
id: 'type-18',
title: __('Autumn', 'blocksy'),
src: 'patterns/autumn.svg',
},
]
export const getUrlForPattern = (id) =>
(window.ct_localizations || ct_customizer_localizations).static_public_url +
`images/${patternsList.find((p) => p.id === id).src}`
const PatternPicker = ({ option, value, onChange }) => {
return (
<Fragment>
<ul className="ct-patterns-list">
{patternsList.map((singlePattern) => (
<li
onClick={() =>
onChange({
...value,
background_pattern: singlePattern.id,
})
}
className={classnames({
active:
singlePattern.id === value.background_pattern,
})}
key={singlePattern.id}
title={singlePattern.title}>
<img
src={
(
window.ct_localizations ||
ct_customizer_localizations
).static_public_url +
`images/${singlePattern.src}`
}
/>
</li>
))}
</ul>
<GenericOptionType
value={value['patternColor']}
values={value}
option={{
id: 'patternColor',
label: __('Pattern Color', 'blocksy'),
type: 'ct-color-picker',
design: 'inline',
value: option.value['patternColor'],
pickers: [
{
title: __('Initial', 'blocksy'),
id: 'default',
},
],
skipNoColorPill: true,
skipArrow: true,
appendToBody: false,
}}
hasRevertButton={false}
onChange={(newValue) =>
onChange({
...value,
patternColor: newValue,
})
}
/>
</Fragment>
)
}
export default PatternPicker