File size: 14,383 Bytes
1f25474
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8c22d3c
 
 
 
 
 
 
1f25474
 
 
 
8c22d3c
 
1f25474
 
 
 
 
8c22d3c
 
1f25474
 
 
 
 
 
 
 
8c22d3c
 
 
 
1f25474
 
 
 
 
 
 
 
8c22d3c
1f25474
 
8c22d3c
 
 
 
 
1f25474
 
 
8c22d3c
 
1f25474
2f6f345
1f25474
 
8c22d3c
 
1f25474
 
8c22d3c
1f25474
 
8c22d3c
 
 
1f25474
 
8c22d3c
 
1f25474
8c22d3c
 
1f25474
 
 
8c22d3c
 
1f25474
8c22d3c
1f25474
8c22d3c
2f6f345
8c22d3c
1f25474
8c22d3c
1f25474
8c22d3c
1f25474
8c22d3c
2f6f345
8c22d3c
1f25474
 
8c22d3c
 
 
1f25474
 
8c22d3c
 
 
 
 
 
 
 
 
2f6f345
8c22d3c
1f25474
 
 
8c22d3c
 
1f25474
8c22d3c
 
f596037
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1f25474
 
 
 
 
 
 
f596037
8c22d3c
1f25474
 
 
 
 
 
 
 
f596037
 
8c22d3c
 
1f25474
 
 
f596037
 
 
 
 
 
 
 
1f25474
 
8c22d3c
1f25474
 
 
f596037
1f25474
f596037
 
1f25474
 
 
 
 
8c22d3c
1f25474
 
