mirror of
https://github.com/m1ngsama/FUJI.git
synced 2025-12-24 10:51:27 +00:00
Merge pull request #35 from nbtca/feature-improve-performance
Feat:Improve performance
This commit is contained in:
commit
4624682985
20 changed files with 44 additions and 13 deletions
|
|
@ -17,6 +17,10 @@ var loadImage = function (index) {
|
|||
if (index >= imageElements.length) return
|
||||
const item = imageElements[index]
|
||||
const image = new Image()
|
||||
if(!item.src){
|
||||
loadImage(index + 1)
|
||||
return
|
||||
}
|
||||
image.src = item.src
|
||||
image.onload = function () {
|
||||
loadImage(index + 1)
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import React from "react"
|
||||
import { useState } from "react"
|
||||
import { Navbar, NavbarBrand, NavbarContent, NavbarItem, NavbarMenuToggle, NavbarMenu, NavbarMenuItem, Link } from "@nextui-org/react"
|
||||
import { SITE_TITLE } from "../../consts"
|
||||
|
||||
export default function App() {
|
||||
const [isMenuOpen, setIsMenuOpen] = React.useState(false)
|
||||
const [isMenuOpen, setIsMenuOpen] = useState(false)
|
||||
|
||||
const menuItems = [
|
||||
{
|
||||
|
|
|
|||
25
src/pages/freshman/react/delayImage.tsx
Normal file
25
src/pages/freshman/react/delayImage.tsx
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import React, { useState, useEffect } from "react"
|
||||
|
||||
interface DelayImageProps {
|
||||
src: string
|
||||
alt: string
|
||||
delay: number // delay in milliseconds
|
||||
}
|
||||
|
||||
const DelayImage: React.FC<DelayImageProps> = ({ src, alt, delay }) => {
|
||||
const [loaded, setLoaded] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
const timer = setTimeout(() => {
|
||||
setLoaded(true)
|
||||
}, delay)
|
||||
|
||||
return () => clearTimeout(timer)
|
||||
}, [delay])
|
||||
|
||||
return (
|
||||
<div>{loaded ? <img src={src} alt={alt} /> : <p>Loading image...</p>}</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default DelayImage
|
||||
|
|
@ -5,7 +5,7 @@ pubDate: 2000-01-01
|
|||
description: 'Apple 与 Applied Environmental Research Foundation 合作,将促进印度马哈拉施特拉邦红树林的保育工作'
|
||||
author: 'Apple Newsroom'
|
||||
cover:
|
||||
url: 'https://www.apple.com.cn/newsroom/images/values/environment/Apple-Earth-Day-India-mangrove-Alibaug-canoe_Full-Bleed-Image.jpg.large_2x.jpg'
|
||||
url: 'https://www.apple.com.cn/newsroom/images/values/environment/Apple-Earth-Day-India-mangrove-Alibaug-canoe_Full-Bleed-Image.jpg.large.jpg'
|
||||
square: 'https://www.apple.com.cn/newsroom/images/values/environment/Apple-Earth-Day-India-mangrove-Alibaug-canoe_Full-Bleed-Image.jpg.large_2x.jpg'
|
||||
alt: 'cover'
|
||||
tags: ["特写", "环保", "Apple", "印度", "红树林", "保育", "新闻稿"]
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ pubDate: 2022-04-19 10:11:26
|
|||
categories:
|
||||
- 技术
|
||||
- Go语言
|
||||
cover: ./_assets/5973f095d19f42f3b0649a0e2f52f006/image-20220419101405456.png
|
||||
cover: https://oss.nbtca.space/blog/clas/image-20220419101405456-wHMqwe.jpeg
|
||||
tid: go-first-tutorial
|
||||
description: Go语言入门教程。
|
||||
permalink: /pages/bd144d/
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 94 KiB |
|
|
@ -5,7 +5,7 @@ pubDate: 2022-04-05 13:13:28
|
|||
categories:
|
||||
- 技术
|
||||
- Linux
|
||||
cover: ./_assets/dfc39c2948664aa78df4a4b4aa11bb2c/20220320105749.png
|
||||
cover: https://oss.nbtca.space/blog/clas/20220320105749-Lmcbbo.jpeg
|
||||
tid: linux-note-signal
|
||||
description: 有关linux信号的一系列笔记。
|
||||
permalink: /pages/aff776/
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ pubDate: 2022-03-19 22:38:56
|
|||
categories:
|
||||
- 技术
|
||||
- Linux
|
||||
cover: ./_assets/cbea6761a0164906b8396942cf61c664/20220320105749.png
|
||||
cover: https://oss.nbtca.space/blog/clas/20220320105749-Lmcbbo.jpeg
|
||||
tid: linux-note-file-io
|
||||
description: 有关linux文件io的一系列笔记。
|
||||
permalink: /pages/82d273/
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ pubDate: 2022-04-05 13:13:35
|
|||
categories:
|
||||
- 技术
|
||||
- Linux
|
||||
cover: ./_assets/f835945d5de246bcabdff51dd984aaf2/20220320105749.png
|
||||
cover: https://oss.nbtca.space/blog/clas/20220320105749-Lmcbbo.jpeg
|
||||
tid: linux-note-process
|
||||
description: 有关linux进程的一系列笔记。
|
||||
permalink: /pages/324bec/
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 99 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 99 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 99 KiB |
|
|
@ -5,7 +5,7 @@ pubDate: 2022-04-05
|
|||
categories:
|
||||
- 技术
|
||||
- Python
|
||||
cover: ./_assets/867f99abfc5c46528fb1d3e570087ed9/data-mining.png
|
||||
cover: https://oss.nbtca.space/blog/clas/data-mining-mid-urPA5j.jpeg
|
||||
tid: python-spider-tiobe-top
|
||||
description: 使用python爬虫的实践记录。
|
||||
permalink: /pages/019940/
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ pubDate: 2022-04-17 14:07:55
|
|||
categories:
|
||||
- 技术
|
||||
- Python
|
||||
cover: ./_assets/7e03f38d60aa4dec9f98cc3f3c137189/data-mining.png
|
||||
cover: https://oss.nbtca.space/blog/clas/data-mining-mid-urPA5j.jpeg
|
||||
tid: python-spider-wzry-hero
|
||||
description: 使用python爬虫的实践记录,王者荣耀篇。
|
||||
permalink: /pages/b8d343/
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 1 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1 MiB |
|
|
@ -7,7 +7,7 @@ categories:
|
|||
- 更多
|
||||
- 学习
|
||||
cover:
|
||||
url: 'https://oss.nbtca.space/blog/clas/20220312214337.png'
|
||||
url: 'https://oss.nbtca.space/blog/clas/20220312214337-large-6apW1g.jpeg'
|
||||
description: 寝室软路由的记录,unraid的折腾和各种体验,文件存储,离线下载,游戏服务器……
|
||||
permalink: /pages/a8d792/
|
||||
author:
|
||||
|
|
|
|||
|
|
@ -5,11 +5,13 @@ pubDate: 2024-09-22
|
|||
description: "和劳动耕耘社的一次联动"
|
||||
author: "小明"
|
||||
cover:
|
||||
url: "./_assets/duck/yuzhiboban.jpg"
|
||||
url: "https://oss.nbtca.space/blog/clas/firedragon-TUIrfP-mid-RIQ91K.jpeg"
|
||||
alt: "cover"
|
||||
tags: ["联动", "鹅社"]
|
||||
---
|
||||
|
||||

|
||||
|
||||
亲爱的朋友们,
|
||||
感谢大家的热情参与,我们的动物命名活动圆满结束!经过激烈的投票与讨论,最终的名字终于出炉!🎉
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ pubDate: 2024-06-18
|
|||
description: ' “时间之河滚滚而去,青春韶华转瞬即逝”'
|
||||
author: 'kongbai'
|
||||
cover:
|
||||
url: 'https://oss.nbtca.space/blog/clas/YQL05614-5xNq3t.jpg'
|
||||
url: 'https://oss.nbtca.space/blog/clas/YQL05614-5xNq3t-mid-ulLkGV.jpeg'
|
||||
square: 'https://www.apple.com.cn/newsroom/images/values/environment/Apple-Earth-Day-India-mangrove-Alibaug-canoe_Full-Bleed-Image.jpg.large_2x.jpg'
|
||||
alt: 'cover'
|
||||
tags: ["活动","志愿者", "新闻稿", "影留宁理","摄影","毕业"]
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ pubDate: 2024-09-16
|
|||
description: "好饿...."
|
||||
author: "星璃,I_e_d_"
|
||||
cover:
|
||||
url: "https://s2.loli.net/2024/09/16/LwYtOGPxEFNUpji.png"
|
||||
url: "https://oss.nbtca.space/blog/clas/LwYtOGPxEFNUpji-vexMSQ.jpeg?x-oss-process=image/resize,h_512,m_lfit"
|
||||
square: ""
|
||||
alt: "cover"
|
||||
tags: ["生活", "吃饭", "介绍", "觅食指南", "攻略"]
|
||||
|
|
|
|||
Loading…
Reference in a new issue