Skip to content

Commit

Permalink
Merge pull request #24 from BeatBuzzer/feat/levelbar
Browse files Browse the repository at this point in the history
added levelbar
  • Loading branch information
synan798 authored Dec 10, 2024
2 parents 4ce2318 + 22c09e9 commit 90ff040
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 24 deletions.
2 changes: 1 addition & 1 deletion layouts/HeaderFooterView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="w-full xl:w-1/2 2xl:w-1/4 flex flex-col h-full">

<!-- Header -->
<div class="h-1/6 border rounded-b-3xl">
<div class="bg-yellow-500 h-1/6 border rounded-b-3xl">
<div class="flex justify-around items-center h-full">
<slot name="header" />
</div>
Expand Down
67 changes: 44 additions & 23 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,78 +2,99 @@
import HeaderFooterView from "~/layouts/HeaderFooterView.vue";
import { UserViewType } from "@/types/components/users.view"
const { user } = useUser()
useUser().fetchUser(); // loading user state just in case
function setLevelbar(newValue: number) {

Check failure on line 9 in pages/index.vue

View workflow job for this annotation

GitHub Actions / eslint

'setLevelbar' is defined but never used. Allowed unused vars must match /^_/u
const levelbar = document.getElementById('levelbar')
if (levelbar) {
levelbar.style.width = newValue + "%"
}
}
</script>

<template>
<div class="bg-gradient-to-b from-indigo-500 to-purple-500">
<HeaderFooterView>
<template #header>
<div>
1A
</div>
<div>
2B
<div class="m-3 w-full flex items-center justify-center">
<Icon name="mdi:fire" class="text-red-600 text-4xl mr-2" />
<p class="text-xl font-bold">Streak: {{ user?.daily_streak }}</p>
</div>
<div>
3C
<div class="m-3 w-full flex items-center justify-center">
<Icon name="mdi:star" class="text-red-600 text-5xl mr-2" />
<div class="w-full bg-gray-700 rounded-full h-2.5">
<div id="levelbar" class="bg-red-600 h-2.5 rounded-full" style="width: 50%" />
</div>
</div>


</template>
<template #content>
<div class="flex flex-col h-full p-3">
<UsersView :view-type="UserViewType.USERTURN" class="h-3/6" :users="[

Check warning on line 37 in pages/index.vue

View workflow job for this annotation

GitHub Actions / eslint

Expected a linebreak before this attribute
{ user_id: 1,
{
user_id: 1,
user_avatar: null,
username: 'Test1'
},
{ user_id: 1,
{
user_id: 1,
user_avatar: null,
username: 'Test1'
},
{ user_id: 1,
{
user_id: 1,
user_avatar: null,
username: 'Test1'
},
{ user_id: 1,
{
user_id: 1,
user_avatar: null,
username: 'Test1'
},
{ user_id: 1,
{
user_id: 1,
user_avatar: null,
username: 'Test1'
},
]"/>
},
]" />
<UsersView :view-type="UserViewType.OPPONENTTURN" class="h-2/6" :users="[

Check warning on line 64 in pages/index.vue

View workflow job for this annotation

GitHub Actions / eslint

Expected a linebreak before this attribute
{ user_id: 1,
{
user_id: 1,
user_avatar: null,
username: 'Test1'
},
{ user_id: 2,
{
user_id: 2,
user_avatar: null,
username: 'Test2'
},
{ user_id: 3,
{
user_id: 3,
user_avatar: null,
username: 'Test3'
},
{ user_id: 4,
{
user_id: 4,
user_avatar: null,
username: 'Test4'
},
]"/>
<HomeControlsGameButtons class="h-1/6"/>
]" />
<HomeControlsGameButtons class="h-1/6" />
</div>
</template>
<template #footer>
<NuxtLink to="/playlists" class="inline-flex items-center text-5xl rounded-xl">
<Icon name="mdi:album" class=""/>
<Icon name="mdi:album" class="" />
</NuxtLink>
<NuxtLink to="/" class="inline-flex items-center text-6xl rounded-full p-1.5">
<Icon name="mdi:home" class="text-white"/>
<Icon name="mdi:home" class="text-white" />
</NuxtLink>
<NuxtLink to="/profile" class="inline-flex items-center text-5xl rounded-xl">
<Icon name="mdi:account-details" class=""/>
<Icon name="mdi:account-details" class="" />
</NuxtLink>
</template>
</HeaderFooterView>
Expand Down

0 comments on commit 90ff040

Please sign in to comment.