make sure it renders the markdown
Browse files- README.md +7 -4
- components/chemistry-card.js +94 -0
- index.html +127 -19
- style.css +75 -18
README.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title: Molecule Mastermind Madness
|
| 3 |
-
emoji: 🐨
|
| 4 |
colorFrom: purple
|
| 5 |
-
colorTo:
|
|
|
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Molecule Mastermind Madness 🧪
|
|
|
|
| 3 |
colorFrom: purple
|
| 4 |
+
colorTo: purple
|
| 5 |
+
emoji: 🐳
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite-v3
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Welcome to your new DeepSite project!
|
| 13 |
+
This project was created with [DeepSite](https://huggingface.co/deepsite).
|
components/chemistry-card.js
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class ChemistryCard extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
:host {
|
| 7 |
+
display: block;
|
| 8 |
+
font-family: 'Tajawal', sans-serif;
|
| 9 |
+
direction: rtl;
|
| 10 |
+
}
|
| 11 |
+
.card {
|
| 12 |
+
background: white;
|
| 13 |
+
border-radius: 0.75rem;
|
| 14 |
+
overflow: hidden;
|
| 15 |
+
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
| 16 |
+
}
|
| 17 |
+
.card-header {
|
| 18 |
+
background: #4f46e5;
|
| 19 |
+
padding: 1.5rem;
|
| 20 |
+
color: white;
|
| 21 |
+
}
|
| 22 |
+
.card-body {
|
| 23 |
+
padding: 1.5rem;
|
| 24 |
+
}
|
| 25 |
+
.card-footer {
|
| 26 |
+
background: #f9fafb;
|
| 27 |
+
padding: 0.75rem 1.5rem;
|
| 28 |
+
border-top: 1px solid #e5e7eb;
|
| 29 |
+
}
|
| 30 |
+
.tag {
|
| 31 |
+
display: inline-flex;
|
| 32 |
+
align-items: center;
|
| 33 |
+
background: #e0e7ff;
|
| 34 |
+
color: #4f46e5;
|
| 35 |
+
padding: 0.25rem 0.75rem;
|
| 36 |
+
border-radius: 9999px;
|
| 37 |
+
font-size: 0.875rem;
|
| 38 |
+
font-weight: 600;
|
| 39 |
+
}
|
| 40 |
+
.question-text, .answer-text {
|
| 41 |
+
background: #f3f4f6;
|
| 42 |
+
padding: 1rem;
|
| 43 |
+
border-radius: 0.5rem;
|
| 44 |
+
border: 1px solid #e5e7eb;
|
| 45 |
+
margin-bottom: 1rem;
|
| 46 |
+
}
|
| 47 |
+
.answer-text {
|
| 48 |
+
background: #ecfdf5;
|
| 49 |
+
border-color: #a7f3d0;
|
| 50 |
+
}
|
| 51 |
+
ul {
|
| 52 |
+
list-style-type: disc;
|
| 53 |
+
padding-right: 1.25rem;
|
| 54 |
+
}
|
| 55 |
+
li {
|
| 56 |
+
margin-bottom: 0.5rem;
|
| 57 |
+
}
|
| 58 |
+
</style>
|
| 59 |
+
<div class="card">
|
| 60 |
+
<div class="card-header">
|
| 61 |
+
<div class="flex justify-between items-center">
|
| 62 |
+
<div>
|
| 63 |
+
<h2 class="text-xl font-bold">سؤال كيميائي</h2>
|
| 64 |
+
<p class="text-indigo-100 text-sm mt-1">
|
| 65 |
+
<span class="font-medium">الصف:</span> 12 |
|
| 66 |
+
<span class="font-medium">السنة:</span> 2015 |
|
| 67 |
+
<span class="font-medium">الدور:</span> الثاني
|
| 68 |
+
</p>
|
| 69 |
+
</div>
|
| 70 |
+
<div class="tag">
|
| 71 |
+
كيمياء
|
| 72 |
+
</div>
|
| 73 |
+
</div>
|
| 74 |
+
</div>
|
| 75 |
+
<div class="card-body">
|
| 76 |
+
<slot name="content"></slot>
|
| 77 |
+
</div>
|
| 78 |
+
<div class="card-footer">
|
| 79 |
+
<div class="flex justify-between items-center text-sm text-gray-500">
|
| 80 |
+
<div class="flex items-center">
|
| 81 |
+
<i data-feather="book" class="mr-1"></i>
|
| 82 |
+
<span>كتاب الكيمياء</span>
|
| 83 |
+
</div>
|
| 84 |
+
<div>
|
| 85 |
+
<span>ChemQuest</span>
|
| 86 |
+
</div>
|
| 87 |
+
</div>
|
| 88 |
+
</div>
|
| 89 |
+
</div>
|
| 90 |
+
`;
|
| 91 |
+
}
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
customElements.define('chemistry-card', ChemistryCard);
|
index.html
CHANGED
|
@@ -1,19 +1,127 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="ar" dir="rtl">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>ChemQuest: Molecular Mysteries Unraveled</title>
|
| 7 |
+
<link rel="stylesheet" href="style.css">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 10 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 11 |
+
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
|
| 12 |
+
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
| 13 |
+
</head>
|
| 14 |
+
<body class="bg-gray-50 min-h-screen">
|
| 15 |
+
<div class="container mx-auto px-4 py-8">
|
| 16 |
+
<div class="max-w-3xl mx-auto">
|
| 17 |
+
<div class="bg-white rounded-xl shadow-lg overflow-hidden mb-8">
|
| 18 |
+
<!-- Header -->
|
| 19 |
+
<div class="bg-indigo-600 px-6 py-4">
|
| 20 |
+
<div class="flex justify-between items-center">
|
| 21 |
+
<div>
|
| 22 |
+
<h2 class="text-white text-xl font-bold">سؤال كيميائي</h2>
|
| 23 |
+
<p class="text-indigo-100 text-sm mt-1">
|
| 24 |
+
<span class="font-medium">الصف:</span> 12 |
|
| 25 |
+
<span class="font-medium">السنة:</span> 2015 |
|
| 26 |
+
<span class="font-medium">الدور:</span> الثاني
|
| 27 |
+
</p>
|
| 28 |
+
</div>
|
| 29 |
+
<div class="bg-white text-indigo-600 px-3 py-1 rounded-full text-sm font-semibold">
|
| 30 |
+
كيمياء
|
| 31 |
+
</div>
|
| 32 |
+
</div>
|
| 33 |
+
</div>
|
| 34 |
+
|
| 35 |
+
<!-- Question Body -->
|
| 36 |
+
<div class="p-6">
|
| 37 |
+
<!-- Metadata -->
|
| 38 |
+
<div class="flex flex-wrap gap-2 mb-6">
|
| 39 |
+
<span class="bg-gray-100 text-gray-800 px-3 py-1 rounded-full text-xs">
|
| 40 |
+
الفصل: الثرموداينمك
|
| 41 |
+
</span>
|
| 42 |
+
<span class="bg-gray-100 text-gray-800 px-3 py-1 rounded-full text-xs">
|
| 43 |
+
رقم السؤال: 3
|
| 44 |
+
</span>
|
| 45 |
+
<span class="bg-gray-100 text-gray-800 px-3 py-1 rounded-full text-xs">
|
| 46 |
+
نوع السؤال: مسائل
|
| 47 |
+
</span>
|
| 48 |
+
</div>
|
| 49 |
+
|
| 50 |
+
<!-- Question Text -->
|
| 51 |
+
<div class="mb-8">
|
| 52 |
+
<h3 class="text-lg font-bold text-gray-800 mb-3">السؤال:</h3>
|
| 53 |
+
<div class="bg-gray-50 p-4 rounded-lg border border-gray-200">
|
| 54 |
+
<div class="question-text text-gray-700 leading-relaxed">
|
| 55 |
+
اعتماداً على نظرية أصرة التكافؤ $(VBT)$ ما نوع التهجين والشكل الهندسي والصفة المغناطيسية للمعقد $[PtCl_{4}]^{-2}$ ؟
|
| 56 |
+
علما أن العدد الذري لـ $Pt=78$
|
| 57 |
+
</div>
|
| 58 |
+
</div>
|
| 59 |
+
</div>
|
| 60 |
+
|
| 61 |
+
<!-- Answer -->
|
| 62 |
+
<div>
|
| 63 |
+
<h3 class="text-lg font-bold text-gray-800 mb-3 flex items-center">
|
| 64 |
+
<i data-feather="check-circle" class="mr-2 text-green-500"></i>
|
| 65 |
+
الإجابة:
|
| 66 |
+
</h3>
|
| 67 |
+
<div class="bg-green-50 p-4 rounded-lg border border-green-200">
|
| 68 |
+
<div class="answer-text">
|
| 69 |
+
**المعقد $[PtCl_{4}]^{-2}$:**
|
| 70 |
+
|
| 71 |
+
- العدد الذري للبلاتين Pt = 78. التوزيع الإلكتروني: $[Xe]_{54} 4f^{14} 5d^9 6s^1$.
|
| 72 |
+
- حالة تأكسد البلاتين: $x + 4(-1) = -2 \\implies x = +2$.
|
| 73 |
+
- التوزيع الإلكتروني للأيون $Pt^{+2}$: $[Xe]_{54} 4f^{14} 5d^8$.
|
| 74 |
+
- الكلوريد ($Cl^-$) ليجند ضعيف، ولكن مع عناصر الدورة الخامسة والسادسة (مثل Pt)، تكون الليجندات ضاغطة. لذا يحدث ازدواج للإلكترونات في 5d.
|
| 75 |
+
- يفرغ أوربيتال واحد في 5d، ويتم التهجين بين هذا الأوربيتال وأوربيتال 6s وأوربيتالين 6p.
|
| 76 |
+
|
| 77 |
+
**النتائج:**
|
| 78 |
+
|
| 79 |
+
- نوع التهجين: $dsp^2$
|
| 80 |
+
- الشكل الهندسي: مربع مستو
|
| 81 |
+
- الصفة المغناطيسية: دايا مغناطيسية لعدم وجود إلكترونات منفردة.
|
| 82 |
+
</div>
|
| 83 |
+
</div>
|
| 84 |
+
</div>
|
| 85 |
+
</div>
|
| 86 |
+
|
| 87 |
+
<!-- Footer -->
|
| 88 |
+
<div class="bg-gray-50 px-6 py-3 border-t border-gray-200">
|
| 89 |
+
<div class="flex justify-between items-center text-sm text-gray-500">
|
| 90 |
+
<div class="flex items-center">
|
| 91 |
+
<i data-feather="book" class="mr-1"></i>
|
| 92 |
+
<span>كتاب الكيمياء</span>
|
| 93 |
+
</div>
|
| 94 |
+
<div>
|
| 95 |
+
<span>ChemQuest</span>
|
| 96 |
+
</div>
|
| 97 |
+
</div>
|
| 98 |
+
</div>
|
| 99 |
+
</div>
|
| 100 |
+
</div>
|
| 101 |
+
</div>
|
| 102 |
+
<script>
|
| 103 |
+
feather.replace();
|
| 104 |
+
// Process markdown in all chemistry cards
|
| 105 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 106 |
+
const cards = document.querySelectorAll('chemistry-card');
|
| 107 |
+
cards.forEach(card => {
|
| 108 |
+
const shadow = card.shadowRoot;
|
| 109 |
+
const question = shadow.querySelector('.question-text');
|
| 110 |
+
const answer = shadow.querySelector('.answer-text');
|
| 111 |
+
|
| 112 |
+
if (question) {
|
| 113 |
+
question.innerHTML = marked.parse(question.textContent);
|
| 114 |
+
}
|
| 115 |
+
if (answer) {
|
| 116 |
+
answer.innerHTML = marked.parse(answer.textContent);
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
if (window.MathJax) {
|
| 120 |
+
MathJax.typesetPromise();
|
| 121 |
+
}
|
| 122 |
+
});
|
| 123 |
+
});
|
| 124 |
+
</script>
|
| 125 |
+
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
|
| 126 |
+
</body>
|
| 127 |
+
</html>
|
style.css
CHANGED
|
@@ -1,28 +1,85 @@
|
|
|
|
|
|
|
|
| 1 |
body {
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
}
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
margin-top: 0;
|
| 9 |
}
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
|
|
|
| 16 |
}
|
| 17 |
|
| 18 |
-
.
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
}
|
| 25 |
|
| 26 |
-
.
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap');
|
| 2 |
+
|
| 3 |
body {
|
| 4 |
+
font-family: 'Tajawal', sans-serif;
|
| 5 |
+
}
|
| 6 |
+
|
| 7 |
+
/* Custom styles for RTL layout */
|
| 8 |
+
[dir="rtl"] .list-disc {
|
| 9 |
+
list-style-type: disc;
|
| 10 |
+
padding-right: 1.25rem;
|
| 11 |
+
}
|
| 12 |
+
/* MathJax and markdown styles */
|
| 13 |
+
.MathJax {
|
| 14 |
+
font-size: 1em !important;
|
| 15 |
+
color: #4b5563 !important;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
/* Ensure markdown content is properly aligned in RTL */
|
| 19 |
+
[dir="rtl"] .question-text p,
|
| 20 |
+
[dir="rtl"] .answer-text p,
|
| 21 |
+
[dir="rtl"] .question-text ul,
|
| 22 |
+
[dir="rtl"] .answer-text ul,
|
| 23 |
+
[dir="rtl"] .question-text ol,
|
| 24 |
+
[dir="rtl"] .answer-text ol {
|
| 25 |
+
text-align: right;
|
| 26 |
+
direction: rtl;
|
| 27 |
+
}
|
| 28 |
+
/* Markdown styles */
|
| 29 |
+
.question-text p, .answer-text p {
|
| 30 |
+
margin-bottom: 1rem;
|
| 31 |
+
line-height: 1.6;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
.question-text strong, .answer-text strong {
|
| 35 |
+
font-weight: 700;
|
| 36 |
+
color: #1e40af;
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
.question-text em, .answer-text em {
|
| 40 |
+
font-style: italic;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
.question-text ul, .answer-text ul {
|
| 44 |
+
list-style-type: disc;
|
| 45 |
+
padding-right: 1.5rem;
|
| 46 |
+
margin-bottom: 1rem;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
.question-text ol, .answer-text ol {
|
| 50 |
+
list-style-type: decimal;
|
| 51 |
+
padding-right: 1.5rem;
|
| 52 |
+
margin-bottom: 1rem;
|
| 53 |
}
|
| 54 |
|
| 55 |
+
.question-text li, .answer-text li {
|
| 56 |
+
margin-bottom: 0.5rem;
|
|
|
|
| 57 |
}
|
| 58 |
|
| 59 |
+
.question-text code, .answer-text code {
|
| 60 |
+
font-family: monospace;
|
| 61 |
+
background-color: #f3f4f6;
|
| 62 |
+
padding: 0.2rem 0.4rem;
|
| 63 |
+
border-radius: 0.25rem;
|
| 64 |
+
font-size: 0.9em;
|
| 65 |
}
|
| 66 |
|
| 67 |
+
.question-text pre, .answer-text pre {
|
| 68 |
+
background-color: #f3f4f6;
|
| 69 |
+
padding: 1rem;
|
| 70 |
+
border-radius: 0.5rem;
|
| 71 |
+
overflow-x: auto;
|
| 72 |
+
margin-bottom: 1rem;
|
| 73 |
}
|
| 74 |
|
| 75 |
+
.question-text blockquote, .answer-text blockquote {
|
| 76 |
+
border-right: 4px solid #d1d5db;
|
| 77 |
+
padding-right: 1rem;
|
| 78 |
+
margin-right: 0;
|
| 79 |
+
margin-left: 1rem;
|
| 80 |
+
color: #4b5563;
|
| 81 |
}
|
| 82 |
+
/* Custom card shadow */
|
| 83 |
+
.shadow-lg {
|
| 84 |
+
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
| 85 |
+
}
|