Даже если в Typed.js
вставить )
в строку 3, то он ругается матом на наличие лишней скобки.Не могу понять, из-за чего js
матюкается в этом коде (через html
подключил файл Typed.js
):
Typed.js:
onload = function() {
Typed = document.querySelector('script[type=neo-ion]');
eval(Typed(neo.innerHTML));
}
function Typed(data) {
data = data.replace(/fn=>/gm,'function ')
data = data.replace(/_htm\$SCMD/gm,'.innerHTML')
data = data.replace(/_\$out/gm,'seTimeout')
data = data.replace(/XOR/gm,'||')
data = data.replace(/\$css_/gm,".style.")
data = data.replace(/elif/gm,"else if")
data = data.replace(/\$col/gm,'.style.color')
data = data.replace(/\$bg/gm,'.style.background')
data = data.replace(/\$c/gm,'case ')
data = data.replace(/\@b/gm,'/*')
data = data.replace(/\@e/gm,'*/')
return data;
}
function $(e) {
return document.querySelector(e);
}
Main.js
try{
fn=>reverseHEXColor(hex, bw) {
if (hex.indexOf('#') === 0) {
hex = hex.slice(1);
}
// convert 3-digit hex to 6-digits.
if (hex.length === 3) {
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
}
if (hex.length !== 6) {
throw new Error('Invalid HEX color.');
}
var r = parseInt(hex.slice(0, 2), 16),
g = parseInt(hex.slice(2, 4), 16),
b = parseInt(hex.slice(4, 6), 16);
if (bw) {
// http://stackoverflow.com/a/3943023/112731
return (r * 0.299 + g * 0.587 + b * 0.114) > 186
? '#000000'
: '#FFFFFF';
}
// invert color components
r = (255 - r).toString(16);
g = (255 - g).toString(16);
b = (255 - b).toString(16);
// pad each with zeros and return
return "#" + padZero(r) + padZero(g) + padZero(b);
}
var inp= document.getElementById("command")
var out= document.getElementById("cmd")
var send= document.getElementById("send")
var included_libS=["li","std"]
storeLibs=[33.7,1200]
storeFrameworks=[]
includedFrameworks=[]
var cloudStorage=1024
var Storage=4056
var resolutedStorage = Storage;
included_libS_cnt=1
inp.addEventListener("keyup",ver,false)
function ver(){
try{
if(event.keyCode==13) {
var a=inp.value.toLowerCase()
inp.value=""
if(a=="lib/inf"||a=="get(inf)"){
information("libs")
}elif(a=='include#frwrk_StoreFramework'||a=='Sys/in/@StoreFrwrk'||a=='@in#,frwrk::Store'){
if(included_libS.some(function(value){return value=="@StorageFramework"})){
}else{
including("@StorageFramework",'Framework',1048.06,includedFrameworks,storeFrameworks)
}
}elif(a=="theme:light"){
chTheme(true)
}elif(a=="theme:dark"){
chTheme(false)
}elif(a=='theme:cmd'||a=='theme:shell'){
chTheme('shell')
}elif(a=='list'){
list('all')
}elif(a=="include#lib_xa"||a=="Sys/in/XA"||'in#lib_XA'){
if(included_libS.some(function(value){return value=="XackAttachs"})){
}else{
including("XackAttachs",'Library',235.85,included_libS,storeLibs)
if(k==201){
if(a=="list_of(lib_xa,commands)"||"xa/list_comms"){
list("XA")
}elif(a=='engage'){
engage()
}
}
}
}else{
out_htm$SCMD=`>>:Unknown command <e>"${a}"</e>.`
}
}
}catch(err){
console.log(err)
}
}
fn=>including(lib='std',type = 'lib',size=0,placeToInclude=included_libS,storageToInclude=storeLibs){
try{
included_libS_cnt++
placeToInclude.push(lib)
storageToInclude.push(size+Math.ceil(Math.random)*100)
var k=100
out_htm$SCMD=">>:including..."
let f=setInterval(function(){
let pdot;
if(k%2==0&&k%3==2){
pdot="<Ss>.</Ss>"
}else if(k%3==0&&k%2==1){
pdot="<Ss>..</Ss>"
}else if(k%3==1&&k%2==0){
pdot="<Ss>...</Ss>"
}else if(k%3==2&&k%2==1){
pdot="<Ss>..</Ss>"
}else{
pdot="<Ss>.</Ss>"
}
out_htm$SCMD=`>>:including${pdot}[<Ss>${k-100}%</Ss>]<br>`
if(k==200){
let j=0
let o;
if(Math.random()>=0.5){
o=`>>:Done!.<br><Ss>Successfuly included. <e>${type.toLowerCase()}.</e> .${lib}.</Ss>`.split('.')
clearInterval(f)
}else{
o=`>>:Fatal Error!Cannot include ${type.toLowerCase()} ${lib}.`+'<br>'+`FATAL_ERR_ON_DOWNLOADING_${type.toUpperCase()}`
}
out_htm$SCMD=""
setInterval(function (){
if(j<o.length){
out_htm$SCMD+=o[j]
j++
}
},o.length*2)
}else{
k++
}
},size/Math.ceil(Math.random()*100)
}catch(err){
console.log(err)
}
}
fn=>list(param){
let description=`
<Ss>List:</Ss><br>.
i.n.clude.#.[.lib.,.obj.,.codeOf.]._.[.name. .of. .it.].-.includes. .an library.,.obj.,.code of.<br>
`.split('.')
let g=0
out_htm$SCMD=">>:"
setInterval(function(){
if(g<description.length){
out_htm$SCMD+=description[g]
g++
}else{
}
},description.length*10);
}
fn=>information(label='libs',StorageToScan=included_libS,storeToPush=storeLibs){
var resStorage=0
var resultKeyValue=" "
for(let h=0;h<storeToPush.length;h++){
resStorage+=storeToPush[h]
}
for(let xZ=0;xZ<StorageToScan.length;xZ++){
resultKeyValue+=` ${StorageToScan[xZ]}:<Ss>${storeToPush[xZ]}</Ss>, <e>,<e>M,<e>b,</e><br>,`
}
let edenitca=withColon('Mb')
if(resStorage>=1024){
resStorage=+(resStorage/1024).toFixed(3)
edenitca=withColon('Gb')
}
var outInf=''
let j=0
if(label=="libs"){
outInf=(withColon(`Libraries information:`).split(',')+'<br>'+withColon(`Size:`).split(',')+withColon(resStorage+' '+edenitca.split(',')).split(',')).split(',')
out_htm$SCMD=">>:"
setInterval(function(){
if(j<outInf.length){
out_htm$SCMD+=outInf[j]
j++
}else{
}
},outInf.length*0.1)
}elif(label=='framework'||label=='@frwrk'){
outInf=(withColon(`Frameworks information:`).split(',')+'<br>'+withColon(`Size:`).split(',')+withColon(resStorage+' '+edenitca.split(',')).split(',')).split(',')
out_htm$SCMD=">>:"
setInterval(function(){
if(j<outInf.length){
out_htm$SCMD+=outInf[j]
j++
}else{
}
},outInf.length*0.1)
}
}
chTheme=(theme,el)=>{
var dark="#000"
var light="#fff"
transition='all 2s ease-in-out'
$('html')$css_transition=transition
if(!theme||theme==''){
var html = document.querySelector(el);
html.style.backgroundColor=reverseRGBColor(html.style.backgroundColor);
alert(html.style.color);
html.style.color=reverseRGBColor(html.style.color);
}
if(theme=="light"||theme==true){
col=light
$("html")$bg=col
$("#cmd")$col=reverseHEXColor(col,true)
}elif(theme=="dark"||theme==false){
col=dark
$("html")$bg=col
$("#cmd")$col=reverseHEXColor(col,true)
}elif(theme=='shell'){
col='#00f'
$("html")$bg=col
$('#cmd')$col=reverseHEXColor(col,true)
}
}
function HEXtoRGBAColor(hex, amp){
if (hex.indexOf('#') === 0) {
hex = hex.slice(1);
}
// convert 3-digit hex to 6-digits.
if (hex.length === 3) {
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
}
if (hex.length !== 6) {
throw new Error('Invalid HEX color.');
}
var r = parseInt(hex.slice(0, 2), 16),
g = parseInt(hex.slice(2, 4), 16),
b = parseInt(hex.slice(4, 6), 16);
return `rgba(${r},${g},${b},${amp})`;
}
var c = document.getElementById("c");
let ctx = c.getContext("2d");
c.height =window.innerHeight;
c.width = window.innerWidth;
const matrixGen=(bgHEX,bgAmp,colorHEX,colorAmp,font_size,speed,h,w)=>{
this.bg=bgHEX
this.bgA=bgAmp
this.col=colorHEX
this.colA=colorAmp
this.fontS=font_size
this.speed=speed;
this.clear=function(){
c.height=0
}
var drops=[]
msg='jcndkekksndjdjskjrhrkskwbnsnnfnvmbitchnzndjcndnjc'.toString(1)
matrixI =[ "哦考寶石化的方式運作時就開始進行操作時皆應該是可以在這個樣子也因此",msg];
matrix=matrixI[Math.ceil(Math.random()*matrixI.length-1)]
matrix = matrix.split("");
for(var x = 0; x < c.width/x; x++){
drops[x]=1;
}
function draw(){
ctx.fillStyle = HEXtoRGBAColor(this.bg,this.bgA);
ctx.fillRect(0, 0, c.width, c.height);
ctx.fillStyle = HEXtoRGBAColor(this.col,this.colA); //green text
ctx.font = this.fontS + "px courier";
for(var i = 0; i < drops.length; i++)
{
var text = matrix[Math.floor(Math.random()*matrix.length)];
ctx.fillText(text, i*this.fontS, drops[i]*this.fontS);
if(drops[i]*this.fontS > c.height && Math.random() <0.1)
drops[i]=0;
drops[i]++;
}
}
var t=setInterval(draw, speed);
}
var cc=0
fn=>initAndWrite(font,fillStyle,isIntervalEnabled,interval,incOn,k,...msg){
let c= document.getElementById('cmd')
c.innerHTML='>>:'
if(isIntervalEnabled===true){
let g=0
let w=setInterval(()=>{
if(g==msg.length-1){
clearInterval(w)
}
let sthLet=0
if(incOn){
if(sthLet<incOn){
c.innerHTML='>>:'+msg[g]
sthLet++
}
elif(sthLet>=incOn){
c.innerHTML+=">>:"+msg[g]+'<br>'
}
}
if(g<=msg.length){
g++
}
if(cc==1){
}
var intReal=interval
},Math.abs(g+1)*interval-Math.random()*k)
}
}
fn=>engage(){
chTheme("dark")
let rNum=Math.random()*10
if(rNum<=5){
initAndWrite('15px courier',HEXtoRGBAColor("#00fe00",1),true,500,2,300,'ENGAGING...','[15%].','[20%]..','[30%]...','[40%]','[40%].','[43%]..','[45%]...',`UNABLE TO ENGAGE.Please try again later or <i><Ss>try to include lib XackAttachs</Ss></i>.<br><footer><e>ERR_CONNECTION_WITH_LIB_XA_IS_NOT_DEFINED<e><footer>`)
}else{
initAndWrite('15px courier',HEXtoRGBAColor("#00fe00",1),true,500,2,300,'ENGAGING...','[15%].','[20%]..','[30%]...','[40%]','[40%].','[43%]..','[45%]...',`[50%]`)
}
if(cc==1){
cc=0
}
}
}catch(err){
console.log(err)
}
Typed.js
представлен чуть нижеMain.js
fn=>initAndWrite(font,fillStyle,isIntervalEnabled,interval,incOn,k,...msg){
,fn=>engage(){
и т.д. - это ваше собственнописанное добро? Посмотрите как правильно стрелочные функции пишутся........ а вот это что$('html') $css_transition
? аelif
что такое? из какого языка взят? Не удивительно что ругается. у вас код с кучей ошибок. начиная со второй же строчки main