gradsyntax commited on
Commit
52fa71f
·
verified ·
1 Parent(s): 7e9a99d

biomedical lab interactive simulations web app with best UI and working simulations

Browse files
Files changed (7) hide show
  1. README.md +7 -4
  2. components/footer.js +54 -0
  3. components/navbar.js +76 -0
  4. components/simulation-card.js +68 -0
  5. index.html +85 -19
  6. script.js +20 -0
  7. style.css +28 -18
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Biosim Lab Explorer
3
- emoji: 🏃
4
  colorFrom: pink
5
- colorTo: indigo
 
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: BioSim Lab Explorer 🧪🔬
 
3
  colorFrom: pink
4
+ colorTo: gray
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/footer.js ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomFooter extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ .footer-link {
7
+ transition: color 0.2s ease;
8
+ }
9
+ .footer-link:hover {
10
+ color: #4f46e5;
11
+ }
12
+ </style>
13
+ <footer class="bg-gray-800 text-white py-12">
14
+ <div class="container mx-auto px-6">
15
+ <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
16
+ <div>
17
+ <h3 class="text-xl font-bold mb-4">BioSim Lab</h3>
18
+ <p class="text-gray-400">Interactive biomedical lab simulations for education and research.</p>
19
+ </div>
20
+ <div>
21
+ <h4 class="font-semibold mb-4">Simulations</h4>
22
+ <ul class="space-y-2">
23
+ <li><a href="microscope.html" class="footer-link text-gray-400">Microscope</a></li>
24
+ <li><a href="dna-extraction.html" class="footer-link text-gray-400">DNA Extraction</a></li>
25
+ <li><a href="blood-analysis.html" class="footer-link text-gray-400">Blood Analysis</a></li>
26
+ </ul>
27
+ </div>
28
+ <div>
29
+ <h4 class="font-semibold mb-4">Resources</h4>
30
+ <ul class="space-y-2">
31
+ <li><a href="tutorials.html" class="footer-link text-gray-400">Tutorials</a></li>
32
+ <li><a href="glossary.html" class="footer-link text-gray-400">Glossary</a></li>
33
+ <li><a href="research.html" class="footer-link text-gray-400">Research Papers</a></li>
34
+ </ul>
35
+ </div>
36
+ <div>
37
+ <h4 class="font-semibold mb-4">Connect</h4>
38
+ <div class="flex space-x-4">
39
+ <a href="#" class="footer-link text-gray-400"><i data-feather="twitter"></i></a>
40
+ <a href="#" class="footer-link text-gray-400"><i data-feather="facebook"></i></a>
41
+ <a href="#" class="footer-link text-gray-400"><i data-feather="linkedin"></i></a>
42
+ <a href="#" class="footer-link text-gray-400"><i data-feather="youtube"></i></a>
43
+ </div>
44
+ </div>
45
+ </div>
46
+ <div class="border-t border-gray-700 mt-8 pt-8 text-center text-gray-400">
47
+ <p>© 2023 BioSim Lab Explorer. All rights reserved.</p>
48
+ </div>
49
+ </div>
50
+ </footer>
51
+ `;
52
+ }
53
+ }
54
+ customElements.define('custom-footer', CustomFooter);
components/navbar.js ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomNavbar extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ .navbar {
7
+ transition: all 0.3s ease;
8
+ }
9
+ .nav-link {
10
+ position: relative;
11
+ }
12
+ .nav-link::after {
13
+ content: '';
14
+ position: absolute;
15
+ width: 0;
16
+ height: 2px;
17
+ bottom: -2px;
18
+ left: 0;
19
+ background-color: #4f46e5;
20
+ transition: width 0.3s ease;
21
+ }
22
+ .nav-link:hover::after {
23
+ width: 100%;
24
+ }
25
+ </style>
26
+ <nav class="navbar bg-white shadow-sm py-4 px-6">
27
+ <div class="container mx-auto flex justify-between items-center">
28
+ <a href="index.html" class="flex items-center space-x-2">
29
+ <i data-feather="activity" class="text-indigo-600"></i>
30
+ <span class="text-xl font-bold text-gray-800">BioSim Lab</span>
31
+ </a>
32
+
33
+ <div class="hidden md:flex space-x-8">
34
+ <a href="index.html" class="nav-link text-gray-700 hover:text-indigo-600">Home</a>
35
+ <a href="simulations.html" class="nav-link text-gray-700 hover:text-indigo-600">Simulations</a>
36
+ <a href="about.html" class="nav-link text-gray-700 hover:text-indigo-600">About</a>
37
+ <a href="contact.html" class="nav-link text-gray-700 hover:text-indigo-600">Contact</a>
38
+ </div>
39
+
40
+ <div class="flex items-center space-x-4">
41
+ <button class="md:hidden focus:outline-none" id="mobile-menu-button">
42
+ <i data-feather="menu"></i>
43
+ </button>
44
+ <a href="login.html" class="hidden md:block px-4 py-2 rounded-md bg-indigo-600 text-white hover:bg-indigo-700 transition">Login</a>
45
+ </div>
46
+ </div>
47
+
48
+ <!-- Mobile menu -->
49
+ <div class="md:hidden hidden bg-white py-4 px-6" id="mobile-menu">
50
+ <div class="flex flex-col space-y-4">
51
+ <a href="index.html" class="text-gray-700 hover:text-indigo-600">Home</a>
52
+ <a href="simulations.html" class="text-gray-700 hover:text-indigo-600">Simulations</a>
53
+ <a href="about.html" class="text-gray-700 hover:text-indigo-600">About</a>
54
+ <a href="contact.html" class="text-gray-700 hover:text-indigo-600">Contact</a>
55
+ <a href="login.html" class="px-4 py-2 rounded-md bg-indigo-600 text-white hover:bg-indigo-700 text-center">Login</a>
56
+ </div>
57
+ </div>
58
+ </nav>
59
+ `;
60
+
61
+ // Mobile menu toggle
62
+ const menuButton = this.shadowRoot.getElementById('mobile-menu-button');
63
+ const mobileMenu = this.shadowRoot.getElementById('mobile-menu');
64
+
65
+ menuButton.addEventListener('click', () => {
66
+ const isHidden = mobileMenu.classList.contains('hidden');
67
+ if (isHidden) {
68
+ mobileMenu.classList.remove('hidden');
69
+ feather.replace();
70
+ } else {
71
+ mobileMenu.classList.add('hidden');
72
+ }
73
+ });
74
+ }
75
+ }
76
+ customElements.define('custom-navbar', CustomNavbar);
components/simulation-card.js ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomSimulationCard extends HTMLElement {
2
+ constructor() {
3
+ super();
4
+ this.attachShadow({ mode: 'open' });
5
+ }
6
+
7
+ static get observedAttributes() {
8
+ return ['title', 'description', 'image', 'link'];
9
+ }
10
+
11
+ attributeChangedCallback(name, oldValue, newValue) {
12
+ this.render();
13
+ }
14
+
15
+ connectedCallback() {
16
+ this.render();
17
+ }
18
+
19
+ render() {
20
+ const title = this.getAttribute('title') || 'Simulation';
21
+ const description = this.getAttribute('description') || 'Interactive biomedical lab simulation';
22
+ const image = this.getAttribute('image') || 'http://static.photos/science/640x360/1';
23
+ const link = this.getAttribute('link') || '#';
24
+
25
+ this.shadowRoot.innerHTML = `
26
+ <style>
27
+ .card {
28
+ transition: all 0.3s ease;
29
+ }
30
+ .card:hover {
31
+ transform: translateY(-5px);
32
+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
33
+ }
34
+ .image-container {
35
+ height: 200px;
36
+ overflow: hidden;
37
+ }
38
+ .image-container img {
39
+ transition: transform 0.5s ease;
40
+ }
41
+ .card:hover .image-container img {
42
+ transform: scale(1.05);
43
+ }
44
+ </style>
45
+ <a href="${link}" class="block">
46
+ <div class="card bg-white rounded-xl shadow-md overflow-hidden h-full">
47
+ <div class="image-container">
48
+ <img src="${image}" alt="${title}" class="w-full h-full object-cover">
49
+ </div>
50
+ <div class="p-6">
51
+ <h3 class="text-xl font-bold text-gray-800 mb-2">${title}</h3>
52
+ <p class="text-gray-600 mb-4">${description}</p>
53
+ <div class="flex items-center text-indigo-600 font-medium">
54
+ <span>Start Simulation</span>
55
+ <i data-feather="arrow-right" class="ml-2"></i>
56
+ </div>
57
+ </div>
58
+ </div>
59
+ </a>
60
+ `;
61
+
62
+ // Replace feather icons after rendering
63
+ if (feather) {
64
+ feather.replace();
65
+ }
66
+ }
67
+ }
68
+ customElements.define('custom-simulation-card', CustomSimulationCard);
index.html CHANGED
@@ -1,19 +1,85 @@
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>BioSim Lab Explorer</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="components/navbar.js"></script>
12
+ <script src="components/footer.js"></script>
13
+ <script src="components/simulation-card.js"></script>
14
+ </head>
15
+ <body class="bg-gray-50">
16
+ <custom-navbar></custom-navbar>
17
+
18
+ <main class="container mx-auto px-4 py-8">
19
+ <section class="mb-16">
20
+ <div class="text-center mb-12">
21
+ <h1 class="text-4xl md:text-5xl font-bold text-gray-800 mb-4">Interactive Biomedical Lab</h1>
22
+ <p class="text-xl text-gray-600 max-w-3xl mx-auto">Explore realistic lab simulations to enhance your biomedical knowledge and skills</p>
23
+ </div>
24
+
25
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
26
+ <custom-simulation-card
27
+ title="Microscope Exploration"
28
+ description="Explore cell structures with our virtual microscope"
29
+ image="http://static.photos/science/640x360/1"
30
+ link="microscope.html">
31
+ </custom-simulation-card>
32
+
33
+ <custom-simulation-card
34
+ title="DNA Extraction"
35
+ description="Step-by-step DNA extraction procedure"
36
+ image="http://static.photos/medical/640x360/2"
37
+ link="dna-extraction.html">
38
+ </custom-simulation-card>
39
+
40
+ <custom-simulation-card
41
+ title="Blood Analysis"
42
+ description="Analyze blood samples virtually"
43
+ image="http://static.photos/medical/640x360/3"
44
+ link="blood-analysis.html">
45
+ </custom-simulation-card>
46
+ </div>
47
+ </section>
48
+
49
+ <section class="bg-white rounded-xl shadow-lg p-8 mb-16">
50
+ <h2 class="text-2xl font-bold text-gray-800 mb-6">How It Works</h2>
51
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
52
+ <div class="text-center">
53
+ <div class="bg-blue-100 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4">
54
+ <i data-feather="play" class="text-blue-600"></i>
55
+ </div>
56
+ <h3 class="text-xl font-semibold mb-2">Select Simulation</h3>
57
+ <p class="text-gray-600">Choose from our collection of biomedical lab simulations</p>
58
+ </div>
59
+ <div class="text-center">
60
+ <div class="bg-green-100 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4">
61
+ <i data-feather="activity" class="text-green-600"></i>
62
+ </div>
63
+ <h3 class="text-xl font-semibold mb-2">Interactive Learning</h3>
64
+ <p class="text-gray-600">Follow guided procedures with realistic lab tools</p>
65
+ </div>
66
+ <div class="text-center">
67
+ <div class="bg-purple-100 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4">
68
+ <i data-feather="award" class="text-purple-600"></i>
69
+ </div>
70
+ <h3 class="text-xl font-semibold mb-2">Test Knowledge</h3>
71
+ <p class="text-gray-600">Complete quizzes to reinforce your understanding</p>
72
+ </div>
73
+ </div>
74
+ </section>
75
+ </main>
76
+
77
+ <custom-footer></custom-footer>
78
+
79
+ <script>
80
+ feather.replace();
81
+ </script>
82
+ <script src="script.js"></script>
83
+ <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
84
+ </body>
85
+ </html>
script.js ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ document.addEventListener('DOMContentLoaded', () => {
2
+ // Initialize tooltips
3
+ const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
4
+ tooltipTriggerList.map(function (tooltipTriggerEl) {
5
+ return new bootstrap.Tooltip(tooltipTriggerEl);
6
+ });
7
+
8
+ // Simulation progress tracking
9
+ if (localStorage.getItem('completedSimulations') === null) {
10
+ localStorage.setItem('completedSimulations', JSON.stringify([]));
11
+ }
12
+ });
13
+
14
+ function trackSimulationCompletion(simulationId) {
15
+ const completed = JSON.parse(localStorage.getItem('completedSimulations'));
16
+ if (!completed.includes(simulationId)) {
17
+ completed.push(simulationId);
18
+ localStorage.setItem('completedSimulations', JSON.stringify(completed));
19
+ }
20
+ }
style.css CHANGED
@@ -1,28 +1,38 @@
 
 
1
  body {
2
- padding: 2rem;
3
- font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
 
 
 
 
 
 
4
  }
5
 
6
- h1 {
7
- font-size: 16px;
8
- margin-top: 0;
9
  }
10
 
11
- p {
12
- color: rgb(107, 114, 128);
13
- font-size: 15px;
14
- margin-bottom: 10px;
15
- margin-top: 5px;
16
  }
17
 
18
- .card {
19
- max-width: 620px;
20
- margin: 0 auto;
21
- padding: 16px;
22
- border: 1px solid lightgray;
23
- border-radius: 16px;
24
  }
25
 
26
- .card p:last-child {
27
- margin-bottom: 0;
28
  }
 
 
 
 
 
 
 
 
 
 
1
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
2
+
3
  body {
4
+ font-family: 'Inter', sans-serif;
5
+ min-height: 100vh;
6
+ display: flex;
7
+ flex-direction: column;
8
+ }
9
+
10
+ main {
11
+ flex: 1;
12
  }
13
 
14
+ .simulation-container {
15
+ transition: all 0.3s ease;
 
16
  }
17
 
18
+ .simulation-container:hover {
19
+ transform: translateY(-5px);
 
 
 
20
  }
21
 
22
+ /* Custom scrollbar */
23
+ ::-webkit-scrollbar {
24
+ width: 8px;
 
 
 
25
  }
26
 
27
+ ::-webkit-scrollbar-track {
28
+ background: #f1f1f1;
29
  }
30
+
31
+ ::-webkit-scrollbar-thumb {
32
+ background: #888;
33
+ border-radius: 4px;
34
+ }
35
+
36
+ ::-webkit-scrollbar-thumb:hover {
37
+ background: #555;
38
+ }