Skip to content

Import a 3D Model and automatically assign and export animations

TypeScript

Start adding some content to successful export

Scott Petrovicc7fb0b250ddf
diff --git a/src/dialog.css b/src/dialog.css
index 94a7e68..367b275 100644
--- a/src/dialog.css
+++ b/src/dialog.css
@@ -2,6 +2,12 @@
margin: 3rem 0;
}
+@keyframes dialog-bounce-in {
+ 0% { transform: scale(0.4); opacity: 0; }
+ 70% { transform: scale(1.1); opacity: 1; }
+ 100% { transform: scale(1.0); }
+}
+
.modal-dialog-overlay {
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
@@ -21,13 +27,7 @@
text-align: center;
max-width: 80%;
box-shadow: 0 0 5rem #0b1d36;
- animation: modal-dialog-bounce-in 0.3s ease-out;
-}
-
-@keyframes modal-dialog-bounce-in {
- 0% { transform: scale(0.4); opacity: 0; }
- 70% { transform: scale(1.1); opacity: 1; }
- 100% { transform: scale(1.0); }
+ animation: dialog-bounce-in 0.3s ease-out;
}
.modal-dialog-body {
@@ -90,16 +90,10 @@
.variation-dialog {
width: 60vw;
- animation: variation-dialog-bounce-in 0.3s ease-out;
+ animation: dialog-bounce-in 0.3s ease-out;
box-shadow: 0 0 7rem #08161e9e;
}
-@keyframes variation-dialog-bounce-in {
- 0% { transform: scale(0.4); opacity: 0; }
- 70% { transform: scale(1.1); opacity: 1; }
- 100% { transform: scale(1.0); }
-}
-
.variation-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
@@ -220,64 +214,80 @@
}
.download-success-dialog-content {
- background: var(--bg-primary);
- border-radius: 8px;
- padding: 2rem;
- max-width: 600px;
- max-height: 80vh;
- overflow-y: auto;
- box-shadow: 0 0 5rem rgba(0, 0, 0, 0.5);
- animation: download-success-bounce-in 0.3s ease-out;
- color: var(--text-primary);
-}
-
-@keyframes download-success-bounce-in {
- 0% {
- transform: scale(0.4);
- opacity: 0;
- }
- 70% {
- transform: scale(1.1);
- opacity: 1;
- }
- 100% {
- transform: scale(1);
- }
+ background: var(--bg-primary);
+ border-radius: 8px;
+ padding: 2rem;
+ max-width: 60rem;
+ overflow-y: auto;
+ box-shadow: 0 0 5rem rgba(0, 0, 0, 0.5);
+ animation: dialog-bounce-in 0.3s ease-out;
+ color: var(--text-primary);
}
.download-success-dialog-content h2 {
- margin: 0 0 1.5rem 0;
- font-size: 1.8rem;
+ margin: 0;
+ font-size: 2.2rem;
color: var(--text-primary);
+ justify-content: space-around;
+ display: flex;
+ margin-bottom: 1.0rem;
}
.download-success-dialog-body {
- color: var(--text-primary);
+color: var(--text-primary);
font-size: 1rem;
line-height: 1.5;
+ display: flex;
+ grid-template-columns: repeat(3, 1fr);
+ gap: 1rem;
}
-.download-success-dialog-body p {
- margin: 0.5rem 0;
+.download-success-dialog-body > p {
+ grid-column: 1 / -1;
+ margin: 0 0 1rem 0;
+ text-align: center;
}
-.download-success-dialog-close {
- margin-top: 1.5rem;
- padding: 0.75rem 1.5rem;
- font-size: 1rem;
- cursor: pointer;
- border: none;
- border-radius: 4px;
- background: var(--button-primary-bg);
- color: var(--button-primary-text);
- transition: opacity 0.2s;
+.download-success-section {
+ padding: 2rem;
+ background: var(--bg-alternate);
+ border-radius: 6px;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
}
-.download-success-dialog-close:hover {
- opacity: 0.8;
+.download-success-section h3 {
+ margin: 0;
+ font-size: 1.5rem;
+ color: var(--text-primary);
}
-.download-success-dialog-close:active {
- opacity: 0.9;
+.download-success-section p {
+ margin: 1rem 0;
+ color: var(--text-alternate);
+ font-size: 1.1rem;
+ line-height: 1.4;
+}
+
+.download-success-dialog-close {
+ display: flex;
+ padding: 1rem;
+ font-size: 1.1rem;
+ justify-content: center;
+}
+
+@media (max-width: 768px) {
+ .download-success-dialog-body {
+ grid-template-columns: 1fr;
+ }
+
+ .download-success-section {
+ padding: 1rem;
+ }
+
+ .download-success-dialog-content {
+ max-width: 90%;
+ }
}
diff --git a/src/lib/DownloadSuccessDialog.ts b/src/lib/DownloadSuccessDialog.ts
index 6cce91b..44b58be 100644
--- a/src/lib/DownloadSuccessDialog.ts
+++ b/src/lib/DownloadSuccessDialog.ts
@@ -1,7 +1,38 @@
export class DownloadSuccessDialog {
private dialog_element: HTMLDivElement | null = null
- private readonly title = 'Export Successful'
- private readonly content_html = '<p>Your animation export is ready!</p>'
+ private readonly content_html = `
+
+
+ <div class="download-success-dialog-content">
+ <h2>Export Successful</h2>
+ <div class="download-success-dialog-body">
+ <div class="download-success-section">
+ <h3>How was your experience</h3>
+ <p>Quick question: Are you enjoying Mesh2Motion? We'd love to hear your feedback!
+ It only takes 2 minutes to answer our brief survey.</p>
+
+ <button>Take Survey</button>
+ </div>
+
+ <div class="download-success-section">
+ <h3>Support the Project</h3>
+ <p>If you find Mesh2Motion helpful, consider donating to help us keep improving the tool
+ and adding new features.</p>
+ <a href="https://support.mesh2motion.org/" class="button">Learn More</a>
+ </div>
+
+ <div class="download-success-section">
+ <h3>Join Our Community</h3>
+ <p>Have questions or want to share your creations? Join us on Discord to connect with
+ other animators and get support.</p>
+ <a href="https://discord.gg/UChE936q7y" target="_blank" class="button">
+ Join Discord Server
+ </a>
+ </div>
+ </div>
+ <a href="#" class="download-success-dialog-close">Not today, maybe tomorrow</a>
+ </div>
+ `
constructor (private readonly options?: { onClose?: () => void }) {}
@@ -11,13 +42,7 @@ export class DownloadSuccessDialog {
this.dialog_element.className = 'download-success-dialog-overlay'
// HTML template for the content
- this.dialog_element.innerHTML = `
- <div class="download-success-dialog-content">
- <h2>${this.title}</h2>
- <div class="download-success-dialog-body">${this.content_html}</div>
- <button class="download-success-dialog-close">Close</button>
- </div>
- `
+ this.dialog_element.innerHTML = this.content_html
document.body.appendChild(this.dialog_element)
// Close button handler
diff --git a/src/styles.css b/src/styles.css
index c33c6e4..8283cd6 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -236,8 +236,13 @@ button.secondary-button {
cursor: pointer;
transition: transform 0.2s ease;
transform: scale(1.00);
+ display: inline-block;
+ padding: 0.5em 1.5em;
+ text-decoration: none;
+ color: var(--text-primary);
}
-button.secondary-button:hover {
+button.secondary-button:hover,
+a.secondary-button:hover {
transform: scale(1.05);
background: var(--bg-alternate);
}
@@ -281,6 +286,9 @@ button, .button {
cursor: pointer;
text-align: center; /* useful for custom file upload label */
transition: all 0.1s ease;
+ text-decoration: none;
+ font-size: 1.0rem;
+ color: var(--text-primary);
}
button:hover, .button:hover {
/* background: var(--button-primary-bg); */