Waifu Tips Plugin

website·Indexed 31 days ago

https://blog.fyz666.xyz

Configuration data for the Waifu Tips plugin, featuring localized text strings for Live2D interactions, including mouseover events, time-based greetings, seasonal holiday messages, visibility changes, and clipboard copy actions.

Tokens
745
Snippets
5
Records
5
Agent score
6%

What's inside Waifu Tips

  1. Define time-based greetings for waifu-tips

    To implement dynamic greetings based on the user's local time, use the time array in the configuration. Each object requires an hour range (e.g., "6-7", "0-5") and a text value. The text value can be a single string or an array of strings for randomized selection.
    "time": [
      { "hour": "8-11", "text": "上午好!工作顺利嘛,不要久坐,多起来走动走动哦!" },
      { "hour": "0-5", "text": "你是夜猫子呀?这么晚还不睡觉,明天起的来嘛?" }
    ]
  2. Configure Live2D waifu-tips localized messages

    The waifu-tips plugin uses a JSON configuration to define localized text strings for various user interactions and time-based events. These strings support HTML tags (like <span>) for styling. The configuration is split into three main categories: date (seasonal/holiday messages), time (hour-specific greetings), and message (event-driven responses).
    {
      "date": [
        { "date": "12/20-12/31", "text": "这几天是<span>圣诞节</span>,主人肯定又去剁手买买买了~" }
      ],
      "time": [
        { "hour": "6-7", "text": "早上好!一日之计在于晨,美好的一天就要开始了~" },
        { "hour": "22-23", "text": ["已经这么晚了呀,早点休息吧,晚安~", "深夜时要爱护眼睛呀!"] }
      ],
      "message": {
        "default": ["嗨~快来逗我玩吧!", "记得把小家加入收藏夹哦!"],
        "console": "哈哈,你打开了控制台,是想要看看我的小秘密吗?",
        "copy": "你都复制了些什么呀,转载要记得加上出处哦!",
        "visibilitychange": "哇,你终于回来了~"
      }
    }
  3. Configure event-driven responses for waifu-tips

    The message object allows you to define specific responses for browser and user events:

    • default: A list of random messages displayed during general interactions.
    • console: Triggered when the user opens the browser developer tools (console).
    • copy: Triggered when the user performs a copy action (clipboard).
    • visibilitychange: Triggered when the user returns to the tab after it was hidden.
    "message": {
      "default": ["..."],
      "console": "Response when console opens",
      "copy": "Response when text is copied",
      "visibilitychange": "Response when tab is refocused"
    }
  4. Configure Live2D waifu tips mouseover and click interactions

    The waifu tips plugin uses a JSON configuration to trigger specific dialogue strings when a user interacts with elements on the page. The configuration is split into mouseover and click arrays, where each entry contains a CSS selector and an array of text strings. The plugin randomly selects one string from the array when the corresponding element is interacted with.
    {
      "mouseover": [
        {
          "selector": "#live2d",
          "text": ["Text option 1", "Text option 2"]
        },
        {
          "selector": ".menu-item-home a",
          "text": ["Go back to home page!"]
        }
      ],
      "click": [
        {
          "selector": "#live2d",
          "text": ["Why are you clicking me?"]
        }
      ]
    }
  5. Implement seasonal greetings in Live2D waifu tips

    The plugin supports a seasons configuration array to trigger specific messages based on the current date. Each object in the array requires a date (in MM/DD or MM/DD-MM/DD format) and the corresponding text to display. The {year} placeholder can be used to dynamically insert the current year.
    "seasons": [
      {
        "date": "01/01",
        "text": "Happy New Year! It is now {year}!"
      },
      {
        "date": "02/14",
        "text": "Happy Valentine's Day!"
      }
    ]