少女折寿中...

zatu的随机图片API

欢迎使用zatu的自建随机图片API,提供高质量的图片背景资源!

图片均为https,不用担心被劫持

API基本调用格式:

https://api.zatusgyo.top/img/ #双端

参数:

type=pc #桌面端或 type=pe #移动端

使用示例:

https://api.zatusgyo.top/img/
https://api.zatusgyo.top/img/?type=pc
https://api.zatusgyo.top/img/?type=pe
使用说明

所有图片均已压缩为WebP格式,可以通过CSS调整显示尺寸:

<img src='https://api.zatusgyo.top/img/' style='width:100%; height:auto; max-width:1280px;'>

推荐使用CSS的object-fit属性来调整图片适应容器:

<img src='https://api.zatusgyo.top/img/' style='width:100%; height:300px; object-fit:cover;'>

使用示例

<img src='https://api.zatusgyo.top/img/' alt='随机背景图片'>
body { background-image: url('https://api.zatusgyo.top/img/?type=pc'); background-size: cover; background-position: center; }
const img = document.createElement('img'); img.src = 'https://api.zatusgyo.top/img/'; document.body.appendChild(img);