diff --git a/frontend/src/lib/components/navbar.svelte b/frontend/src/lib/components/navbar.svelte
index c499808..3f8f5db 100644
--- a/frontend/src/lib/components/navbar.svelte
+++ b/frontend/src/lib/components/navbar.svelte
@@ -16,7 +16,6 @@
let navbar_title;
let navbar_category;
- let navbar_search;
function isActive(str, url) {
if (url === str) return 'navbar-active';
@@ -106,27 +105,10 @@
+
-
- {
- update_gradient(event, navbar_search);
- }}
- on:mouseenter={() => {
- animateForeground(true, navbar_search);
- }}
- on:mouseleave={() => {
- animateForeground(false, navbar_search);
- }}
- >
-
-
-
-
diff --git a/frontend/src/lib/components/search.svelte b/frontend/src/lib/components/search.svelte
index a1db255..9a67c6c 100644
--- a/frontend/src/lib/components/search.svelte
+++ b/frontend/src/lib/components/search.svelte
@@ -6,6 +6,13 @@
import { mdiMagnify } from '@mdi/js';
import anime from 'animejs';
+ export let width = '50%';
+ export let font_size = '1rem';
+ export let padding = '1rem';
+ export let logo_size = 20;
+ export let margin = '0rem';
+ export let text_color = 'var(--color-subtext)';
+
let div_search;
let input_search;
let svgIcon;
@@ -18,7 +25,6 @@
return;
}
selected = true;
- animateButton(true);
showSearch(true);
// Animating the div
@@ -37,7 +43,7 @@
percent_var: [0, 100],
opacity_var: [1, 0],
easing: 'easeOutQuad',
- duration: 400,
+ duration: 300,
update: function (anim) {
div_search.style.background = `radial-gradient(circle farthest-corner at 0px 0px, var(--color-background) ${anim.animations[0].currentValue}%, rgba(149,138,152,${anim.animations[1].currentValue}) 100%)`;
}
@@ -48,27 +54,11 @@
function closeSearch(event) {
if (selected && event.target != input_search && event.target != svgIcon.svgElement) {
- animateButton(false);
showSearch(false);
selected = false;
}
}
- function animateButton(isEntering) {
- const tvalue = isEntering ? [0, -0.8] : [-0.8, 0];
- const svalue = isEntering ? [1, 1.2] : [1.2, 1];
- anime({
- targets: { transform: 0, scale: 1 },
- transform: tvalue,
- scale: svalue,
- duration: 300,
- easing: 'easeOutQuad',
- update: function (anim) {
- svgIcon.svgElement.style.transform = `scale(${anim.animations[1].currentValue}) translateX(${anim.animations[0].currentValue}rem)`;
- }
- });
- }
-
function showSearch(isEntering) {
//transform: ;
if (isEntering) {
@@ -98,10 +88,21 @@
-
+
diff --git a/frontend/src/lib/components/svg-icon-custom.svelte b/frontend/src/lib/components/svg-icon-custom.svelte
index 90a079d..0c0840c 100644
--- a/frontend/src/lib/components/svg-icon-custom.svelte
+++ b/frontend/src/lib/components/svg-icon-custom.svelte
@@ -22,6 +22,7 @@
export let viewbox = null;
export let flip = 'none';
export let rotate = 0;
+ export let padding = 0;
// Reactive statements to set default values based on type
$: defaults = types[type] || types.default;
@@ -37,9 +38,9 @@