image.png

文字渐变

  1. h1 {
  2. background-image: linear-gradient(180deg, #b2d6f6, #00f5ff);
  3. background-clip: text;
  4. -webkit-background-clip: text;
  5. color: transparent;
  6. }

时间显示

  1. const [now, setNow] = useState(new Date().toLocaleString())
  2. useEffect(() => {
  3. setInterval(()=> setNow(new Date().toLocaleString()), 1000)
  4. },[])