diff --git a/src/components/HomeIndex/index.tsx b/src/components/HomeIndex/index.tsx index c53a59c..a88df25 100644 --- a/src/components/HomeIndex/index.tsx +++ b/src/components/HomeIndex/index.tsx @@ -17,7 +17,9 @@ const HomeIndex: React.FC = () => { r: -8, h: 160, w: (el: any) => { - return Math.max(320, el.parentNode.offsetWidth * 0.55) + if (el) { + return Math.max(320, el.parentNode.offsetWidth * 0.55) + } }, }, @@ -29,7 +31,9 @@ const HomeIndex: React.FC = () => { r: 15, h: 360, w: (el: any) => { - return Math.max(220, el.parentNode.offsetWidth * 0.3) + if (el) { + return Math.max(220, el.parentNode.offsetWidth * 0.3) + } }, }, @@ -41,7 +45,9 @@ const HomeIndex: React.FC = () => { r: 6, h: 300, w: (el: any) => { - return Math.max(330, el.parentNode.offsetWidth * 0.55) + if (el) { + return Math.max(330, el.parentNode.offsetWidth * 0.55) + } }, }, @@ -53,7 +59,9 @@ const HomeIndex: React.FC = () => { r: -5, h: 400, w: (el: any) => { - return Math.max(305, el.parentNode.offsetWidth * 0.45) + if (el) { + return Math.max(305, el.parentNode.offsetWidth * 0.45) + } }, }, @@ -65,7 +73,9 @@ const HomeIndex: React.FC = () => { r: -20, h: 525, w: (el: any) => { - return Math.max(160, el.parentNode.offsetWidth * 0.3) + if (el) { + return Math.max(160, el.parentNode.offsetWidth * 0.3) + } }, }, @@ -77,7 +87,9 @@ const HomeIndex: React.FC = () => { r: 10, h: 160, w: (el: any) => { - return Math.max(320, el.parentNode.offsetWidth * 0.55) + if (el) { + return Math.max(320, el.parentNode.offsetWidth * 0.55) + } }, }, ]