-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add config builder page to demo (#564)
- Loading branch information
1 parent
fca7650
commit 5aa9b03
Showing
14 changed files
with
1,050 additions
and
6 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" data-theme="light"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Dynamic Form Builder</title> | ||
<link rel="stylesheet" href="../css/pico.min.css"> | ||
<link rel="stylesheet" href="../css/config-builder-style.css"> | ||
|
||
<script src="./js/script.js" type="module"></script> | ||
</head> | ||
<body> | ||
<main class="container"> | ||
<div class="header"> | ||
<h1>Create your TIDO config</h1> | ||
</div> | ||
<div class="split-view"> | ||
<div class="form-container"> | ||
<div id="app"></div> | ||
</div> | ||
<div class="json-container"> | ||
<button id="copy" class="outline">Copy</button> | ||
<pre id="jsonOutput"></pre> | ||
</div> | ||
</div> | ||
|
||
</main> | ||
</body> | ||
</html> |
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,28 @@ | ||
function triggerConfetti() { | ||
const confettiCount = 50; // Number of confetti pieces | ||
const explosionOriginX = window.innerWidth / 2; // Center of screen | ||
const explosionOriginY = window.innerHeight; // Bottom of screen | ||
|
||
for (let i = 0; i < confettiCount; i++) { | ||
let confetti = document.createElement("div"); | ||
confetti.className = "confetti"; | ||
document.body.appendChild(confetti); | ||
|
||
// Random trajectory | ||
let x = (Math.random() - 0.5) * window.innerWidth + "px"; // Spread horizontally | ||
let y = (Math.random() * -(window.innerHeight)) + "px"; // Upward explosion | ||
|
||
confetti.style.setProperty('--x', x); | ||
confetti.style.setProperty('--y', y); | ||
confetti.style.left = `${explosionOriginX}px`; | ||
confetti.style.top = `${explosionOriginY}px`; | ||
confetti.style.backgroundColor = `hsl(${Math.random() * 360}, 100%, 50%)`; // Random colors | ||
|
||
// Remove confetti after animation | ||
setTimeout(() => confetti.remove(), 1500); | ||
} | ||
} | ||
|
||
export { | ||
triggerConfetti | ||
} |
Oops, something went wrong.