-
Notifications
You must be signed in to change notification settings - Fork 2
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 dev-karpov0/frontend-test
Frontend test
- Loading branch information
Showing
9 changed files
with
440 additions
and
80 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea/ |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,62 +1,70 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<html xmlns="http://www.w3.org/1999/html"> | ||
<head> | ||
<title>Навигатор ВВГУ</title> | ||
<title>ВВГУ.Ориентир</title> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<style> | ||
body { | ||
background: url('bg.jpg'); | ||
background-size: 100% | ||
} | ||
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" /> | ||
|
||
<link rel="stylesheet" href="nullstyle.css"> | ||
<link rel="stylesheet" href="styles.css"> | ||
|
||
button.new { | ||
background: -moz-linear-gradient(#70d7e7, #7bccd8, #ffffff); | ||
background: -webkit-gradient(linear, 0 0, 0 100%, from(#b8e2e1), to(#b6abdf), color-stop(0.5, #91d5e3)); | ||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF1493', endColorstr='#EBFFFF'); | ||
padding: 3px 7px; | ||
color: #000000; | ||
-moz-border-radius: 5px; | ||
-webkit-border-radius: 5px; | ||
border-radius: 5px; | ||
border: 1px solid #0e0c0c; | ||
} | ||
</style> | ||
<script type="text/javascript" src="Plan_VVSU.js"></script> | ||
<script type="text/javascript" src="../read_plan.js"></script> | ||
<script type="text/javascript" src="../process_plan.js"></script> | ||
<script type="text/javascript" src="../find_route.js"></script> | ||
<script type="text/javascript" src="show_route.js" defer></script> | ||
</head> | ||
|
||
<body> | ||
<center> | ||
|
||
<h3>Навигатор ВВГУ</h3> | ||
<form name="frm"> | ||
<p>Откуда: <input type="text" size="8" name="from" /></p> | ||
<p>Куда: <input type="text" size="8" name="to" /></p> | ||
<p><button type="button" class="new" onClick="showRoute();">Маршрут</button></p> | ||
</form> | ||
<div class="background"> </div> | ||
<div class="container"> | ||
<div class="header"> | ||
<div class="header__logo"> | ||
<img src="images/logo.svg" alt=""/> | ||
</div> | ||
<div class="header__title">Ориентир</div> | ||
<div class="header__subtitle">Упрощенный навигатор по университету.</div> | ||
</div> | ||
<div class="form"> | ||
<form name="frm"> | ||
<input type="text" id="from" placeholder="Откуда" class="form__input"/> | ||
<input type="text" id="to" placeholder="Куда" class="form__input"/> | ||
<button type="button" id="button" onclick="showRoute();" class="form__button">Проложить маршрут</button> | ||
</form> | ||
<div id="output" class="output" hidden> | ||
<div class="output__header"> | ||
<div class="output__line"></div> | ||
<div class="output__title">Маршрут</div> | ||
<div class="output__item-container"> | ||
<div id="out-from" class="output__item">ауд. 4407</div> | ||
-> | ||
<div id="out-to" class="output__item">ауд. 4305</div> | ||
</div> | ||
</div> | ||
<div id="output-container"></div> | ||
</div> | ||
<!-- <div id="route-text" hidden>123</div>--> | ||
<div id="error-text" hidden></div> | ||
</div> | ||
</div> | ||
<!-- <center>--> | ||
|
||
<p> </p> | ||
<p>Справка:</p> | ||
<p>Введите номера аудиторий</p> | ||
<p>1 - главный вход, 2 - зимний сад</p> | ||
<!-- <h3>ВВГУ.Ориентир</h3>--> | ||
<!-- <form name="frm">--> | ||
<!-- <p>Откуда: <input type="text" size="8" name="from" /></p>--> | ||
<!-- <p>Куда: <input type="text" size="8" name="to" /></p>--> | ||
<!-- <p><button type="button" class="new" onClick="showRoute();">Маршрут</button></p>--> | ||
<!-- </form>--> | ||
|
||
<p> </p> | ||
<p id="route_text"></p> | ||
<!-- <p> </p>--> | ||
<!-- <p>Справка:</p>--> | ||
<!-- <p>Введите номера аудиторий</p>--> | ||
<!-- <p>1 - главный вход, 2 - зимний сад</p> --> | ||
|
||
</center> | ||
<!-- <p> </p>--> | ||
<!-- <p id="route_text"></p>--> | ||
|
||
<script type="text/javascript"> | ||
function showRoute() | ||
{ | ||
let from_point = frm.from.value; | ||
let to_point = frm.to.value; | ||
let route = findRoute(from_point, to_point); | ||
let route_str = route.join("<br/>"); | ||
document.getElementById("route_text").innerHTML = route_str; | ||
} | ||
</script> | ||
<!-- </center>--> | ||
</body> | ||
</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,38 @@ | ||
/*Обнуление*/ | ||
*{ | ||
padding: 0; | ||
margin: 0; | ||
border: 0; | ||
} | ||
*,*:before,*:after{ | ||
-moz-box-sizing: border-box; | ||
-webkit-box-sizing: border-box; | ||
box-sizing: border-box; | ||
} | ||
:focus,:active{outline: none;} | ||
a:focus,a:active{outline: none;} | ||
|
||
nav,footer,header,aside{display: block;} | ||
|
||
html,body{ | ||
height: 100%; | ||
width: 100%; | ||
font-size: 100%; | ||
line-height: 1; | ||
font-size: 14px; | ||
-ms-text-size-adjust: 100%; | ||
-moz-text-size-adjust: 100%; | ||
-webkit-text-size-adjust: 100%; | ||
} | ||
input,button,textarea{font-family:inherit;} | ||
|
||
input::-ms-clear{display: none;} | ||
button{cursor: pointer;} | ||
button::-moz-focus-inner {padding:0;border:0;} | ||
a, a:visited{text-decoration: none;} | ||
a:hover{text-decoration: none;} | ||
ul li{list-style: none;} | ||
img{vertical-align: top;} | ||
|
||
h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight: 400;} | ||
/*--------------------*/ |
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,80 @@ | ||
|
||
|
||
let toField = document.getElementById("to"); | ||
let fromField = document.getElementById("from"); | ||
let button = document.getElementById("button"); | ||
//let routeText = document.getElementById("route-text"); | ||
let errorText = document.getElementById("error-text"); | ||
let outputContainer = document.getElementById("output-container"); | ||
let outputBlock = document.getElementById("output"); | ||
let outFrom = document.getElementById("out-from"); | ||
let outTo = document.getElementById("out-to"); | ||
let state = false; | ||
|
||
function showRoute() | ||
{ | ||
if (!state) { | ||
let from_point = fromField.value; | ||
let to_point = toField.value; | ||
|
||
let route = ''; | ||
try { | ||
route = findRoute(from_point, to_point); | ||
} catch (e) { | ||
errorText.innerHTML = e.message; | ||
errorText.hidden = false; | ||
return; | ||
} | ||
|
||
//let route_str = route.join("<br/>"); | ||
let route_str = route.map((val, idx) => { | ||
return `<div class="output__step">${val}</div>`; | ||
}).join(' '); | ||
|
||
outputContainer.innerHTML = route_str; | ||
//routeText.hidden = false; | ||
//routeText.innerHTML = route_str; | ||
|
||
outFrom.innerHTML = from_point; | ||
outTo.innerHTML = to_point; | ||
|
||
toField.hidden = true; | ||
fromField.hidden = true; | ||
|
||
errorText.hidden = true; | ||
|
||
button.innerHTML = "Проложить новый маршрут"; | ||
|
||
outputBlock.hidden = false; | ||
|
||
// toField.classList.add("collapsed"); | ||
// fromField.classList.add("collapsed"); | ||
|
||
state = true; | ||
} else { | ||
toField.hidden = false; | ||
toField.value = ""; | ||
|
||
fromField.hidden = false; | ||
fromField.value = ""; | ||
|
||
//routeText.hidden = true; | ||
|
||
button.innerHTML = "Проложить маршрут"; | ||
|
||
outputBlock.hidden = true; | ||
|
||
state = false; | ||
} | ||
} | ||
|
||
/*При нажатии ENTER в текстовом поле*/ | ||
const clickEvent = function(event) { | ||
if (event.key === "Enter") { | ||
event.preventDefault(); | ||
showRoute(); | ||
} | ||
} | ||
|
||
toField.addEventListener("keypress", clickEvent); | ||
fromField.addEventListener("keypress", clickEvent); |
Oops, something went wrong.