Skip to content

Commit

Permalink
Merge branch 'main' into iron
Browse files Browse the repository at this point in the history
  • Loading branch information
Rizwan-S authored Jul 19, 2021
2 parents 83afa6b + 1c0d723 commit 8364e07
Show file tree
Hide file tree
Showing 9 changed files with 752 additions and 73 deletions.
Binary file added assets/Images/linechart.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Images/password-generator.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Images/radarchart.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 45 additions & 12 deletions assets/css/FAQs.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,60 @@
margin: 0;
padding: 0;
font-family: 'Hind', sans-serif;
background: rgb(239, 250, 251);
background: brown;
color: #4d5974;
display: flex;
min-height: 100vh;
}
}

.container {
margin: 0 auto;
padding: 4rem;
width: 48rem;
}

.card{
background-color:rgb(194, 187, 187);
box-shadow: rgba(50, 50, 93, 0.25) 0px 50px 100px -20px, rgba(0, 0, 0, 0.3) 0px 30px 60px -30px, rgba(10, 37, 64, 0.35) 0px -2px 6px 0px inset;
}
h2{
color: #362222;
text-align:center;
letter-spacing: 2px;
background-color:rgb(194, 187, 187);
}
.border-bottom{
border-bottom: 1px solid purple;
padding-bottom: 5px;
}

