File size: 6,191 Bytes
ad1dcd6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<html><head><base href="https://websim.ai/socraticsage" /><title>Socratic Sage - Engaging Philosophical Dialogues</title><style>
    body {
        font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
        line-height: 1.6;
        color: #333;
        max-width: 800px;
        margin: 0 auto;
        padding: 20px;
        background-color: #f5f5f5;
    }
    h1, h2 {
        color: #2c3e50;
    }
    h1 {
        text-align: center;
        font-size: 2.5em;
        margin-bottom: 20px;
        border-bottom: 2px solid #2c3e50;
        padding-bottom: 10px;
    }
    .container {
        background-color: #fff;
        border-radius: 8px;
        padding: 30px;
        box-shadow: 0 0 20px rgba(0,0,0,0.1);
    }
    textarea, input[type="text"] {
        width: 100%;
        padding: 10px;
        margin-bottom: 20px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 16px;
    }
    button {
        background-color: #2c3e50;
        color: white;
        border: none;
        padding: 10px 20px;
        text-align: center;
        text-decoration: none;
        display: inline-block;
        font-size: 16px;
        margin: 4px 2px;
        cursor: pointer;
        border-radius: 4px;
        transition: background-color 0.3s;
    }
    button:hover {
        background-color: #34495e;
    }
    #dialogue {
        margin-top: 20px;
        padding: 20px;
        background-color: #f9f9f9;
        border-left: 5px solid #2c3e50;
        border-radius: 4px;
        max-height: 400px;
        overflow-y: auto;
    }
    .socrates, .user {
        margin-bottom: 15px;
        padding: 10px;
        border-radius: 4px;
    }
    .socrates {
        background-color: #e8f4f8;
    }
    .user {
        background-color: #f0f0f0;
        text-align: right;
    }
    .footer {
        margin-top: 30px;
        text-align: center;
        font-size: 0.9em;
        color: #7f8c8d;
    }
    #topicInput {
        margin-bottom: 10px;
    }
</style></head><body>
    <div class="container">
        <h1>Socratic Sage</h1>
        <p>Welcome to the Socratic Sage, where we engage in thought-provoking dialogues in the style of Socrates. Choose a topic, and let us embark on a journey of critical thinking and self-discovery through the art of questioning.</p>
        
        <h2>Choose Your Topic of Inquiry:</h2>
        <input type="text" id="topicInput" placeholder="Enter your topic here...">
        
        <button onclick="beginDialogue()">Begin Dialogue</button>
        
        <div id="dialogue"></div>
        
        <div id="userResponseArea" style="display:none;">
            <textarea id="userResponse" placeholder="Your thoughts..."></textarea>
            <button onclick="continueDialogue()">Respond</button>
        </div>
        
        <h2>The Socratic Method:</h2>
        <ul>
            <li>Encourages critical thinking and deeper understanding</li>
            <li>Challenges assumptions and preconceived notions</li>
            <li>Fosters intellectual curiosity and lifelong learning</li>
            <li>Develops reasoning and analytical skills</li>
            <li>Promotes self-reflection and personal growth</li>
        </ul>
    </div>
    
    <div class="footer">
        <p>© 2023 Socratic Sage | <a href="https://websim.ai/socraticsage/about">About</a> | <a href="https://websim.ai/socraticsage/contact">Contact</a></p>
    </div>

    <script>
        let dialogueHistory = [];
        let currentTopic = "";

        function beginDialogue() {
            currentTopic = document.getElementById('topicInput').value;
            dialogueHistory = [];
            const dialogueDiv = document.getElementById('dialogue');
            dialogueDiv.innerHTML = "";
            
            const initialQuestion = generateInitialQuestion(currentTopic);
            addToDialogue("Socrates", initialQuestion);
            
            document.getElementById('userResponseArea').style.display = 'block';
        }

        function continueDialogue() {
            const userResponse = document.getElementById('userResponse').value;
            addToDialogue("User", userResponse);
            
            const socratesResponse = generateSocraticResponse(userResponse);
            addToDialogue("Socrates", socratesResponse);
            
            document.getElementById('userResponse').value = "";
        }

        function addToDialogue(speaker, text) {
            const dialogueDiv = document.getElementById('dialogue');
            const newEntry = document.createElement('div');
            newEntry.className = speaker.toLowerCase();
            newEntry.innerHTML = `<strong>${speaker}:</strong> ${text}`;
            dialogueDiv.appendChild(newEntry);
            dialogueDiv.scrollTop = dialogueDiv.scrollHeight;
            
            dialogueHistory.push({speaker, text});
        }

        function generateInitialQuestion(topic) {
            const questions = [
                `What do you believe is the essence of ${topic}?`,
                `How would you define ${topic}?`,
                `What is your understanding of ${topic}?`,
                `In your view, what is the most important aspect of ${topic}?`,
                `How do you think ${topic} affects our lives?`
            ];
            return questions[Math.floor(Math.random() * questions.length)];
        }

        function generateSocraticResponse(userResponse) {
            const responses = [
                `Interesting perspective. But have you considered the opposite view? What if ${currentTopic} were actually...?`,
                `I see. And how did you come to this conclusion about ${currentTopic}?`,
                `That's a thoughtful answer. How might someone with a different background view ${currentTopic}?`,
                `Let's examine that further. What assumptions are we making about ${currentTopic}?`,
                `Indeed. And how does this understanding of ${currentTopic} align with your personal experiences?`
            ];
            return responses[Math.floor(Math.random() * responses.length)];
        }
    </script>
</body></html>