Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model card previews #873

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Model card previews #873

wants to merge 4 commits into from

Conversation

rahulkgupta
Copy link
Collaborator

@rahulkgupta rahulkgupta commented Sep 19, 2024

  • assets now reads from catalog.json and will create mixins from there.
  • catalog.json values contains a src field which is used for both glb and images.

todo

  • remove images from here.

id="${item.id}"
shadow
gltf-model="url(${item.src}/${item.id}.glb)"
category="${item.category || ''}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use data-category here unless you're creating a category component.

Copy link
Collaborator Author

@rahulkgupta rahulkgupta Sep 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was trying to maintain existing functionality

  function addCategoryNamesToMixins(html, categoryName) {
    const parser = new DOMParser();
    const doc = parser.parseFromString(html, 'text/html');
    const mixinNodes = doc.querySelectorAll('a-mixin');
    mixinNodes.forEach((mixinNode) => {
      mixinNode.setAttribute('category', categoryName);
    });
    return doc.documentElement.innerHTML;
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants