v3 · 37 files

ProjectElly/content/block.html 12.2 KB Raw
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <!-- Tabler Icons -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@latest/dist/tabler-icons.min.css">
  <style>
    :root {
      --primary-color: #667eea;
      --danger-color: #ff4757;
      --success-color: #2ed573;
    }
    
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    
    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }
    
    .container {
      background: white;
      padding: 40px;
      border-radius: 20px;
      box-shadow: 0 20px 60px rgba(0,0,0,0.3);
      max-width: 500px;
      width: 100%;
      text-align: center;
    }
    
    .icon {
      font-size: 80px;
      margin-bottom: 20px;
      color: var(--danger-color);
      animation: bounce 2s infinite;
    }
    
    h1 {
      color: var(--danger-color);
      margin-bottom: 15px;
      font-size: 28px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
    }
    
    .message {
      color: #666;
      margin-bottom: 30px;
      line-height: 1.6;
      font-size: 16px;
    }
    
    .reason {
      background: #f8f9fa;
      padding: 15px;
      border-radius: 10px;
      margin: 20px 0;
      text-align: left;
      border-left: 4px solid var(--danger-color);
    }
    
    .reason-title {
      font-weight: bold;
      color: #333;
      margin-bottom: 5px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    
    .timer {
      font-size: 48px;
      font-weight: bold;
      color: var(--primary-color);
      margin: 20px 0;
      font-family: monospace;
    }
    
    .controls {
      display: flex;
      gap: 15px;
      margin-top: 30px;
    }
    
    button {
      flex: 1;
      padding: 15px;
      border: none;
      border-radius: 10px;
      font-size: 16px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
    }
    
    button:hover {
      transform: translateY(-2px);
      box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    }
    
    .btn-override {
      background: var(--success-color);
      color: white;
    }
    
    .btn-go-back {
      background: #f1f2f6;
      color: #333;
    }
    
    .pin-hint {
      font-size: 13px;
      color: #666;
      margin: 8px 0 12px;
      line-height: 1.4;
    }

    .pin-input {
      margin: 20px 0;
      text-align: center;
    }
    
    .pin-input .override-pin-entry {
      width: 100%;
      max-width: 280px;
      height: 52px;
      font-size: 20px;
      text-align: center;
      letter-spacing: 0.15em;
      border: 2px solid #ddd;
      border-radius: 10px;
      margin: 0 auto;
      display: block;
      font-weight: 600;
    }
    
    .pin-input .override-pin-entry:focus {
      outline: none;
      border-color: var(--primary-color);
      box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }
    
    .stats {
      display: flex;
      justify-content: space-around;
      margin-top: 30px;
      padding-top: 20px;
      border-top: 1px solid #eee;
    }
    
    .stat-item {
      text-align: center;
    }
    
    .stat-number {
      font-size: 24px;
      font-weight: bold;
      color: var(--primary-color);
    }
    
    .stat-label {
      font-size: 12px;
      color: #666;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
    }
    
    .custom-message {
      background: #fff9e6;
      padding: 15px;
      border-radius: 10px;
      margin: 20px 0;
      border-left: 4px solid #ffa502;
    }
    
    @keyframes bounce {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-10px); }
    }
    
    @keyframes pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.7; }
    }
    
    .pulse {
      animation: pulse 2s infinite;
    }
    
    /* Icon styling */
    .ti {
      font-size: 1.1em;
      vertical-align: middle;
    }

    /* ----- Theme: Light (default) ----- */
    body.theme-light {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    body.theme-light .container {
      background: white;
      color: #111;
    }
    body.theme-light .message,
    body.theme-light .stat-label {
      color: #666;
    }
    body.theme-light .reason {
      background: #f8f9fa;
    }
    body.theme-light .reason-title {
      color: #333;
    }
    body.theme-light .stats {
      border-top-color: #eee;
    }
    body.theme-light .btn-go-back {
      background: #f1f2f6;
      color: #333;
    }

    /* ----- Theme: Dark ----- */
    body.theme-dark {
      background: linear-gradient(145deg, #0f172a 0%, #1e1b4b 100%);
    }
    body.theme-dark .container {
      background: #1e293b;
      color: #f1f5f9;
      box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    }
    body.theme-dark .message {
      color: #94a3b8;
    }
    body.theme-dark h1 {
      color: #f87171;
    }
    body.theme-dark .reason {
      background: #0f172a;
      border-left-color: #f87171;
    }
    body.theme-dark .reason-title {
      color: #e2e8f0;
    }
    body.theme-dark #reasonText {
      color: #cbd5e1;
    }
    body.theme-dark .stats {
      border-top-color: #334155;
    }
    body.theme-dark .stat-label {
      color: #94a3b8;
    }
    body.theme-dark .btn-go-back {
      background: #334155;
      color: #f1f5f9;
    }
    body.theme-dark .pin-input input {
      background: #0f172a;
      border-color: #475569;
      color: #f8fafc;
    }
    body.theme-dark .custom-message {
      background: #422006;
      color: #fde68a;
      border-left-color: #f59e0b;
    }

    body.theme-dark .pin-hint {
      color: #94a3b8;
    }

    body.theme-dark .pin-input .override-pin-entry {
      background: #0f172a;
      border-color: #475569;
      color: #f8fafc;
    }

    /* ----- Theme: Blue ----- */
    body.theme-blue {
      background: linear-gradient(160deg, #0c4a6e 0%, #1d4ed8 45%, #312e81 100%);
    }
    body.theme-blue .container {
      background: rgba(255,255,255,0.97);
      color: #0f172a;
    }
    body.theme-blue .message {
      color: #475569;
    }
    body.theme-blue h1 {
      color: #1d4ed8;
    }
    body.theme-blue .reason {
      background: #eff6ff;
      border-left-color: #2563eb;
    }
    body.theme-blue .reason-title {
      color: #1e3a8a;
    }
    body.theme-blue .stats {
      border-top-color: #bfdbfe;
    }
    body.theme-blue .btn-go-back {
      background: #dbeafe;
      color: #1e40af;
    }

    body.theme-blue .pin-hint {
      color: #475569;
    }

    body.theme-blue .pin-input .override-pin-entry {
      border-color: #93c5fd;
    }

    /* PIN — always visible (no modal; avoids browser dialog / user-gesture issues) */
    .elly-pin-inline {
      margin: 24px 0 8px;
      padding: 20px 18px;
      border-radius: 16px;
      text-align: center;
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    }
    .elly-pin-inline h3 {
      margin: 0 0 0.5rem;
      font-size: 1.1rem;
      color: #333;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }
    .elly-pin-actions {
      display: flex;
      gap: 12px;
      margin-top: 16px;
      justify-content: center;
      flex-wrap: wrap;
    }
    .elly-pin-actions button {
      flex: 1;
      min-width: 120px;
    }
    body.theme-dark .elly-pin-inline {
      background: #0f172a;
      border-color: #334155;
      color: #f1f5f9;
    }
    body.theme-dark .elly-pin-inline h3 {
      color: #e2e8f0;
    }
    body.theme-dark .elly-pin-inline .pin-hint {
      color: #94a3b8;
    }
    body.theme-blue .elly-pin-inline {
      background: #eff6ff;
      border-color: #bfdbfe;
    }
    .elly-pin-inline.elly-pin-flash {
      outline: 3px solid #667eea;
      box-shadow: 0 0 0 6px rgba(102, 126, 234, 0.35);
      transition: box-shadow 0.2s ease, outline-color 0.2s ease;
    }

    body.theme-blue .elly-pin-inline h3 {
      color: #1e3a8a;
    }
  </style>
</head>
<body class="theme-light">
  <div class="container">
    <div class="icon">
      <i class="ti ti-shield-lock"></i>
    </div>
    <h1><i class="ti ti-ban"></i> Website Blocked By Elly</h1>
    
    <div class="message">
      This website has been blocked by Elly to help you stay focused and productive.
    </div>
    
    <div class="reason" id="blockReason">
      <div class="reason-title">
        <i class="ti ti-info-circle"></i> Reason:
      </div>
      <div id="reasonText">Loading...</div>
    </div>
    
    <div class="custom-message" id="customMessage" style="display: none;">
      <div id="customMessageText"></div>
    </div>
    
    <div class="timer" id="countdownTimer">
      <i class="ti ti-clock"></i> 00:00
    </div>

    <section class="elly-pin-inline" id="ellyPinSection" aria-labelledby="ellyPinTitle">
      <h3 id="ellyPinTitle"><i class="ti ti-key"></i> Parent override (15 min)</h3>
      <p class="pin-hint">Enter your parent PIN (8–12 digits). This site stays allowed for 15 minutes (new tabs and refreshes included).</p>
      <div class="pin-input">
        <input type="password" id="overridePinEntry" class="override-pin-entry" maxlength="12" minlength="8" inputmode="numeric" autocomplete="off" aria-label="Override PIN">
      </div>
      <div class="elly-pin-actions">
        <button type="button" id="ellyPinSubmit" class="btn-override">
          <i class="ti ti-check"></i> Submit PIN
        </button>
        <button type="button" id="ellyPinCancel" class="btn-go-back">
          <i class="ti ti-x"></i> Clear
        </button>
      </div>
    </section>
    
    <div class="controls">
      <button type="button" id="ellyBtnOverride" class="btn-override">
        <i class="ti ti-key"></i> Focus PIN field
      </button>
      <button type="button" id="ellyBtnGoBack" class="btn-go-back">
        <i class="ti ti-arrow-back"></i> Go Back
      </button>
    </div>
    
    <div class="stats">
      <div class="stat-item">
        <div class="stat-number" id="todayBlocks">0</div>
        <div class="stat-label">
          <i class="ti ti-shield-x"></i> Blocks Today
        </div>
      </div>
      <div class="stat-item">
        <div class="stat-number" id="timeSaved">0h</div>
        <div class="stat-label">
          <i class="ti ti-clock-check"></i> Time Saved
        </div>
      </div>
      <div class="stat-item">
        <div class="stat-number" id="productivity">0%</div>
        <div class="stat-label">
          <i class="ti ti-trending-up"></i> Productivity
        </div>
      </div>
    </div>
  </div>
  
  <script>
    (function applyBlockPageTheme() {
      function apply(settings) {
        var t = (settings && settings.theme) || 'light';
        if (t !== 'light' && t !== 'dark' && t !== 'blue') {
          t = 'light';
        }
        document.body.classList.remove('theme-light', 'theme-dark', 'theme-blue');
        document.body.classList.add('theme-' + t);
      }
      chrome.storage.sync.get(['settings'], function (r) {
        apply(r.settings || {});
      });
      chrome.storage.onChanged.addListener(function (changes, area) {
        if (area !== 'sync' || !changes.settings) {
          return;
        }
        chrome.storage.sync.get(['settings'], function (r2) {
          apply(r2.settings || {});
        });
      });
    })();
  </script>
  <!-- Classic script (not type=module): content.js is intentionally not an ES module. -->
  <script src="content.js"></script>
</body>
</html>