Merge version_3 into main #4
@@ -167,7 +167,7 @@ export default function RootLayout({
|
||||
|
||||
const backgroundImage = computedStyle.backgroundImage;
|
||||
if (backgroundImage && backgroundImage !== 'none') {
|
||||
const urlMatch = backgroundImage.match(/url(['"]?([^'")]+)['"]?)/);
|
||||
const urlMatch = backgroundImage.match(/url(['"]?([^'")]+)['"]?/);
|
||||
if (urlMatch && urlMatch[1] && !urlMatch[1].includes('gradient')) {
|
||||
const area = element.offsetWidth * element.offsetHeight;
|
||||
const hasReasonableSize = area > 1000;
|
||||
@@ -185,7 +185,7 @@ export default function RootLayout({
|
||||
|
||||
const buttonClasses = ['btn', 'button', 'cta', 'action-button'];
|
||||
const hasButtonClass = buttonClasses.some(cls =>
|
||||
element.classList.contains(cls) || element.classList.contains(\`btn-\${cls}\`)
|
||||
element.classList.contains(cls) || element.classList.contains(`btn-${cls}`)
|
||||
);
|
||||
|
||||
if (hasButtonClass && element.textContent && element.textContent.trim().length > 0) {
|
||||
@@ -294,7 +294,8 @@ export default function RootLayout({
|
||||
className = element.className.baseVal;
|
||||
}
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
catch (e) {}
|
||||
|
||||
const info = {
|
||||
tagName: tagName,
|
||||
@@ -336,7 +337,7 @@ export default function RootLayout({
|
||||
const computedStyle = window.getComputedStyle(element);
|
||||
const backgroundImage = computedStyle.backgroundImage;
|
||||
if (backgroundImage && backgroundImage !== 'none') {
|
||||
const urlMatch = backgroundImage.match(/url(['"]?([^'")]+)['"]?)/);
|
||||
const urlMatch = backgroundImage.match(/url(['"]?([^'")]+)['"]?/);
|
||||
if (urlMatch) {
|
||||
const originalBgSrc = extractOriginalUrl(urlMatch[1]);
|
||||
if (tagName !== 'img') {
|
||||
@@ -677,17 +678,17 @@ export default function RootLayout({
|
||||
const rect = element.getBoundingClientRect();
|
||||
const overlay = document.createElement('div');
|
||||
overlay.className = 'webild-hover-overlay';
|
||||
overlay.style.cssText = \`
|
||||
overlay.style.cssText = `
|
||||
position: fixed !important;
|
||||
top: \${rect.top - 2}px !important;
|
||||
left: \${rect.left - 2}px !important;
|
||||
width: \${rect.width + 4}px !important;
|
||||
height: \${rect.height + 4}px !important;
|
||||
top: ${rect.top - 2}px !important;
|
||||
left: ${rect.left - 2}px !important;
|
||||
width: ${rect.width + 4}px !important;
|
||||
height: ${rect.height + 4}px !important;
|
||||
background-color: rgba(90, 113, 230, 0.15) !important;
|
||||
pointer-events: none !important;
|
||||
z-index: 999998 !important;
|
||||
transition: all 0.15s ease !important;
|
||||
\`;
|
||||
`;
|
||||
document.body.appendChild(overlay);
|
||||
return overlay;
|
||||
};
|
||||
@@ -750,11 +751,11 @@ export default function RootLayout({
|
||||
elementTypeLabel.classList.add('label-bottom');
|
||||
}
|
||||
|
||||
elementTypeLabel.style.cssText = \`
|
||||
left: \${labelLeft}px !important;
|
||||
top: \${labelTop}px !important;
|
||||
elementTypeLabel.style.cssText = `
|
||||
left: ${labelLeft}px !important;
|
||||
top: ${labelTop}px !important;
|
||||
transform: none !important;
|
||||
\`;
|
||||
`;
|
||||
};
|
||||
|
||||
const removeElementTypeLabel = () => {
|
||||
@@ -1008,7 +1009,7 @@ export default function RootLayout({
|
||||
const getStorageKey = () => {
|
||||
const url = new URL(window.location.href);
|
||||
const pathParts = url.pathname.split('/').filter(Boolean);
|
||||
return \`webild-changes-\${pathParts.join('-')}\`;
|
||||
return `webild-changes-${pathParts.join('-')}`;
|
||||
};
|
||||
|
||||
const saveChangeToStorage = (change) => {
|
||||
@@ -1244,7 +1245,7 @@ export default function RootLayout({
|
||||
|
||||
if (isBackground) {
|
||||
oldValue = window.getComputedStyle(element).backgroundImage;
|
||||
element.style.backgroundImage = \`url('\${newSrc}')\`;
|
||||
element.style.backgroundImage = `url('${newSrc}')`;
|
||||
replaced = true;
|
||||
} else if (element.tagName.toLowerCase() === 'img') {
|
||||
oldValue = element.src;
|
||||
@@ -1279,7 +1280,7 @@ export default function RootLayout({
|
||||
const hasBackgroundImage = window.getComputedStyle(element).backgroundImage !== 'none';
|
||||
if (hasBackgroundImage) {
|
||||
oldValue = window.getComputedStyle(element).backgroundImage;
|
||||
element.style.backgroundImage = \`url('\${newSrc}')\`;
|
||||
element.style.backgroundImage = `url('${newSrc}')`;
|
||||
replaced = true;
|
||||
}
|
||||
}
|
||||
@@ -1289,7 +1290,7 @@ export default function RootLayout({
|
||||
|
||||
let cleanOldValue = oldValue;
|
||||
if (oldValue.includes('url(')) {
|
||||
const urlMatch = oldValue.match(/url(['"]?([^'")]+)['"]?)/);
|
||||
const urlMatch = oldValue.match(/url(['"]?([^'")]+)['"]?/);
|
||||
if (urlMatch) {
|
||||
cleanOldValue = urlMatch[1];
|
||||
}
|
||||
|
||||
@@ -2,23 +2,23 @@
|
||||
/* Base units */
|
||||
/* --vw is set by ThemeProvider */
|
||||
|
||||
/* --background: #f6f0e9;;
|
||||
--card: #efe7dd;;
|
||||
--foreground: #2b180a;;
|
||||
--primary-cta: #2b180a;;
|
||||
--secondary-cta: #efe7dd;;
|
||||
--accent: #94877c;;
|
||||
--background-accent: #afa094;; */
|
||||
/* --background: #060000;;
|
||||
--card: #1d0d0d;;
|
||||
--foreground: #ffe6e6;;
|
||||
--primary-cta: #ff3d4a;;
|
||||
--secondary-cta: #1f0a0a;;
|
||||
--accent: #7b2d2d;;
|
||||
--background-accent: #b8111f;; */
|
||||
|
||||
--background: #f6f0e9;;
|
||||
--card: #efe7dd;;
|
||||
--foreground: #2b180a;;
|
||||
--primary-cta: #2b180a;;
|
||||
--primary-cta-text: #f6f0e9;;
|
||||
--secondary-cta: #efe7dd;;
|
||||
--secondary-cta-text: #2b180a;;
|
||||
--accent: #94877c;;
|
||||
--background-accent: #afa094;;
|
||||
--background: #060000;;
|
||||
--card: #1d0d0d;;
|
||||
--foreground: #ffe6e6;;
|
||||
--primary-cta: #ff3d4a;;
|
||||
--primary-cta-text: #060000;;
|
||||
--secondary-cta: #1f0a0a;;
|
||||
--secondary-cta-text: #ffe6e6;;
|
||||
--accent: #7b2d2d;;
|
||||
--background-accent: #b8111f;;
|
||||
|
||||
/* text sizing - set by ThemeProvider */
|
||||
/* --text-2xs: clamp(0.465rem, 0.62vw, 0.62rem);
|
||||
|
||||
Reference in New Issue
Block a user