AARIFSHABIR commited on
Commit
a56ca21
·
verified ·
1 Parent(s): e087bf9

Plesae make an app teaching machanism of General organic reactions in a magnificient way - Initial Deployment

Browse files
Files changed (3) hide show
  1. README.md +5 -3
  2. index.html +573 -19
  3. prompts.txt +1 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Mechanism
3
- emoji: 🐢
4
  colorFrom: gray
5
  colorTo: purple
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: mechanism
3
+ emoji: 🐳
4
  colorFrom: gray
5
  colorTo: purple
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,573 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>Organic Reaction Mechanisms | Interactive Learning</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
+ .mechanism-step {
11
+ transition: all 0.5s ease;
12
+ }
13
+ .electron-flow {
14
+ stroke-dasharray: 10;
15
+ animation: dash 2s linear infinite;
16
+ stroke: #3b82f6;
17
+ stroke-width: 2px;
18
+ fill: none;
19
+ }
20
+ @keyframes dash {
21
+ to {
22
+ stroke-dashoffset: 100;
23
+ }
24
+ }
25
+ .reagent-hover:hover {
26
+ transform: translateY(-5px);
27
+ box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
28
+ }
29
+ .molecule {
30
+ transition: all 0.3s ease;
31
+ }
32
+ .active-molecule {
33
+ transform: scale(1.05);
34
+ box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
35
+ }
36
+ .progress-arrow {
37
+ animation: bounce 1.5s infinite;
38
+ }
39
+ @keyframes bounce {
40
+ 0%, 100% { transform: translateX(0); }
41
+ 50% { transform: translateX(10px); }
42
+ }
43
+ .canvas-container {
44
+ perspective: 1000px;
45
+ }
46
+ .molecule-canvas {
47
+ transform-style: preserve-3d;
48
+ transition: transform 1s;
49
+ }
50
+ .rotate-x {
51
+ transform: rotateX(15deg);
52
+ }
53
+ .rotate-y {
54
+ transform: rotateY(15deg);
55
+ }
56
+ </style>
57
+ </head>
58
+ <body class="bg-gray-100 min-h-screen font-sans">
59
+ <header class="bg-indigo-900 text-white shadow-lg">
60
+ <div class="container mx-auto px-4 py-6">
61
+ <div class="flex justify-between items-center">
62
+ <div class="flex items-center space-x-2">
63
+ <i class="fas fa-atom text-3xl text-yellow-400 animate-spin" style="animation-duration: 10s;"></i>
64
+ <h1 class="text-3xl font-bold">Organic Reaction Explorer</h1>
65
+ </div>
66
+ <nav class="hidden md:flex space-x-6">
67
+ <a href="#" class="hover:text-yellow-300 transition">Home</a>
68
+ <a href="#" class="hover:text-yellow-300 transition">Mechanisms</a>
69
+ <a href="#" class="hover:text-yellow-300 transition">Reactions</a>
70
+ <a href="#" class="hover:text-yellow-300 transition">Quiz</a>
71
+ </nav>
72
+ <button class="md:hidden text-xl">
73
+ <i class="fas fa-bars"></i>
74
+ </button>
75
+ </div>
76
+ <div class="mt-6 text-center">
77
+ <h2 class="text-4xl font-bold mb-4">Discover the Magic of Reaction Mechanisms</h2>
78
+ <p class="text-xl text-indigo-200 max-w-3xl mx-auto">Interactive learning platform to visualize and understand organic chemistry reaction pathways</p>
79
+ </div>
80
+ </div>
81
+ </header>
82
+
83
+ <main class="container mx-auto px-4 py-8">
84
+ <div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
85
+ <!-- Sidebar with reactions list -->
86
+ <div class="lg:col-span-1 bg-white rounded-xl shadow-md p-6 h-fit sticky top-4">
87
+ <h3 class="text-2xl font-bold text-indigo-800 mb-6 flex items-center">
88
+ <i class="fas fa-flask mr-2"></i> Reaction Library
89
+ </h3>
90
+ <div class="space-y-3">
91
+ <button onclick="showMechanism('sn2')" class="w-full text-left p-3 rounded-lg hover:bg-indigo-50 transition flex items-center justify-between reagent-hover">
92
+ <span>Nucleophilic Substitution (SN²)</span>
93
+ <i class="fas fa-arrow-right text-indigo-600"></i>
94
+ </button>
95
+ <button onclick="showMechanism('sn1')" class="w-full text-left p-3 rounded-lg hover:bg-indigo-50 transition flex items-center justify-between reagent-hover">
96
+ <span>Nucleophilic Substitution (SN¹)</span>
97
+ <i class="fas fa-arrow-right text-indigo-600"></i>
98
+ </button>
99
+ <button onclick="showMechanism('e2')" class="w-full text-left p-3 rounded-lg hover:bg-indigo-50 transition flex items-center justify-between reagent-hover">
100
+ <span>Elimination (E2)</span>
101
+ <i class="fas fa-arrow-right text-indigo-600"></i>
102
+ </button>
103
+ <button onclick="showMechanism('e1')" class="w-full text-left p-3 rounded-lg hover:bg-indigo-50 transition flex items-center justify-between reagent-hover">
104
+ <span>Elimination (E1)</span>
105
+ <i class="fas fa-arrow-right text-indigo-600"></i>
106
+ </button>
107
+ <button onclick="showMechanism('addition')" class="w-full text-left p-3 rounded-lg hover:bg-indigo-50 transition flex items-center justify-between reagent-hover">
108
+ <span>Electrophilic Addition</span>
109
+ <i class="fas fa-arrow-right text-indigo-600"></i>
110
+ </button>
111
+ <button onclick="showMechanism('esterification')" class="w-full text-left p-3 rounded-lg hover:bg-indigo-50 transition flex items-center justify-between reagent-hover">
112
+ <span>Esterification</span>
113
+ <i class="fas fa-arrow-right text-indigo-600"></i>
114
+ </button>
115
+ </div>
116
+
117
+ <div class="mt-8 bg-yellow-50 border-l-4 border-yellow-400 p-4 rounded-r-lg">
118
+ <h4 class="font-bold text-yellow-800 flex items-center">
119
+ <i class="fas fa-lightbulb mr-2"></i> Quick Tip
120
+ </h4>
121
+ <p class="text-yellow-700 mt-2">Mechanisms show how electrons move during reactions. Follow the electron flow to understand bond changes!</p>
122
+ </div>
123
+ </div>
124
+
125
+ <!-- Main content area with mechanisms -->
126
+ <div class="lg:col-span-2 space-y-8">
127
+ <!-- Mechanism introduction -->
128
+ <div id="mechanism-intro" class="bg-white rounded-xl shadow-md p-6">
129
+ <h2 class="text-3xl font-bold text-indigo-800 mb-4">Welcome to Reaction Mechanisms!</h2>
130
+ <p class="text-gray-700 mb-4">Organic reaction mechanisms are step-by-step descriptions of how reactions occur at the molecular level. Understanding these pathways is key to mastering organic chemistry.</p>
131
+ <p class="text-gray-700 mb-4">Select a reaction from the left panel to explore its mechanism in detail with interactive animations and explanations.</p>
132
+ <img src="https://cdn.pixabay.com/photo/2016/06/08/14/55/molecule-1444300_960_720.png" alt="Organic molecule" class="w-full h-48 object-contain mt-4 opacity-80">
133
+ </div>
134
+
135
+ <!-- SN2 Mechanism (default shown) -->
136
+ <div id="sn2-mechanism" class="mechanism-content bg-white rounded-xl shadow-md p-6 hidden">
137
+ <div class="flex justify-between items-center mb-6">
138
+ <h2 class="text-2xl font-bold text-indigo-800">Nucleophilic Substitution (SN²) Mechanism</h2>
139
+ <span class="bg-green-100 text-green-800 px-3 py-1 rounded-full text-sm font-medium">Bimolecular</span>
140
+ </div>
141
+
142
+ <div class="mb-6">
143
+ <p class="text-gray-700 mb-3">SN² reactions involve a nucleophile attacking the electrophilic carbon from the opposite side of the leaving group. All bonds change in one concerted step.</p>
144
+ <div class="bg-indigo-50 p-4 rounded-lg">
145
+ <h4 class="font-bold text-indigo-700">Key Features:</h4>
146
+ <ul class="list-disc pl-5 mt-2 text-indigo-700 space-y-1">
147
+ <li>Concerted mechanism (single step)</li>
148
+ <li>Stereospecific (inversion of configuration)</li>
149
+ <li>Rate depends on both substrate and nucleophile</li>
150
+ <li>Preferred for primary and methyl substrates</li>
151
+ </ul>
152
+ </div>
153
+ </div>
154
+
155
+ <div class="canvas-container mb-8">
156
+ <div class="bg-gray-50 border-2 border-gray-200 rounded-lg p-4">
157
+ <svg viewBox="0 0 800 300" class="w-full h-auto">
158
+ <!-- Substrate -->
159
+ <g class="molecule substrate" id="substrate-sn2">
160
+ <text x="150" y="150" class="text-xl font-bold fill-indigo-800">CH3-Br</text>
161
+ <circle cx="200" cy="150" r="8" fill="#10b981" />
162
+ <text x="200" y="190" class="text-sm fill-gray-600">Leaving Group (Br⁻)</text>
163
+ <path d="M185,150 L215,150" stroke="black" stroke-width="2" />
164
+ </g>
165
+
166
+ <!-- Nucleophile -->
167
+ <g class="molecule nucleophile" id="nucleophile-sn2">
168
+ <text x="450" y="150" class="text-xl font-bold fill-indigo-800">OH⁻</text>
169
+ <circle cx="400" cy="150" r="8" fill="#3b82f6" />
170
+ <text x="400" y="190" class="text-sm fill-gray-600">Nucleophile (OH⁻)</text>
171
+ </g>
172
+
173
+ <!-- Electron flow arrows -->
174
+ <path id="sn2-arrow" class="electron-flow" d="M400,150 Q300,150 235,150" marker-end="url(#arrowhead)" />
175
+ <defs>
176
+ <marker id="arrowhead" markerWidth="10" markerHeight="7" refX="0" refY="3.5" orient="auto">
177
+ <polygon points="0 0, 10 3.5, 0 7" fill="#3b82f6" />
178
+ </marker>
179
+ </defs>
180
+
181
+ <!-- Transition state -->
182
+ <g id="transition-state-sn2" class="opacity-0 hidden">
183
+ <rect x="250" y="110" width="100" height="80" rx="10" fill="#fef3c7" stroke="#f59e0b" stroke-width="2" />
184
+ <text x="300" y="150" text-anchor="middle" class="font-bold fill-amber-800">Transition State</text>
185
+ <path d="M250,150 L350,150" stroke="#f59e0b" stroke-width="2" />
186
+ <text x="300" y="170" text-anchor="middle" class="text-sm fill-gray-600">Partial bonds</text>
187
+ </g>
188
+
189
+ <!-- Product -->
190
+ <g id="product-sn2" class="opacity-0">
191
+ <text x="550" y="150" class="text-xl font-bold fill-indigo-800">CH3-OH + Br⁻</text>
192
+ <text x="550" y="190" class="text-sm fill-gray-600">Products</text>
193
+ </g>
194
+ </svg>
195
+ </div>
196
+ </div>
197
+
198
+ <div class="flex flex-col md:flex-row gap-4 mb-6">
199
+ <button onclick="animateSN2()" class="flex-1 bg-indigo-600 hover:bg-indigo-700 text-white py-3 px-6 rounded-lg transition flex items-center justify-center">
200
+ <i class="fas fa-play-circle mr-2"></i> Animate Mechanism
201
+ </button>
202
+ <button onclick="resetSN2()" class="flex-1 bg-gray-200 hover:bg-gray-300 text-gray-800 py-3 px-6 rounded-lg transition flex items-center justify-center">
203
+ <i class="fas fa-redo mr-2"></i> Reset Animation
204
+ </button>
205
+ </div>
206
+
207
+ <div class="bg-blue-50 border-l-4 border-blue-400 p-4 rounded-r-lg">
208
+ <h4 class="font-bold text-blue-800">Mechanism Steps:</h4>
209
+ <ol class="list-decimal pl-5 mt-2 text-blue-700 space-y-2">
210
+ <li>The nucleophile (OH⁻) approaches the carbon atom from the opposite side of the leaving group (Br⁻)</li>
211
+ <li>Simultaneous bond formation (C-OH) and bond breaking (C-Br)</li>
212
+ <li>The transition state forms with partial bonds to both groups</li>
213
+ <li>Complete inversion of configuration at the carbon center</li>
214
+ </ol>
215
+ </div>
216
+ </div>
217
+
218
+ <!-- SN1 Mechanism -->
219
+ <div id="sn1-mechanism" class="mechanism-content bg-white rounded-xl shadow-md p-6 hidden">
220
+ <div class="flex justify-between items-center mb-6">
221
+ <h2 class="text-2xl font-bold text-indigo-800">Nucleophilic Substitution (SN¹) Mechanism</h2>
222
+ <span class="bg-purple-100 text-purple-800 px-3 py-1 rounded-full text-sm font-medium">Unimolecular</span>
223
+ </div>
224
+
225
+ <div class="mb-6">
226
+ <p class="text-gray-700 mb-3">SN¹ reactions occur in two steps: first the leaving group departs to form a carbocation intermediate, then the nucleophile attacks.</p>
227
+ <div class="bg-purple-50 p-4 rounded-lg">
228
+ <h4 class="font-bold text-purple-700">Key Features:</h4>
229
+ <ul class="list-disc pl-5 mt-2 text-purple-700 space-y-1">
230
+ <li>Two-step mechanism</li>
231
+ <li>Forms carbocation intermediate</li>
232
+ <li>Racemization occurs at chiral centers</li>
233
+ <li>Rate depends only on substrate concentration</li>
234
+ <li>Preferred for tertiary and secondary substrates</li>
235
+ <li>Often competes with E1 elimination</li>
236
+ </ul>
237
+ </div>
238
+ </div>
239
+
240
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6">
241
+ <!-- Step 1 -->
242
+ <div class="bg-gray-100 rounded-lg p-4 mechanism-step" id="sn1-step1">
243
+ <h4 class="font-bold text-purple-700 mb-2">Step 1: Ionization</h4>
244
+ <div class="flex justify-center">
245
+ <svg viewBox="0 0 200 100" class="w-full">
246
+ <text x="100" y="40" text-anchor="middle" class="text-sm fill-gray-700">CH3-C-CH3</text>
247
+ <text x="100" y="45" text-anchor="middle" class="text-sm fill-gray-700">|</text>
248
+ <text x="100" y="55" text-anchor="middle" class="text-sm fill-gray-700">Br</text>
249
+ <path d="M100,60 L100,80" stroke="black" stroke-width="1" />
250
+ <text x="100" y="95" text-anchor="middle" class="text-xs fill-gray-500">(slow)</text>
251
+
252
+ <g id="sn1-leaving-group" class="opacity-0">
253
+ <path d="M100,80 L120,100" stroke="#ef4444" stroke-width="2" marker-end="url(#arrowhead-red)" />
254
+ <circle cx="120" cy="100" r="5" fill="#ef4444" />
255
+ <text x="130" y="100" class="text-xs fill-gray-700">Br⁻</text>
256
+ </g>
257
+
258
+ <g id="sn1-carbocation" class="opacity-0">
259
+ <text x="100" y="70" text-anchor="middle" class="text-sm fill-red-600">+</text>
260
+ <circle cx="100" cy="80" r="15" fill="none" stroke="#ef4444" stroke-width="2" stroke-dasharray="5,5" />
261
+ </g>
262
+ </svg>
263
+ </div>
264
+ </div>
265
+
266
+ <!-- Progress arrow -->
267
+ <div class="flex items-center justify-center progress-arrow">
268
+ <i class="fas fa-arrow-right text-2xl text-purple-500"></i>
269
+ </div>
270
+
271
+ <!-- Step 2 -->
272
+ <div class="bg-gray-100 rounded-lg p-4 mechanism-step" id="sn1-step2">
273
+ <h4 class="font-bold text-purple-700 mb-2">Step 2: Nucleophilic Attack</h4>
274
+ <div class="flex justify-center">
275
+ <svg viewBox="0 0 200 100" class="w-full">
276
+ <g id="sn1-nucleophile" class="opacity-0">
277
+ <circle cx="50" cy="50" r="5" fill="#3b82f6" />
278
+ <text x="40" y="50" class="text-xs fill-gray-700">OH⁻</text>
279
+ <path d="M55,50 L80,50" stroke="#3b82f6" stroke-width="2" marker-end="url(#arrowhead-blue)" />
280
+ </g>
281
+
282
+ <g id="sn1-final-product" class="opacity-0">
283
+ <text x="120" y="40" text-anchor="middle" class="text-sm fill-gray-700">CH3-C-CH3</text>
284
+ <text x="120" y="45" text-anchor="middle" class="text-sm fill-gray-700">|</text>
285
+ <text x="120" y="50" text-anchor="middle" class="text-sm fill-gray-700">OH</text>
286
+ </g>
287
+ </svg>
288
+ </div>
289
+ </div>
290
+ </div>
291
+
292
+ <div class="flex flex-col md:flex-row gap-4 mb-6">
293
+ <button onclick="animateSN1()" class="flex-1 bg-purple-600 hover:bg-purple-700 text-white py-3 px-6 rounded-lg transition flex items-center justify-center">
294
+ <i class="fas fa-play-circle mr-2"></i> Animate Mechanism
295
+ </button>
296
+ <button onclick="resetSN1()" class="flex-1 bg-gray-200 hover:bg-gray-300 text-gray-800 py-3 px-6 rounded-lg transition flex items-center justify-center">
297
+ <i class="fas fa-redo mr-2"></i> Reset Animation
298
+ </button>
299
+ </div>
300
+
301
+ <div class="bg-purple-50 border-l-4 border-purple-400 p-4 rounded-r-lg">
302
+ <h4 class="font-bold text-purple-800">Energy Profile:</h4>
303
+ <div class="mt-4">
304
+ <img src="https://chem.libretexts.org/@api/deki/files/36048/CNX_Chem_07_04_Sn1energy.jpeg?revision=1" alt="SN1 energy diagram" class="w-full h-auto rounded">
305
+ <p class="text-sm text-purple-700 mt-2">The energy diagram shows the two-step process with a carbocation intermediate. The first step (formation of carbocation) is the rate-determining step.</p>
306
+ </div>
307
+ </div>
308
+ </div>
309
+
310
+ <!-- E2 Mechanism -->
311
+ <div id="e2-mechanism" class="mechanism-content bg-white rounded-xl shadow-md p-6 hidden">
312
+ <div class="flex justify-between items-center mb-6">
313
+ <h2 class="text-2xl font-bold text-indigo-800">Elimination (E2) Mechanism</h2>
314
+ <span class="bg-teal-100 text-teal-800 px-3 py-1 rounded-full text-sm font-medium">Bimolecular</span>
315
+ </div>
316
+
317
+ <div class="mb-6">
318
+ <p class="text-gray-700 mb-3">E2 reactions involve concerted removal of a proton and a leaving group to form a double bond. The base abstracts a proton while the leaving group departs.</p>
319
+ <div class="bg-teal-50 p-4 rounded-lg">
320
+ <h4 class="font-bold text-teal-700">Key Features:</h4>
321
+ <ul class="list-disc pl-5 mt-2 text-teal-700 space-y-1">
322
+ <li>Concerted mechanism (single step)</li>
323
+ <li>Requires strong base and good leaving group</li>
324
+ <li>Anti-periplanar geometry required</li>
325
+ <li>Rate depends on both substrate and base</li>
326
+ <li>Often competes with SN2 reactions</li>
327
+ </ul>
328
+ </div>
329
+ </div>
330
+
331
+ <div class="mb-8">
332
+ <div class="bg-gray-50 border-2 border-gray-200 rounded-lg p-4">
333
+ <svg viewBox="0 0 800 300" class="w-full h-auto">
334
+ <!-- Substrate -->
335
+ <g class="molecule" id="substrate-e2">
336
+ <text x="150" y="150" class="text-xl font-bold fill-indigo-800">CH3-CH2-Br</text>
337
+ <circle cx="230" cy="150" r="8" fill="#10b981" />
338
+ <text x="230" y="190" class="text-sm fill-gray-600">Leaving Group (Br⁻)</text>
339
+ </g>
340
+
341
+ <!-- Base -->
342
+ <g class="molecule" id="base-e2">
343
+ <text x="450" y="150" class="text-xl font-bold fill-indigo-800">HO⁻</text>
344
+ <circle cx="400" cy="150" r="8" fill="#ec4899" />
345
+ <text x="400" y="190" class="text-sm fill-gray-600">Base (HO⁻)</text>
346
+ </g>
347
+
348
+ <!-- Proton -->
349
+ <g id="proton-e2">
350
+ <circle cx="300" cy="180" r="4" fill="#ef4444" />
351
+ <text x="280" y="170" class="text-xs fill-gray-700">H</text>
352
+ </g>
353
+
354
+ <!-- Electron flow arrows -->
355
+ <path id="e2-base-arrow" class="electron-flow" d="M400,150 Q350,150 300,180" marker-end="url(#arrowhead-pink)" />
356
+ <path id="e2-leaving-arrow" class="electron-flow" d="M230,150 Q265,180 300,180" marker-end="url(#arrowhead-green)" />
357
+
358
+ <defs>
359
+ <marker id="arrowhead-pink" markerWidth="10" markerHeight="7" refX="0" refY="3.5" orient="auto">
360
+ <polygon points="0 0, 10 3.5, 0 7" fill="#ec4899" />
361
+ </marker>
362
+ <marker id="arrowhead-green" markerWidth="10" markerHeight="7" refX="0" refY="3.5" orient="auto">
363
+ <polygon points="0 0, 10 3.5, 0 7" fill="#10b981" />
364
+ </marker>
365
+ </defs>
366
+
367
+ <!-- Product -->
368
+ <g id="product-e2" class="opacity-0">
369
+ <text x="550" y="150" class="text-xl font-bold fill-indigo-800">CH2=CH2 + Br⁻ + H2O</text>
370
+ <text x="550" y="190" class="text-sm fill-gray-600">Products</text>
371
+ </g>
372
+ </svg>
373
+ </div>
374
+ </div>
375
+
376
+ <div class="flex flex-col md:flex-row gap-4 mb-6">
377
+ <button onclick="animateE2()" class="flex-1 bg-teal-600 hover:bg-teal-700 text-white py-3 px-6 rounded-lg transition flex items-center justify-center">
378
+ <i class="fas fa-play-circle mr-2"></i> Animate Mechanism
379
+ </button>
380
+ <button onclick="resetE2()" class="flex-1 bg-gray-200 hover:bg-gray-300 text-gray-800 py-3 px-6 rounded-lg transition flex items-center justify-center">
381
+ <i class="fas fa-redo mr-2"></i> Reset Animation
382
+ </button>
383
+ </div>
384
+
385
+ <div class="bg-teal-50 border-l-4 border-teal-400 p-4 rounded-r-lg">
386
+ <h4 class="font-bold text-teal-800">Stereochemistry:</h4>
387
+ <p class="text-teal-700 mt-2">For cyclohexane systems, the hydrogens and leaving groups must be in the anti position (dihedral angle of 180°). This requirement often determines which product will form when multiple β-hydrogens are available.</p>
388
+ <div class="mt-4 flex justify-center">
389
+ <img src="https://www.chemistrysteps.com/wp-content/uploads/2017/10/e2-anti-coplanar-requirement.png" alt="Anti-periplanar geometry" class="w-64 h-auto rounded">
390
+ </div>
391
+ </div>
392
+ </div>
393
+
394
+ <!-- Additional mechanisms would be similar in structure -->
395
+ <!-- Placeholders for other mechanisms -->
396
+ <div id="e1-mechanism" class="mechanism-content bg-white rounded-xl shadow-md p-6 hidden">
397
+ <div class="text-center py-12">
398
+ <i class="fas fa-flask text-5xl text-indigo-400 mb-4"></i>
399
+ <h3 class="text-xl font-bold text-gray-700">E1 Elimination Mechanism</h3>
400
+ <p class="text-gray-500 mt-2">Coming soon with detailed animations!</p>
401
+ </div>
402
+ </div>
403
+
404
+ <div id="addition-mechanism" class="mechanism-content bg-white rounded-xl shadow-md p-6 hidden">
405
+ <div class="text-center py-12">
406
+ <i class="fas fa-flask text-5xl text-indigo-400 mb-4"></i>
407
+ <h3 class="text-xl font-bold text-gray-700">Electrophilic Addition Mechanism</h3>
408
+ <p class="text-gray-500 mt-2">Coming soon with detailed animations!</p>
409
+ </div>
410
+ </div>
411
+
412
+ <div id="esterification-mechanism" class="mechanism-content bg-white rounded-xl shadow-md p-6 hidden">
413
+ <div class="text-center py-12">
414
+ <i class="fas fa-flask text-5xl text-indigo-400 mb-4"></i>
415
+ <h3 class="text-xl font-bold text-gray-700">Esterification Mechanism</h3>
416
+ <p class="text-gray-500 mt-2">Coming soon with detailed animations!</p>
417
+ </div>
418
+ </div>
419
+ </div>
420
+ </div>
421
+ </main>
422
+
423
+ <footer class="bg-gray-800 text-white py-8 mt-12">
424
+ <div class="container mx-auto px-4">
425
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
426
+ <div>
427
+ <h3 class="text-xl font-bold mb-4">Organic Reaction Explorer</h3>
428
+ <p class="text-gray-400">Interactive platform for learning organic chemistry reaction mechanisms through visualization and animations.</p>
429
+ </div>
430
+ <div>
431
+ <h3 class="text-xl font-bold mb-4">Quick Links</h3>
432
+ <ul class="space-y-2">
433
+ <li><a href="#" class="text-gray-400 hover:text-white transition">Home</a></li>
434
+ <li><a href="#" class="text-gray-400 hover:text-white transition">Reaction Library</a></li>
435
+ <li><a href="#" class="text-gray-400 hover:text-white transition">Practice Problems</a></li>
436
+ <li><a href="#" class="text-gray-400 hover:text-white transition">About</a></li>
437
+ </ul>
438
+ </div>
439
+ <div>
440
+ <h3 class="text-xl font-bold mb-4">Connect</h3>
441
+ <div class="flex space-x-4">
442
+ <a href="#" class="text-2xl text-gray-400 hover:text-white transition"><i class="fab fa-twitter"></i></a>
443
+ <a href="#" class="text-2xl text-gray-400 hover:text-white transition"><i class="fab fa-facebook"></i></a>
444
+ <a href="#" class="text-2xl text-gray-400 hover:text-white transition"><i class="fab fa-instagram"></i></a>
445
+ <a href="#" class="text-2xl text-gray-400 hover:text-white transition"><i class="fab fa-youtube"></i></a>
446
+ </div>
447
+ </div>
448
+ </div>
449
+ <div class="border-t border-gray-700 mt-8 pt-6 text-center text-gray-400">
450
+ <p>&copy; 2023 Organic Reaction Explorer. All rights reserved.</p>
451
+ </div>
452
+ </div>
453
+ </footer>
454
+
455
+ <script>
456
+ // Show the selected mechanism and hide others
457
+ function showMechanism(mechanism) {
458
+ // Hide all mechanism contents
459
+ document.querySelectorAll('.mechanism-content').forEach(el => {
460
+ el.classList.add('hidden');
461
+ });
462
+
463
+ // Hide the intro if it's visible
464
+ document.getElementById('mechanism-intro').classList.add('hidden');
465
+
466
+ // Show the selected mechanism
467
+ document.getElementById(`${mechanism}-mechanism`).classList.remove('hidden');
468
+ }
469
+
470
+ // Animation functions for each mechanism
471
+ function animateSN2() {
472
+ const arrow = document.getElementById('sn2-arrow');
473
+ const transitionState = document.getElementById('transition-state-sn2');
474
+ const product = document.getElementById('product-sn2');
475
+ const substrate = document.getElementById('substrate-sn2');
476
+ const nucleophile = document.getElementById('nucleophile-sn2');
477
+
478
+ // Reset first
479
+ arrow.classList.add('electron-flow');
480
+ transitionState.classList.add('hidden');
481
+ product.classList.add('opacity-0');
482
+ substrate.classList.remove('active-molecule');
483
+ nucleophile.classList.remove('active-molecule');
484
+
485
+ // Animate
486
+ setTimeout(() => {
487
+ substrate.classList.add('active-molecule');
488
+ nucleophile.classList.add('active-molecule');
489
+ }, 500);
490
+
491
+ setTimeout(() => {
492
+ transitionState.classList.remove('hidden');
493
+ transitionState.classList.remove('opacity-0');
494
+ }, 1500);
495
+
496
+ setTimeout(() => {
497
+ product.classList.remove('opacity-0');
498
+ substrate.classList.add('opacity-0');
499
+ nucleophile.classList.add('opacity-0');
500
+ }, 2500);
501
+ }
502
+
503
+ function resetSN2() {
504
+ const arrow = document.getElementById('sn2-arrow');
505
+ const transitionState = document.getElementById('transition-state-sn2');
506
+ const product = document.getElementById('product-sn2');
507
+ const substrate = document.getElementById('substrate-sn2');
508
+ const nucleophile = document.getElementById('nucleophile-sn2');
509
+
510
+ arrow.classList.remove('electron-flow');
511
+ transitionState.classList.add('hidden');
512
+ product.classList.add('opacity-0');
513
+ substrate.classList.remove('opacity-0', 'active-molecule');
514
+ nucleophile.classList.remove('opacity-0', 'active-molecule');
515
+ }
516
+
517
+ function animateSN1() {
518
+ document.getElementById('sn1-leaving-group').classList.remove('opacity-0');
519
+ document.getElementById('sn1-carbocation').classList.remove('opacity-0');
520
+
521
+ setTimeout(() => {
522
+ document.getElementById('sn1-nucleophile').classList.remove('opacity-0');
523
+ document.getElementById('sn1-final-product').classList.remove('opacity-0');
524
+ }, 1500);
525
+ }
526
+
527
+ function resetSN1() {
528
+ document.getElementById('sn1-leaving-group').classList.add('opacity-0');
529
+ document.getElementById('sn1-carbocation').classList.add('opacity-0');
530
+ document.getElementById('sn1-nucleophile').classList.add('opacity-0');
531
+ document.getElementById('sn1-final-product').classList.add('opacity-0');
532
+ }
533
+
534
+ function animateE2() {
535
+ document.getElementById('e2-base-arrow').classList.add('electron-flow');
536
+ document.getElementById('e2-leaving-arrow').classList.add('electron-flow');
537
+
538
+ setTimeout(() => {
539
+ document.getElementById('product-e2').classList.remove('opacity-0');
540
+ document.getElementById('substrate-e2').classList.add('opacity-0');
541
+ document.getElementById('base-e2').classList.add('opacity-0');
542
+ document.getElementById('proton-e2').classList.add('opacity-0');
543
+ }, 2000);
544
+ }
545
+
546
+ function resetE2() {
547
+ document.getElementById('e2-base-arrow').classList.remove('electron-flow');
548
+ document.getElementById('e2-leaving-arrow').classList.remove('electron-flow');
549
+ document.getElementById('product-e2').classList.add('opacity-0');
550
+ document.getElementById('substrate-e2').classList.remove('opacity-0');
551
+ document.getElementById('base-e2').classList.remove('opacity-0');
552
+ document.getElementById('proton-e2').classList.remove('opacity-0');
553
+ }
554
+
555
+ // Show SN2 by default
556
+ window.onload = function() {
557
+ showMechanism('sn2');
558
+ };
559
+
560
+ // Mobile menu toggle
561
+ document.querySelector('.md\\:hidden').addEventListener('click', function() {
562
+ const nav = document.querySelector('nav');
563
+ if (nav.classList.contains('hidden')) {
564
+ nav.classList.remove('hidden');
565
+ nav.classList.add('flex', 'flex-col', 'absolute', 'top-16', 'right-4', 'bg-white', 'shadow-lg', 'rounded-lg', 'p-4', 'z-50');
566
+ } else {
567
+ nav.classList.add('hidden');
568
+ nav.classList.remove('flex', 'flex-col', 'absolute', 'top-16', 'right-4', 'bg-white', 'shadow-lg', 'rounded-lg', 'p-4', 'z-50');
569
+ }
570
+ });
571
+ </script>
572
+ <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=AARIFSHABIR/mechanism" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
573
+ </html>
prompts.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ Plesae make an app teaching machanism of General organic reactions in a magnificient way