-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from allancarlos123/refactoring
Refactoring
- Loading branch information
Showing
7 changed files
with
169 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,8 @@ | ||
#Options +SymLinksIfOwnerMatch | ||
#RewriteEngine On | ||
#RewriteCond %{REQUEST_FILENAME} !-f | ||
#RewriteCond %{REQUEST_FILENAME} !-d | ||
#RewriteRule ^(.*)$ /front-controller.php?action=$1 [QSA,L] | ||
|
||
#<IfModule mod_rewrite.c> | ||
# Options +SymLinksIfOwnerMatch | ||
# RewriteEngine On | ||
|
||
# RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ | ||
# RewriteRule ^(.*) - [E=BASE:%1] | ||
|
||
# RewriteCond %{ENV:REDIRECT_STATUS} ^$ | ||
# RewriteRule ^index\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L] | ||
|
||
# RewriteCond %{REQUEST_FILENAME} -f | ||
# RewriteRule .? - [L] | ||
|
||
# Rewrite all other queries to the front controller. | ||
# RewriteRule .? %{ENV:BASE}/index.php [L] | ||
#</IfModule> | ||
|
||
|
||
<IfModule mod_rewrite.c> | ||
Options +SymLinksIfOwnerMatch | ||
RewriteEngine On | ||
|
||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteCond %{REQUEST_FILENAME} !-d | ||
RewriteRule ^([^?]*)$ /index.php [NC,L,QSA] | ||
|
||
#Options -MultiViews | ||
|
||
#RewriteEngine On | ||
#RewriteCond %{REQUEST_FILENAME} !-f | ||
#RewriteCond %{REQUEST_FILENAME} !-d | ||
#RewriteRule (.+) /controller/index.php?page=$1 [QSA,L] | ||
|
||
|
||
|
||
|
||
#RewriteBase / | ||
|
||
#RewriteCond %{REQUEST_FILENAME} !-f | ||
#RewriteCond %{REQUEST_FILENAME} !-d | ||
#RewriteRule (.+) /controller/index.php?page=$1 [QSA,L] | ||
|
||
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
var searchButtonElement = $("#searchButton"); | ||
var clearInputElement = $("#clearInput"); | ||
var querytElement = $("input[name=query]"); | ||
|
||
function closeClearButton() { | ||
clearInputElement.hide(); | ||
searchButtonElement.show(); | ||
querytElement.val(""); | ||
querytElement.focus(); | ||
} | ||
|
||
// Detects whether field is changed to determine which buttons appear | ||
querytElement.keyup(function() { | ||
clearInputElement.hide(); | ||
searchButtonElement.show(); | ||
}); | ||
|
||
clearInputElement.click(closeClearButton); | ||
|
||
var products_price = $(".product--price"); | ||
$(products_price).each(function(index) { | ||
var price = $(this).data("price"); | ||
$(this).text( | ||
price.toLocaleString("pt-BR", { | ||
style: "currency", | ||
currency: "BRL" | ||
}) | ||
); | ||
}); | ||
|
||
// Initialize Swiper | ||
var swiper = new Swiper(".swiper-container", { | ||
slidesPerView: 5, | ||
spaceBetween: 5, | ||
breakpoints: { | ||
1440: { | ||
slidesPerView: 3, | ||
spaceBetween: 30 | ||
}, | ||
1024: { | ||
slidesPerView: 2, | ||
centeredSlides: true, | ||
spaceBetween: 30 | ||
}, | ||
768: { | ||
slidesPerView: 2, | ||
spaceBetween: 30 | ||
}, | ||
640: { | ||
slidesPerView: 1.5, | ||
spaceBetween: 5 | ||
}, | ||
320: { | ||
slidesPerView: 1.5, | ||
spaceBetween: 3 | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,21 @@ | ||
<?php | ||
|
||
// First, include Requests | ||
include('vendor/rmccue/requests/library/Requests.php'); | ||
Requests::register_autoloader(); | ||
|
||
// if ($_SERVER['REQUEST_URI'] == '/help') { | ||
// include 'help.php'; | ||
// } elseif ($_SERVER['REQUEST_URI'] == '/calendar') { | ||
// include 'calendar.php'; | ||
// } else { | ||
// include 'notfound.php'; | ||
// } | ||
|
||
Requests::register_autoloader(); | ||
|
||
if (isset($_SERVER['REDIRECT_URL'])) { | ||
$requested_page = $_SERVER['REDIRECT_URL']; | ||
} | ||
else { | ||
$requested_page = 'home'; | ||
$requested_page = $_SERVER['REDIRECT_URL']; | ||
} else { | ||
$requested_page = 'home'; | ||
} | ||
|
||
switch($requested_page) { | ||
case "/search": | ||
include(__DIR__."/search-results.php"); | ||
break; | ||
case "home": | ||
include(__DIR__."/home.php"); | ||
break; | ||
default: | ||
include(__DIR__."/404.php"); | ||
case "/search": | ||
include(__DIR__."/public/search-results.php"); | ||
break; | ||
case "home": | ||
include(__DIR__."/public/home.php"); | ||
break; | ||
default: | ||
include(__DIR__."/public/404.html"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | ||
<title>404 page - Jamp Challenge</title> | ||
<link | ||
rel="stylesheet" | ||
href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" | ||
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" | ||
crossorigin="anonymous" | ||
/> | ||
<link rel="stylesheet" href="./assets/css/style.css" /> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="col-md-12"> | ||
<div class="text-center"> | ||
<div class="title"> | ||
404 | ||
</div> | ||
|
||
<div class="subtitle"> | ||
Opa, a página que você está procurando não existe. | ||
</div> | ||
|
||
<div class="buttons"> | ||
<a class="button" href="/">Volte para o início</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> | ||
|
||
<style> | ||
body { | ||
background: url(https://i.imgur.com/76NZB7A.gif) no-repeat center center | ||
fixed; | ||
background-size: cover; | ||
font-family: 'Moderat Bold', sans-serif; | ||
background-color: #342643; | ||
} | ||
|
||
.title { | ||
font-size: 6em; | ||
font-weight: 700; | ||
color: #412f97; | ||
} | ||
|
||
.subtitle { | ||
font-size: 40px; | ||
font-weight: 700; | ||
color: #412f97; | ||
} | ||
|
||
.buttons { | ||
margin: 30px; | ||
} | ||
.buttons a.button { | ||
font-weight: 700; | ||
border: 2px solid #1fc499; | ||
text-decoration: none; | ||
padding: 15px; | ||
text-transform: uppercase; | ||
color: #1fc499; | ||
border-radius: 26px; | ||
transition: all 0.2s ease-in-out; | ||
} | ||
.buttons a.button:hover { | ||
background-color: #412f97; | ||
color: white; | ||
transition: all 0.2s ease-in-out; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.