---
type: "Source File"
title: "<section class=\"hero hero-compact\">"
description: "{% extends \"base.html\" %} {% block title %}Instant Cope Analyser{% endblock %} {% block meta_description %}Paste any UK political statement or article URL and get an AI cope score. Measures denial, scapegoating, and."
resource: "https://uk.copecheck.com"
tags: ["copecheck", "uk", "source-file", "html"]
timestamp: "2026-05-04T20:10:43Z"
site: "uk"
source_path: "copecheck-uk/templates/analyser.html"
---

# <section class="hero hero-compact">

Source path: `copecheck-uk/templates/analyser.html`  
Index snapshot generated: `2026-11-24T13:42:54Z`  
File modified: `2026-05-04T20:10:43Z`

```html
{% extends "base.html" %}
{% block title %}Instant Cope Analyser{% endblock %}
{% block meta_description %}Paste any UK political statement or article URL and get an AI cope score. Measures denial, scapegoating, and reality-avoidance.{% endblock %}

{% block content %}
<section class="hero hero-compact">
    <div class="hero-inner">
        <h1 class="hero-title">Instant Cope Analyser</h1>
        <p class="hero-subtitle">
            Paste a quote, headline, article excerpt, or URL. We'll tell you how much cope it contains,
            who's being scapegoated, and what the data actually says.
        </p>
    </div>
</section>

<section class="analyser-section">
    <div class="analyser-input">
        <div class="input-tabs">
            <button class="input-tab active" data-mode="text" onclick="switchMode('text')">Paste Text</button>
            <button class="input-tab" data-mode="url" onclick="switchMode('url')">Paste URL</button>
        </div>

        <div id="text-mode">
            <textarea id="cope-input" placeholder="Paste a political quote, newspaper headline, or article excerpt here...

e.g. &quot;Net migration must come down to protect British workers and our public services.&quot;

e.g. &quot;The economy is fundamentally strong -- we just need to cut red tape and unleash growth.&quot;

e.g. &quot;If we taxed billionaires properly, all our problems would be solved.&quot;" maxlength="10000"></textarea>
        </div>

        <div id="url-mode" style="display:none">
            <input type="url" id="cope-url" placeholder="https://www.bbc.co.uk/news/..." class="url-input">
            <p class="url-hint">Paste a URL to a news article, opinion piece, or political statement. We'll extract the text and analyse it.</p>
        </div>

        <div class="input-footer">
            <span class="char-count"><span id="char-current">0</span> chars</span>
            <button id="analyse-btn" class="btn btn-primary" onclick="analyseCope()">
                <span class="btn-text">Analyse Cope</span>
                <span class="btn-loading" style="display:none">
                    <span class="spinner"></span> Detecting cope...
                </span>
            </button>
        </div>
    </div>

    <div id="result-panel" class="result-panel" style="display:none">
        <div id="url-extracted" class="url-extracted" style="display:none">
            <span class="extracted-label">Extracted from:</span>
            <span class="extracted-title" id="extracted-title"></span>
        </div>

        <div class="result-header">
            <div class="result-score-ring">
                <svg viewBox="0 0 120 120">
                    <circle cx="60" cy="60" r="54" class="ring-bg"/>
                    <circle cx="60" cy="60" r="54" class="ring-fill" id="score-ring"/>
                </svg>
                <span class="ring-score" id="result-score">0</span>
            </div>
            <div class="result-meta">
                <span class="result-verdict" id="result-verdict"></span>
                <span class="result-type" id="result-type"></span>
            </div>
        </div>

        <div class="result-block" id="scapegoat-block" style="display:none">
            <h3 class="result-block-title">
                <span class="block-icon">&#x1f3af;</span> Scapegoats Detected
            </h3>
            <div class="scapegoat-tags" id="scapegoat-tags"></div>
        </div>

        <div class="result-block">
            <h3 class="result-block-title">
                <span class="block-icon">&#x1f3d7;&#xfe0f;</span> The Structural Reality Being Avoided
            </h3>
            <p id="result-structural"></p>
        </div>

        <div class="result-block">
            <h3 class="result-block-title">
                <span class="block-icon">&#x1f4ca;</span> What the Data Actually Says
            </h3>
            <p id="result-data"></p>
        </div>

        <div class="result-block result-explanation">
            <h3 class="result-block-title">
                <span class="block-icon">&#x1f50d;</span> Analysis
            </h3>
            <p id="result-explanation"></p>
        </div>
    </div>

    <div id="error-panel" class="error-panel" style="display:none">
        <p id="error-text"></p>
    </div>

    {% if recent %}
    <div class="recent-analyses">
        <h3 class="recent-title">Recent Analyses</h3>
        {% for a in recent %}
        <a href="/analysis/{{ a.slug }}" class="recent-item">
            <span class="recent-score" style="color: {% if a.cope_score >= 75 %}#e63946{% elif a.cope_score >= 50 %}#f4a261{% else %}#2a9d8f{% endif %}">{{ a.cope_score }}</span>
            <span class="recent-text">{{ (a.extracted_title or a.input_text[:80]) }}{% if not a.extracted_title and a.input_text|length > 80 %}...{% endif %}</span>
            <span class="recent-verdict">{{ a.verdict }}</span>
        </a>
        {% endfor %}
    </div>
    {% endif %}
</section>
{% endblock %}

{% block scripts %}
<script>
let currentMode = 'text';

function switchMode(mode) {
    currentMode = mode;
    document.querySelectorAll('.input-tab').forEach(t => t.classList.remove('active'));
    document.querySelector(`[data-mode="${mode}"]`).classList.add('active');
    document.getElementById('text-mode').style.display = mode === 'text' ? '' : 'none';
    document.getElementById('url-mode').style.display = mode === 'url' ? '' : 'none';
}

const textarea = document.getElementById('cope-input');
const charCurrent = document.getElementById('char-current');

textarea.addEventListener('input', () => {
    charCurrent.textContent = textarea.value.length;

    // Auto-detect URL pasted into text field
    const val = textarea.value.trim();
    if (val.match(/^https?:\/\/\S+$/) && val.indexOf(' ') === -1) {
        document.getElementById('cope-url').value = val;
        switchMode('url');
        textarea.value = '';
    }
});

async function analyseCope() {
    let text;
    if (currentMode === 'url') {
        text = document.getElementById('cope-url').value.trim();
    } else {
        text = textarea.value.trim();
    }
    if (!text) return;

    const btn = document.getElementById('analyse-btn');
    const btnText = btn.querySelector('.btn-text');
    const btnLoading = btn.querySelector('.btn-loading');
    const resultPanel = document.getElementById('result-panel');
    const errorPanel = document.getElementById('error-panel');

    btnText.style.display = 'none';
    btnLoading.style.display = 'inline-flex';
    btn.disabled = true;
    resultPanel.style.display = 'none';
    errorPanel.style.display = 'none';

    try {
        const resp = await fetch('/api/analyse', {
            method: 'POST',
            headers: {'Content-Type': 'application/json'},
            body: JSON.stringify({text})
        });

        if (!resp.ok) {
            const err = await resp.json();
            throw new Error(err.error || 'Analysis failed');
        }

        const data = await resp.json();
        displayResult(data);
    } catch (e) {
        errorPanel.style.display = 'block';
        document.getElementById('error-text').textContent = e.message;
    } finally {
        btnText.style.display = 'inline';
        btnLoading.style.display = 'none';
        btn.disabled = false;
    }
}

function displayResult(data) {
    const panel = document.getElementById('result-panel');
    panel.style.display = 'block';

    // URL extracted title
    const urlBlock = document.getElementById('url-extracted');
    if (data.extracted_title) {
        urlBlock.style.display = 'block';
        document.getElementById('extracted-title').textContent = data.extracted_title;
    } else {
        urlBlock.style.display = 'none';
    }

    const score = data.cope_score || 0;
    document.getElementById('result-score').textContent = score;

    const ring = document.getElementById('score-ring');
    const circumference = 2 * Math.PI * 54;
    ring.style.strokeDasharray = circumference;
    ring.style.strokeDashoffset = circumference - (score / 100) * circumference;
    ring.style.stroke = score >= 90 ? '#e63946' : score >= 75 ? '#f4a261' : score >= 60 ? '#e9c46a' : '#2a9d8f';

    const verdict = document.getElementById('result-verdict');
    verdict.textContent = data.verdict || '';
    verdict.className = 'result-verdict verdict-' + (data.verdict || '').toLowerCase().replace(/\s/g, '-');

    document.getElementById('result-type').textContent = data.cope_type || '';

    const scapegoats = data.scapegoats_detected || [];
    const sgBlock = document.getElementById('scapegoat-block');
    const sgTags = document.getElementById('scapegoat-tags');
    if (scapegoats.length > 0) {
        sgBlock.style.display = 'block';
        sgTags.innerHTML = scapegoats.map(s =>
            `<span class="scapegoat-detected-tag">${s}</span>`
        ).join('');
    } else {
        sgBlock.style.display = 'none';
    }

    document.getElementById('result-structural').textContent = data.structural_reality || '';
    document.getElementById('result-data').textContent = data.what_data_says || '';
    document.getElementById('result-explanation').textContent = data.explanation || '';

    panel.scrollIntoView({behavior: 'smooth', block: 'start'});
}
</script>
{% endblock %}
```
