PageSourceSearch

https://www.toddhobgood.com/content/themes/etna-interactive-site/src/js/cookie-disclosure.js?ver=1790982084

js toddhobgood.com collected 2026-10-04 13:29:33 UTC 4,610 bytes, 179 lines download raw bytes

1(function () {
2  function initCookieDisclosure() {
3    var cookieKey = "cookieDisclosureDismissed";
4    var expiresAt = 0;
5
6    if (document.getElementById("cookie-disclosure")) {
7      return;
8    }
9
10    try {
11      expiresAt = Number(localStorage.getItem(cookieKey)) || 0;
12    } catch (error) {}
13
14    if (expiresAt > Date.now()) {
15      return;
16    }
17
18    var style = document.createElement("style");
19
20    style.textContent = `
21      #cookie-disclosure {
22        position: fixed;
23        right: 16px;
24        bottom: 60px;
25        width: 360px;
26        max-width: calc(100vw - 32px);
27        padding: 20px;
28        background: #fff;
29        color: #454545;
30        border: 1px solid #e5e5e5;
31        border-radius: 12px;
32        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
33        font-family: Arial, sans-serif;
34        text-align: left;
35        z-index: 999999;
36        box-sizing: border-box;
37      }
38
39      #cookie-disclosure p {
40        margin: 0 0 10px;
41        padding: 0;
42        color: #454545;
43        font-family: Arial, sans-serif;
44        font-size: 13px !important;
45        font-weight: 400;
46        line-height: 1.55 !important;
47        letter-spacing: normal;
48        text-transform: none;
49      }
50
51      #cookie-disclosure .cookie-links {
52        display: flex;
53        align-items: stretch;
54        gap: 10px;
55        margin-top: 18px;
56      }
57
58      #cookie-disclosure .cookie-links a,
59      #cookie-disclosure .cookie-links button {
60        display: inline-flex;
61        align-items: center;
62        justify-content: center;
63        flex: 1;
64        width: auto;
65        min-height: 42px;
66        margin: 0;
67        padding: 10px 14px;
68        border: 1px solid #d8d8d8;
69        border-radius: 6px;
70        background: #fff;
71     color: #333;
72        font-family: Arial, sans-serif;
73        font-size: 12px !important;
74        font-weight: 600;
75        line-height: 1.2 !important;
76        letter-spacing: normal;
77        text-align: center;
78        text-decoration: none !important;
79        text-transform: none;
80        box-shadow: none;
81        box-sizing: border-box;
82        cursor: pointer;
83        appearance: none;
84        transition: background-color 0.2s, border-color 0.2s;
85      }
86
87      #cookie-disclosure .cookie-links a:hover {
88        background: #f5f5f5;
89        border-color: #bcbcbc;
90      }
91
92      #cookie-disclosure .cookie-links button {
93        background: #292929 ;
94        border-color: #292929;
95        color: #fff;
96      }
97
98      #cookie-disclosure .cookie-links button:hover {
99        background: #454545;
100        border-color: #454545;
101      }
102
103      #cookie-disclosure .cookie-links a:focus-visible,
104      #cookie-disclosure .cookie-links button:focus-visible {
105        outline: 2px solid #333;
106        outline-offset: 3px;
107      }
108
109      @media (max-width: 480px) {
110        #cookie-disclosure {
111          left: 12px;
112          right: 12px;
113          bottom: 60px;
114          width: auto;
115          max-width: none;
116          padding: 18px;
117        }
118      }
119
120      @media (prefers-reduced-motion: reduce) {
121        #cookie-disclosure .cookie-links a,
122        #cookie-disclosure .cookie-links button {
123          transition: none;
124        }
125      }
126    `;
127
128    var banner = document.createElement("div");
129
130    banner.id = "cookie-disclosure";
131    banner.setAttribute("role", "region");
132    banner.setAttribute("aria-label", "Cookie notice");
133
134    banner.innerHTML = `
135      <p>This website uses cookies and similar technologies. Some are necessary for the site to work. Others measure how visitors use the site and support our advertising.</p>
136
137      <p>Our Privacy Policy explains what we collect and how to control cookies in your browser.</p>
138
139      <div class="cookie-links">
140        <a
141          href="https://www.toddhobgood.com/privacy-policy/"
142          target="_blank"
143          rel="noopener"
144        >
145          Privacy Policy
146        </a>
147
148        <button type="button" id="cookie-dismiss">
149          Got it
150        </button>
151      </div>
152    `;
153
154    banner
155      .querySelector("#cookie-dismiss")
156      .addEventListener("click", function () {
157        banner.remove();
158        style.remove();
159
160        try {
161          localStorage.setItem(
162            cookieKey,
163            String(Date.now() + 365 * 24 * 60 * 60 * 1000),
164          );
165        } catch (error) {}
166      });
167
168    document.head.appendChild(style);
169    document.body.appendChild(banner);
170  }
171
172  if (document.readyState === "loading") {
173    document.addEventListener("DOMContentLoaded", initCookieDisclosure, {
174      once: true,
175    });
176  } else {
177    initCookieDisclosure();
178  }
179})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.