Skip to content

Commit

Permalink
Merge pull request #2640 from AsmitaMishra24/master
Browse files Browse the repository at this point in the history
Added Citation Generator
  • Loading branch information
Sulagna-Dutta-Roy authored Aug 9, 2024
2 parents 67f1d2f + db9a8f7 commit d7b51f7
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 0 deletions.
Binary file added Citation Generator/icon128.png
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 Citation Generator/icon16.png
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 Citation Generator/icon48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Citation Generator/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Citation Generator</title>
<link rel="stylesheet" href="style.css">
</head>
<div class="container">
<h1>Citation Generator</h1>
<form id="citation-form">
<label for="author">Author:</label>
<input type="text" id="author" name="author" required>

<label for="title">Title:</label>
<input type="text" id="title" name="title" required>

<label for="publisher">Publisher:</label>
<input type="text" id="publisher" name="publisher" required>

<label for="year">Year:</label>
<input type="text" id="year" name="year" required>

<button type="submit">Genrate Citation</button>
</form>

<div id="citation-output">
<h2>Your Citation:</h2>
<p id="citation"></p>
</div>
</div>
<script src="script.js"></script>
</body>
</html>
16 changes: 16 additions & 0 deletions Citation Generator/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"manifest_version": 3,
"name": "Citation Generator",
"version": "1.0",
"description": "A simple citation generator tool.",
"icons": {
"16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png"
},
"action": {
"default_popup": "index.html",
"default_icon": "icon128.png"
},
"permissions": []
}
13 changes: 13 additions & 0 deletions Citation Generator/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
document.getElementById('citation-form').addEventListener('submit', function(e) {
e.preventDefault();

const author = document.getElementById('author').value;
const title = document.getElementById('title').value;
const publisher = document.getElementById('publisher').value;
const year = document.getElementById('year').value;

const citation = `${author}. (${year}). *${title}*. ${publisher}.`;

document.getElementById('citation').textContent = citation;

});
55 changes: 55 additions & 0 deletions Citation Generator/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
body {
width: 100%;
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
}

.container {
max-width: fit-content;
margin: 50px auto;
padding: 20px;
}

h1 {
text-align: center;
}

form {
display: flex;
flex-direction: column;
}

label {
margin-top: 10px;
}

input {
padding: 8px;
margin-top: 5px;
font-size: 16px;
}

button {
margin-top: 20px;
padding: 10px;
font-size: 16px;
background-color: #007bff;
color: #fff;
border: none;
cursor: pointer;
}

button:hover {
background-color: #0056b3;
}

#citation-output {
margin-top: 20px;
}

#citation {
font-style: italic;
color: #333;
}

0 comments on commit d7b51f7

Please sign in to comment.