update:适配移动端
parent
b3a8d2abee
commit
47f5ef220c
|
@ -26,9 +26,8 @@ export default function Form() {
|
|||
>
|
||||
<div className="text-[#fff] text-[24px] font-semibold">提交</div>
|
||||
<img
|
||||
className="w-[26px] h-[22px]"
|
||||
src="/home/submit_icon.png"
|
||||
width={26}
|
||||
height={22}
|
||||
alt=""
|
||||
/>
|
||||
|
||||
|
|
|
@ -18,11 +18,13 @@ export default function Header(props: { dict: Record<string, string>, lang: stri
|
|||
const [hash, setHash] = useState('#home')
|
||||
useEffect(() => {
|
||||
const designWidth = 1440;
|
||||
const deviceWidth = window.innerWidth;
|
||||
const deviceWidth = document.documentElement.clientWidth
|
||||
let scale = 1
|
||||
console.log('designWidth', deviceWidth)
|
||||
if (deviceWidth <= 1440) {
|
||||
scale = deviceWidth / designWidth;
|
||||
}
|
||||
console.log('scale', scale)
|
||||
document.documentElement.style.fontSize = `${scale * 14.4}px`;
|
||||
switch (hash) {
|
||||
case '#home':
|
||||
|
@ -127,7 +129,7 @@ export default function Header(props: { dict: Record<string, string>, lang: stri
|
|||
|
||||
<div className={`absolute ${!show && 'hidden'} left-0 right-0 top-0 bottom-0 left-0 top-0 z-[10000]`} onClick={() => setShow(false)}>
|
||||
<Link href={lang[0] === 'zh' ? '/en' : '/'}>
|
||||
<div className={`absolute right-[55px] top-[68px] w-[129px] h-[28px] leading-[28px]
|
||||
<div className={`absolute right-[40px] top-[68px] w-[129px] h-[28px] leading-[28px]
|
||||
bg-[#EEF1F6] text-center transition-all duration-300 origin-top group-hover:block`}>
|
||||
<div className="text-[14px] text-[#333333]">{dict?.lang1}</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue