김명주

Update test result page design

......@@ -158,3 +158,26 @@
font-weight: bold;
color:rgb(0, 153, 255);
}
#home
{
position:relative;
font-family: 'Nanum Gothic';
font-size:x-large;
font-weight: bold;
color:white;
top:80%;
left:35%;
background-color: rgb(0, 153, 255);
}
#reset
{
position:relative;
font-family: 'Nanum Gothic';
font-size:x-large;
font-weight: bold;
color:white;
top:80%;
left:55%;
background-color: rgb(0, 153, 255);
}
\ No newline at end of file
......
<!DOCTYPE html>
<html>
<head>
<title>추천 카트</title>
<link rel="stylesheet" type="text/css" href="test_result.css" />
</head>
<script>
var item='<%- body %>';
var url='<%- url %>';
var stritem=item.split(".");
var item = '<%- body %>';
var url = '<%- url %>';
var stritem = item.split(".");
function load() {
return fetch("metadata/kart.json")
.then((response) => response.json())
......@@ -16,13 +17,13 @@
load().then((kart) => {
const div_target = document.querySelector("#total");
var obj = document.createElement('text');
var obj2=document.createElement('text');
var obj2 = document.createElement('text');
for (var i = 0; i < kart.length; i++) {
if (kart[i]['id'] == stritem[0]) {
obj.id="text1";
obj2.id="text2";
obj.id = "text1";
obj2.id = "text2";
obj.innerText = "나에게 맞는 카트는 ";
obj2.innerText=kart[i]['name'];
obj2.innerText = kart[i]['name'];
break;
}
}
......@@ -31,9 +32,10 @@
});
function Img() {
return url+item;
return url + item;
}
</script>
<body>
<div id="total">
<div id="words">
......@@ -43,22 +45,25 @@
<img id="imgId" src="">
<script>document.getElementById("imgId").src = Img()</script>
</div>
<button id="reset" onClick="location.href='/test'">다시하기</button>
<button id="home" onClick="location.href='/'">HOME</button>
</div>
</body>
<script>
var keyword="<%- keyword %>";
var keyarr=keyword.split(',');
const div_target=document.querySelector("#words");
var i=0, index=0;
while(index<7){
if(keyarr[index]!="empty"){
var obj=document.createElement('button');
obj.id="word"+(i+1);
obj.innerText='#'+keyarr[index];
var keyword = "<%- keyword %>";
var keyarr = keyword.split(',');
const div_target = document.querySelector("#words");
var i = 0, index = 0;
while (index < 7) {
if (keyarr[index] != "empty") {
var obj = document.createElement('button');
obj.id = "word" + (i + 1);
obj.innerText = '#' + keyarr[index];
div_target.append(obj);
i++;
}
index++;
}
</script>
</html>
\ No newline at end of file
......