Skip to content

Commit f7f46f6

Browse files
authored
Merge pull request #84 from Amanmahe/main
Add Candle Glow Effect with Beta Value and Smooth Data Processing
2 parents 80bb84b + 5ebf637 commit f7f46f6

File tree

11 files changed

+748
-355
lines changed

11 files changed

+748
-355
lines changed

package-lock.json

Lines changed: 29 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "chords",
3-
"version": "2.5.0a",
3+
"version": "2.5.1a",
44
"private": true,
55
"scripts": {
66
"dev": "next dev",
@@ -41,7 +41,7 @@
4141
"html2canvas": "^1.4.1",
4242
"jszip": "^3.10.1",
4343
"lucide-react": "^0.460.0",
44-
"next": "14.2.21",
44+
"next": "^14.2.21",
4545
"next-pwa": "^5.6.0",
4646
"next-themes": "^0.3.0",
4747
"react": "^18",

src/app/globals.css

Lines changed: 79 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
--highlight: 0 0% 100%; /* Light mode: white color */
1212
--gray-light: 0 0% 95%; /* Light mode: gray-100 */
1313

14-
1514
--card: 0 0% 100%;
1615
--card-foreground: 222.2 84% 4.9%;
1716

@@ -44,7 +43,7 @@
4443
--background: 222.2 84% 4.9%;
4544
--foreground: 210 40% 98%;
4645

47-
--highlight: 222.2 84% 4.9%; /* Dark mode: light gray */
46+
--highlight: 222.2 84% 4.9%; /* Dark mode: light gray */
4847
--gray-light: 222.2 84% 7%; /* Dark mode: dark gray */
4948

5049
--card: 222.2 84% 4.9%;
@@ -72,14 +71,73 @@
7271
--input: 217.2 32.6% 25%; /* Darkened from 17.5% to 25% */
7372
--ring: 212.7 26.8% 83.9%;
7473
}
75-
}
7674

77-
@layer base {
75+
/* Apply global border style and background colors */
7876
* {
7977
@apply border-border;
8078
}
8179
body {
8280
@apply bg-background text-foreground;
81+
margin: 0;
82+
overflow: hidden;
83+
}
84+
85+
/* Custom Keyframes & Animations */
86+
@keyframes twinkle {
87+
0% { opacity: 0.2; }
88+
50% { opacity: 1; }
89+
100% { opacity: 0.2; }
90+
}
91+
@keyframes float {
92+
0%, 100% { transform: translateY(0); }
93+
50% { transform: translateY(-10px); }
94+
}
95+
@keyframes float-slow {
96+
0%, 100% { transform: translateY(0px); }
97+
50% { transform: translateY(-5px); }
98+
}
99+
@keyframes float-slow-reverse {
100+
0%, 100% { transform: translateY(0px); }
101+
50% { transform: translateY(5px); }
102+
}
103+
@keyframes float-medium {
104+
0%, 100% { transform: translateY(0px); }
105+
50% { transform: translateY(-8px); }
106+
}
107+
@keyframes ping-slow {
108+
0% { transform: scale(1); opacity: 1; }
109+
50% { transform: scale(1.5); opacity: 0.5; }
110+
100% { transform: scale(1); opacity: 1; }
111+
}
112+
@keyframes pulse-slow {
113+
0%, 100% { opacity: 0.1; }
114+
50% { opacity: 0.3; }
115+
}
116+
@keyframes shootingStar {
117+
0% { transform: translate(-100px, -100px) rotate(45deg); opacity: 0; }
118+
10% { opacity: 1; }
119+
20% { transform: translate(120vw, 120vh) rotate(45deg); opacity: 0; }
120+
100% { opacity: 0; }
121+
}
122+
123+
/* Custom Animation Classes */
124+
.animate-float-slow {
125+
animation: float-slow 4s infinite ease-in-out;
126+
}
127+
.animate-float-slow-reverse {
128+
animation: float-slow-reverse 4s infinite ease-in-out;
129+
}
130+
.animate-float-medium {
131+
animation: float-medium 5s infinite ease-in-out;
132+
}
133+
.animate-ping-slow {
134+
animation: ping-slow 2s infinite;
135+
}
136+
.animate-pulse-slow {
137+
animation: pulse-slow 2s infinite;
138+
}
139+
.delay-300 {
140+
animation-delay: 0.3s;
83141
}
84142
}
85143

@@ -99,3 +157,20 @@
99157
border-color: hsl(var(--gray-light));
100158
}
101159
}
160+
@keyframes flicker {
161+
0%, 100% { transform: scale(1); opacity: 1; }
162+
50% { transform: scale(1.05); opacity: 0.95; }
163+
}
164+
165+
.animate-flicker {
166+
animation: flicker 1.2s ease-in-out infinite;
167+
}
168+
169+
@keyframes wickFlicker {
170+
0%, 100% { transform: translateX(0); }
171+
50% { transform: translateX(1px); }
172+
}
173+
174+
.animate-wickFlicker {
175+
animation: wickFlicker 0.5s infinite;
176+
}

src/app/serial-plotter/page.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ const SerialPlotter = () => {
3737
const bitsref = useRef<number>(10);
3838
const channelsref = useRef<number>(1);
3939
const sweepPositions = useRef<number[]>(new Array(channelsref.current).fill(0)); // Array for sweep positions
40+
const SYNC_BYTE_1 = 0xC7;
41+
const SYNC_BYTE_2 = 0x7C;
42+
const blockSize = 9; // Packet size: 9 bytes per packet
43+
const maxSamples = 256; // Number of samples to display in plot
44+
45+
// Refs to store plot data for 3 channels.
46+
const plotDataRef = useRef<{ ch0: number[]; ch1: number[]; ch2: number[] }>({ch0: [],ch1: [],ch2: []});
47+
4048

4149
useEffect(() => {
4250
if (rawDataRef.current) {

0 commit comments

Comments
 (0)