Spaces:
Running
Running
<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> |