Spaces:
Running
Running
A single-page website where users type a personal thought. When they click ‘Understand Me’, the site displays 3 interpretations: Rational, Emotional, and Poetic. These are generated using keyword-matching, emotion categories, and random combinations of prewritten responses in JavaScript. No backend, no AI, no data leaves the browser. Optional ambient background music and slow fade-in for drama. - Initial Deployment
Browse files- README.md +7 -5
- index.html +404 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: interpretor
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: yellow
|
| 5 |
+
colorTo: pink
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,404 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Thought Interpreter</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<style>
|
| 10 |
+
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Roboto:wght@300;400;700&display=swap');
|
| 11 |
+
|
| 12 |
+
body {
|
| 13 |
+
font-family: 'Roboto', sans-serif;
|
| 14 |
+
background-color: #f8f9fa;
|
| 15 |
+
color: #333;
|
| 16 |
+
transition: background-color 0.5s ease;
|
| 17 |
+
min-height: 100vh;
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
.title-font {
|
| 21 |
+
font-family: 'Playfair Display', serif;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
.fade-in {
|
| 25 |
+
animation: fadeIn 1.5s ease-in;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
@keyframes fadeIn {
|
| 29 |
+
from { opacity: 0; }
|
| 30 |
+
to { opacity: 1; }
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
.interpretation-card {
|
| 34 |
+
transition: all 0.3s ease;
|
| 35 |
+
transform: translateY(20px);
|
| 36 |
+
opacity: 0;
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
.interpretation-card.show {
|
| 40 |
+
transform: translateY(0);
|
| 41 |
+
opacity: 1;
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
.music-control {
|
| 45 |
+
transition: all 0.3s ease;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
.music-control:hover {
|
| 49 |
+
transform: scale(1.1);
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
textarea {
|
| 53 |
+
resize: none;
|
| 54 |
+
min-height: 120px;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
.bg-gradient {
|
| 58 |
+
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
|
| 59 |
+
}
|
| 60 |
+
</style>
|
| 61 |
+
</head>
|
| 62 |
+
<body class="bg-gradient">
|
| 63 |
+
<div class="container mx-auto px-4 py-8 max-w-4xl">
|
| 64 |
+
<!-- Header -->
|
| 65 |
+
<header class="text-center mb-12 fade-in">
|
| 66 |
+
<h1 class="title-font text-4xl md:text-5xl font-bold text-gray-800 mb-4">Thought Interpreter</h1>
|
| 67 |
+
<p class="text-lg text-gray-600">Share your thought and discover its hidden dimensions</p>
|
| 68 |
+
|
| 69 |
+
<!-- Music Control -->
|
| 70 |
+
<div class="mt-6 flex justify-center items-center space-x-4">
|
| 71 |
+
<button id="musicToggle" class="music-control bg-white p-3 rounded-full shadow-md hover:shadow-lg">
|
| 72 |
+
<i class="fas fa-music text-purple-600"></i>
|
| 73 |
+
</button>
|
| 74 |
+
<span id="musicStatus" class="text-sm text-gray-600">Background music: Off</span>
|
| 75 |
+
<audio id="ambientMusic" loop>
|
| 76 |
+
<source src="https://assets.mixkit.co/music/preview/mixkit-forest-flow-1380.mp3" type="audio/mpeg">
|
| 77 |
+
</audio>
|
| 78 |
+
</div>
|
| 79 |
+
</header>
|
| 80 |
+
|
| 81 |
+
<!-- Main Content -->
|
| 82 |
+
<main>
|
| 83 |
+
<!-- Input Section -->
|
| 84 |
+
<section class="mb-12 fade-in">
|
| 85 |
+
<div class="bg-white rounded-xl shadow-md p-6 md:p-8">
|
| 86 |
+
<h2 class="title-font text-2xl font-semibold text-gray-800 mb-4">What's on your mind?</h2>
|
| 87 |
+
<textarea id="thoughtInput" class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent" placeholder="Type your thought here..."></textarea>
|
| 88 |
+
<div class="flex justify-between items-center mt-4">
|
| 89 |
+
<span id="charCount" class="text-sm text-gray-500">0/200 characters</span>
|
| 90 |
+
<button id="interpretBtn" class="px-6 py-2 bg-purple-600 text-white rounded-lg hover:bg-purple-700 transition duration-300 disabled:opacity-50 disabled:cursor-not-allowed" disabled>
|
| 91 |
+
Understand Me
|
| 92 |
+
</button>
|
| 93 |
+
</div>
|
| 94 |
+
</div>
|
| 95 |
+
</section>
|
| 96 |
+
|
| 97 |
+
<!-- Results Section (Initially Hidden) -->
|
| 98 |
+
<section id="resultsSection" class="hidden">
|
| 99 |
+
<h2 class="title-font text-2xl md:text-3xl font-semibold text-gray-800 mb-6 text-center">Your Thought Interpreted</h2>
|
| 100 |
+
|
| 101 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
|
| 102 |
+
<!-- Rational Interpretation -->
|
| 103 |
+
<div id="rationalCard" class="interpretation-card bg-white rounded-xl shadow-md p-6 border-t-4 border-blue-500">
|
| 104 |
+
<div class="flex items-center mb-4">
|
| 105 |
+
<div class="bg-blue-100 p-3 rounded-full mr-3">
|
| 106 |
+
<i class="fas fa-brain text-blue-600"></i>
|
| 107 |
+
</div>
|
| 108 |
+
<h3 class="title-font text-xl font-semibold text-gray-800">Rational</h3>
|
| 109 |
+
</div>
|
| 110 |
+
<p id="rationalText" class="text-gray-700">Your logical interpretation will appear here...</p>
|
| 111 |
+
</div>
|
| 112 |
+
|
| 113 |
+
<!-- Emotional Interpretation -->
|
| 114 |
+
<div id="emotionalCard" class="interpretation-card bg-white rounded-xl shadow-md p-6 border-t-4 border-red-500">
|
| 115 |
+
<div class="flex items-center mb-4">
|
| 116 |
+
<div class="bg-red-100 p-3 rounded-full mr-3">
|
| 117 |
+
<i class="fas fa-heart text-red-600"></i>
|
| 118 |
+
</div>
|
| 119 |
+
<h3 class="title-font text-xl font-semibold text-gray-800">Emotional</h3>
|
| 120 |
+
</div>
|
| 121 |
+
<p id="emotionalText" class="text-gray-700">Your emotional interpretation will appear here...</p>
|
| 122 |
+
</div>
|
| 123 |
+
|
| 124 |
+
<!-- Poetic Interpretation -->
|
| 125 |
+
<div id="poeticCard" class="interpretation-card bg-white rounded-xl shadow-md p-6 border-t-4 border-yellow-500">
|
| 126 |
+
<div class="flex items-center mb-4">
|
| 127 |
+
<div class="bg-yellow-100 p-3 rounded-full mr-3">
|
| 128 |
+
<i class="fas fa-feather-alt text-yellow-600"></i>
|
| 129 |
+
</div>
|
| 130 |
+
<h3 class="title-font text-xl font-semibold text-gray-800">Poetic</h3>
|
| 131 |
+
</div>
|
| 132 |
+
<p id="poeticText" class="text-gray-700">Your poetic interpretation will appear here...</p>
|
| 133 |
+
</div>
|
| 134 |
+
</div>
|
| 135 |
+
|
| 136 |
+
<div class="text-center mt-8">
|
| 137 |
+
<button id="resetBtn" class="px-6 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300 transition duration-300">
|
| 138 |
+
Start Over
|
| 139 |
+
</button>
|
| 140 |
+
</div>
|
| 141 |
+
</section>
|
| 142 |
+
</main>
|
| 143 |
+
|
| 144 |
+
<!-- Footer -->
|
| 145 |
+
<footer class="text-center mt-16 text-sm text-gray-500 fade-in">
|
| 146 |
+
<p>All interpretations are generated in your browser. No data is collected or stored.</p>
|
| 147 |
+
<p class="mt-2">© 2023 Thought Interpreter</p>
|
| 148 |
+
</footer>
|
| 149 |
+
</div>
|
| 150 |
+
|
| 151 |
+
<script>
|
| 152 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 153 |
+
// DOM Elements
|
| 154 |
+
const thoughtInput = document.getElementById('thoughtInput');
|
| 155 |
+
const interpretBtn = document.getElementById('interpretBtn');
|
| 156 |
+
const charCount = document.getElementById('charCount');
|
| 157 |
+
const resultsSection = document.getElementById('resultsSection');
|
| 158 |
+
const rationalText = document.getElementById('rationalText');
|
| 159 |
+
const emotionalText = document.getElementById('emotionalText');
|
| 160 |
+
const poeticText = document.getElementById('poeticText');
|
| 161 |
+
const resetBtn = document.getElementById('resetBtn');
|
| 162 |
+
const musicToggle = document.getElementById('musicToggle');
|
| 163 |
+
const musicStatus = document.getElementById('musicStatus');
|
| 164 |
+
const ambientMusic = document.getElementById('ambientMusic');
|
| 165 |
+
|
| 166 |
+
// Interpretation databases
|
| 167 |
+
const rationalResponses = {
|
| 168 |
+
keywords: {
|
| 169 |
+
'work': ["This seems to be related to productivity and career aspirations.", "Work-related thoughts often stem from a desire for achievement or security.", "Professional concerns typically involve weighing costs and benefits."],
|
| 170 |
+
'love': ["Romantic considerations involve complex social and biological factors.", "Relationships can be analyzed through attachment theory frameworks.", "Love is a powerful motivator with measurable psychological effects."],
|
| 171 |
+
'future': ["Future-oriented thinking engages the prefrontal cortex's planning functions.", "Anticipating outcomes is a key survival mechanism in humans.", "Projection into the future involves probabilistic reasoning."],
|
| 172 |
+
'past': ["Nostalgia activates the brain's memory consolidation pathways.", "Reflection on past events helps with pattern recognition.", "Historical analysis can inform present decision-making."],
|
| 173 |
+
'money': ["Financial considerations trigger risk-assessment neural pathways.", "Economic decisions involve opportunity cost calculations.", "Monetary concerns often relate to Maslow's hierarchy of needs."],
|
| 174 |
+
'family': ["Kin relationships are fundamental to human social structures.", "Family dynamics follow established psychological patterns.", "Genetic and environmental factors shape familial bonds."],
|
| 175 |
+
'friend': ["Friendship satisfies the human need for social connection.", "Peer relationships follow reciprocity principles.", "Social bonds have measurable health benefits."],
|
| 176 |
+
'time': ["Time perception is a complex neurological phenomenon.", "Temporal concerns relate to resource allocation strategies.", "Chronological thinking is uniquely human."],
|
| 177 |
+
'dream': ["Dream analysis reveals subconscious processing mechanisms.", "Sleep states facilitate memory consolidation.", "Aspirations follow goal-setting theory principles."],
|
| 178 |
+
'change': ["Change management involves cognitive adaptation processes.", "Transition periods activate stress response systems.", "Neurological plasticity enables behavioral modification."]
|
| 179 |
+
},
|
| 180 |
+
generic: [
|
| 181 |
+
"From a logical perspective, this thought appears to be about fundamental human needs.",
|
| 182 |
+
"Rational analysis suggests this relates to basic decision-making processes.",
|
| 183 |
+
"This seems to involve cognitive processes common to most individuals.",
|
| 184 |
+
"A systematic approach would examine this through established psychological frameworks.",
|
| 185 |
+
"Objectively speaking, this thought pattern follows predictable neural pathways."
|
| 186 |
+
]
|
| 187 |
+
};
|
| 188 |
+
|
| 189 |
+
const emotionalResponses = {
|
| 190 |
+
emotions: {
|
| 191 |
+
'happy': ["Your joy radiates from this thought like sunshine!", "This happiness speaks to your fulfilled spirit.", "What a beautiful expression of contentment!"],
|
| 192 |
+
'sad': ["This sorrow weighs heavy on your heart.", "Your pain is valid and understandable.", "Grief moves through you like a slow river."],
|
| 193 |
+
'angry': ["This fury burns with righteous energy!", "Your anger points to something that needs to change.", "Strong emotions demand to be heard."],
|
| 194 |
+
'fear': ["This anxiety wraps around you like fog.", "Your fear protects you, but don't let it control you.", "Uncertainty can be terrifying, but also transformative."],
|
| 195 |
+
'love': ["Your heart overflows with tender affection!", "This love connects you to something greater.", "What a powerful expression of connection!"],
|
| 196 |
+
'confused': ["This uncertainty leaves you feeling untethered.", "Not knowing can be its own kind of wisdom.", "The maze of your mind has many turns."],
|
| 197 |
+
'hopeful': ["Your optimism shines like a beacon!", "This hope carries the seeds of possibility.", "What wonderful anticipation fills your spirit!"],
|
| 198 |
+
'lonely': ["This isolation feels vast and empty.", "Your longing for connection is deeply human.", "Even in solitude, you're part of something larger."],
|
| 199 |
+
'excited': ["Your enthusiasm bubbles over with energy!", "This thrill courses through you like electricity!", "What vibrant anticipation you're experiencing!"],
|
| 200 |
+
'peaceful': ["This serenity flows through you like calm water.", "Your tranquility is a rare and precious gift.", "What beautiful stillness you've found."]
|
| 201 |
+
},
|
| 202 |
+
generic: [
|
| 203 |
+
"This touches something deep within your emotional core.",
|
| 204 |
+
"Your feelings about this are valid and important.",
|
| 205 |
+
"This thought carries significant emotional weight.",
|
| 206 |
+
"There's profound feeling behind these words.",
|
| 207 |
+
"Emotionally, this resonates on multiple levels."
|
| 208 |
+
]
|
| 209 |
+
};
|
| 210 |
+
|
| 211 |
+
const poeticResponses = {
|
| 212 |
+
fragments: {
|
| 213 |
+
start: [
|
| 214 |
+
"Like a whisper of dawn,",
|
| 215 |
+
"As autumn leaves dancing,",
|
| 216 |
+
"With the patience of mountains,",
|
| 217 |
+
"Like a river carving stone,",
|
| 218 |
+
"As stars tracing ancient paths,",
|
| 219 |
+
"With the fragility of spider's silk,",
|
| 220 |
+
"Like fire transforming all it touches,",
|
| 221 |
+
"As tides obeying the moon's call,",
|
| 222 |
+
"With the persistence of roots through rock,",
|
| 223 |
+
"Like a melody half-remembered,"
|
| 224 |
+
],
|
| 225 |
+
middle: [
|
| 226 |
+
"your thought lingers",
|
| 227 |
+
"your words take flight",
|
| 228 |
+
"the meaning unfolds",
|
| 229 |
+
"truth reveals itself",
|
| 230 |
+
"understanding blossoms",
|
| 231 |
+
"the heart responds",
|
| 232 |
+
"silence speaks volumes",
|
| 233 |
+
"light finds its way",
|
| 234 |
+
"shadows grow shorter",
|
| 235 |
+
"time stands still"
|
| 236 |
+
],
|
| 237 |
+
end: [
|
| 238 |
+
"in the garden of the mind.",
|
| 239 |
+
"between what is and what could be.",
|
| 240 |
+
"where all rivers meet the sea.",
|
| 241 |
+
"as the world turns toward morning.",
|
| 242 |
+
"in the space between breaths.",
|
| 243 |
+
"while the universe listens.",
|
| 244 |
+
"beneath the surface of things.",
|
| 245 |
+
"where endings become beginnings.",
|
| 246 |
+
"as the veil grows thin.",
|
| 247 |
+
"in the language of the soul."
|
| 248 |
+
]
|
| 249 |
+
},
|
| 250 |
+
full: [
|
| 251 |
+
"Your thought is a feather drifting on the wind of consciousness.",
|
| 252 |
+
"These words form constellations in the night sky of your mind.",
|
| 253 |
+
"Like raindrops on a pond, your idea ripples outward.",
|
| 254 |
+
"This is the song your heart sings when no one is listening.",
|
| 255 |
+
"Your thought blooms like a flower in the desert after rain.",
|
| 256 |
+
"These words are footprints in the sand of your psyche.",
|
| 257 |
+
"Like a key turning in a long-forgotten lock, your idea opens doors.",
|
| 258 |
+
"Your thought is a bridge between worlds seen and unseen.",
|
| 259 |
+
"This is the color of your mind at this exact moment.",
|
| 260 |
+
"Your words weave tapestries in the loom of understanding."
|
| 261 |
+
]
|
| 262 |
+
};
|
| 263 |
+
|
| 264 |
+
// Emotion detection words
|
| 265 |
+
const emotionWords = {
|
| 266 |
+
'happy': ['happy', 'joy', 'delight', 'pleasure', 'cheer', 'glad', 'content'],
|
| 267 |
+
'sad': ['sad', 'grief', 'sorrow', 'mourn', 'heartbreak', 'melancholy', 'blue'],
|
| 268 |
+
'angry': ['angry', 'mad', 'fury', 'rage', 'irritated', 'frustrated', 'annoyed'],
|
| 269 |
+
'fear': ['fear', 'scared', 'afraid', 'anxious', 'worried', 'nervous', 'terror'],
|
| 270 |
+
'love': ['love', 'adore', 'cherish', 'passion', 'affection', 'devotion', 'romance'],
|
| 271 |
+
'confused': ['confused', 'uncertain', 'doubt', 'puzzled', 'bewildered', 'perplexed', 'mystified'],
|
| 272 |
+
'hopeful': ['hope', 'optimistic', 'expect', 'anticipate', 'wish', 'faith', 'confidence'],
|
| 273 |
+
'lonely': ['lonely', 'alone', 'isolated', 'abandoned', 'forsaken', 'solitary', 'detached'],
|
| 274 |
+
'excited': ['excited', 'thrilled', 'eager', 'enthused', 'pumped', 'elated', 'animated'],
|
| 275 |
+
'peaceful': ['peace', 'calm', 'serene', 'tranquil', 'relaxed', 'placid', 'composed']
|
| 276 |
+
};
|
| 277 |
+
|
| 278 |
+
// Music control
|
| 279 |
+
let musicPlaying = false;
|
| 280 |
+
musicToggle.addEventListener('click', function() {
|
| 281 |
+
if (musicPlaying) {
|
| 282 |
+
ambientMusic.pause();
|
| 283 |
+
musicStatus.textContent = 'Background music: Off';
|
| 284 |
+
musicToggle.innerHTML = '<i class="fas fa-music text-purple-600"></i>';
|
| 285 |
+
} else {
|
| 286 |
+
ambientMusic.play();
|
| 287 |
+
musicStatus.textContent = 'Background music: On';
|
| 288 |
+
musicToggle.innerHTML = '<i class="fas fa-pause text-purple-600"></i>';
|
| 289 |
+
}
|
| 290 |
+
musicPlaying = !musicPlaying;
|
| 291 |
+
});
|
| 292 |
+
|
| 293 |
+
// Character count and button enable/disable
|
| 294 |
+
thoughtInput.addEventListener('input', function() {
|
| 295 |
+
const count = this.value.length;
|
| 296 |
+
charCount.textContent = `${count}/200 characters`;
|
| 297 |
+
interpretBtn.disabled = count < 10 || count > 200;
|
| 298 |
+
});
|
| 299 |
+
|
| 300 |
+
// Interpretation function
|
| 301 |
+
interpretBtn.addEventListener('click', function() {
|
| 302 |
+
const thought = thoughtInput.value.toLowerCase();
|
| 303 |
+
|
| 304 |
+
// Generate Rational interpretation
|
| 305 |
+
let rationalInterpretation = generateRationalInterpretation(thought);
|
| 306 |
+
|
| 307 |
+
// Generate Emotional interpretation
|
| 308 |
+
let emotionalInterpretation = generateEmotionalInterpretation(thought);
|
| 309 |
+
|
| 310 |
+
// Generate Poetic interpretation
|
| 311 |
+
let poeticInterpretation = generatePoeticInterpretation();
|
| 312 |
+
|
| 313 |
+
// Display results
|
| 314 |
+
rationalText.textContent = rationalInterpretation;
|
| 315 |
+
emotionalText.textContent = emotionalInterpretation;
|
| 316 |
+
poeticText.textContent = poeticInterpretation;
|
| 317 |
+
|
| 318 |
+
// Show results section
|
| 319 |
+
resultsSection.classList.remove('hidden');
|
| 320 |
+
|
| 321 |
+
// Animate cards
|
| 322 |
+
setTimeout(() => {
|
| 323 |
+
document.getElementById('rationalCard').classList.add('show');
|
| 324 |
+
}, 200);
|
| 325 |
+
setTimeout(() => {
|
| 326 |
+
document.getElementById('emotionalCard').classList.add('show');
|
| 327 |
+
}, 400);
|
| 328 |
+
setTimeout(() => {
|
| 329 |
+
document.getElementById('poeticCard').classList.add('show');
|
| 330 |
+
}, 600);
|
| 331 |
+
|
| 332 |
+
// Scroll to results
|
| 333 |
+
setTimeout(() => {
|
| 334 |
+
resultsSection.scrollIntoView({ behavior: 'smooth' });
|
| 335 |
+
}, 800);
|
| 336 |
+
});
|
| 337 |
+
|
| 338 |
+
// Reset function
|
| 339 |
+
resetBtn.addEventListener('click', function() {
|
| 340 |
+
thoughtInput.value = '';
|
| 341 |
+
charCount.textContent = '0/200 characters';
|
| 342 |
+
interpretBtn.disabled = true;
|
| 343 |
+
resultsSection.classList.add('hidden');
|
| 344 |
+
|
| 345 |
+
// Reset cards animation
|
| 346 |
+
document.getElementById('rationalCard').classList.remove('show');
|
| 347 |
+
document.getElementById('emotionalCard').classList.remove('show');
|
| 348 |
+
document.getElementById('poeticCard').classList.remove('show');
|
| 349 |
+
|
| 350 |
+
// Scroll to top
|
| 351 |
+
window.scrollTo({ top: 0, behavior: 'smooth' });
|
| 352 |
+
});
|
| 353 |
+
|
| 354 |
+
// Helper functions
|
| 355 |
+
function generateRationalInterpretation(text) {
|
| 356 |
+
// Check for keywords
|
| 357 |
+
for (const [keyword, responses] of Object.entries(rationalResponses.keywords)) {
|
| 358 |
+
if (text.includes(keyword)) {
|
| 359 |
+
return responses[Math.floor(Math.random() * responses.length)];
|
| 360 |
+
}
|
| 361 |
+
}
|
| 362 |
+
|
| 363 |
+
// Fallback to generic
|
| 364 |
+
return rationalResponses.generic[Math.floor(Math.random() * rationalResponses.generic.length)];
|
| 365 |
+
}
|
| 366 |
+
|
| 367 |
+
function generateEmotionalInterpretation(text) {
|
| 368 |
+
// Detect emotion
|
| 369 |
+
let detectedEmotion = null;
|
| 370 |
+
for (const [emotion, words] of Object.entries(emotionWords)) {
|
| 371 |
+
for (const word of words) {
|
| 372 |
+
if (text.includes(word)) {
|
| 373 |
+
detectedEmotion = emotion;
|
| 374 |
+
break;
|
| 375 |
+
}
|
| 376 |
+
}
|
| 377 |
+
if (detectedEmotion) break;
|
| 378 |
+
}
|
| 379 |
+
|
| 380 |
+
// Use specific response if emotion detected
|
| 381 |
+
if (detectedEmotion && emotionalResponses.emotions[detectedEmotion]) {
|
| 382 |
+
const responses = emotionalResponses.emotions[detectedEmotion];
|
| 383 |
+
return responses[Math.floor(Math.random() * responses.length)];
|
| 384 |
+
}
|
| 385 |
+
|
| 386 |
+
// Fallback to generic
|
| 387 |
+
return emotionalResponses.generic[Math.floor(Math.random() * emotionalResponses.generic.length)];
|
| 388 |
+
}
|
| 389 |
+
|
| 390 |
+
function generatePoeticInterpretation() {
|
| 391 |
+
// 50% chance for full poem or constructed one
|
| 392 |
+
if (Math.random() > 0.5) {
|
| 393 |
+
return poeticResponses.full[Math.floor(Math.random() * poeticResponses.full.length)];
|
| 394 |
+
} else {
|
| 395 |
+
const start = poeticResponses.fragments.start[Math.floor(Math.random() * poeticResponses.fragments.start.length)];
|
| 396 |
+
const middle = poeticResponses.fragments.middle[Math.floor(Math.random() * poeticResponses.fragments.middle.length)];
|
| 397 |
+
const end = poeticResponses.fragments.end[Math.floor(Math.random() * poeticResponses.fragments.end.length)];
|
| 398 |
+
return `${start} ${middle} ${end}`;
|
| 399 |
+
}
|
| 400 |
+
}
|
| 401 |
+
});
|
| 402 |
+
</script>
|
| 403 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=dhishooooom/interpretor" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 404 |
+
</html>
|