@import url(../asset/css/atom-one-dark.min.css.css);
@import url(../asset/css/window98.css);
@import url(../asset/css/quizDog.css);
@font-face {
font-family: 'DungGeunMo';
src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_six@1.2/DungGeunMo.woff') format('woff');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Cafe24Dangdanghae';
src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.2/Cafe24Dangdanghae.woff') format('woff');
font-weight: normal;
font-style: normal;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'DungGeunMo';
}
*::after, *::before {
box-sizing: border-box;
}
a{
text-decoration: none;
}
body {
background-color: #f6f6f6;
background-image:
linear-gradient(90deg, #cdcccc 0px, #cdcccc 1px, transparent 1px, transparent 99px, transparent 100px),
linear-gradient(#cdcccc 0px, #cdcccc 1px, transparent 1px, transparent 99px, transparent 100px),
linear-gradient(#e0e0e0 0px, #e0e0e0 1px, transparent 1px, transparent 99px, transparent 100px),
linear-gradient(90deg, #e0e0e0 0px, #e0e0e0 1px, transparent 1px, transparent 99px, transparent 100px),
linear-gradient(transparent 0px, transparent 5px, #f6f6f6 5px, #f6f6f6 95px, transparent 95px, transparent 100px),
linear-gradient(90deg, #e0e0e0 0px, #e0e0e0 1px, transparent 1px, transparent 99px, #e0e0e0 99px, #e0e0e0 100px),
linear-gradient(90deg, transparent 0px, transparent 5px, #f6f6f6 5px, #f6f6f6 95px, transparent 95px, transparent 100px),
linear-gradient(transparent 0px, transparent 1px, #f6f6f6 1px, #f6f6f6 99px, transparent 99px, transparent 100px),
linear-gradient(#cdcccc, #cdcccc);
background-size:100px 100%, 100% 100px, 100% 10px, 10px 100%, 100% 100px, 100px 100%, 100px 100%, 100px 100px, 100px 100px;
}
#header {
position: absolute;
left: 0;
top: 0;
width: 100%;
background: #262626;
color: #fff;
display: flex;
padding: 10px;
justify-content: space-between;
align-items: center;
z-index: 10;
}
#header::before {
content: '';
border: 4px ridge #a3a3a3;
position: absolute;
left: 5px;
top: 5px;
width: calc(100% - 10px);
height: calc(100% - 10px);
z-index: -1;
}
#header h1 {
padding: 3px 0 6px 10px;
}
#header h1 a {
text-decoration: none;
color: #fff;
}
#header nav {
padding-right: 10px;
}
#header nav li {
list-style: none;
display: inline;
}
#header nav li a {
color: #fff;
display: inline-block;
padding: 0 10px;
transition: all 0.2s;
border: 1px dashed #fff;
}
#header nav li.active a {
background: #fff;
color: #262626;
}
#header nav li a:hover {
opacity: 0.5;
}
#footer {
margin-top: 200px;
width: 100%;
background: #fff;
text-align: center;
padding: 20px;
}
#footer a {
color: #262626;
font-size: 16px;
}
/*quiz__wrap*/
.quiz__wrap {
display: flex;
align-items: center;
justify-content: center;
margin-top: 150px;
flex-wrap: wrap;
}
.quiz {
max-width: 500px;
width: 100%;
background: #fff;
border: 8px ridge #cacaca;
margin: 10px;
}
.quiz__type {
background: #cacaca;
text-align: center;
font-size: 14px;
color: #3b3b3b;
border: 3px ridge #cacaca;
padding: 3px 0;
position: relative;
}
.quiz__type::before {
content: '';
position: absolute;
left: 2px;
top: 2px;
width: 5px;
height: 5px;
border: 6px ridge #648a30;
}
.quiz__type::after {
content: '';
position: absolute;
right: 2px;
top: 2px;
width: 5px;
height: 5px;
border: 6px ridge #648a30;
}
.quiz__question {
border-bottom: 6px ridge #cacaca;
border-top: 6px ridge #cacaca;
padding: 13px 30px;
font-size: 24px;
line-height: 1.6;
}
.quiz__number {
font-family: 'Cafe24Dangdanghae';
color: #648a30;
}
.quiz__ask {
font-family: 'Cafe24Dangdanghae';
color: #262626;
}
.quiz__view {
background: #f5f5f5;
position: relative;
}
.quiz__view .true {
position: absolute;
left: 70%;
top: 100px;
width: 120px;
height: 120px;
color: #fff;
border-radius: 50%;
z-index: 100;
line-height: 120px;
text-align: center;
background: #f5534f;
display: none;
}
.quiz__view .false {
position: absolute;
right: 70%;
top: 100px;
width: 120px;
height: 120px;
background: #fff;
border-radius: 50%;
z-index: 100;
line-height: 120px;
text-align: center;
color: #f5534f;
display: none;
}
.quiz__answer {
border-top: 6px ridge #cacaca;
background: #f5f5f5;
padding: 10px;
}
.quiz__confirm {
padding: 10px;
border: 6px ridge #cacaca;
width: 100%;
font-size: 22px;
padding: 13px 20px;
background: #d6d6d6;
font-family: 'Cafe24Dangdanghae';
text-shadow: 1px 1px 1px #fff;
transition: all 0.3s;
}
.quiz__confirm:hover {
background: #b3b3b3;
}
.quiz__result {
text-align: center;
padding: 10px;
border: 6px ridge #cacaca;
width: 100%;
font-size: 22px;
padding: 13px 20px;
background: #fff;
font-family: 'Cafe24Dangdanghae';
text-shadow: 1px 1px 1px #fff;
display: none;
color: #262626;
}
.quiz__input {
width: 100%;
padding: 13px 20px;
border: 6px ridge #cacaca;
font-size: 22px;
padding: 13px 20px;
background: #fff;
font-family: 'Cafe24Dangdanghae';
text-shadow: 1px 1px 1px #fff;
margin-bottom: 10px;
}
hljs.highlightAll();
modal()
tabMenu()
const quizType = document.querySelector(".quiz__type"); //퀴즈 종류
const quizNumber = document.querySelector(".quiz__number"); //퀴즈 번호
const quizAsk = document.querySelector(".quiz__ask"); //퀴즈 질문
const quizConfirm = document.querySelector(".quiz__confirm"); //정답 확인 버튼
const quizResult = document.querySelector(".quiz__result"); //정답 결과
const quizDog = document.querySelector(".dog"); //강아지
const quizTrue = document.querySelector(".true"); //정답입니다
const quizFalse = document.querySelector(".false"); //틀렸습니다.
//문제 정보
const answerType = "javascript"
const answerNum = 1;
const answerAsk = "객체 기반의 스크립트 프로그래밍 언어는 무엇입니까?";
const answerResult = "javascript";
//문제 출력
quizType.textContent = answerType;
quizNumber.textContent = answerNum + ".";
quizAsk.textContent = answerAsk;
quizResult.textContent = answerResult;
//정답 확인
//정답 버튼을 클릭하면 정답확인은 안보이게, 숨겨진 정답은 보이게
quizConfirm.addEventListener("click", ()=>{
quizConfirm.style.display = "none";
quizResult.style.display = "block";
quizDog.classList.add("like");
})
quizResult.addEventListener("click", ()=>{
quizConfirm.style.display = "block";
quizResult.style.display = "none";
quizDog.classList.remove("like");
})
//주말숙제 서치 이펙트 참고해서 인풋 값 비교해서 버튼 클릭하면 정답입니다, 아닙니다~ 나오게
const inputBox = document.querySelector(".quiz__input");
const quizData = inputBox.value
quizConfirm.addEventListener("click", ()=>{
factCheck();
})
function factCheck(){
if(answerResult==inputBox.value){
quizDog.classList.remove("dislike");
quizDog.classList.add("like");
quizFalse.style.display = "none"
quizTrue.style.display = "block"
} if(answerResult!=inputBox.value){
quizDog.classList.remove("like");
quizDog.classList.add("dislike");
quizTrue.style.display = "none"
quizFalse.style.display = "block"
}
}