Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<add> : Adding Faq page built with simple html, css & js #1070

Merged
merged 2 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions FAQ_page/Devanshukoli/Index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>FAQ Page</title>
<link rel="stylesheet" href="./style.css" />
<style></style>
</head>
<body>
<section>
<h2 class="title">FAQ</h2>

<div class="faq">
<div class="question">
<h3>Is your website is secure?</h3>
<svg width="15" height="10" viewBox="0 0 42 25">
<path d="M3 3L21 12L39 3" stroke="white" stroke-width="7" storke-linecap="round"/>
</svg>
</div>

<div class="answer">
<p>Yes, it is :)</p>
</div>
</div>

<div class="faq">
<div class="question">
<h3>Do you charge Deals?</h3>
<svg width="15" height="10" viewBox="0 0 42 25">
<path d="M3 3L21 12L39 3" stroke="white" stroke-width="7" storke-linecap="round" />
</svg>
</div>

<div class="answer">
<p>NO, We don't ;(</p>
</div>
</div>
<div class="faq">
<div class="question">
<h3>What about price?</h3>
<svg width="15" height="10" viewBox="0 0 42 25">
<path d="M3 3L21 12L39 3" stroke="white" stroke-width="7" storke-linecap="round"/>
</svg>
</div>

<div class="answer">
<p>navigate through price page.</p>
</div>
</div>
</section>
<script src="./app.js"></script>
</body>
</html>
7 changes: 7 additions & 0 deletions FAQ_page/Devanshukoli/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const faqs = document.querySelectorAll('.faq')

faqs.forEach(faq => {
faq.addEventListener('click', () => {
faq.classList.toggle('active')
})
})
81 changes: 81 additions & 0 deletions FAQ_page/Devanshukoli/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
@import url("https://fonts.googleapis.com/css2?family=Sometype+Mono&display=swap");

* {
margin: 0;
padding: 0;
box-sizing: border-box:
}

body {
font-family: "Sometype+Mono", sans-serif;
background: #e5d2d28a;
color : #160b0b
}

section {
min-height: 100vh;
width: 80%;
margin: 0 auto;
display : flex;
flex-direction: column;
align-items: center;
}

.title {
font-size: 3rem;
margin: 2rem 0rem;
}

.faq {
max-width: 700px;
margin-top: 2rem;
padding-bottom: 1rem;
border-bottom: 2px solid #ccc;
cursor: pointer;
}

.question {
display: flex;
justify-content: space-between;
align-items: center;
}

.question h3 {
font-size: 1.8rem;
}

.answer {
max-height: 0;
overflow: hidden;
transition: max-height 1.4s ease;
}

.answer p {
padding-top: 1rem;
line-height: 1.6;
font-size: 1.4rem;
}

.faq.active .answer {
max-height: 300px;
animation : fade 1s ease-in-out;
}

.faq.active svg {
transform: rotate(180deg)
}

svg {
transition: transform 0.5s ease-in;
}

@keyframes fade {
from {
opacity: 0;
transform: translateY(-10px);
}
to {
opacity: 1;
transform: translateY(0px)
}
}
Loading