diff --git a/src/components/ResourceBar.astro b/src/components/ResourceBar.astro index f095923..384b8fd 100644 --- a/src/components/ResourceBar.astro +++ b/src/components/ResourceBar.astro @@ -4,8 +4,10 @@ import { getUserResources } from '../lib/utils/resourceManager'; import { getHighestWeightedLanguage, getLocales } from '../lib/lang/langDriver'; import resourceTypes from '../lib/data/resources.json'; +import format from '../lib/utils/format'; const resourceLang = await getLocales(getHighestWeightedLanguage(Astro.request.headers.get('accept-language')), 'resources'); +const resBarLang = await getLocales(getHighestWeightedLanguage(Astro.request.headers.get('accept-language')), 'resourcebar'); const resources = await getUserResources(new ObjectId(Astro.cookies.get('userid')?.value ?? '')); @@ -23,7 +25,11 @@ for(const key in resources) {
@@ -75,6 +86,7 @@ for(const key in resources) { display: flex; flex-direction: row; padding-left: 15px; + position: relative; } .resourcebar-item-icon { @@ -102,36 +114,55 @@ for(const key in resources) { .resourcebar-item-amount { font-size: 1.2em; } + +.resourcebar-item .resourcebar-item-tooltip { + position: absolute; + background-color: gray; + margin-top: 70px; + width: 150%; + border-radius: 10px; + transition: opacity 1s; + opacity: 0; +} + +.resourcebar-item:hover .resourcebar-item-tooltip { + opacity: 1; +}