Created
March 17, 2023 20:21
-
-
Save trevor-atlas/5eea582ea68faf7a4aa68d1f6ee487bd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Menu: Icebreaker | |
// Description: Get a random icebreaker question | |
// Author: Trevor Atlas | |
// Twitter: @trevoratlas | |
import '@johnlindquist/kit'; | |
const dbvalues = await db('icebreakers'); | |
const icebreakers: string[] = dbvalues.data; | |
const getRandomElement = <T>(arr: T[]) => { | |
const index = Math.floor(Math.random() * arr.length); | |
return arr[index]; | |
}; | |
const item = getRandomElement(icebreakers); | |
await div( | |
` | |
<div class="w-full h-full text-center flex items-center justify-center"> | |
<h1 :class="responseClass">${item}</h1> | |
<div> | |
` | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment