binded code snippets

knuckle-code-snippets
Fabien Benetou 1 year ago
parent 1cbc2a6f15
commit dd8e8cf026
  1. 11
      index.html

@ -3504,10 +3504,10 @@ AFRAME.registerComponent('startfunctions', {
document.body.addEventListener('highlighterready', _ => {
fetch('https://fabien.benetou.fr/pub/home/future_of_text_demo/engine/codesplits.txt').then( r => r.text()).then( s => {
s.split(/^$/m).filter( l => l.match(/\nfunc|\nAFRAME/)).slice(0,5).map( snippet => {
//let nw = addCodeEditor( snippet, "javascript", "0 "+(1+Math.random()/2)+" -.4" )
//nw.element.classList.add('docs')
//setTimeout( _ => nw.element.setAttribute('scale', '.01 .01 .01'), 1000 )
/* debug tests for picking */
let nw = addCodeEditor( snippet, "javascript", "0 "+(1+Math.random()/2)+" -.4" )
nw.element.classList.add('docs')
setTimeout( _ => nw.element.setAttribute('scale', '.01 .01 .01'), 1000 )
/* debug tests for picking
let el = document.createElement("a-box")
el.classList.add('docs')
el.setAttribute("scale", '.05 .05 .05')
@ -3515,7 +3515,8 @@ AFRAME.registerComponent('startfunctions', {
el.setAttribute("wireframe", 'true')
el.setAttribute("target", '')
AFRAME.scenes[0].appendChild(el)
// somehow can't get picket
// somehow can't get picked
*/
}
)
} )

Loading…
Cancel
Save