<commit_before>var botao = document.querySelector('#mudaLayout');
var mural = document.querySelector('.mural');
var botoesRemove = document.querySelectorAll('.opcoesDoCartao-remove');
var formulario = document.querySelector('.novoCartao');

botao.addEventListener('click', mudaLayout);
botao.addEventListener('click', mudaLabelBotao);


function mudaLabelBotao(){
    if(mural.classList.contains('mural--linhas')){
        botao.textContent = 'Blocos';    
    }else{
        botao.textContent = 'Linhas';
    }
}


function mudaLayout(){
    mural.classList.toggle('mural--linhas');
};


for(var i=0; i<botoesRemove.length;i++){
    var botaoRemove = botoesRemove[i];
    botaoRemove.addEventListener('click', function(){
        //this.parentNode.parentNode.remove();
        var botao = this;
        var idCartao = 'cartao_' + botao.dataset.cartao;
        
        var cartao = document.querySelector('#'+idCartao);
        cartao.classList.add('cartao--sumindo');
        setTimeout(function(){
            cartao.remove();
        },400);
    });
}

formulario.addEventListener('submit', salvaNovoCarta);
                            
function salvaNovoCarta(evento){ 
    evento.preventDefault();
    var campoConteudo = document.querySelector('.novoCartao-conteudo');
    var digitado = campoConteudo.value;
    if(digitado.length>0){
      
        var mural = document.querySelector('.mural');
        //var campoConteudo = document.querySelector('[name=novoCartao-conteudo]');
        
        var conteudoNovoCartao= document.createElement('p');
        conteudoNovoCartao.textContent  = digitado;
        conteudoNovoCartao.classList.add('cartao-conteudo');

        var novoCartao = document.createElement('div');
        novoCartao.classList.add('cartao');

        novoCartao.appendChild(conteudoNovoCartao);
        mural.insertBefore(novoCartao, mural.firstElementChild);
        campoConteudo.value = '';
        campoConteudo.focus();
    }
}<commit_msg>acrescentou o botao excluir no cartão criado<commit_after>var botao = document.querySelector('#mudaLayout');
var mural = document.querySelector('.mural');
var botoesRemove = document.querySelectorAll('.opcoesDoCartao-remove');
var formulario = document.querySelector('.novoCartao');

botao.addEventListener('click', mudaLayout);
botao.addEventListener('click', mudaLabelBotao);


function mudaLabelBotao(){
    if(mural.classList.contains('mural--linhas')){
        botao.textContent = 'Blocos';    
    }else{
        botao.textContent = 'Linhas';
    }
}


function mudaLayout(){
    mural.classList.toggle('mural--linhas');
};


$('.opcoesDoCartao-remove').click(removeCartao);

                                 
function removeCartao(){
        //this.parentNode.parentNode.remove();
        var botao = $(this);
        var idCartao = 'cartao_' + botao.data('cartao');
        
        var cartao = $('#'+idCartao).addClass('cartao--sumindo');
        setTimeout(function(){
            cartao.remove();
        },400);
    }

$('.novoCartao').submit(salvaNovoCarta);
 
 var numeroDeCartoes = $('.cartao').length;

function salvaNovoCarta(evento){ 
    evento.preventDefault();
    
    
    var campoConteudo = $('.novoCartao-conteudo');
    var digitado = campoConteudo.val();
    if(digitado){
     numeroDeCartoes++;
        var novoCartao = $('<div>').addClass('cartao').attr('id', 'cartao_'+(numeroDeCartoes+1)) ;
        
        var opcoesDoCartao = $('<div>').addClass('opcoesDoCartao').appendTo(novoCartao);
        
        $('<button>').addClass('opcoesDoCartao-opcao opcoesDoCartao-remove').text('Remove').appendTo(opcoesDoCartao).data('cartao',numeroDeCartoes+1).click(removeCartao);
        
        $('<p>').text(digitado).addClass('cartao-conteudo').appendTo(novoCartao);
        novoCartao.prependTo('.mural');
        campoConteudo.val('').focus();
    }
}
{'fraction_non_alphanumeric': 0.1525687597301505, 'fraction_numerical': 0.002594706798131811, 'mean_word_length': 3.3559322033898304, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '2829960', 'n_tokens_mistral': 1243, 'n_tokens_neox': 1254, 'n_words': 160}