Skip to content

Commit

Permalink
added code chef coding problem extension
Browse files Browse the repository at this point in the history
  • Loading branch information
NAVJOT-786 committed Jun 9, 2024
1 parent 2062589 commit c3bee75
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Code Chef Coding Problem/background.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
chrome.runtime.onInstalled.addListener(() => {
console.log('CodeChef Coding Problem Navigator Extension Installed');
});

19 changes: 19 additions & 0 deletions Code Chef Coding Problem/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"manifest_version": 3,
"name": "CodeChef Coding Problem Navigator",
"description": "Navigate to CodeChef coding problems",
"version": "1.0",
"permissions": ["activeTab"],
"action": {
"default_popup": "popup.html",
"default_icon": {
"16": "icon.png",
"48": "icon.png",
"128": "icon.png"
}
},
"background": {
"service_worker": "background.js"
}
}

14 changes: 14 additions & 0 deletions Code Chef Coding Problem/popup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CodeChef Navigator</title>
<link rel="stylesheet" href="typewriter.css">
</head>
<body>
<h1>Welcome to CodeChef Coding Problems</h1>
<button id="navigate-button">Go to CodeChef</button>
<script src="popup.js"></script>
</body>
</html>
4 changes: 4 additions & 0 deletions Code Chef Coding Problem/popup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
document.getElementById('navigate-button').addEventListener('click', function() {
chrome.tabs.create({ url: 'https://www.codechef.com/' });
});

21 changes: 21 additions & 0 deletions Code Chef Coding Problem/typewriter.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.typewriter h1 {
overflow: hidden;
border-right: .15em solid orange;
white-space: nowrap;
margin: 0 auto;
letter-spacing: .15em;
animation:
typing 3.5s steps(40, end),
blink-caret .75s step-end infinite;
}

@keyframes typing {
from { width: 0 }
to { width: 100% }
}

@keyframes blink-caret {
from, to { border-color: transparent }
50% { border-color: orange }
}

49 changes: 49 additions & 0 deletions Code Chef Coding Problem/welcome.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome to CodeChef</title>
<link rel="stylesheet" href="typewriter.css">
<style>
body {
background: linear-gradient(45deg, yellow, orange);
color: white;
text-align: center;
padding: 50px;
}
.typewriter h1 {
overflow: hidden;
border-right: .15em solid orange;
white-space: nowrap;
margin: 0 auto;
letter-spacing: .15em;
animation:
typing 3.5s steps(40, end),
blink-caret .75s step-end infinite;
}

@keyframes typing {
from { width: 0 }
to { width: 100% }
}

@keyframes blink-caret {
from, to { border-color: transparent }
50% { border-color: orange }
}
</style>
</head>
<body>
<div class="typewriter">
<h1>Welcome to CodeChef Coding Problems</h1>
</div>
<p>Enhance your coding skills with CodeChef's challenging problems!</p>
<button onclick="navigateToCodeChef()">Start Coding</button>
<script>
function navigateToCodeChef() {
window.location.href = "https://www.codechef.com/";
}
</script>
</body>
</html>
6 changes: 6 additions & 0 deletions Code Chef Coding Problem/welcome.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
document.addEventListener('DOMContentLoaded', function() {
setTimeout(function() {
window.location.href = 'https://www.codechef.com/';
}, 5000); // Redirect after 5 seconds
});

0 comments on commit c3bee75

Please sign in to comment.