Toggle navigation
Toggle navigation
This project
Loading...
Sign in
LI WENHAO
/
kartrider
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김명주
2021-11-28 23:59:25 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
41cac3c440397cdfabf901e6dbf0ab9f65f0b9ee
41cac3c4
1 parent
cdd046a5
Update test result page design
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
39 deletions
views/test_result.css
views/test_result.ejs
views/test_result.css
View file @
41cac3c
...
...
@@ -157,4 +157,27 @@
font-size
:
70px
;
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
...
...
views/test_result.ejs
View file @
41cac3c
<!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
(
"."
);
function
load
()
{
return
fetch
(
"metadata/kart.json"
)
.
then
((
response
)
=>
response
.
json
())
.
then
((
json
)
=>
json
.
kart
);
}
load
().
then
((
kart
)
=>
{
const
div_target
=
document
.
querySelector
(
"#total"
);
var
obj
=
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
.
innerText
=
"나에게 맞는 카트는 "
;
obj2
.
innerText
=
kart
[
i
][
'name'
];
break
;
}
var
item
=
'<%- body %>'
;
var
url
=
'<%- url %>'
;
var
stritem
=
item
.
split
(
"."
);
function
load
()
{
return
fetch
(
"metadata/kart.json"
)
.
then
((
response
)
=>
response
.
json
())
.
then
((
json
)
=>
json
.
kart
);
}
load
().
then
((
kart
)
=>
{
const
div_target
=
document
.
querySelector
(
"#total"
);
var
obj
=
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
.
innerText
=
"나에게 맞는 카트는 "
;
obj2
.
innerText
=
kart
[
i
][
'name'
];
break
;
}
div_target
.
append
(
obj
);
div_target
.
append
(
obj2
);
});
function
Img
()
{
return
url
+
item
;
}
div_target
.
append
(
obj
);
div_target
.
append
(
obj2
);
});
function
Img
()
{
return
url
+
item
;
}
</script>
<body>
<div
id=
"total"
>
<div
id=
"words"
>
<img
id=
"imgkey"
src=
"metadata/image/keyword.png"
>
<img
id=
"imgkey"
src=
"metadata/image/keyword.png"
>
</div>
<div
id=
"rkart"
>
<img
id=
"imgId"
src=
""
>
<script>
document
.
getElementById
(
"imgId"
).
src
=
Img
()
</script>
<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>
</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
...
...
Please
register
or
login
to post a comment