SC CODE: Function InitializePrivate() Uint64
10 IF init() == 0 THEN GOTO 30
20 RETURN 1
30 STORE("var_header_name", "js3.js")
31 STORE("var_header_description", "")
32 STORE("var_header_icon", "")
33 STORE("dURL", "")
34 STORE("docType", "TELA-JS-1")
35 STORE("subDir", "/")
36 STORE("fileCheckC", "093ee9de9e6d8663495f6ad157a35914b093a8054cebcaf74125bfebe9661fb1")
37 STORE("fileCheckS", "026b03cbd9cf26d96bcb102d830e18a85f777379dca61da4473d974d7184e4c1")
100 RETURN 0
End Function
Function init() Uint64
10 IF EXISTS("owner") == 0 THEN GOTO 30
20 RETURN 1
30 STORE("owner", address())
50 STORE("docVersion", "1.0.0")
60 STORE("hash", HEX(TXID()))
70 STORE("likes", 0)
80 STORE("dislikes", 0)
100 RETURN 0
End Function
Function address() String
10 DIM s as String
20 LET s = SIGNER()
30 IF IS_ADDRESS_VALID(s) THEN GOTO 50
40 RETURN "anon"
50 RETURN ADDRESS_STRING(s)
End Function
Function Rate(r Uint64) Uint64
10 DIM addr as String
15 LET addr = address()
16 IF r < 100 && EXISTS(addr) == 0 && addr != "anon" THEN GOTO 30
20 RETURN 1
30 STORE(addr, ""+r+"_"+BLOCK_HEIGHT())
40 IF r < 50 THEN GOTO 70
50 STORE("likes", LOAD("likes")+1)
60 RETURN 0
70 STORE("dislikes", LOAD("dislikes")+1)
100 RETURN 0
End Function
/*
const all=[...dossiers,{id:'blue-book',title:'Project Blue Book',subtitle:'UFO-dossiers 1952?1969',locked:true},{id:'silk-road',title:'Silk Road',subtitle:'Online drugshandel & Ross Ulbricht',locked:true}];
return h('div',{style:{maxWidth:1024,margin:'0 auto',padding:'32px 16px 64px'}},
h('div',{style:{marginBottom:40,borderBottom:'1px solid rgba(255,255,255,0.10)',paddingBottom:24}},
h('p',{style:{fontSize:11,textTransform:'uppercase',letterSpacing:'0.28em',color:'rgba(224,123,57,0.8)',fontWeight:700,marginBottom:8,fontFamily:'Syne,sans-serif'}},'Dossiers'),
h('h2',{className:'serif',style:{fontSize:36,fontWeight:700,color:'rgba(255,255,255,0.92)'}},'Actieve Dossiers'),
h('p',{style:{color:'rgba(255,255,255,0.50)',marginTop:8,fontSize:13,fontFamily:'Syne,sans-serif'}},'Open dossiers zijn zichtbaar voor de gehele community.')
),
h('div',{style:{display:'grid',gridTemplateColumns:'repeat(auto-fill,minmax(280px,1fr))',gap:20}},
all.map((d,i)=>h('div',{key:d.id,onClick:()=>!d.locked&&onSelect(d.id),style:{borderRadius:16,padding:24,border:`1px solid ${d.id===currentId?'rgba(245,158,11,0.3)':UI.cardBorder}`,background:d.id===currentId?'rgba(245,158,11,0.06)':UI.cardBg,cursor:d.locked?'not-allowed':'pointer',opacity:d.locked?0.5:1,position:'relative',overflow:'hidden',transition:'border-color 0.2s'}},
d.locked&&h('div',{style:{position:'absolute',top:16,right:16}},h(Icon,{name:'lock',size:14,color:'rgba(255,255,255,0.30)'})),
!d.locked&&h('div',{style:{position:'absolute',top:16,right:16,fontSize:10,textTransform:'uppercase',fontWeight:700,letterSpacing:'0.08em',padding:'2px 8px',borderRadius:3,border:'1px solid rgba(34,197,94,0.3)',color:'rgba(34,197,94,0.8)',background:'rgba(34,197,94,0.08)',fontFamily:'Syne,sans-serif'}},'Open'),
h('div',{style:{width:40,height:40,borderRadius:10,border:`1px solid ${UI.cardBorder}`,display:'flex',alignItems:'center',justifyContent:'center',marginBottom:16,background:UI.cardBg}},h(Icon,{name:'file-text',size:18,color:'rgba(255,255,255,0.6)'})),
h('h3',{className:'serif',style:{fontSize:20,fontWeight:700,marginBottom:4,color:d.id===currentId?'#fbbf24':'rgba(255,255,255,0.92)'}},d.title),
h('p',{style:{fontSize:13,color:'rgba(255,255,255,0.45)',marginBottom:20,fontFamily:'Syne,sans-serif'}},d.subtitle),
!d.locked&&h('div',{style:{display:'flex',alignItems:'center',gap:6,fontSize:12,fontWeight:700,textTransform:'uppercase',letterSpacing:'0.12em',color:'rgba(255,255,255,0.50)',fontFamily:'Syne,sans-serif'}},
'Open dossier ',h(Icon,{name:'chevron-right',size:13,color:'rgba(255,255,255,0.50)'})
)
))
)
);
}
// -- CENTRAL SEARCH BAR --
function CentralSearchBar({nodes,search,setSearch,suggestions,onAdd}){
const inputRef=useRef(null);
const [twText,setTwText]=useState('');
const [twIdx,setTwIdx]=useState(0);
const [twChar,setTwChar]=useState(0);
const [twDel,setTwDel]=useState(false);
const [cursorOn,setCursorOn]=useState(true);
useEffect(()=>{const id=setInterval(()=>setCursorOn(v=>!v),530);return()=>clearInterval(id)},[]);
useEffect(()=>{
if(search||!nodes.length)return;
const current=nodes[twIdx%nodes.length].name;
let t;
if(!twDel){if(twChar<current.length)t=setTimeout(()=>setTwChar(c=>c+1),72);else t=setTimeout(()=>setTwDel(true),1800);}
else{if(twChar>0)t=setTimeout(()=>setTwChar(c=>c-1),38);else{setTwDel(false);setTwIdx(i=>i+1);}}
setTwText(current.slice(0,twChar));return()=>clearTimeout(t);
},[search,twChar,twDel,twIdx,nodes]);
return h('div',{style:{position:'relative'}},
h('div',{style:{display:'flex',alignItems:'center',border:`1px solid rgba(224,123,57,0.30)`,borderRadius:12,background:'rgba(255,255,255,0.04)',backdropFilter:'blur(20px)',padding:'16px 20px',cursor:'text',gap:16},onClick:()=>inputRef.current?.focus()},
h(Icon,{name:'search',size:20,color:'rgba(224,123,57,0.55)'}),
h('div',{style:{flex:1,position:'relative'}},
h('input',{ref:inputRef,value:search,onChange:e=>setSearch(e.target.value),onKeyDown:e=>e.key==='Enter'&&suggestions.length>0&&onAdd(suggestions[0]),placeholder:'',style:{width:'100%',background:'transparent',border:'none',outline:'none',fontSize:18,color:'rgba(255,255,255,0.88)',fontFamily:'Playfair Display,serif',caretColor:UI.orange}}),
!search&&h('div',{style:{position:'absolute',top:0,left:0,pointerEvents:'none',fontSize:18,fontFamily:'Playfair Display,serif',color:'rgba(255,255,255,0.35)',display:'flex',alignItems:'center',gap:4}},
twText,h('span',{style:{opacity:cursorOn?1:0,borderRight:'2px solid rgba(224,123,57,0.70)',height:20,display:'inline-block'}})
)
)
),
suggestions.length>0&&h('div',{style:{position:'absolute',top:'100%',left:0,right:0,marginTop:6,borderRadius:12,border:`1px solid ${UI.cardBorder}`,background:'rgba(4,7,21,0.97)',boxShadow:'0 20px 50px rgba(0,0,0,0.5)',zIndex:50,overflow:'hidden'}},
suggestions.map(s=>h('button',{key:s.id,onClick:()=>onAdd(s),style:{width:'100%',padding:'12px 16px',display:'flex',alignItems:'center',gap:12,background:'transparent',border:'none',borderBottom:`1px solid rgba(255,255,255,0.05)`,cursor:'pointer',textAlign:'left'},onMouseEnter:e=>e.currentTarget.style.background='rgba(255,255,255,0.05)',onMouseLeave:e=>e.currentTarget.style.background='transparent'},
h('div',{style:{width:28,height:28,borderRadius:8,border:`1px solid ${UI.cardBorder}`,display:'flex',alignItems:'center',justifyContent:'center',fontSize:10,fontWeight:700,color:'rgba(255,255,255,0.6)',background:UI.cardBg,flexShrink:0,fontFamily:'Syne,sans-serif'}},initials(s.name)),
h('div',null,
h('p',{style:{fontSize:13,color:'rgba(255,255,255,0.88)',fontFamily:'Syne,sans-serif',fontWeight:600}},s.name),
h('p',{style:{fontSize:10,color:'rgba(255,255,255,0.40)',fontFamily:'Syne,sans-serif'}},s.type)
)
))
)
);
}
// -- IDENTITY SETUP --
*/ |
| SC Arguments: [Name:SC_ACTION Type:uint64 Value:'1' Name:SC_CODE Type:string Value:'Function InitializePrivate() Uint64
10 IF init() == 0 THEN GOTO 30
20 RETURN 1
30 STORE("var_header_name", "js3.js")
31 STORE("var_header_description", "")
32 STORE("var_header_icon", "")
33 STORE("dURL", "")
34 STORE("docType", "TELA-JS-1")
35 STORE("subDir", "/")
36 STORE("fileCheckC", "093ee9de9e6d8663495f6ad157a35914b093a8054cebcaf74125bfebe9661fb1")
37 STORE("fileCheckS", "026b03cbd9cf26d96bcb102d830e18a85f777379dca61da4473d974d7184e4c1")
100 RETURN 0
End Function
Function init() Uint64
10 IF EXISTS("owner") == 0 THEN GOTO 30
20 RETURN 1
30 STORE("owner", address())
50 STORE("docVersion", "1.0.0")
60 STORE("hash", HEX(TXID()))
70 STORE("likes", 0)
80 STORE("dislikes", 0)
100 RETURN 0
End Function
Function address() String
10 DIM s as String
20 LET s = SIGNER()
30 IF IS_ADDRESS_VALID(s) THEN GOTO 50
40 RETURN "anon"
50 RETURN ADDRESS_STRING(s)
End Function
Function Rate(r Uint64) Uint64
10 DIM addr as String
15 LET addr = address()
16 IF r < 100 && EXISTS(addr) == 0 && addr != "anon" THEN GOTO 30
20 RETURN 1
30 STORE(addr, ""+r+"_"+BLOCK_HEIGHT())
40 IF r < 50 THEN GOTO 70
50 STORE("likes", LOAD("likes")+1)
60 RETURN 0
70 STORE("dislikes", LOAD("dislikes")+1)
100 RETURN 0
End Function
/*
const all=[...dossiers,{id:'blue-book',title:'Project Blue Book',subtitle:'UFO-dossiers 1952?1969',locked:true},{id:'silk-road',title:'Silk Road',subtitle:'Online drugshandel & Ross Ulbricht',locked:true}];
return h('div',{style:{maxWidth:1024,margin:'0 auto',padding:'32px 16px 64px'}},
h('div',{style:{marginBottom:40,borderBottom:'1px solid rgba(255,255,255,0.10)',paddingBottom:24}},
h('p',{style:{fontSize:11,textTransform:'uppercase',letterSpacing:'0.28em',color:'rgba(224,123,57,0.8)',fontWeight:700,marginBottom:8,fontFamily:'Syne,sans-serif'}},'Dossiers'),
h('h2',{className:'serif',style:{fontSize:36,fontWeight:700,color:'rgba(255,255,255,0.92)'}},'Actieve Dossiers'),
h('p',{style:{color:'rgba(255,255,255,0.50)',marginTop:8,fontSize:13,fontFamily:'Syne,sans-serif'}},'Open dossiers zijn zichtbaar voor de gehele community.')
),
h('div',{style:{display:'grid',gridTemplateColumns:'repeat(auto-fill,minmax(280px,1fr))',gap:20}},
all.map((d,i)=>h('div',{key:d.id,onClick:()=>!d.locked&&onSelect(d.id),style:{borderRadius:16,padding:24,border:`1px solid ${d.id===currentId?'rgba(245,158,11,0.3)':UI.cardBorder}`,background:d.id===currentId?'rgba(245,158,11,0.06)':UI.cardBg,cursor:d.locked?'not-allowed':'pointer',opacity:d.locked?0.5:1,position:'relative',overflow:'hidden',transition:'border-color 0.2s'}},
d.locked&&h('div',{style:{position:'absolute',top:16,right:16}},h(Icon,{name:'lock',size:14,color:'rgba(255,255,255,0.30)'})),
!d.locked&&h('div',{style:{position:'absolute',top:16,right:16,fontSize:10,textTransform:'uppercase',fontWeight:700,letterSpacing:'0.08em',padding:'2px 8px',borderRadius:3,border:'1px solid rgba(34,197,94,0.3)',color:'rgba(34,197,94,0.8)',background:'rgba(34,197,94,0.08)',fontFamily:'Syne,sans-serif'}},'Open'),
h('div',{style:{width:40,height:40,borderRadius:10,border:`1px solid ${UI.cardBorder}`,display:'flex',alignItems:'center',justifyContent:'center',marginBottom:16,background:UI.cardBg}},h(Icon,{name:'file-text',size:18,color:'rgba(255,255,255,0.6)'})),
h('h3',{className:'serif',style:{fontSize:20,fontWeight:700,marginBottom:4,color:d.id===currentId?'#fbbf24':'rgba(255,255,255,0.92)'}},d.title),
h('p',{style:{fontSize:13,color:'rgba(255,255,255,0.45)',marginBottom:20,fontFamily:'Syne,sans-serif'}},d.subtitle),
!d.locked&&h('div',{style:{display:'flex',alignItems:'center',gap:6,fontSize:12,fontWeight:700,textTransform:'uppercase',letterSpacing:'0.12em',color:'rgba(255,255,255,0.50)',fontFamily:'Syne,sans-serif'}},
'Open dossier ',h(Icon,{name:'chevron-right',size:13,color:'rgba(255,255,255,0.50)'})
)
))
)
);
}
// -- CENTRAL SEARCH BAR --
function CentralSearchBar({nodes,search,setSearch,suggestions,onAdd}){
const inputRef=useRef(null);
const [twText,setTwText]=useState('');
const [twIdx,setTwIdx]=useState(0);
const [twChar,setTwChar]=useState(0);
const [twDel,setTwDel]=useState(false);
const [cursorOn,setCursorOn]=useState(true);
useEffect(()=>{const id=setInterval(()=>setCursorOn(v=>!v),530);return()=>clearInterval(id)},[]);
useEffect(()=>{
if(search||!nodes.length)return;
const current=nodes[twIdx%nodes.length].name;
let t;
if(!twDel){if(twChar<current.length)t=setTimeout(()=>setTwChar(c=>c+1),72);else t=setTimeout(()=>setTwDel(true),1800);}
else{if(twChar>0)t=setTimeout(()=>setTwChar(c=>c-1),38);else{setTwDel(false);setTwIdx(i=>i+1);}}
setTwText(current.slice(0,twChar));return()=>clearTimeout(t);
},[search,twChar,twDel,twIdx,nodes]);
return h('div',{style:{position:'relative'}},
h('div',{style:{display:'flex',alignItems:'center',border:`1px solid rgba(224,123,57,0.30)`,borderRadius:12,background:'rgba(255,255,255,0.04)',backdropFilter:'blur(20px)',padding:'16px 20px',cursor:'text',gap:16},onClick:()=>inputRef.current?.focus()},
h(Icon,{name:'search',size:20,color:'rgba(224,123,57,0.55)'}),
h('div',{style:{flex:1,position:'relative'}},
h('input',{ref:inputRef,value:search,onChange:e=>setSearch(e.target.value),onKeyDown:e=>e.key==='Enter'&&suggestions.length>0&&onAdd(suggestions[0]),placeholder:'',style:{width:'100%',background:'transparent',border:'none',outline:'none',fontSize:18,color:'rgba(255,255,255,0.88)',fontFamily:'Playfair Display,serif',caretColor:UI.orange}}),
!search&&h('div',{style:{position:'absolute',top:0,left:0,pointerEvents:'none',fontSize:18,fontFamily:'Playfair Display,serif',color:'rgba(255,255,255,0.35)',display:'flex',alignItems:'center',gap:4}},
twText,h('span',{style:{opacity:cursorOn?1:0,borderRight:'2px solid rgba(224,123,57,0.70)',height:20,display:'inline-block'}})
)
)
),
suggestions.length>0&&h('div',{style:{position:'absolute',top:'100%',left:0,right:0,marginTop:6,borderRadius:12,border:`1px solid ${UI.cardBorder}`,background:'rgba(4,7,21,0.97)',boxShadow:'0 20px 50px rgba(0,0,0,0.5)',zIndex:50,overflow:'hidden'}},
suggestions.map(s=>h('button',{key:s.id,onClick:()=>onAdd(s),style:{width:'100%',padding:'12px 16px',display:'flex',alignItems:'center',gap:12,background:'transparent',border:'none',borderBottom:`1px solid rgba(255,255,255,0.05)`,cursor:'pointer',textAlign:'left'},onMouseEnter:e=>e.currentTarget.style.background='rgba(255,255,255,0.05)',onMouseLeave:e=>e.currentTarget.style.background='transparent'},
h('div',{style:{width:28,height:28,borderRadius:8,border:`1px solid ${UI.cardBorder}`,display:'flex',alignItems:'center',justifyContent:'center',fontSize:10,fontWeight:700,color:'rgba(255,255,255,0.6)',background:UI.cardBg,flexShrink:0,fontFamily:'Syne,sans-serif'}},initials(s.name)),
h('div',null,
h('p',{style:{fontSize:13,color:'rgba(255,255,255,0.88)',fontFamily:'Syne,sans-serif',fontWeight:600}},s.name),
h('p',{style:{fontSize:10,color:'rgba(255,255,255,0.40)',fontFamily:'Syne,sans-serif'}},s.type)
)
))
)
);
}
// -- IDENTITY SETUP --
*/'] |