Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- function hexToRGB(h) {ldelim}
- let r = 0,
- g = 0,
- b = 0;
- // 3 digits
- if (h.length == 4) {ldelim}
- r = "0x" + h[1] + h[1];
- g = "0x" + h[2] + h[2];
- b = "0x" + h[3] + h[3];
- // 6 digits
- {rdelim} else if (h.length == 7) {ldelim}
- r = "0x" + h[1] + h[2];
- g = "0x" + h[3] + h[4];
- b = "0x" + h[5] + h[6];
- {rdelim}
- return +r + "," + +g + "," + +b;
- {rdelim}
- var site_styles = getComputedStyle(document.body);
- var sl_n2_def = site_styles.getPropertyValue('--sl_n2');
- function reloadVariables() {ldelim}
- var m1_rgb = hexToRGB(site_styles.getPropertyValue('--m1').trim());
- var m2_rgb = hexToRGB(site_styles.getPropertyValue('--m2').trim());
- var m3_rgb = hexToRGB(site_styles.getPropertyValue('--m3').trim());
- var sl_n2 = sl_n2_def.replace(/var\(\-\-m3\)/g, 'rgb(' + m3_rgb + ')');
- document.documentElement.style.setProperty('--sl_n2', sl_n2);
- {rdelim};
- reloadVariables();
- $(function(){ldelim}
- $(document).on('click', '.s3solution-themes-list__item', function(){ldelim}
- reloadVariables();
- $('link').on('load', function(){ldelim}
- reloadVariables();
- {rdelim});
- {rdelim});
- {rdelim});
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement