From 0137ad017f683fb97825529c6ec6969b85037fbf Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Tue, 28 Jun 2022 18:06:18 +0900 Subject: [PATCH 1/3] Examples: Added external tag. --- examples/index.html | 25 +++++++++---------------- examples/tags.json | 3 ++- files/main.css | 10 ++++++++++ 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/examples/index.html b/examples/index.html index 6c1a11cdc57ab..1658869da47ca 100644 --- a/examples/index.html +++ b/examples/index.html @@ -77,18 +77,18 @@

three.js

for ( const key in files ) { - const section = files[ key ]; + const category = files[ key ]; const header = document.createElement( 'h2' ); header.textContent = key; header.setAttribute( 'data-category', key ); container.appendChild( header ); - for ( let i = 0; i < section.length; i ++ ) { + for ( let i = 0; i < category.length; i ++ ) { - const file = section[ i ]; + const file = category[ i ]; - const link = createLink( file ); + const link = createLink( file, tags[ file ] ); container.appendChild( link ); links[ file ] = link; @@ -201,15 +201,17 @@

three.js

} - function createLink( file ) { + function createLink( file, tags ) { + + const external = Array.isArray( tags ) && tags.includes( 'external' ) ? ' external' : ''; const template = `
- +
-
${getName( file )}
+
${ getName( file ) }${ external }
`; @@ -319,18 +321,9 @@

three.js

link.classList.remove( 'hidden' ); - for ( let i = 0; i < res.length; i ++ ) { - - text = name.replace( res[ i ], '' + res[ i ] + '' ); - - } - - link.querySelector( '.title' ).innerHTML = text; - } else { link.classList.add( 'hidden' ); - link.querySelector( '.title' ).innerHTML = name; } diff --git a/examples/tags.json b/examples/tags.json index 65bdf5c797ade..7da06abac9388 100644 --- a/examples/tags.json +++ b/examples/tags.json @@ -33,6 +33,7 @@ "webgl_loader_ttf": [ "text", "font" ], "webgl_loader_pdb": [ "molecules", "css2d" ], "webgl_loader_ldraw": [ "lego" ], + "webgl_loader_ifc": [ "external" ], "webgl_lod": [ "level", "details" ], "webgl_materials_blending": [ "alpha" ], "webgl_materials_blending_custom": [ "alpha" ], @@ -88,7 +89,7 @@ "webgl_postprocessing_unreal_bloom_selective": [ "glow" ], "webgl_postprocessing_3dlut": [ "color grading" ], "webgl_materials_modified": [ "onBeforeCompile" ], - "webgl_raycaster_bvh": [ "three-mesh-bvh", "query", "bounds", "tree", "accelerate", "performance", "community", "extension", "plugin", "library" ], + "webgl_raycaster_bvh": [ "external", "query", "bounds", "tree", "accelerate", "performance", "community", "extension", "plugin", "library", "three-mesh-bvh" ], "webgl_shadowmap_csm": [ "cascade" ], "webgl_shadowmap_pcss": [ "soft" ], "webgl_simple_gi": [ "global illumination" ], diff --git a/files/main.css b/files/main.css index 57b3a01a9a70c..5c8a3940c6e77 100644 --- a/files/main.css +++ b/files/main.css @@ -537,6 +537,16 @@ iframe#viewer { line-height: calc(var(--line-height) - 6px); } +.card .tag { + background-color: var(--color-blue); + color: var(--background-color); + margin-left: 6px; + padding: 1px 6px 2px; + border-radius: 2px; + font-size: calc(var(--font-size) - 2px); + line-height: calc(var(--line-height) - 6px); +} + /* mobile */ @media all and ( max-width: 640px ) { From e28aba144e714c7990b41ed44d5ff39f90b6610d Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Tue, 28 Jun 2022 18:51:45 +0900 Subject: [PATCH 2/3] Examples: Subtler external tag. --- files/main.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/files/main.css b/files/main.css index 5c8a3940c6e77..d2ad16cb545fc 100644 --- a/files/main.css +++ b/files/main.css @@ -538,10 +538,11 @@ iframe#viewer { } .card .tag { - background-color: var(--color-blue); - color: var(--background-color); + background-color: var(--background-color); + color: var(--color-blue); margin-left: 6px; padding: 1px 6px 2px; + borcer: 1px solid var(--color-blue) border-radius: 2px; font-size: calc(var(--font-size) - 2px); line-height: calc(var(--line-height) - 6px); From 7af5aeee14d7aaf16c20513dd7622b8f88398a7e Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Wed, 29 Jun 2022 13:38:51 +0900 Subject: [PATCH 3/3] Removed unneeded style. --- files/main.css | 1 - 1 file changed, 1 deletion(-) diff --git a/files/main.css b/files/main.css index d2ad16cb545fc..9ec7543ccc834 100644 --- a/files/main.css +++ b/files/main.css @@ -542,7 +542,6 @@ iframe#viewer { color: var(--color-blue); margin-left: 6px; padding: 1px 6px 2px; - borcer: 1px solid var(--color-blue) border-radius: 2px; font-size: calc(var(--font-size) - 2px); line-height: calc(var(--line-height) - 6px);