限时优惠活动
亲爱的苦力吧用户,我们为了回馈新老用户一直以来的鼎力支持,即日起(2025-02-06至2025-03-06)凡是购买苦力吧VIP/充值K币的新老用户,都直接可获得买一送一的优惠馈赠。例如:购买一个月的VIP会员可直接获得两个月的VIP会员;充值100K币可直接获得200K币,以此类推!有任何疑问可联系在线客服,感谢各位用户对苦力吧素材的信任与厚爱,我们将一如既往的给大家上新更多优质的素材源码,祝大家开工大吉、工作顺利、心想事成。

jquery模拟终端代码输入输出动画打字特效

所属分类: 网页特效-动画效果    2024-01-28 03:44:27

jquery模拟终端代码输入输出动画打字特效 ie兼容6
 查看演示  登录后下载 温馨提示
登录会员即可享受免费下载
 我要建站

jquery模拟终端代码输入输出动画打字特效(共4个文件)

    • terminal-emulator.css
    • emulator.js
    • index.html
    • terminal-emulator.min.js

使用方法

let emulator;

function terminalEmulatorDOMReady() {
    // initiate
    emulator = new Emulator([
        new Command(
            new Input(
                new Keystroke("init", "white", 0)
            ),
            new Output([
                new Line([
                    new Keystroke("各位前端大神 ", "white", 0),
                    new Keystroke("欢迎访问苦力吧,", "white", 0),
                    new Keystroke("感谢大家一直以来, ", "green", 0),
                    new Keystroke("对于我们的支持, ", "blue", 0),
                    new Keystroke("THS", "red", 0),
                    new Keystroke("!!! ", "yellow", 0)
                ]), new Line([
                    new Keystroke("I am ", "magenta", 0),
                    new Keystroke("noot-noot ", "cyan", 0)
                ])
            ])
        ), new Command(
            new Input(
                new Keystroke("ls", "magenta", 0)
            ),
            new Output([
                new Line([
                    new Keystroke("css", "blue", 1),
                    new Keystroke("index.html", "white", 1),
                    new Keystroke("less", "blue", 0)
                ]), new Line([
                    new Keystroke("node_modules", "blue", 1),
                    new Keystroke("package.json", "white", 1)
                ]), new Line([
                    new Keystroke("node_modules", "blue", 1),
                    new Keystroke("package.json", "white", 1)
                ]), new Line([
                    new Keystroke("node_modules", "blue", 1),
                    new Keystroke("package.json", "white", 1)
                ]), new Line([
                    new Keystroke("node_modules", "blue", 1),
                    new Keystroke("package.json", "white", 1)
                ]), new Line([
                    new Keystroke("node_modules", "blue", 1),
                    new Keystroke("package.json", "white", 1)
                ]), new Line([
                    new Keystroke("node_modules", "blue", 1),
                    new Keystroke("package.json", "white", 1)
                ]), new Line([
                    new Keystroke("website", "blue", 1),
                    new Keystroke("js", "blue", 0)
                ])
            ])
        ), new Command(
            new Input(
                new Keystroke("init", "white", 0)
            ),
            new Output([
                new Line([
                    new Keystroke("goo d ", "white", 0),
                    new Keystroke("morning ", "white", 0),
                    new Keystroke("fellow ", "green", 0),
                    new Keystroke("internet ", "blue", 0),
                    new Keystroke("user", "red", 0),
                    new Keystroke("!!! ", "yellow", 0)
                ]), new Line([
                    new Keystroke("I am ", "magenta", 0),
                    new Keystroke("noot-noot ", "cyan", 0)
                ])
            ])
        )
    ], $("#emulator0"), "kuli8.com", "localhost", 160, 200);
    // hide by default
    $(".emulator-container .emulator").addClass("hidden");
    $(".emulator-container .emulator.hidden .command-container")
        .not(":last")
        .addClass("hidden");
    return 0;
}

function terminalEmulatorPageloaded() {
    // you have many options when deciding when to start emulation:

    /* SCROLLING - once emulator-container is in view
        note that this requires content to actually fill up more
        than the window's height */
    // $(window).scroll(emulatorBehaviour);

    // DELAY - simply wait for a bit
    setTimeout(emulatorBehaviour, 1500);

    /* ANYTHING ELSE - obviously, you can use whatever you fancy.
        if you're feeling particularly generous, you
        could add some implementation here and submit a pull request! */

    return 0;
}

// trigger handler example
function emulatorBehaviour() {
    // emulator animations
    $(".emulator-container .emulator.hidden").each(function () {
        if (elementInView($(this).parent())) {
            emulator.changeState();
            emulator.emulate(this);
        }
    });

    // helper function: determine whether a (DOM) Emulator is in view
    function elementInView(elem) {
        const docViewTop = $(window).scrollTop(); // distance to top of doc
        const docViewBottom = docViewTop + $(window).height();
        const elemTop = $(elem).offset().top; // distance to top of doc
        const elemHeight = $(elem).height();
        return docViewTop <= elemTop && docViewBottom >= elemTop + elemHeight;
    }
}

站长提示:
1. 苦力吧素材官方QQ群:950875342
2. 平台上所有素材资源,需注册登录会员方能正常下载。
3. 会员用户积极反馈网站、素材资源BUG或错误问题,每次奖励2K币
4. PHP源码类素材,如需协助安装调试,或你有二次开发需求,可联系苦力吧客服。
5. 付费素材资源,需充值后方能下载,如有任何疑问可直接联系苦力吧客服
相关资源 / 动画效果

CSS创建的文本文字颜色渐变动画特效

一款文字颜色渐变动画效果,循环的灯光照射动画在文本上连续移动渐变字体颜色,非常的引人夺目。
  动画效果
 8501  0

纯CSS创建的带有图标和文本文字的button按钮

图标使用了Font Awesome CSS,按钮有四种颜色,包括绿色、三叶草色、红色和深灰色。可设置自定义背景颜色和图标。
  动画效果
 4411  0

javascript动态循环显示文本文字特效

一款文本文字幻灯片动画特效,默认循环显示p标签文本短句,类似于文字幻灯片效果。
  动画效果
 4202  0

jquery提交表单给按钮添加加载动画特效

一款给按钮添加加载动画效果,表单填写完毕,点击提交发送按钮,会自动给按钮添加上加载动画。
  动画效果
 9152  0

评论数(0) 回复有机会获得K币 用户协议

^_^ 还没有人评论,快来抢个沙发!
😀
  • 😀
  • 😊
  • 😂
  • 😍
  • 😑
  • 😷
  • 😵
  • 😛
  • 😣
  • 😱
  • 😋
  • 😎
  • 😵
  • 😕
  • 😶
  • 😚
  • 😜
  • 😭
发表评论