---
title: "[教程] 为你的网站增加石蒜模拟器 复制粘贴代码就行 快来试试吧"
url: https://www.landian.news/archives/95385.html
date: 2022-09-06T22:34:43+08:00
modified: 2022-09-06T14:34:43+00:00
author: "山外的鸭子哥"
description: "来自Github上的石蒜模拟器网页小组件 🎉 直接引用现成脚本为你的网站或者纯HTML网页添加石蒜模拟器。 具 [&hellip;]"
categories: "技术教程"
tags: "html, web, 石蒜, 石蒜模拟器"
---

# [教程] 为你的网站增加石蒜模拟器 复制粘贴代码就行 快来试试吧

[来自Github上的石蒜模拟器网页小组件](https://github.com/dsrkafuu/sakana-widget/blob/main/README.zh.md) 🎉 直接引用现成脚本为你的网站或者纯HTML网页添加石蒜模拟器。

具体效果可以刷新蓝点网看看网页右侧，有前端开发能力的用户建议直接看Github可以根据需要进行自定义。

蓝点网这里引入的是现成模块只需要放到网页中即可，无论是WordPress还是其他博客系统都可以轻松添加。

注：由于下面是录制的动态图所以牺牲了帧率导致比较卡顿，建议用户点击蓝点网右侧石蒜模拟器进行体验。

为避免干扰后续蓝点网会删除这个小组件，需要体验可以进入原作者网站：[https://sakana.dsrkafuu.net/](https://sakana.dsrkafuu.net/)

[!\[\\[教程\\] 为你的网站增加石蒜模拟器 复制粘贴代码就行 快来试试吧\](https://img.lancdn.com/landian/2022/09/95385.gif)](https://img.lancdn.com/landian/2022/09/95385.gif)

```
#复制下面这段代码粘贴到网页中即可
#如果是WordPress等博客系统可以在主题中找到页脚设置等，切换到HTML模式粘贴即可
<div id="left_layer" style="position:fixed; top:350px; right:30px;">
  <div id="sakana-widget"></div>
  <script>
    function initSakanaWidget() {
      new SakanaWidget().mount('#sakana-widget');
    }
  </script>
  <script
    async
    onload="initSakanaWidget()"
    src="https://cdn.jsdelivr.net/npm/sakana-widget@2.2.2/lib/sakana.min.js"
  ></script>
</div>
```

---

Source: [[教程] 为你的网站增加石蒜模拟器 复制粘贴代码就行 快来试试吧](https://www.landian.news/archives/95385.html)
