Skip to content

Commit

Permalink
Merge branch 'birdflop' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
saboooor committed Jun 21, 2024
2 parents befe084 + 01f15e1 commit 331b292
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/routes/resources/animtab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export default component$(() => {
onMouseDown$={(e, el) => {
if (e.target != el) return;
const rect = el.getBoundingClientRect();
const pos = (((e.clientX - rect.left) / rect.width) * store.text.length) / store.text.length * 100;
const pos = ((e.clientX - rect.left) / rect.width) * 100;
if (store.colors.find(c => c.pos == pos)) return;
const newColors = store.colors.slice(0);
newColors.push({ hex: getRandomColor(), pos });
Expand All @@ -184,7 +184,7 @@ export default component$(() => {
return;
}
const rect = el.getBoundingClientRect();
const pos = (((e.clientX - rect.left) / rect.width) * store.text.length) / store.text.length * 100;
const pos = ((e.clientX - rect.left) / rect.width) * 100;
if (store.colors.find(c => c.pos == pos)) return;
addbutton.classList.remove('opacity-0');
addbutton.style.left = `${pos}%`;
Expand All @@ -210,7 +210,7 @@ export default component$(() => {
tmpstore.opened.id = -1;
el.classList.add('-mt-2', 'scale-125', 'z-[1000]');
el.style.filter = 'drop-shadow(0 0 10px rgb(31 41 55))';
let pos = (((e.clientX - rect.left) / rect.width) * store.text.length) / store.text.length * 100;
let pos = ((e.clientX - rect.left) / rect.width) * 100;
if (pos < 0) pos = 0;
if (pos > 100) pos = 100;
if (store.colors.find(c => c.pos == pos)) return;
Expand Down
6 changes: 3 additions & 3 deletions src/routes/resources/rgb/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export default component$(() => {
onMouseDown$={(e, el) => {
if (e.target != el) return;
const rect = el.getBoundingClientRect();
const pos = (((e.clientX - rect.left) / rect.width) * store.text.length) / store.text.length * 100;
const pos = ((e.clientX - rect.left) / rect.width) * 100;
if (store.colors.find(c => c.pos == pos)) return;
const newColors = store.colors.slice(0);
newColors.push({ hex: getRandomColor(), pos });
Expand All @@ -153,7 +153,7 @@ export default component$(() => {
return;
}
const rect = el.getBoundingClientRect();
const pos = (((e.clientX - rect.left) / rect.width) * store.text.length) / store.text.length * 100;
const pos = ((e.clientX - rect.left) / rect.width) * 100;
if (store.colors.find(c => c.pos == pos)) return;
addbutton.classList.remove('opacity-0');
addbutton.style.left = `${pos}%`;
Expand All @@ -179,7 +179,7 @@ export default component$(() => {
tmpstore.opened.id = -1;
el.classList.add('-mt-2', 'scale-125', 'z-[1000]');
el.style.filter = 'drop-shadow(0 0 10px rgb(31 41 55))';
let pos = (((e.clientX - rect.left) / rect.width) * store.text.length) / store.text.length * 100;
let pos = ((e.clientX - rect.left) / rect.width) * 100;
if (pos < 0) pos = 0;
if (pos > 100) pos = 100;
if (store.colors.find(c => c.pos == pos)) return;
Expand Down

0 comments on commit 331b292

Please sign in to comment.