Blame view

天文台pc/tianwentai-ui/src/app/pages/WebIframePage.tsx 962 Bytes
3a3dc915   王天杨   feat: 稻城亚丁项目批量更新
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
  import { useEffect, useState } from "react";
  import { useI18n } from "../i18n";
  
  const CAS_URL = "https://www.cas.cn/";
  
  export function WebIframePage() {
    const { t } = useI18n();
    const [loaded, setLoaded] = useState(false);
  
    useEffect(() => {
      setLoaded(false);
    }, []);
  
    return (
      <div className="relative flex min-h-0 w-full flex-1 flex-col overflow-hidden">
        {!loaded ? (
          <div className="absolute inset-0 z-10 flex items-center justify-center bg-black/25 backdrop-blur-sm">
            <div className="rounded-lg border border-white/15 bg-blue-950/60 px-4 py-3 text-sm text-white shadow-lg">
              {t("dialog.loading")}
            </div>
          </div>
        ) : null}
        <iframe
          title="天文馆官网"
          src={CAS_URL}
          className="h-full w-full flex-1 border-0 bg-white"
          onLoad={() => setLoaded(true)}
          referrerPolicy="no-referrer"
          allow="fullscreen"
        />
      </div>
    );
  }