Created
February 20, 2023 15:06
-
-
Save YonatanKra/c307e8bf5eb4d4d3c712b3697088bb0a to your computer and use it in GitHub Desktop.
With prize handling
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
function addNextQuestion(question) { | |
if (question.rewardUrl) { | |
showWinningModal(question.rewardUrl); | |
} else { | |
const cardContent = generateCardContent(question); | |
card.innerHTML = cardContent; | |
} | |
} | |
function showWinningModal(rewardUrl) { | |
dialog.headline = 'You Made It!'; | |
dialog.icon = 'surprised-solid'; | |
dialog.innerHTML = ` | |
<div slot="content" style="text-align: center;"> | |
<h2> Congratulations! </h2> | |
<p> | |
<a href=${rewardUrl}> | |
<vwc-button appearance='filled' connotation="success" label="Get Your Prize!!!"></vwc-button> | |
</p> | |
</a> | |
</div> | |
`; | |
dialog.showModal(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment