<commit_before>var container, stats;
var controls;
var camera, scene, renderer, particle;
var mouseX = 0;
var mouseY = 0;

var loader = new THREE.TextureLoader();
loader.crossOrigin = '';

var windowHalfX = window.innerWidth / 2;
var windowHalfY = window.innerHeight / 2;

init();
animate();

function initSkybox() {
    var prefix = "images/"
    var directions  = ["rt", "lf", "up", "dn", "bk", "ft"];
    var imageSuffix = ".png";
    var skyGeometry = new THREE.CubeGeometry( 5000, 5000, 5000 );	

    var materialArray = [];
    for (var i = 0; i < 6; i++)
    	materialArray.push(new THREE.MeshBasicMaterial({
    		map: loader.load(prefix + directions[i] + imageSuffix),
    		side: THREE.BackSide
    	}));
    var skyMaterial = materialArray;
    var skyBox = new THREE.Mesh(skyGeometry, skyMaterial);
    scene.add(skyBox);
}

function init() {

    container = document.createElement('div');
    document.body.appendChild(container);

    scene = new THREE.Scene();

    camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 20000);
    scene.add(camera);
    camera.position.set(0,150,400);
    camera.lookAt(scene.position);



    initSkybox();

    var axes = new THREE.AxisHelper(100);
    scene.add( axes )

    var material = new THREE.SpriteMaterial({
        map: loader.load("images/smoke.png"),
        blending: THREE.AdditiveBlending
    });

    for (var i = 0; i < 2000; i++) {

        particle = new THREE.Sprite(material);

        initParticle(particle, Math.random() * 30);

        scene.add(particle);
    }

    renderer = new THREE.WebGLRenderer( { antialias: true } );
    renderer.setClearColor(0xFFFFFF);
    renderer.setSize(window.innerWidth, window.innerHeight);

    container.appendChild(renderer.domElement);

    stats = new Stats();
    container.appendChild(stats.dom);

    THREEx.WindowResize(renderer, camera);
    controls = new THREE.OrbitControls( camera, renderer.domElement );


}

function generateSprite() {

    var canvas = document.createElement('canvas');
    canvas.width = 16;
    canvas.height = 16;

    var context = canvas.getContext('2d');
    var gradient = context.createRadialGradient(canvas.width / 2, canvas.height / 2, 0, canvas.width / 2, canvas.height / 2, canvas.width / 2);
    gradient.addColorStop(0, 'rgba(255,0,0,1)');
    gradient.addColorStop(0.5, 'rgba(255,40,0,1)');
    gradient.addColorStop(1, 'rgba(0,0,0,1)');

    context.fillStyle = gradient;
    context.fillRect(0, 0, canvas.width, canvas.height);

    return canvas;

}

function initParticle(particle, delay) {

    var particle = this instanceof THREE.Sprite ? this : particle;
    var delay = delay !== undefined ? delay : 0;

    particle.position.set(Math.random()*60, 0, Math.random()*60);
    particle.scale.x = particle.scale.y = Math.random() * 24 + 12;

    new TWEEN.Tween(particle)
        .delay(delay)
        .to({}, 7000)
        .onComplete(initParticle)
        .start();

    new TWEEN.Tween(particle.position)
        .delay(delay)
        .to({
            x: Math.random() * 100  - 50 ,
            y: Math.random() * 1000 - 10 ,
            z: Math.random() * 100 - 50
        }, 10000)
        .start();

   // new TWEEN.Tween(particle.scale)
   //     .delay(delay)
   //     .to({
   //         x: 0.01,
   //         y: 0.01
   //     }, 10000)
   //     .start();

}

function animate() {
    requestAnimationFrame(animate);

    render();
    update();
}

function update() {
    stats.update();
}

function render() {
    TWEEN.update();
    renderer.render(scene, camera);
}<commit_msg>new edit<commit_after>var container, stats;
var controls;
var camera, scene, renderer, particle;
var mouseX = 0;
var mouseY = 0;

var loader = new THREE.TextureLoader();
loader.crossOrigin = '';

var windowHalfX = window.innerWidth / 2;
var windowHalfY = window.innerHeight / 2;

init();
animate();

function initSkybox() {
    var prefix = "images/"
    var directions  = ["rt", "lf", "up", "dn", "bk", "ft"];
    var imageSuffix = ".png";
    var skyGeometry = new THREE.CubeGeometry( 5000, 5000, 5000 );	

    var materialArray = [];
    for (var i = 0; i < 6; i++)
    	materialArray.push(new THREE.MeshBasicMaterial({
    		map: loader.load(prefix + directions[i] + imageSuffix),
    		side: THREE.BackSide
    	}));
    var skyMaterial = materialArray;
    var skyBox = new THREE.Mesh(skyGeometry, skyMaterial);
    scene.add(skyBox);
}

function init() {

    container = document.createElement('div');
    document.body.appendChild(container);

    scene = new THREE.Scene();

    camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 20000);
    scene.add(camera);
    camera.position.set(0,150,400);
    camera.lookAt(scene.position);

    initSkybox();

    var material = new THREE.SpriteMaterial({
        map: loader.load("images/smoke.png"),
        blending: THREE.AdditiveBlending
    });


    for (var i = 0; i < 900; i++) {
        particle = new THREE.Sprite(material);
        initParticle(particle, 10 * i);
        scene.add(particle);
    }

    renderer = new THREE.WebGLRenderer( { antialias: true } );
    renderer.setClearColor(0xFFFFFF);
    renderer.setSize(window.innerWidth, window.innerHeight);

    container.appendChild(renderer.domElement);

    stats = new Stats();
    container.appendChild(stats.dom);

    THREEx.WindowResize(renderer, camera);
    controls = new THREE.OrbitControls( camera, renderer.domElement );
}

function initParticle(particle, delay) {
    var particle = this instanceof THREE.Sprite ? this : particle;
    var delay = delay !== undefined ? delay : 0;

    const PI_2 = 6.283185307179586476

    const angle = Math.random() * PI_2
    particle.position.set(Math.random() * Math.sin(angle) * 10,
	    	          Math.random() * 1,
	    		  Math.random() * Math.cos(angle) * 10),
    particle.scale.x = particle.scale.y = Math.random() * 15 + 5;
    particle.material.color = new THREE.Color(1.0, 0.4, 0.02);


    const x = 0.7
    const ttl = 2000 * (Math.random() * (1.0 - x) + x)

    new TWEEN.Tween(particle)
        .delay(delay)
        .to({}, ttl)
        .onComplete(initParticle)
        .start();


    new TWEEN.Tween(particle.position)
        .delay(delay)
        .to({
            x: Math.random() * 100  - 50 ,
            y: Math.random() * 1000 - 10 ,
            z: Math.random() * 100 - 50
        }, ttl* 10)
        .start();



    new TWEEN.Tween(particle.scale)
        .delay(delay)
        .to({
            x: 0.00,
            y: 0.00
        }, ttl)
        .start();

}

function animate() {
    requestAnimationFrame(animate);

    render();
    update();
}

function update() {
    stats.update();
}

function render() {
    TWEEN.update();
    renderer.render(scene, camera);
}
{'fraction_non_alphanumeric': 0.14728796119359105, 'fraction_numerical': 0.03454358371306777, 'mean_word_length': 2.6758508914100485, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1112606', 'n_tokens_mistral': 2460, 'n_tokens_neox': 2178, 'n_words': 500}