f596037
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1f25474
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Shingle Geek β€” Open Roofing Cost Data</title>
  <meta name="description" content="Open-source roofing cost transparency data for 400+ US cities. Independent pricing analysis by Shingle Geek.">
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link href="https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;700;800;900&display=swap" rel="stylesheet">
  <style>
    * { margin: 0; padding: 0; box-sizing: border-box; }

    :root {
      --accent: #ea5f1a;
      --accent-light: #ff7a3d;
      --bg: #0f1116;
      --bg-2: #181b22;
      --bg-3: #1e222b;
      --text: #e8e8e6;
      --text-2: #9a9a96;
      --card-border: #2a2e38;
      --line: #2a2e38;
    }

    body {
      font-family: 'Inter Tight', system-ui, sans-serif;
      background: var(--bg) !important;
      color: var(--text) !important;
      overflow-x: hidden;
    }

    /* ── Hero ─────────────────────────────────────────── */
    .hero {
      background: var(--bg);
      padding: 64px 24px 48px;
      text-align: center;
      position: relative;
      overflow: hidden;
    }

    .hero::before {
      content: '';
      position: absolute;
      top: -50%; left: -50%;
      width: 200%; height: 200%;
      background: radial-gradient(circle at 30% 50%, rgba(234,95,26,0.1) 0%, transparent 50%),
                  radial-gradient(circle at 70% 80%, rgba(234,95,26,0.06) 0%, transparent 40%);
      animation: pulse 8s ease-in-out infinite alternate;
    }

    @keyframes pulse {
      from { transform: scale(1) rotate(0deg); }
      to { transform: scale(1.05) rotate(2deg); }
    }

    .hero-content { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }

    .hero-badge {
      display: inline-flex; align-items: center; gap: 6px;
      background: rgba(234,95,26,0.15); border: 1px solid rgba(234,95,26,0.3);
      color: var(--accent-light); font-size: 12px; font-weight: 600;
      letter-spacing: 0.08em; text-transform: uppercase;
      padding: 6px 14px; border-radius: 100px; margin-bottom: 24px;
    }

    .hero h1 {
      font-size: clamp(32px, 5vw, 48px); font-weight: 900;
      letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 14px;
    }
    .hero h1 span { color: #ea5f1a !important; }

    .hero p {
      font-size: 16px; line-height: 1.6; color: var(--text-2);
      max-width: 500px; margin: 0 auto 28px;
    }

    .hero-links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

    .hero-links a {
      display: inline-flex; align-items: center; gap: 8px;
      padding: 12px 24px; border-radius: 10px; font-size: 14px;
      font-weight: 600; text-decoration: none; transition: all 0.2s ease;
    }

    .btn-primary { background: var(--accent); color: white; }
    .btn-primary:hover { background: var(--accent-light); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(234,95,26,0.3); }

    .btn-outline { background: transparent; color: var(--text); border: 1px solid var(--card-border); }
    .btn-outline:hover { border-color: var(--accent); background: rgba(234,95,26,0.05); transform: translateY(-2px); }

    /* ── Stats ─────────────────────────────────────────── */
    .stats {
      display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
      background: var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    }
    @media (max-width: 600px) { .stats { grid-template-columns: repeat(2, 1fr); } }

    .stat { background: var(--bg-2); padding: 24px 16px; text-align: center; }
    .stat-value { font-size: 30px; font-weight: 900; letter-spacing: -0.03em; color: #ea5f1a !important; line-height: 1; margin-bottom: 4px; }
    .stat-label { font-size: 12px; font-weight: 500; color: var(--text-2); }

    /* ── Table Section ─────────────────────────────────── */
    .section {
      max-width: 800px; margin: 0 auto; padding: 40px 24px;
    }
    .section h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
    .section h2 span { color: #ea5f1a !important; }
    .section-sub { font-size: 14px; color: var(--text-2); line-height: 1.6; margin-bottom: 20px; }

    .preview-table {
      width: 100%; border-collapse: collapse; font-size: 14px;
      background: var(--bg-3); border-radius: 12px; overflow: hidden;
      border: 1px solid var(--card-border);
    }
    .preview-table th {
      background: var(--bg-2); color: var(--text-2); padding: 10px 16px;
      text-align: left; font-weight: 600; font-size: 11px;
      letter-spacing: 0.06em; text-transform: uppercase;
    }
    .preview-table td { padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--text); }
    .preview-table tr:last-child td { border-bottom: none; }
    .preview-table tr:hover td { background: rgba(234,95,26,0.04); }
    .cost-fair { color: #4ade80; font-weight: 600; }
    .cost-markup { color: #f87171; font-weight: 600; }
    .preview-table a { color: #ea5f1a !important; text-decoration: none; font-weight: 500; }
    .preview-table a:hover { text-decoration: underline; }

    /* ── Footer ────────────────────────────────────────── */
    .footer {
      background: var(--bg-2); border-top: 1px solid var(--line);
      color: var(--text-2); text-align: center; padding: 24px; font-size: 13px;
    }
    .footer a { color: var(--accent-light); text-decoration: none; }
    .footer a:hover { text-decoration: underline; }

    /* ── Search Bar ────────────────────────────────────── */
    .search-container {
      margin-bottom: 24px;
      position: relative;
    }
    .search-input {
      width: 100%;
      padding: 14px 16px 14px 44px;
      background: var(--bg-3);
      border: 1px solid var(--card-border);
      border-radius: 10px;
      color: var(--text);
      font-family: inherit;
      font-size: 14px;
      outline: none;
      transition: all 0.2s ease;
      box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    .search-input:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(234, 95, 26, 0.15), 0 4px 12px rgba(0,0,0,0.15);
    }
    .search-input::placeholder {
      color: var(--text-2);
    }
    .search-input:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }
    .search-icon {
      position: absolute;
      left: 16px;
      top: 50%;
      transform: translateY(-50%);
      font-size: 16px;
      pointer-events: none;
      user-select: none;
    }
  </style>
</head>
<body>

  <div class="hero">
    <div class="hero-content">
      <div class="hero-badge">🏠 Open Data Initiative</div>
      <h1>See What Your Roof <span>Actually Costs</span></h1>
      <p>Independent, city-level roofing cost data β€” so homeowners can compare fair contractor pricing against inflated sales quotes.</p>
      <div class="hero-links">
        <a href="https://www.shinglegeek.com" class="btn-primary" target="_blank">🌐 Visit Shingle Geek</a>
        <a href="https://huggingface.co/datasets/ShingleGeek/roofing-cost-index" class="btn-outline" target="_blank">πŸ“Š Download Dataset</a>
      </div>
    </div>
  </div>

  <div class="stats">
    <div class="stat"><div class="stat-value" id="city-count">505</div><div class="stat-label">US Cities Tracked</div></div>
    <div class="stat"><div class="stat-value" id="state-count">50</div><div class="stat-label">States Covered</div></div>
    <div class="stat"><div class="stat-value">$0</div><div class="stat-label">Hidden Fees</div></div>
    <div class="stat"><div class="stat-value">Weekly</div><div class="stat-label">Data Refresh</div></div>
  </div>

  <div class="section">
    <h2>Dataset <span>Explorer</span></h2>
    <p class="section-sub">Fair contractor estimate vs. sales company price. Use the interactive search below to look up any tracked city.</p>
    
    <div class="search-container">
      <span class="search-icon">πŸ”</span>
      <input type="text" id="city-search" class="search-input" placeholder="Loading interactive search..." disabled>
    </div>

    <table class="preview-table">
      <thead>
        <tr><th>City</th><th>State</th><th>Fair Estimate</th><th>Sales Price</th><th>Source</th></tr>
      </thead>
      <tbody>
        <tr><td>Houston</td><td>TX</td><td class="cost-fair">$11,900</td><td class="cost-markup">$15,470</td><td><a href="https://www.shinglegeek.com/cost/houston-tx" target="_blank">View β†’</a></td></tr>
        <tr><td>Nashville</td><td>TN</td><td class="cost-fair">$11,900</td><td class="cost-markup">$15,470</td><td><a href="https://www.shinglegeek.com/cost/nashville-tn" target="_blank">View β†’</a></td></tr>
        <tr><td>Beverly Hills</td><td>CA</td><td class="cost-fair">$12,100</td><td class="cost-markup">$15,730</td><td><a href="https://www.shinglegeek.com/cost/beverly-hills-ca" target="_blank">View β†’</a></td></tr>
        <tr><td>Kirkland</td><td>WA</td><td class="cost-fair">$10,750</td><td class="cost-markup">$13,975</td><td><a href="https://www.shinglegeek.com/cost/kirkland-wa" target="_blank">View β†’</a></td></tr>
        <tr><td>Naples</td><td>FL</td><td class="cost-fair">$11,900</td><td class="cost-markup">$15,470</td><td><a href="https://www.shinglegeek.com/cost/naples-fl" target="_blank">View β†’</a></td></tr>
      </tbody>
    </table>
  </div>

  <div class="footer">
    <p>Β© 2026 <a href="https://www.shinglegeek.com" target="_blank">Shingle Geek</a> Β· CC BY 4.0 Β· JSONL + CSV formats available</p>
  </div>

  <script>
    let allCities = [];
    const defaultCities = [
      { city: 'Houston', state: 'TX', fairEstimate: 11900, salesEstimate: 15470, slug: 'houston-tx' },
      { city: 'Nashville', state: 'TN', fairEstimate: 11900, salesEstimate: 15470, slug: 'nashville-tn' },
      { city: 'Beverly Hills', state: 'CA', fairEstimate: 12100, salesEstimate: 15730, slug: 'beverly-hills-ca' },
      { city: 'Kirkland', state: 'WA', fairEstimate: 10750, salesEstimate: 13975, slug: 'kirkland-wa' },
      { city: 'Naples', state: 'FL', fairEstimate: 11900, salesEstimate: 15470, slug: 'naples-fl' }
    ];

    async function initDynamicData() {
      const searchInput = document.getElementById('city-search');
      const cityCountEl = document.getElementById('city-count');
      const stateCountEl = document.getElementById('state-count');

      try {
        const csvUrl = 'https://huggingface.co/datasets/ShingleGeek/roofing-cost-index/resolve/main/roofing_cost_index_2026.csv';
        const response = await fetch(csvUrl);
        if (!response.ok) throw new Error('Failed to fetch dataset');
        const csvText = await response.text();

        const lines = csvText.split('\n');
        const parsedData = [];
        const uniqueStates = new Set();

        for (let i = 1; i < lines.length; i++) {
          const line = lines[i].trim();
          if (!line) continue;
          const parts = line.split(',');
          if (parts.length >= 5) {
            const city = parts[0].replace(/"/g, '').trim();
            const state = parts[1].replace(/"/g, '').trim();
            const fairEstimate = parseInt(parts[2].trim(), 10);
            const salesEstimate = parseInt(parts[3].trim(), 10);
            const sourceUrl = parts.slice(4).join(',').replace(/"/g, '').trim();
            const slug = sourceUrl.split('/').pop();

            if (city && state && !isNaN(fairEstimate)) {
              parsedData.push({ city, state, fairEstimate, salesEstimate, slug });
              uniqueStates.add(state);
            }
          }
        }

        if (parsedData.length > 0) {
          allCities = parsedData;
          cityCountEl.textContent = allCities.length;
          stateCountEl.textContent = uniqueStates.size;
          
          searchInput.placeholder = `πŸ” Search ${allCities.length} cities...`;
          searchInput.disabled = false;
        }
      } catch (error) {
        console.warn('Falling back to static defaults:', error);
        searchInput.placeholder = 'πŸ” Search 500+ cities...';
        searchInput.disabled = false; // keep search enabled but we will search locally compiled defaults or show warning
      }
    }

    function handleSearch(e) {
      const query = e.target.value.toLowerCase().trim();
      const dataset = allCities.length > 0 ? allCities : defaultCities;
      
      if (!query) {
        renderRows(defaultCities);
        return;
      }

      const filtered = dataset.filter(c => 
        c.city.toLowerCase().includes(query) || 
        c.state.toLowerCase() === query
      );

      renderRows(filtered.slice(0, 10), query, filtered.length);
    }

    function renderRows(items, query = '', totalCount = 0) {
      const tableBody = document.querySelector('.preview-table tbody');
      if (items.length === 0) {
        tableBody.innerHTML = `<tr><td colspan="5" style="text-align: center; color: var(--text-2); padding: 32px 16px;">No cities found matching "${query}"</td></tr>`;
        return;
      }

      let html = '';
      items.forEach(item => {
        html += `<tr>
          <td>${item.city}</td>
          <td>${item.state}</td>
          <td class="cost-fair">$${item.fairEstimate.toLocaleString()}</td>
          <td class="cost-markup">$${item.salesEstimate.toLocaleString()}</td>
          <td><a href="https://www.shinglegeek.com/cost/${item.slug}" target="_blank">View β†’</a></td>
        </tr>`;
      });

      if (totalCount > 10) {
        html += `<tr><td colspan="5" style="text-align: center; color: var(--text-2); font-size: 12px; padding: 12px; border-top: 1px solid var(--line);">Showing top 10 of ${totalCount} matching cities.</td></tr>`;
      }
      
      tableBody.innerHTML = html;
    }

    document.getElementById('city-search').addEventListener('input', handleSearch);
    window.addEventListener('DOMContentLoaded', initDynamicData);
  </script>
</body>
</html>