Skip to content

Commit 7ec0c60

Browse files
committed
Layout fixes
1 parent 12e24e5 commit 7ec0c60

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

src/components/GitSequencer.css

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,15 +270,15 @@
270270
margin-top: 0.25rem;
271271
margin-left: 1rem;
272272
font-size: 0.9rem;
273-
min-height: 1.4em;
273+
min-height: 3rem;
274274
}
275275

276276
.status-msg .dim {
277277
color: var(--text-dim);
278278
}
279279

280280
.status-msg .hint-tip {
281-
color: var(--text-dim);
281+
color: #555555;
282282
font-size: 0.85rem;
283283
line-height: 1.5rem;
284284
padding-left: 0.5rem;
@@ -502,7 +502,11 @@
502502
overflow-x: auto;
503503
max-width: 100%;
504504
scrollbar-width: thin;
505-
scrollbar-color: var(--accent) var(--bg);
505+
scrollbar-color: #555555 var(--bg);
506+
}
507+
508+
.graph-section.no-data {
509+
overflow-x: hidden;
506510
}
507511

508512
.graph-section::-webkit-scrollbar {
@@ -514,7 +518,7 @@
514518
}
515519

516520
.graph-section::-webkit-scrollbar-thumb {
517-
background-color: var(--accent);
521+
background-color: #888888;
518522
border-radius: 3px;
519523
}
520524

src/components/GitSequencer.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ const GitSequencer = () => {
324324
const titleFont = `bold ${legendTitleSize}px monospace`;
325325
const versionFont = `${legendVersionSize}px monospace`;
326326
ctx.font = titleFont;
327-
const titleText = 'GitHub Music';
327+
const titleText = 'GitMusic';
328328
const titleWidth = ctx.measureText(titleText).width;
329329
ctx.font = versionFont;
330330
const versionText = 'v1.0.0';
@@ -735,16 +735,16 @@ const GitSequencer = () => {
735735
<span className="success">✓ loaded {data.weeks.length} weeks</span>
736736
) : (
737737
<>
738-
<div className="hint-tip">└─ enter git username (loads one with higher git contributions)</div>
739-
<div className="hint-tip">└─ use -p github|gitlab to choose platform</div>
738+
<div className="hint-tip">└─ default: most active contributions</div>
739+
<div className="hint-tip">└─ use -p github|gitlab to force platform</div>
740740
</>
741741
)
742742
}
743743
</div>
744744
</div>
745745

746746
{/* Contribution Graph */}
747-
<div className="graph-section" ref={graphSectionRef}>
747+
<div className={`graph-section ${!data || isAnimating || error ? 'no-data' : ''}`} ref={graphSectionRef}>
748748
{data && !isAnimating && !error ? (
749749
<div className="graph-grid">
750750
{data.weeks.map((week, wIndex) => (

src/hooks/useSequencer.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export function useSequencer(audioEngine) {
6060
if (!data) return;
6161

6262
await Tone.start();
63+
Tone.context.lookAhead = 0.1; // Increase lookahead for mobile stability
6364

6465
const cols = data.weeks.map((_, i) => i);
6566

@@ -104,7 +105,8 @@ export function useSequencer(audioEngine) {
104105
let weekDensity = 0;
105106
week.days.forEach(d => weekDensity += d.level);
106107

107-
if (weekDensity > 10) {
108+
// Only sample if extremely dense (prevent "wall of sound" while keeping most notes)
109+
if (weekDensity > 25) {
108110
// Busy week: random sampling
109111
const activeDays = week.days
110112
.map((d, i) => ({ day: d, index: i }))
@@ -142,7 +144,7 @@ export function useSequencer(audioEngine) {
142144
setActiveNotes(playingIndices);
143145
}, time);
144146
}
145-
}, cols, "8n").start(0);
147+
}, cols, "8n").start("0:0:0");
146148

147149
// Adaptive BPM
148150
let totalContribs = 0;
@@ -159,7 +161,7 @@ export function useSequencer(audioEngine) {
159161
const stop = useCallback(() => {
160162
Tone.Transport.stop();
161163
Tone.Transport.cancel(); // Clear all scheduled events
162-
Tone.Transport.position = 0; // Reset position
164+
Tone.Transport.position = "0:0:0"; // Reset position safely
163165
if (sequenceRef.current) {
164166
sequenceRef.current.stop();
165167
sequenceRef.current.dispose();

0 commit comments

Comments
 (0)