update while testing on the cloud
This commit is contained in:
parent
a7e63de299
commit
3282369151
5 changed files with 433 additions and 23 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -40,3 +40,5 @@ firebase.json
|
||||||
##
|
##
|
||||||
original_collider.svg
|
original_collider.svg
|
||||||
original.svg
|
original.svg
|
||||||
|
|
||||||
|
data
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
.DS_Store
|
.DS_Store
|
||||||
index.html
|
|
||||||
404.html
|
|
||||||
about.html
|
about.html
|
||||||
participants.html
|
hello.txt
|
||||||
fragment.html
|
|
||||||
home.html
|
home.html
|
||||||
intorudction.json
|
index.html
|
||||||
src
|
|
||||||
index.json
|
index.json
|
||||||
|
Readme.md
|
||||||
|
src
|
||||||
|
participants.html
|
||||||
|
|
|
||||||
405
test_data/home.html
Normal file
405
test_data/home.html
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -62,7 +62,7 @@
|
||||||
<div id="frags">
|
<div id="frags">
|
||||||
<div id="-1" class="octet-stream"><a href='.DS_Store'>.DS_Store</a><span class="filename">.DS_Store</span></div>
|
<div id="-1" class="octet-stream"><a href='.DS_Store'>.DS_Store</a><span class="filename">.DS_Store</span></div>
|
||||||
<div id="-1" class="json"><a href='introduction.json'>introduction.json</a><span class="filename">introduction.json</span></div>
|
<div id="-1" class="json"><a href='introduction.json'>introduction.json</a><span class="filename">introduction.json</span></div>
|
||||||
<div id="-1" class="svg+xml"><figure><img class="image" src="original.svg"><figcaption>original.svg</figcaption></figure></div>
|
<div id="-1" class="svg"><figure><img class="image" src="original.svg"><figcaption>original.svg</figcaption></figure></div>
|
||||||
<div id="-1" class="html"><section id="original_collider.svg">
|
<div id="-1" class="html"><section id="original_collider.svg">
|
||||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1080 734">
|
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1080 734">
|
||||||
<defs>
|
<defs>
|
||||||
|
|
|
||||||
|
|
@ -103,21 +103,25 @@ frag_request.onload = function() {
|
||||||
color = ['#556270'];
|
color = ['#556270'];
|
||||||
|
|
||||||
const addFrag = () => {
|
const addFrag = () => {
|
||||||
let _frag = fragments.shift();
|
try{
|
||||||
let p = findElementByProperty(participants, 'path', `${_frag.artist}`)
|
let _frag = fragments.shift();
|
||||||
if (_frag.artist == "") return;
|
let p = findElementByProperty(participants, 'path', `${_frag.artist}`)
|
||||||
let frag = document.querySelector(`._${p.fragId}`).cloneNode(true); // get fragments by artist
|
if (_frag.artist == "") return;
|
||||||
frag.classList=[];
|
let frag = document.querySelector(`._${p.fragId}`).cloneNode(true); // get fragments by artist
|
||||||
frag.id= `_${_frag.index}`;
|
frag.classList=[];
|
||||||
frag.childNodes[0].setAttribute("href", `${window.location.origin}/${_frag.artist}/#${convertIndexToString(_frag.index)}`);
|
frag.id= `_${_frag.index}`;
|
||||||
|
frag.childNodes[0].setAttribute("href", `${window.location.origin}/${_frag.artist}/#${convertIndexToString(_frag.index)}`);
|
||||||
|
|
||||||
let text = frag.children[0].children[frag.children[0].children.length - 1];
|
let text = frag.children[0].children[frag.children[0].children.length - 1];
|
||||||
text.innerHTML = `#${convertIndexToString(_frag.index)}`
|
text.innerHTML = `#${convertIndexToString(_frag.index)}`
|
||||||
|
|
||||||
let shape = frag.children[0].children[0];
|
let shape = frag.children[0].children[0];
|
||||||
|
|
||||||
svg.appendChild(frag);
|
svg.appendChild(frag);
|
||||||
frag_disp.push(addFragToWorld(shape));
|
frag_disp.push(addFragToWorld(shape));
|
||||||
|
} catch(e) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
let initY= 0;
|
let initY= 0;
|
||||||
const addFragToWorld = (path) => {
|
const addFragToWorld = (path) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue