Skip to content

Import a 3D Model and automatically assign and export animations

TypeScript

add request animation, even with some filtered results for better discoverability

Scott Petrovica54ec80d19e2
diff --git a/src/lib/processes/animations-listing/AnimationSearch.ts b/src/lib/processes/animations-listing/AnimationSearch.ts
index 7b459af..2cf62c1 100644
--- a/src/lib/processes/animations-listing/AnimationSearch.ts
+++ b/src/lib/processes/animations-listing/AnimationSearch.ts
@@ -340,6 +340,16 @@ export class AnimationSearch extends EventTarget {
this.animation_list_container.innerHTML += animation_entry_html
})
+ // when searching, the results might be close but not what they want (e.g. "wall" but looking for "wall run")
+ // so give them a way to request an animation at the end of the results
+ if (filter_text.trim() !== '') {
+ this.animation_list_container.insertAdjacentHTML('beforeend', `
+ <a href="#" class="request-animation-link anim-request-tile" data-rig-type="${this.skeleton_type}">
+ <span>Not finding what you want?</span>
+ <span class="anim-request-tile-action">Request an animation</span>
+ </a>`)
+ }
+
// only so many WebM videos can be playing at the same time
// so this is an optimization to convert only elements in the active scroll area to video elements
this.setup_lazy_video_loading()
diff --git a/src/styles.css b/src/styles.css
index 03227bb..5abc744 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -958,6 +958,39 @@ div.modal-dialog-body p.survey-thank-you {
color: var(--text-primary);
}
+/* tile at the end of filtered results to request an animation */
+#animations-items .anim-request-tile {
+ display: inline-flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ gap: 0.4rem;
+ width: 103px;
+ height: 160px;
+ padding: 0.5rem;
+ box-sizing: border-box;
+ border: 1px dashed var(--bg-tertiary);
+ background: var(--bg-primary);
+ text-align: center;
+ text-decoration: none;
+ font-style: normal;
+ font-size: 85%;
+ line-height: 120%;
+}
+
+#animations-items .anim-request-tile:hover {
+ border-color: var(--text-primary);
+}
+
+.anim-request-tile-icon {
+ font-size: 200%;
+ line-height: 100%;
+}
+
+.anim-request-tile-action {
+ text-decoration: underline;
+}
+
#build-version {
position: fixed;
bottom: 0;