Skip to content

Commit

Permalink
Merge branch 'main' into shivani
Browse files Browse the repository at this point in the history
  • Loading branch information
shivaniyuvrajyadav authored May 26, 2023
2 parents 49ae6ba + 901b4ac commit 825a488
Show file tree
Hide file tree
Showing 10 changed files with 540 additions and 65 deletions.
Binary file added assets/cheatsheets/C.pdf
Binary file not shown.
Binary file added assets/cheatsheets/CPP.pdf
Binary file not shown.
Binary file added assets/cheatsheets/Python.pdf
Binary file not shown.
24 changes: 23 additions & 1 deletion assets/css/darkmode.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
body.light{

--darkback:white;
--textcolor:#555;
--textcolor2:#0c2e8a;
Expand Down Expand Up @@ -46,3 +45,26 @@ body{
color:var(--textcolor);

}


body.light .card-heading {
color: var(--footer);
background-image: linear-gradient(to right, #0c2e8a, #6da6db);
}

body.light .view-btn {
color: var(--footer);
}

body.light .viewRepo {
background-color: #051b5a;
border-top: 1px solid #87bef1;
}

body.light .hacktober-heading {
color: #081e5b;
}

body.light .card {
background-color: #eff2f5;
}
51 changes: 42 additions & 9 deletions assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,30 +50,45 @@ h6 {
visibility: hidden;
opacity: 0;
right: 15px;
bottom: 15px;
bottom: 80px;
z-index: 996;
background: #2796ff;
width: 40px;
height: 40px;
transition: all 0.4s;
transition: opacity 0.3s ease;
animation: slideUp 0.8s infinite;
}

.back-to-top i {
font-size: 28px;
color: #fff;
line-height: 0;
transition: opacity 0.3s ease;
}

.back-to-top:hover {
background: #2796ff;
background: #8ec2f4;
color: #fff;
}

.back-to-top.active {
visibility: visible;
opacity: 1;
}

@keyframes slideUp {
20% {
transform: translateY(40px);
}
30% {
transform: translateY(50px);
}
40% {
transform: translateY(60px);
}
50% {
transform: translateY(70px);
}
}
/*--------------------------------------------------------------
# Header
--------------------------------------------------------------*/
Expand Down Expand Up @@ -618,16 +633,13 @@ section {
text-align: center;
min-height: fit-content;
box-shadow: 0px 2px 12px var(--border-color);

=======
background-color: #141d26;
border-radius: 12px;
transition: box-shadow 0.3s ease, transform 0.3s ease;
}
#testimonials .testimonial-item:hover {
transform: scale(1.1);
box-shadow: 0px 10px 25px var(--border-color);

}

@media (max-width: 767px) {
Expand Down Expand Up @@ -780,7 +792,7 @@ section {
color: #2796ff;
}
.hoverchanger:hover {
background-color:#07052c
background-color: #07052c;
}
#contact .contact-address,
#contact .contact-phone,
Expand Down Expand Up @@ -996,7 +1008,8 @@ section {
margin-bottom: 15px;
}
.view-btn {
width:140px;
/* width: fit-content; */
width:140px;
height:47px;
border-radius:12px;
cursor:pointer;
Expand Down Expand Up @@ -1084,3 +1097,23 @@ section {
font-size: 12px;
}
}


/* ====================== SCROLL BAR ===================== */

::-webkit-scrollbar{
width: 12px;
}

::-webkit-scrollbar-track{
background: rgb(7, 31, 48);
}

::-webkit-scrollbar-thumb{
background: linear-gradient(transparent, #198df9);
border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover{
background: linear-gradient(transparent, #99ccfb);
}
80 changes: 80 additions & 0 deletions assets/js/cheatsheets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
const repodata = [
{
heading: "C",
description: "C programming language cheatsheet",
link: "/assets/cheatsheets/C.pdf",
},
{
heading: "Java",
description: "Java programming language cheatsheet",
link: "https://introcs.cs.princeton.edu/java/11cheatsheet/",
},
{
heading: "HTML",
description: "HTML cheatsheet",
link: "https://htmlcheatsheet.com/",
},
{
heading: "CSS",
description: "CSS cheatsheet",
link: "https://htmlcheatsheet.com/css/",
},
{
heading: "JavaScript",
description: "JavaScript programming language cheatsheet",
link: "https://htmlcheatsheet.com/js/",
},
{
heading: "C++",
description: "C++ programming language cheatsheet",
link: "./assets/cheatsheets/CPP.pdf",
},
{
heading: "Python",
description: "Python programming language cheatsheet",
link: "./assets/cheatsheets/Python.pdf",
},
];

const optionsContainer = document.querySelector(".option-container");

let allOptions;

allOptions = repodata.map(
(option) =>
`<div class="option">
<h1 class="cheatsheet-heading">${option.heading}</h1>
<p class="option-description">
${option.description}
</p>
<button class="option-btn" onclick="showCheatsheet('${option.link}')">View</button>
</div>`
);

optionsContainer.innerHTML = allOptions.join("");

function showCheatsheet(link) {
const overlay = document.createElement("div");
overlay.classList.add("overlay");

const iframeContainer = document.createElement("div");
iframeContainer.classList.add("iframe-container");

const iframe = document.createElement("iframe");
iframe.src = link;
iframe.frameborder = "0";
iframe.allowfullscreen = true;
iframe.style.width ="100%";
iframe.style.height = "95vh";
const closeBtn = document.createElement("button");
closeBtn.classList.add("close-btn");
closeBtn.textContent = "Close";
closeBtn.addEventListener("click", () => {
document.body.removeChild(overlay);
});
overlay.appendChild(closeBtn);
iframeContainer.appendChild(iframe);
overlay.appendChild(iframeContainer);
document.body.appendChild(overlay);
}

156 changes: 156 additions & 0 deletions cheatsheets.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta content="width=device-width, initial-scale=1.0" name="viewport" />

<title>CheatSheets</title>
<meta content="" name="description" />
<meta content="" name="keywords" />

<!-- Favicons -->
<link href="assets/img/Light Blue.jpg" rel="icon" />
<link href="assets/img/Light Blue.jpg" rel="apple-touch-icon" />

<!-- Google Fonts -->
<link
href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,700,700i|Raleway:300,400,500,700,800|Montserrat:300,400,700"
rel="stylesheet"
/>

<!-- CSS CDNs -->
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/aos/2.3.4/aos.css"
integrity="sha512-1cK78a1o+ht2JcaW6g8OXYwqpev9+6GqOkz9xmBN9iUUhIndKtxwILGWYOSibOKjLsEdjyjZvYDq/cZwNeak0w=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>

<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
crossorigin="anonymous"
/>

<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.8.1/font/bootstrap-icons.min.css"
integrity="sha512-Oy+sz5W86PK0ZIkawrG0iv7XwWhYecM3exvUtMKNJMekGFJtVAhibhRPTpmyTj8+lJCkmWfnpxKgT2OopquBHA=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>

<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/boxicons/2.1.1/css/boxicons.min.css"
integrity="sha512-nOk7sj5T6Zi3Ond5VHhc+L4WHvRuRhV/cOcWWDl2mOyTetiIfuv56UJzD0yYhz9Kqwk1PpU0/PX5+qpX43hVWg=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>

<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/8.0.6/swiper-bundle.css"
integrity="sha512-+S5HQ2Ix/L84uhBLMimQiJlFjqR/Unnord77MEDNpWtK99i2Tk212EPb3/ahEjgaPRBKkKtTzMHIdO2HQXT3dQ=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>

<!-- CSS -->
<link href="assets/css/style.css" rel="stylesheet" />
<link rel="stylesheet" href="./assets/css/darkmode.css" />
<script src=""></script>
</head>

<body>
<!-- ======= Header ======= -->
<header id="header" class="d-flex align-items-center">
<div class="container d-flex justify-content-between">
<div id="logo">
<a href="index.html"
><img
src="assets/img/Banner - Light.png"
alt=""
height="50px"
width="270px"
/></a>
</div>
<nav id="navbar" class="navbar">
<ul>
<li><a class="nav-link scrollto active" href="./index.html#hero">Home</a></li>
<li><a class="nav-link scrollto" href="./index.html#about">About</a></li>
<li><a class="nav-link scrollto" href="./index.html#services">Services</a></li>
<li>
<a class="nav-link scrollto" href="./index.html#testimonials">Testimonials</a>
</li>
<li><a class="nav-link scrollto" href="./index.html#contact">Contact</a></li>
<li>
<a
href="./hacktoberfest.html"
class="btn-get-started scrollto hacktoberfest-btn"
>Hacktoberfest</a
>
</li>
<li class="darkmode"></li>
</ul>

<i class="bi bi-list mobile-nav-toggle"></i>
</nav>
</nav>
</div>
</header>
<!-- End Header -->

<!-- Main Section -->
<div>
<h1 class="cheatsheet-heading">CheatSheets</h1>
<div class="option-container">
<div class="option">
<!-- This content is dynamically added via hacktoberfest.js -->
</div>
</div>

<a
href="#"
class="back-to-top d-flex align-items-center justify-content-center"
><i class="bi bi-arrow-up-short"></i
></a>

<!-- JS CDN -->
<script>
function showCheatsheet(language) {
var cheatsheetContainer = document.getElementById("option-container");
cheatsheetContainer.innerHTML = "";

if (language === "C") {
cheatsheetContainer.innerHTML = "<h3>Cheatsheet for C</h3><p>Content for C cheatsheet...</p>";
} else if (language === "Java") {
cheatsheetContainer.innerHTML = "<h3>Cheatsheet for Java</h3><p>Content for Java cheatsheet...</p>";
} else if (language === "HTML") {
cheatsheetContainer.innerHTML = "<h3>Cheatsheet for HTML</h3><p>Content for HTML cheatsheet...</p>";
} else if (language === "CSS") {
cheatsheetContainer.innerHTML = "<h3>Cheatsheet for CSS</h3><p>Content for CSS cheatsheet...</p>";
} else if (language === "JavaScript") {
cheatsheetContainer.innerHTML = "<h3>Cheatsheet for JavaScript</h3><p>Content for JavaScript cheatsheet...</p>";
}
else if (language === "C++") {
cheatsheetContainer.innerHTML = "<h3>Cheatsheet for C++</h3><p>Content for C++ cheatsheet...</p>";
} else if (language === "Python") {
cheatsheetContainer.innerHTML = "<h3>Cheatsheet for Python</h3><p>Content for Python cheatsheet...</p>";
}
}
</script>
<script
type="module"
src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.esm.js"
></script>

<!-- JS -->
<script defer src="./assets/js/darkmode_logic.js"></script>
<script src="assets/js/main.js"></script>
<script src="./assets/js/cheatsheets.js"></script>
<!-- End Main Section -->
</body>
</html>
Loading

0 comments on commit 825a488

Please sign in to comment.