Giter Site home page Giter Site logo

bganimate's Introduction

bganimate

// 网页背景动画脚本 // ==UserScript== // @name 背景动画 // @namespace // @version 0.1 // @description 网页背景动画脚本 // @author cyblack // @match :///* // @icon
// @grant none // ==/UserScript==

function insertScript() { var scriptElement = document.createElement('script'); scriptElement.src = "https://eqcn.ajz.miesnfu.com/wp-content/plugins/wp-3d-pony/live2dw/lib/L2Dwidget.min.js" scriptElement.defer = true // scriptElement.text = 'L2Dwidget.init({"model": { "jsonPath": "https://unpkg.com/[email protected]/assets/tororo.model.json", "scale": 1, "hHeadPos": 0.5, "vHeadPos": 0.618 },"dialog": {enable: true,script: {"tap body": "哎呀!别碰我!","tap face": "人家是在认真写博客哦",}},"mobile": { "show": true, scale: 0.5 },"display": {"superSample": 2,"width": 200,"height": 400,"position": "left","hOffset": 0,"vOffset": 0}})'; document.body.appendChild(scriptElement) }

function insertL2Dwidget() { if(document.getElementById('live2d-widget')) { return false } const modelList = ['https://unpkg.com/[email protected]/assets/miku.model.json', 'https://unpkg.com/[email protected]/assets/hijiki.model.json', 'https://unpkg.com/[email protected]/assets/shizuku.model.json', 'https://unpkg.com/[email protected]/assets/tororo.model.json', 'https://unpkg.com/[email protected]/assets/wanko.model.json', 'https://unpkg.com/[email protected]/assets/shizuku.model.json', // 'https://unpkg.com/[email protected]/assets/z16.model.json', // 'https://unpkg.com/[email protected]/assets/koharu.model.json' ];

var scriptElement = document.createElement('script');
let path = modelList[parseInt(Math.random()*modelList.length)];
scriptElement.text = ` function init() { if(document.getElementById('live2d-widget')){return};L2Dwidget.init({"model": { "jsonPath": "${path}", "scale": 1, "hHeadPos": 0.5, "vHeadPos": 0.618 },"dialog": {enable: true,script: {"tap body": "哎呀!别碰我!","tap face": "hahahaha",}},"mobile": { "show": true, scale: 0.5 },"display": {"superSample": 2,"width": 100,"height": 200,"position": "right","hOffset": 0,"vOffset": 0}})};init()`;
document.body.appendChild(scriptElement)

}

(function() { 'use strict'; insertScript() setTimeout(() => { insertL2Dwidget() }, 500)

// Your code here... })();

bganimate's People

Contributors

cy567 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.