CouseraTranslator

cousera课程翻译

目前為 2023-04-04 提交的版本,檢視 最新版本

// ==UserScript==
// @name         CouseraTranslator
// @namespace    http://tampermonkey.net/
// @version      0.8
// @description  cousera课程翻译
// @author       JiaoWoBanXianEr
// @match        https://www.coursera.org/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=baidu.com
// @grant        none
// ==/UserScript==
let color = '#ffff22';
let bgColor = "#7f7f7f";
let fontSize = 60
let t;

function translate(){
    let text = document.querySelector('.rc-Phrase.active.css-ugczj4');
    t.textContent = text.outerText;
}

var i = setInterval(function() {translate();}, 100);
window.onload = function(){init();};
setTimeout(() => {
    init();
}, 10000);

function init(){
    t = document.createElement("div");
    t.style.position = 'absolute';
    t.style.margin = 'auto';
    t.style.textAlign = 'center';
    t.style.zIndex = 99;
    t.style.height = 40 + 'px';
    t.style.left = 'auto';
    t.style.right = 'auto';
    t.style.top = 10+'%';
    t.style.backgroundColor = bgColor;
    t.style.fontSize = 40+'px';
    t.style.color = color;
    //t.innerHTML = '<div id="sub_container" style="z-index: 99; position: absolute; top: 10%; left: auto; right: auto; height: 60px; margin: auto; text-align: center; background-color: rgb(127, 127, 127); font-size: 60px; color: rgb(255, 255, 34);">初始化</div>'
    document.querySelector('.vjs-react.c-video.vjs-fluid.vjs-circle-play-centered').appendChild(t);
}
(function() {
    'use strict';
    
    // Your code here...
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址