Skip to content

Instantly share code, notes, and snippets.

@YonatanKra
Created February 20, 2023 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YonatanKra/c307e8bf5eb4d4d3c712b3697088bb0a to your computer and use it in GitHub Desktop.
Save YonatanKra/c307e8bf5eb4d4d3c712b3697088bb0a to your computer and use it in GitHub Desktop.
With prize handling
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