diff --git a/README.md b/README.md
index dc68051..05d5be3 100644
--- a/README.md
+++ b/README.md
@@ -10,11 +10,12 @@ This repository contains source code of [my academic website](https://mkhangg.co
## Update
List of updates (in terms of functionalities):
+* **[17 Nov 2023]** Moving JS particles when dark theme is enabled (like fireflies) is added.
* **[17 Nov 2023]** New webpage scrollbar style is added.
-* **[06 Nov 2023]** Sound effects when users interacting with functionalities.
+* **[06 Nov 2023]** Sound effects when users interact with functionalities.
* **[04 Nov 2023]** Sink to disappear the icon is added.
* **[04 Nov 2023]** Simple draggable pop-up icon (like Messenger) is added.
-* **[30 Oct 2023]** Dark/Light theme is displayed based on time of client.
+* **[30 Oct 2023]** Dark/Light theme is displayed based on the client's time.
* **[30 Oct 2023]** Dark/Light theme toggle button is added.
diff --git a/_data/fails.yaml b/_data/fails.yaml
deleted file mode 100644
index 78f00f4..0000000
--- a/_data/fails.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
-events:
- - description: Got rejected from most of fellowship programs (ETH Zurich SSRF, CMU RISS, MIT SRP, Stanford SURF, UIUC SRF).
- date: 03/2023
-
- - description: Battery-free UAV got rejected from MobiSys '22.
- date: 05/2022
-
- - description: IoTree got rejected from NSDI '22.
- date: 12/2021
-
- - description: Got rejected from many colleges (too many to list them here).
- date: 03/2020
-
- - description: Failed to get into the mathematics PTNK-TST team for VMO.
- date: 09/2018
-
- - description: Didn't win the first prize in the mathematics municipal competition.
- date: 03/2017
-
-introduction: instead of having a news section in which people usually share good things, I decided to highlight some of my greatest failures (by year) to remind myself that my life perhaps looks like this iceberg model. however, these are written out mainly from my memory and i guess there are tons of things that i forgot.
\ No newline at end of file
diff --git a/_data/gallery.yaml b/_data/gallery.yaml
index e3d7054..40b17db 100644
--- a/_data/gallery.yaml
+++ b/_data/gallery.yaml
@@ -28,4 +28,4 @@ pictures:
caption: my boys from tđn maths team
year: 2017
-introduction: not all about robots, but also some happy moments of my life and my list of failures.
+introduction: not all about robots, but also some happy moments of my life.
diff --git a/_layouts/main.html b/_layouts/main.html
index e93744f..3c1646c 100644
--- a/_layouts/main.html
+++ b/_layouts/main.html
@@ -30,6 +30,9 @@
+
+
📍 gallery
- not all about robots, but also some happy moments of my life and
my list of failures.
+ not all about robots, but also some happy moments of my life.
diff --git a/_site/js/scripts.js b/_site/js/scripts.js
index f8cb1ec..55a7fea 100644
--- a/_site/js/scripts.js
+++ b/_site/js/scripts.js
@@ -158,3 +158,76 @@ document.addEventListener('DOMContentLoaded', function() {
// Automatically update year in footer
document.getElementById("currentYear").textContent = new Date().getFullYear();
+
+
+// Canvas for particle moves
+const canvas = document.getElementById('canvas');
+const ctx = canvas.getContext('2d');
+const particles = [];
+
+
+// Resize canvas width and height
+function resizeCanvas() {
+ canvas.width = window.innerWidth;
+ canvas.height = window.innerHeight;
+}
+window.addEventListener('resize', resizeCanvas);
+resizeCanvas();
+
+
+// Class for Particle
+class Particle {
+
+ constructor() {
+ this.reset();
+ }
+
+ reset() {
+ this.x = Math.random() * canvas.width;
+ this.y = Math.random() * canvas.height;
+ this.vx = (Math.random() - 0.5) * 2;
+ this.vy = (Math.random() - 0.5) * 2;
+ this.color = 'rgba(255, 255, 255, ' + 0.7 + ')';
+ this.lifespan = 100;
+ }
+
+ update() {
+ this.x += this.vx;
+ this.y += this.vy;
+ this.color = 'rgba(255, 255, 255, ' + this.lifespan--/100 + ')';
+
+ if (this.lifespan <= 0) {
+ this.reset();
+ }
+ }
+
+ draw(ctx) {
+ ctx.fillStyle = this.color;
+ ctx.beginPath();
+ ctx.arc(this.x, this.y, 2, 0, Math.PI * 2);
+ ctx.fill();
+ }
+}
+
+
+// Initialize 101 particles
+for (let i = 0; i < 101; i++) {
+ particles.push(new Particle());
+}
+
+
+// Make the particles move
+function animate() {
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
+
+ particles.forEach(particle => {
+ particle.update();
+ particle.draw(ctx);
+ });
+
+ requestAnimationFrame(animate);
+}
+
+
+// Animate the particles
+animate();
diff --git a/_site/styles/styles.css b/_site/styles/styles.css
index b10d625..42c4228 100644
--- a/_site/styles/styles.css
+++ b/_site/styles/styles.css
@@ -90,7 +90,7 @@ div.gallery {
float: left;
width: 212px;
}
-div.gallery:nth-child(9n+1) {
+div.gallery:nth-child(8n+1) {
clear: both;
}
div.gallery img {
@@ -251,31 +251,6 @@ button.dark-theme {
}
-/* Fancy list for failure items */
-.fancy-list {
- max-width: 600px;
- margin: 10px 0 0 0;
- padding: 0;
- list-style: none;
-}
-.fancy-list li {
- border: 1px solid #ddd;
- padding: 10px 15px;
- margin-bottom: 10px;
- border-radius: 7px;
- transition: transform 0.3s ease, box-shadow 0.3s ease;
-}
-.fancy-list li:hover {
- transform: translateY(-5px);
-}
-.fancy-list li::before {
- color: #000000;
- font-size: 24px;
- vertical-align: middle;
- margin-right: 10px;
-}
-
-
/* New style for webpage scrollbar */
::-webkit-scrollbar-track {
background-color: #f1f1f1;
@@ -289,4 +264,14 @@ button.dark-theme {
::-webkit-scrollbar {
width: 10px;
}
-
\ No newline at end of file
+
+
+/* Styles for middle-layer moving-particle canvas */
+canvas {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: -1;
+}
diff --git a/anotherme.md b/anotherme.md
deleted file mode 100644
index 3a736eb..0000000
--- a/anotherme.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-layout: main
----
-
-{% include_relative _sections/about.html %}
-{% include_relative _sections/fails.html %}
-{% include_relative _sections/footer.html %}
diff --git a/assets/img/devices_mockup_white_transparent.png b/assets/img/devices_mockup_white_transparent.png
deleted file mode 100644
index 98b65d3..0000000
Binary files a/assets/img/devices_mockup_white_transparent.png and /dev/null differ
diff --git a/assets/img/iceberg.png b/assets/img/iceberg.png
deleted file mode 100644
index 00760cb..0000000
Binary files a/assets/img/iceberg.png and /dev/null differ
diff --git a/js/scripts.js b/js/scripts.js
index f8cb1ec..55a7fea 100644
--- a/js/scripts.js
+++ b/js/scripts.js
@@ -158,3 +158,76 @@ document.addEventListener('DOMContentLoaded', function() {
// Automatically update year in footer
document.getElementById("currentYear").textContent = new Date().getFullYear();
+
+
+// Canvas for particle moves
+const canvas = document.getElementById('canvas');
+const ctx = canvas.getContext('2d');
+const particles = [];
+
+
+// Resize canvas width and height
+function resizeCanvas() {
+ canvas.width = window.innerWidth;
+ canvas.height = window.innerHeight;
+}
+window.addEventListener('resize', resizeCanvas);
+resizeCanvas();
+
+
+// Class for Particle
+class Particle {
+
+ constructor() {
+ this.reset();
+ }
+
+ reset() {
+ this.x = Math.random() * canvas.width;
+ this.y = Math.random() * canvas.height;
+ this.vx = (Math.random() - 0.5) * 2;
+ this.vy = (Math.random() - 0.5) * 2;
+ this.color = 'rgba(255, 255, 255, ' + 0.7 + ')';
+ this.lifespan = 100;
+ }
+
+ update() {
+ this.x += this.vx;
+ this.y += this.vy;
+ this.color = 'rgba(255, 255, 255, ' + this.lifespan--/100 + ')';
+
+ if (this.lifespan <= 0) {
+ this.reset();
+ }
+ }
+
+ draw(ctx) {
+ ctx.fillStyle = this.color;
+ ctx.beginPath();
+ ctx.arc(this.x, this.y, 2, 0, Math.PI * 2);
+ ctx.fill();
+ }
+}
+
+
+// Initialize 101 particles
+for (let i = 0; i < 101; i++) {
+ particles.push(new Particle());
+}
+
+
+// Make the particles move
+function animate() {
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
+
+ particles.forEach(particle => {
+ particle.update();
+ particle.draw(ctx);
+ });
+
+ requestAnimationFrame(animate);
+}
+
+
+// Animate the particles
+animate();
diff --git a/styles/styles.css b/styles/styles.css
index b10d625..42c4228 100644
--- a/styles/styles.css
+++ b/styles/styles.css
@@ -90,7 +90,7 @@ div.gallery {
float: left;
width: 212px;
}
-div.gallery:nth-child(9n+1) {
+div.gallery:nth-child(8n+1) {
clear: both;
}
div.gallery img {
@@ -251,31 +251,6 @@ button.dark-theme {
}
-/* Fancy list for failure items */
-.fancy-list {
- max-width: 600px;
- margin: 10px 0 0 0;
- padding: 0;
- list-style: none;
-}
-.fancy-list li {
- border: 1px solid #ddd;
- padding: 10px 15px;
- margin-bottom: 10px;
- border-radius: 7px;
- transition: transform 0.3s ease, box-shadow 0.3s ease;
-}
-.fancy-list li:hover {
- transform: translateY(-5px);
-}
-.fancy-list li::before {
- color: #000000;
- font-size: 24px;
- vertical-align: middle;
- margin-right: 10px;
-}
-
-
/* New style for webpage scrollbar */
::-webkit-scrollbar-track {
background-color: #f1f1f1;
@@ -289,4 +264,14 @@ button.dark-theme {
::-webkit-scrollbar {
width: 10px;
}
-
\ No newline at end of file
+
+
+/* Styles for middle-layer moving-particle canvas */
+canvas {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: -1;
+}