Skip to content

Commit

Permalink
perf(JVirtual): gpu acceleration
Browse files Browse the repository at this point in the history
Signed-off-by: Fernando Fernández <ferferga@hotmail.com>
  • Loading branch information
ferferga committed Dec 19, 2024
1 parent 0e6b9a8 commit eb459ed
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions frontend/src/components/lib/JVirtual/JVirtual.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<JSlot
v-for="internal_item in visibleItems"
:key="indexAsKey ? internal_item.index : undefined"
class="uno-transform-gpu"
:class="gridClass"
:style="internal_item.style">
<slot
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/components/lib/JVirtual/j-virtual.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,12 @@ class JVirtualWorker {

for (let index = first; index < last; index++) {
const { x, y } = getItemOffsetByIndex(index, resizeMeasurement);
const translateX = `translateX(${x}px)`;
const translateY = `translateY(${y}px)`;

res.push({
index,
style: {
transform: `${translateX} ${translateY}`
'--j-translate-x': `${x}px`,
'--j-translate-y': `${y}px`
}
});
}
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/pages/playback/video.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
:class="{ 'uno-cursor-none': !overlay }"
@mousemove="handleMouseMove"
@touchend="handleMouseMove">
<JOverlay v-show="overlay">
<JOverlay
class="player-overlay"
override>
<div
class="d-flex flex-column align-center justify-space-between player-overlay">
<div class="osd-top pt-s pl-s pr-s">
Expand Down
8 changes: 6 additions & 2 deletions packages/configs/unocss.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { defineConfig, presetUno } from 'unocss';
import { defineConfig, presetUno, transformerVariantGroup } from 'unocss';

export const defaultConfig = defineConfig({
presets: [
presetUno({
prefix: 'uno-',
preflight: false
variablePrefix: 'j-',
preflight: 'on-demand'
})
],
transformers: [
transformerVariantGroup()
],
theme: {
colors: {
background: 'rgb(var(--j-color-background))'
Expand Down

0 comments on commit eb459ed

Please sign in to comment.