mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
feat: improve scrolling with calculator
This commit is contained in:
@@ -98,7 +98,7 @@
|
|||||||
<div class="flex items-center justify-between gap-8 rounded-lg border border-transparent {isSelected ? 'bg-zinc-900/5 dark:bg-white/10 border-zinc-900/5 dark:border-zinc-100/5' : ''}">
|
<div class="flex items-center justify-between gap-8 rounded-lg border border-transparent {isSelected ? 'bg-zinc-900/5 dark:bg-white/10 border-zinc-900/5 dark:border-zinc-100/5' : ''}">
|
||||||
<div class="flex flex-col flex-1 items-center py-4 pl-4 min-w-0">
|
<div class="flex flex-col flex-1 items-center py-4 pl-4 min-w-0">
|
||||||
<div class="overflow-hidden py-2 w-full font-semibold text-center whitespace-nowrap text-zinc-900 dark:text-white text-ellipsis"
|
<div class="overflow-hidden py-2 w-full font-semibold text-center whitespace-nowrap text-zinc-900 dark:text-white text-ellipsis"
|
||||||
style="--char-count: {result?.length || 10}; font-size: min(2.5rem, max(1rem, calc(25vw / var(--char-count, 10))))">
|
style="--char-count: {searchTerm?.length || 10}; font-size: min(2.5rem, max(1rem, calc(35vw / var(--char-count, 10))))">
|
||||||
{searchTerm}
|
{searchTerm}
|
||||||
</div>
|
</div>
|
||||||
<div class="px-3 py-1 mt-1 text-sm rounded-md text-zinc-900 dark:text-zinc-300 bg-zinc-100 dark:bg-zinc-100/10">
|
<div class="px-3 py-1 mt-1 text-sm rounded-md text-zinc-900 dark:text-zinc-300 bg-zinc-100 dark:bg-zinc-100/10">
|
||||||
|
|||||||
@@ -195,6 +195,8 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<ul class="overflow-y-auto max-h-[24rem] text-base scroll-py-2 p-1 gap-0.5 flex flex-col">
|
||||||
<Calculator
|
<Calculator
|
||||||
searchTerm={searchTerm}
|
searchTerm={searchTerm}
|
||||||
isSelected={selectedIndex === 0}
|
isSelected={selectedIndex === 0}
|
||||||
@@ -202,7 +204,6 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
{#if combinedResults.length > 0}
|
{#if combinedResults.length > 0}
|
||||||
<ul class="overflow-y-auto max-h-[24rem] text-base scroll-py-2 p-1 gap-0.5 flex flex-col">
|
|
||||||
{#each combinedResults as result, i (result.id)}
|
{#each combinedResults as result, i (result.id)}
|
||||||
{@const isSelected = selectedIndex === (calculatorResult ? i + 1 : i)}
|
{@const isSelected = selectedIndex === (calculatorResult ? i + 1 : i)}
|
||||||
{@const item = result.item}
|
{@const item = result.item}
|
||||||
@@ -251,7 +252,6 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</li>
|
</li>
|
||||||
{/each}
|
{/each}
|
||||||
</ul>
|
|
||||||
{:else if !calculatorResult}
|
{:else if !calculatorResult}
|
||||||
<div class="px-8 py-16 text-center text-zinc-900 dark:text-zinc-200 sm:px-16">
|
<div class="px-8 py-16 text-center text-zinc-900 dark:text-zinc-200 sm:px-16">
|
||||||
{#if isLoading}
|
{#if isLoading}
|
||||||
@@ -265,9 +265,10 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
</ul>
|
||||||
<div class="px-3 py-2 w-full border-t border-zinc-900/5 dark:border-zinc-100/5 bg-white/5">
|
<div class="px-3 py-2 w-full border-t border-zinc-900/5 dark:border-zinc-100/5 bg-white/5">
|
||||||
{#if combinedResults.length > 0 || calculatorResult}
|
{#if combinedResults.length > 0 || calculatorResult}
|
||||||
<div class="flex justify-between items-center text-sm text-zinc-500 dark:text-zinc-400">
|
<div class="flex justify-between items-center h-5 text-sm text-zinc-500 dark:text-zinc-400">
|
||||||
<div class="flex gap-4 items-center">
|
<div class="flex gap-4 items-center">
|
||||||
{#if !calculatorResult}
|
{#if !calculatorResult}
|
||||||
{#if selectedIndex >= 0 && selectedIndex < combinedResults.length}
|
{#if selectedIndex >= 0 && selectedIndex < combinedResults.length}
|
||||||
|
|||||||
@@ -31,8 +31,13 @@ const testPlugin: Plugin<typeof settings> = {
|
|||||||
run: async (api) => {
|
run: async (api) => {
|
||||||
console.log('Test plugin running');
|
console.log('Test plugin running');
|
||||||
|
|
||||||
|
api.events.on('ping', (data) => {
|
||||||
|
console.log('Ping received! Page changed to: ', data);
|
||||||
|
});
|
||||||
|
|
||||||
const { unregister } = api.seqta.onPageChange((page) => {
|
const { unregister } = api.seqta.onPageChange((page) => {
|
||||||
console.log('Page changed to', page);
|
//console.log('Page changed to', page);
|
||||||
|
api.events.emit('ping', page);
|
||||||
|
|
||||||
console.log('Current setting value:', api.settings.someSetting);
|
console.log('Current setting value:', api.settings.someSetting);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import themesPlugin from './built-in/themes';
|
|||||||
import animatedBackgroundPlugin from './built-in/animatedBackground';
|
import animatedBackgroundPlugin from './built-in/animatedBackground';
|
||||||
import assessmentsAveragePlugin from './built-in/assessmentsAverage';
|
import assessmentsAveragePlugin from './built-in/assessmentsAverage';
|
||||||
import globalSearchPlugin from './built-in/globalSearch';
|
import globalSearchPlugin from './built-in/globalSearch';
|
||||||
|
import testPlugin from './built-in/test';
|
||||||
|
|
||||||
// Initialize plugin manager
|
// Initialize plugin manager
|
||||||
const pluginManager = PluginManager.getInstance();
|
const pluginManager = PluginManager.getInstance();
|
||||||
@@ -18,7 +19,7 @@ pluginManager.registerPlugin(assessmentsAveragePlugin);
|
|||||||
pluginManager.registerPlugin(notificationCollectorPlugin);
|
pluginManager.registerPlugin(notificationCollectorPlugin);
|
||||||
pluginManager.registerPlugin(timetablePlugin);
|
pluginManager.registerPlugin(timetablePlugin);
|
||||||
pluginManager.registerPlugin(globalSearchPlugin);
|
pluginManager.registerPlugin(globalSearchPlugin);
|
||||||
//pluginManager.registerPlugin(testPlugin);
|
pluginManager.registerPlugin(testPlugin);
|
||||||
|
|
||||||
export { init as Monofile } from './monofile';
|
export { init as Monofile } from './monofile';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user