Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Include your project-specific ignores in this file
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files
11 changes: 11 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
60 changes: 60 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Page Not Found</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>

* {
line-height: 1.2;
margin: 0;
}

html {
color: #888;
display: table;
font-family: sans-serif;
height: 100%;
text-align: center;
width: 100%;
}

body {
display: table-cell;
vertical-align: middle;
margin: 2em auto;
}

h1 {
color: #555;
font-size: 2em;
font-weight: 400;
}

p {
margin: 0 auto;
width: 280px;
}

@media only screen and (max-width: 280px) {

body, p {
width: 95%;
}

h1 {
font-size: 1.5em;
margin: 0 0 0.3em;
}

}

</style>
</head>
<body>
<h1>Page Not Found</h1>
<p>Sorry, but the page you were trying to view does not exist.</p>
</body>
</html>
<!-- IE needs 512+ bytes: http://blogs.msdn.com/b/ieinternals/archive/2010/08/19/http-error-pages-in-internet-explorer.aspx -->
67 changes: 67 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
module.exports = function( grunt ) {

grunt.initConfig({

uglify : {
options : {
mangle : false
},

my_target : {
files : {
'assets/js/main.js' : [ 'assets/_js/scripts.js' ],
'assets/js/slider.js' : [ 'assets/_js/slider.js' ]
}
}
}, // uglify

imagemin: {

public: {

expand: true,
cwd: 'assets/images',
src: '**/*.{png,jpg,gif}',
dest: 'assets/images'
}
}, // imagemin

sass : {
dist : {
options : { style : 'compressed' },
files : {
'assets/css/main.css' : 'assets/sass/main.scss'
}
}
}, // sass



watch : {
dist : {
files : [
'assets/_js/**/*',
'assets/sass/**/*'
],

tasks : [ 'uglify', 'sass' ]
}
} // watch

});


// Plugins do Grunt
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks( 'grunt-contrib-sass' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );


// Tarefas que serão executadas
grunt.registerTask( 'default', [ 'uglify', 'sass', 'imagemin' ] );

// Tarefa para Watch
grunt.registerTask( 'w', [ 'watch' ] );

};
52 changes: 52 additions & 0 deletions assets/_js/scripts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
jQuery(document).ready(function($) {
$('.search-form').each(function() {
$(this).find('input').keypress(function(e) {
if (e.which == 10 || e.which == 13) {
this.form.submit();
}
});
$(this).find('input[type=submit]').hide();
});
$('#main-slider').cslider({
current: 0,
bgincrement: 50,
autoplay: false,
interval: 4000
});
$.getJSON('assets/js/products.json', function(data) {
this.qtd = data.products.length;
this.retorno = '';
for (i = 0; i < this.qtd; i++) {
this.retorno += '<div class="col col-4"><div class="item"><div class="frame">';
this.retorno += (data.products[i].flagFreeshipping == true) ? '<span class="flag flag-frete"></span>' : ' ';
this.retorno += (data.products[i].flagNovelty == true) ? '<span class="flag flag-novidade"></span>' : ' ';
this.retorno += '<div class="item-image"><a href="' + data.products[i].url + '"><img src="' + data.products[i].imgUrl + '" alt="' + data.products[i].name + '"></a></div>';
this.retorno += '<div class="item-ratings stars-' + data.products[i].rating + '"><ul class="list-inline"><li><label for="star1" title="1 Estrela"><input type="radio" id="star1" name="rating" value="1"/></label></li><li><label for="star2" title="2 Estrelas"><input type="radio" id="star2" name="rating" value="2"/></label></li><li><label for="star3" title="3 Estrelas"><input type="radio" id="star3" name="rating" value="3"/></label></li><li><label for="star4" title="4 Estrelas"><input type="radio" id="star4" name="rating" value="4"/></label></li><li><label for="star5" title="5 Estrelas"><input type="radio" id="star5" name="rating" value="5"/></label></li></ul></div>';
this.retorno += '<div class="item-title"><p><a href="' + data.products[i].url + '">' + data.products[i].name + '</a></p></div>';
this.retorno += '<div class="item-price">';
this.retorno += (data.products[i].price == false) ? '<span class="item-old-price">R$<i>' + data.products[i].oldPrice + '</i></span><span class="item-special-price"> R$<i>' + data.products[i].specialPrice + '</i></span>' : '<span class="item-regular-price"> R$<i>' + data.products[i].price + '</i></span>';
this.retorno += (data.products[i].qtyParcel < 1) ? '' : '<span class="item-parcel-price">ou <i>' + data.products[i].qtyParcel + ' x</i> de <i>R$' + data.products[i].priceParcel + '</i></span>';
this.retorno += '</div></div>';
this.retorno += '<button type="button" class="add-to-cart" id="' + data.products[i].sku + '">Adiconar ao Carrinho</button>';
this.retorno += '</div></div>';
}
$('#item-products').html(this.retorno);
var count = 0;
var theTotal = 0;
$(".item").each(function(index) {
var getPrice = parseInt($(this).find('.item-regular-price i').text() || $(this).find('.item-special-price i').text());
$(this).on("click", "button", function() {
count++;
theTotal += parseFloat(getPrice);
$('.header-cart-qty').text(count);
$('.header-cart-amount').text('R$' + theTotal + ',00');
$('html, body').animate({
'scrollTop': $(".header-cart").position().top
});
});
});
});
if ($(window).width() < 768) {
$('.slider').remove();
}
});
Loading