-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add basic styling, preliminary layout with data
- Loading branch information
Showing
8 changed files
with
114 additions
and
119 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,4 @@ | ||
<script> | ||
import { onMount } from "svelte"; | ||
import { GlobalStats } from "../../../wailsjs/go/main/App.js"; | ||
// Holds the general global leaderboard stats | ||
let stats = {}; | ||
// Because separating the keys with regex is worse | ||
const generalStats = { | ||
LessonCompletions: "Lessons Completed", | ||
XPEarned: "XP Earned", | ||
BootsChats: "Chats with Boots", | ||
SolutionsPeeked: "Solutions Peeked", | ||
DiscordMessagesSent: "Discord Messages", | ||
RegisteredUsersAlltime: "Registered Users", | ||
}; | ||
// getGlobalStats returns the current global leaderboard stats | ||
// The stats are shaped like [name,value] | ||
function getGlobalStats() { | ||
GlobalStats().then((result) => (stats = result)); | ||
} | ||
onMount(() => { | ||
getGlobalStats(); | ||
}); | ||
</script> | ||
|
||
<main> | ||
{#each Object.entries(stats) as stat} | ||
<div> | ||
{generalStats[stat[0]] + ": " + stat[1]} | ||
</div> | ||
{/each} | ||
</main> | ||
<main>Welcome to Boot.dev Buddy!</main> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<script> | ||
import { onMount } from "svelte"; | ||
import { | ||
TopCommunity, | ||
TopDailyLearners, | ||
GlobalStats, | ||
} from "../../../wailsjs/go/main/App.js"; | ||
// Holds the top 30 discord karma leaderboard users | ||
let archons = []; | ||
// Holds the general global leaderboard stats | ||
let stats = {}; | ||
// Holds the top 30 leaderboard users | ||
let leaders = []; | ||
// Because separating the keys with regex is worse | ||
const generalStats = { | ||
LessonCompletions: "Lessons Completed", | ||
XPEarned: "XP Earned", | ||
BootsChats: "Chats with Boots", | ||
SolutionsPeeked: "Solutions Peeked", | ||
DiscordMessagesSent: "Discord Messages", | ||
RegisteredUsersAlltime: "Registered Users", | ||
}; | ||
// getGlobalStats returns the current global leaderboard stats | ||
// The stats are shaped like [name,value] | ||
function getTopDailyStats() { | ||
TopDailyLearners().then((result) => (leaders = result)); | ||
} | ||
// getTopCommunity returns the top 30 users with the highest karma, | ||
// a stat earned by being active in the Discord channel | ||
function getTopCommunity() { | ||
TopCommunity().then((result) => (archons = result)); | ||
} | ||
// getGlobalStats returns the current global leaderboard stats | ||
// The stats are shaped like [name,value] | ||
function getGlobalStats() { | ||
GlobalStats().then((result) => (stats = result)); | ||
} | ||
onMount(() => { | ||
getTopDailyStats(); | ||
getTopCommunity(); | ||
getGlobalStats(); | ||
}); | ||
</script> | ||
|
||
<main> | ||
{#each Object.entries(stats) as stat} | ||
<div> | ||
{generalStats[stat[0]] + ": " + stat[1]} | ||
</div> | ||
{/each} | ||
{#each archons as sage} | ||
<div> | ||
{sage?.Handle} | ||
</div> | ||
{/each} | ||
{#each leaders as lead} | ||
<div> | ||
{lead?.Handle} | ||
</div> | ||
{/each} | ||
</main> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters