mirror of
				https://github.com/caojiezi2003/live2d-widget.git
				synced 2025-10-31 10:22:48 +00:00 
			
		
		
		
	change api url
This commit is contained in:
		
							parent
							
								
									14c2c04cf0
								
							
						
					
					
						commit
						95f06fab6a
					
				
							
								
								
									
										17
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								README.md
									
									
									
									
									
								
							| @ -1,22 +1,25 @@ | ||||
| # live2d-widget | ||||
| 
 | ||||
| ## 功能 | ||||
| 在网页中添加 Live2D 看板娘 | ||||
| 在网页中添加Live2D看板娘 | ||||
| 
 | ||||
| ## Demo | ||||
| https://zhangshuqiao.org   | ||||
| 左下角可查看效果 | ||||
| 在[米米的博客](https://zhangshuqiao.org)的左下角可查看效果 | ||||
| 
 | ||||
| ## 依赖 | ||||
| 需要jQuery和font-awesome   | ||||
| 请确保它们已在页面中加载 | ||||
| 请确保它们已在页面中加载,例如在`<header>`中加入: | ||||
| ``` | ||||
| <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | ||||
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> | ||||
| ``` | ||||
| 
 | ||||
| ## 使用 | ||||
| 请修改autoload.js中的参数(具体参考该文件内的注释),这样,通过 | ||||
| 请把整个项目克隆到服务器上,使之能够通过正常访问。修改autoload.js中的参数(具体参考该文件内的注释),这样,通过 | ||||
| ``` | ||||
| <script src="/path/to/autolload.js"></script> | ||||
| <script src="/path/to/autoload.js"></script> | ||||
| ``` | ||||
| 就可以加载了 | ||||
| 就可以加载了。 | ||||
| 
 | ||||
| waifu-tips.json中包含了触发条件(selector,选择器)和触发时显示的文字(text)。源文件是对Hexo的NexT主题有效的,为了适用于你自己的网页,也需要自行修改,或增加新内容。 | ||||
| 
 | ||||
|  | ||||
| @ -19,7 +19,7 @@ $.ajax({ | ||||
| 
 | ||||
| // 初始化看板娘,会自动加载指定目录下的 waifu-tips.json
 | ||||
| $(window).on("load", function() { | ||||
| 	initWidget("/lib/waifu/", "https://api.fghrsh.net/live2d"); | ||||
| 	initWidget("/lib/waifu/", "https://live2d.fghrsh.net/api"); | ||||
| }); | ||||
| //initWidget第一个参数为waifu-tips.json所在的文件夹,第二个参数为api地址
 | ||||
| //api后端可自行搭建,参考https://github.com/fghrsh/live2d_api
 | ||||
|  | ||||
| @ -207,8 +207,7 @@ function initWidget(waifuPath, apiPath) { | ||||
| 
 | ||||
| 	function initModel() { | ||||
| 		if (waifuPath === undefined) waifuPath = ""; | ||||
| 		if (apiPath === undefined) apiPath = ""; | ||||
| 		apiURL = apiPath; | ||||
| 		apiURL = apiPath || ""; | ||||
| 		var modelId = localStorage.getItem("modelId"), | ||||
| 			modelTexturesId = localStorage.getItem("modelTexturesId"); | ||||
| 		if (modelId == null) { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 StevenJoeZhang
						StevenJoeZhang