.img{
width:200px;
position:relative;
top: -10px;
filter: drop-shadow(0 25px 0px #E1D6F6);
}

/*expand and collapse cards*/


.accordion .accordion-item {
border-bottom: 1px solid #e5e5e5;
border-bottom: 1px solid #ebc7c7;
color: #222831;
text-align: center;

}

.accordion .accordion-item button[aria-expanded='true'] {
border-bottom: 1px solid #03b5d2;
border-bottom: 1px dotted #F0EFEF;
}
.accordion button {
position: relative;
display: block;
text-align: left;
align-items: center;
width: 100%;
padding: 1em 0;
color: #7288a2;
color: #31112C;
font-size: 1.15rem;
font-weight: 400;
border: none;
Expand All @@ -40,15 +71,17 @@
}
.accordion button:hover, .accordion button:focus {
cursor: pointer;
color: #03b5d2;
color: #EE4540;

}
.accordion button:hover::after, .accordion button:focus::after {
cursor: pointer;
color: #03b5d2;
border: 1px solid #03b5d2;
color: #A72693;
border: 1px solid #A72693;
}
.accordion button .accordion-title {
padding: 1em 1.5em 1em 0;

}
.accordion button .icon {
display: inline-block;
Expand Down Expand Up @@ -80,7 +113,7 @@
background: currentColor;
}
.accordion button[aria-expanded='true'] {
color: #03b5d2;
color: #EE4540;
}
.accordion button[aria-expanded='true'] .icon::after {
width: 0;
Expand All @@ -100,7 +133,7 @@
}
.accordion .accordion-content p {
font-size: 1rem;
font-weight: 300;
font-weight: bold;
margin: 2em 0;
}
/*ends*/
19 changes: 16 additions & 3 deletions public/FAQs.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,25 @@
</head>
<body>
<div class="container">
<h2>Frequently Asked Questions</h2>

<div class="card">
<div class="column">
<img src="https://raw.githubusercontent.com/luamoris/react-faq-card-info/a8bb6248c30bae08f077566df122ac83c23a3532/src/img/illustration-woman-online-desktop.svg" class= "img">
<h2><span class ="border-bottom">FREQUENTLY ASKED QUESTIONS</span> </h2>
</div>



<div class="accordion">
<div class="accordion-item">
<button id="accordion-button-1" aria-expanded="false"><span class="accordion-title">What is JavaScript?</span><span class="icon" aria-hidden="true"></span></button>
<div class="card-1">
<div class="accordion-item">
<button id="accordion-button-1" aria-expanded="false" ><span class="accordion-title">What is JavaScript?</span><span class="icon" aria-hidden="true"></span></button>
<div class="accordion-content">
<p>JavaScript is a lightweight and interpreted programming language with object-oriented capacity. It helps you to develop interactivity into static HTML pages.</p>
</div>
</div>
</div>

<div class="accordion-item">
<button id="accordion-button-2" aria-expanded="false"><span class="accordion-title">What are the different features of JavaScript?</span><span class="icon" aria-hidden="true"></span></button>
<div class="accordion-content">
Expand Down Expand Up @@ -50,6 +61,8 @@ <h2>Frequently Asked Questions</h2>
</div>
</div>
</div>

</div>
<script src="../assets/js/FAQs.js"></script>
</body>
</html>
210 changes: 210 additions & 0 deletions public/linechart.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
crossorigin="anonymous"
/>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>

<title>Line Chart</title>
</head>

<body style="background-color: antiquewhite">
<section class="mt-4">
<div class="container">
<div class="text-center">
<h2>Line Chart in Vanilla JavaScript</h2>
</div>
<div class="row justify-content-center mt-4">
<div class="col-md-8 text-center">
<button
class="btn btn-primary"
data-bs-toggle="modal"
data-bs-target="#reg-modal"
>
Add Dataset
</button>
</div>
</div>

<hr />
</div>
</section>

<!-- modal itself -->
<div
class="modal fade"
id="reg-modal"
tabindex="-1"
aria-labelledby="modal-title"
aria-hidden="true"
>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modal-title">Enter your information</h5>
<button
type="button"
class="btn-close"
data-bs-dismiss="modal"
aria-label="Close"
></button>
</div>
<div class="modal-body">
<form id="dataform">
<div class="mb-3">
<input
type="text"
class="form-control"
id="chartname"
placeholder="Chart Name"
/>
</div>
<hr />
<div class="mb-3">
<input
type="text"
class="form-control"
id="datalabel"
name="datalabel"
placeholder="Label Name"
/>
</div>
<div class="mb-3">
<input
type="number"
class="form-control"
id="datavalue"
name="datavalue"
placeholder="Value"
/>
</div>
<div id="newJSdiv"></div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" id="addvalue">
Add One Value
</button>
<button
type="button"
class="btn btn-success"
onclick="saveValues()"
data-bs-dismiss="modal"
>
Submit
</button>
</div>
</div>
</div>
</div>

<div class="container">
<canvas id="chart"></canvas>
</div>

<script>
let chart = document.getElementById("chart").getContext("2d");
let dataForm = document.getElementById("dataform");
let addValue = document.getElementById("addvalue");

// Adding a new pair of values
addValue.onclick = function () {
let newDiv = document.createElement("div");
newDiv.id = "newdiv";
newDiv.class = "mb-3";
newDiv.style.padding = "10px 0px 10px 0px";

// Creating and adding the newly created label
let newLabel = document.createElement("input");
newLabel.setAttribute("id", "dynamiclabel");
newLabel.setAttribute("name", "newdatalabel");
newLabel.setAttribute("type", "text");
newLabel.setAttribute("class", "form-control");
newLabel.setAttribute("placeholder", "Label Name");
newLabel.style.margin = "5px 0px 5px 0px";
newDiv.appendChild(newLabel);

// Creating and adding the newly created value feild
let newValue = document.createElement("input");
newValue.setAttribute("id", "dynamicvalue");
newValue.setAttribute("name", "newdatavalue");
newValue.setAttribute("type", "number");
newValue.setAttribute("class", "form-control");
newValue.setAttribute("placeholder", "Value");
newLabel.style.margin = "5px 0px 5px 0px";
newDiv.appendChild(newValue);

document.getElementById("newJSdiv").appendChild(newDiv);
};

// Submit button
const saveValues = () => {
let chartName = document.getElementById("chartname").value;
let dataLabel = document.getElementById("datalabel").value;
let dataValue = document.getElementById("datavalue").value;

let dynamicLabel = document.getElementsByName("newdatalabel");
let dynamicValue = document.getElementsByName("newdatavalue");

let labels = [dataLabel];
let values = [dataValue];

// Saving values created by dynamic fields
for (let i = 0; i < dynamicLabel.length; i++) {
labels.push(dynamicLabel[i].value);
values.push(dynamicValue[i].value);
}

/// Plotting the chart
const lineChart = new Chart(chart, {
type: "line",
data: {
labels: labels,
datasets: [
{
label: chartName,
data: values,
borderWidth: 2,
borderColor: "green",
hoverBorderWidth: 4,
hoverBorderColor: "#000",
},
],
},
options: {
plugins: {
title: {
display: true,
text: chartName,
fontSize: 30,
},
legend: {
display: false,
},
},
},
});
};
</script>

<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js"
integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4"
crossorigin="anonymous"
></script>

<script>
const tooltips = document.querySelectorAll(".tt");
tooltips.forEach((t) => {
new bootstrap.Tooltip(t);
});
</script>
</body>
</html>
Loading

0 comments on commit 8364e07

Please sign in to comment.