Skip to content

Commit

Permalink
Fixed spline viewer issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rgravitvl committed Dec 6, 2024
1 parent f95eae0 commit cf6deea
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
13 changes: 13 additions & 0 deletions blocks/spline-viewer/spline-viewer.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.spline-viewerwrapper :is(.block) {
display: block
}

.spline-viewerwrapper :is(.bg-danaherlightblue-50) {
--tw-bg-opacity: 1;
background-color: rgb(239 251 253 / var(--tw-bg-opacity))
}

.spline-viewerwrapper :is(.bg-danaherpurple-800) {
--tw-bg-opacity: 1;
background-color: rgb(64 0 165 / var(--tw-bg-opacity))
}
5 changes: 2 additions & 3 deletions blocks/spline-viewer/spline-viewer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { getFragmentFromFile } from '../../scripts/scripts.js';
import { loadScript } from '../../scripts/lib-franklin.js';

Check failure on line 2 in blocks/spline-viewer/spline-viewer.js

View workflow job for this annotation

GitHub Actions / build

'loadScript' is defined but never used

export default async function decorate(block) {
try {
Expand All @@ -7,9 +8,7 @@ export default async function decorate(block) {
block.innerHTML = '';
const parser = new DOMParser();
const fragmentHtml = parser.parseFromString(fragment, 'text/html');
[...fragmentHtml.body.children].forEach((item) => {
block.append(item);
});
block.append(fragmentHtml?.body?.firstElementChild);
} catch (e) {
block.textContent = '';
// eslint-disable-next-line no-console
Expand Down
5 changes: 5 additions & 0 deletions build-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ const fileMappings = [
output: './blocks/mini-teasers/mini-teasers.css',
wrapper: 'mini-teasers-wrapper',
},
{
content: './blocks/spline-viewer/spline-viewer.js',
output: './blocks/spline-viewer/spline-viewer.css',
wrapper: 'spline-viewerwrapper',
},
{
content: ['./blocks/page-jump-menu/page-jump-menu.js', './blocks/page-tabs/page-tabs.js'],
output: './blocks/page-jump-menu/page-jump-menu.css',
Expand Down
1 change: 0 additions & 1 deletion fragments/spline.html
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
<script type="module" src="https://unpkg.com/@splinetool/[email protected]/build/spline-viewer.js"></script>
<spline-viewer url="https://prod.spline.design/UBAIdqMtOkuDExkL/scene.splinecode"></spline-viewer>
1 change: 1 addition & 0 deletions head.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
<link rel="dns-prefetch" href="https://danaherls.scene7.com">
<link rel="stylesheet" href="/styles/styles.css"/>
<script type="application/ld+json" data-name="website">{"@context":"https://schema.org","@type":"WebSite","url":" https://lifesciences.danaher.com/","name":"Danaher Life Sciences","alternateName":"DH Life Sciences","description":" Explore our automation solutions, analytical innovations, and digital solutions to accelerate drug development time by up to 50%. We empower the creation of biopharmaceuticals, gene/cell therapies & innovative treatments.","potentialAction":{"@type":"SearchAction","target":"https://lifesciences.danaher.com/us/en/search.html#q={search_term_string}","query-input":"required name=search_term_string"}}</script>
<script type="module" src="https://unpkg.com/@splinetool/[email protected]/build/spline-viewer.js"></script>

0 comments on commit cf6deea

Please sign in to comment.