码桶

发现社区成员的开源项目

main
popup.html2.7 KB
<!DOCTYPE html>
<!--
  超链新标签页打开 (Open Links in New Tab)
  作者:白逸 | 官网:https://imxcy.cn
  Copyright (c) 白逸. All rights reserved.
-->
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <style>
    * { margin: 0; padding: 0; box-sizing: border-box; }
    :root {
      --accent: #4285f4;
      --text: #202124;
      --muted: #5f6368;
      --border: #e0e0e0;
    }
    body {
      width: 240px;
      font-family: "Microsoft YaHei", system-ui, -apple-system, sans-serif;
      padding: 18px 20px;
      color: var(--text);
      background: #fff;
    }
    .header {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 16px;
    }
    .header .dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--muted);
      transition: background 0.25s;
    }
    .header .dot.on { background: var(--accent); }
    .title {
      font-size: 14px;
      font-weight: 600;
    }
    .row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 0;
    }
    .row-label { font-size: 13px; color: var(--text); }
    .status { font-size: 12px; color: var(--muted); }
    .switch {
      position: relative;
      display: inline-block;
      width: 46px;
      height: 26px;
      flex: none;
    }
    .switch input { opacity: 0; width: 0; height: 0; }
    .slider {
      position: absolute;
      cursor: pointer;
      inset: 0;
      background: #ccc;
      border-radius: 26px;
      transition: 0.25s;
    }
    .slider:before {
      content: "";
      position: absolute;
      height: 20px; width: 20px;
      left: 3px; bottom: 3px;
      background: #fff;
      border-radius: 50%;
      transition: 0.25s;
    }
    input:checked + .slider { background: var(--accent); }
    input:checked + .slider:before { transform: translateX(20px); }
    .footer {
      margin-top: 14px;
      padding-top: 12px;
      border-top: 1px solid var(--border);
      font-size: 11px;
      color: var(--muted);
      text-align: center;
    }
    .footer a { color: var(--muted); text-decoration: none; }
    .footer a:hover { color: var(--accent); }
  </style>
</head>
<body>
  <div class="header">
    <span class="dot" id="dot"></span>
    <span class="title">超链新标签页打开</span>
  </div>
  <div class="row">
    <span class="row-label">强制新标签页打开</span>
    <label class="switch">
      <input type="checkbox" id="toggle">
      <span class="slider"></span>
    </label>
  </div>
  <div class="status" id="status"></div>
  <div class="footer">
    作者 白逸 | <a href="https://imxcy.cn" target="_blank" rel="noopener noreferrer">imxcy.cn</a>
  </div>
  <script src="popup.js"></script>
</body>
</html>