Skip to content

Commit

Permalink
cut logs, thrw in gpu accel?
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeisnt committed Nov 28, 2024
1 parent 7c26fd1 commit b06ac22
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
1 change: 0 additions & 1 deletion dist/web/browser-sim.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export class BrowserSimulation {
content.classList.remove("active");
});
const content = document.querySelector(`.${tabInfo.className}-content`);
console.log(`tab to activate: ${tabInfo.title}`, content);
if (content) {
content.classList.remove("hidden");
content.classList.add("active");
Expand Down
38 changes: 38 additions & 0 deletions index.css
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,8 @@ h2 {
position: relative;
z-index: 1;
overflow: auto;
will-change: transform;
-webkit-overflow-scrolling: touch;
}

/* Add mobile adjustments */
Expand Down Expand Up @@ -1760,3 +1762,39 @@ h2 {
font-size: 11px;
}
}

/* Add will-change to optimize scrolling performance */
.browser-content {
will-change: transform;
-webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Use transform instead of top/left for animations */
.tab::before {
transform: translateY(-50%);
will-change: transform;
}

/* Add hardware acceleration for smoother scrolling */
.gmail-content-area,
.github-main,
.gdocs-content-area,
.reddit-main {
-webkit-overflow-scrolling: touch;
will-change: transform;
transform: translateZ(0); /* Force GPU acceleration */
}

/* Prevent repaints during scrolling */
.gmail-email {
will-change: transform;
backface-visibility: hidden;
}

/* Optimize fixed elements */
.gmail-toolbar,
.github-header,
.gdocs-header {
will-change: transform;
transform: translateZ(0);
}
1 change: 0 additions & 1 deletion src/web/browser-sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export class BrowserSimulation {
});

const content = document.querySelector(`.${tabInfo.className}-content`);
console.log(`tab to activate: ${tabInfo.title}`, content);
if (content) {
content.classList.remove("hidden");
content.classList.add("active");
Expand Down

0 comments on commit b06ac22

Please sign in to comment.