图片API接口

图片API接口

能力有限请手动刷新网页进行切换壁纸

https://api.asxe.vip/scenery.php

Random Image

https://api.asxe.vip/random.php

Random Image

https://t.mwm.moe/pc

Random Image

https://api.maho.cc/random-img/pc.php

Random Image

https://unsplash.it/1600/900?random

Random Image

推荐

https://t.mwm.moe/fj

Random Image

https://picsum.photos/580/300

Random Image

https://source.unsplash.com/random

Random Image

https://imgapi.xl0408.top/index.php

Random Image

https://api.paugram.com/bing

Random Image

以下是img中调用api实现刷新的代码

<div>
    <img id="randomImage" alt="Random Image">
  </div>
  <button onclick="fetchRandomImage()">点击这里刷新</button>

  <script>
    function fetchRandomImage() {
      fetch('https://api.maho.cc/random-img/pc.php')
        .then(response => response.blob())
        .then(blob => {
          const imageUrl = URL.createObjectURL(blob);
          document.getElementById('randomImage').src = imageUrl;
        })
        .catch(error => console.error('Error fetching image:', error));
    }

    // 初始加载一张图片
    fetchRandomImage();
  </script>
<div>
    <img src="https://ybapi.cn/API/pc_acgimg.php " alt="Random Image" style="width: 50%; height: 50%;">
</div>

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容