File size: 1,207 Bytes
c5cb52f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Prompt Details</title>
</head>
<body>
    <h1>Prompt Details</h1>
    <div id="prompt-container"></div>
    
    <script>
        const urlParams = new URLSearchParams(window.location.search);
        const promptId = urlParams.get('id');
        
        // Fetch the prompt data dynamically (you can modify this part based on how you are storing prompts)
        fetch('/prompt/prompt.json')  // Assuming prompts are stored in this file
            .then(response => response.json())
            .then(prompts => {
                const prompt = prompts.find(p => p.id === promptId);
                if (prompt) {
                    document.getElementById('prompt-container').innerHTML = `
                        <h2>Prompt ID: ${promptId}</h2>
                        <p><strong>Prompt:</strong> ${prompt.prompt.replace(/\n/g, '<br>')}</p>
                    `;
                } else {
                    document.getElementById('prompt-container').innerText = "Prompt not found.";
                }
            });
    </script>
</body>
</html>