Skip to content

Commit

Permalink
merged contribution from itsbhh
Browse files Browse the repository at this point in the history
  • Loading branch information
multiverseweb committed Oct 2, 2024
1 parent 38e7e30 commit b6ac384
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 89 deletions.
102 changes: 44 additions & 58 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Sometype+Mono:ital,wght@0,400..700;1,400..700&display=swap"
rel="stylesheet" />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0"
/>
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0" />
<link rel="shortcut icon" href="images/Nomenclature.png" type="image/x-icon" />
</head>

Expand Down Expand Up @@ -61,23 +59,21 @@
</table>
</div>
</nav>
<!-- Hamburger for smaller screens -->
<div class="hamburger" onclick="toggleSidebar()">
<span class="material-symbols-outlined"> unfold_more </span>
</div>
<!-- Sidebar structure -->
<div id="sidebar" class="sidebar">
<span class="close-btn" onclick="toggleSidebar()">&times;</span>
<a href="" class="home">Home</a>
<a href="pages/refine.html" class="competitive">Code Refiner</a>
<a href="pages/obfuscation.html" class="obfuscation">Code Obfuscator</a>
<a href="pages/timeComplexity.html" class="time">Time Complexity Analyser</a>
<a href="../index.html#contributeSection">Contribute!</a>
<a href="../index.html#feedback">Give Feedback!</a>
<a href="https://github.com/multiverseweb/CodeIt/blob/main/LICENSE#L3"
>License</a
>
</div>
<!-- Hamburger for smaller screens -->
<div class="hamburger" onclick="toggleSidebar()">
<span class="material-symbols-outlined"> unfold_more </span>
</div>
<!-- Sidebar structure -->
<div id="sidebar" class="sidebar">
<span class="close-btn" onclick="toggleSidebar()">&times;</span>
<a href="" class="home">Home</a>
<a href="pages/refine.html" class="competitive">Code Refiner</a>
<a href="pages/obfuscation.html" class="obfuscation">Code Obfuscator</a>
<a href="pages/timeComplexity.html" class="time">Time Complexity Analyser</a>
<a href="../index.html#contributeSection">Contribute!</a>
<a href="../index.html#feedback">Give Feedback!</a>
<a href="https://github.com/multiverseweb/CodeIt/blob/main/LICENSE#L3">License</a>
</div>
<div class="gap"></div>
</div>

Expand Down Expand Up @@ -196,10 +192,13 @@
<div class="right">
<p class="heading">Want to contribute to this Project?</p>
<p class="text">
As this is an Open-Source Software, contributions are always welcome. Whether you're interested in adding new features, fixing bugs, or improving documentation, your contributions are valuable. You can contribute to the project by visiting the link to the GitHub repository provided below. Join me in making CodeIt even better for everyone!
As this is an Open-Source Software, contributions are always welcome. Whether you're interested in adding new
features, fixing bugs, or improving documentation, your contributions are valuable. You can contribute to the
project by visiting the link to the GitHub repository provided below. Join me in making CodeIt even better for
everyone!
</p>
<a class="contributeBtn" href="https://github.com/multiverseweb/CodeIt">Contribute<img
src="https://static-00.iconduck.com/assets.00/github-icon-2048x1999-d37ckpm6.png" id="github"></a>
src="https://static-00.iconduck.com/assets.00/github-icon-2048x1999-d37ckpm6.png" id="github"></a>
</div>
</div>

Expand All @@ -214,44 +213,31 @@
</div>

<div class="right_last">
<form
name="CodeIt Reviews"
action="POST"
data-netlify="true"
id="feedback"
>
<form name="CodeIt Reviews" action="POST" data-netlify="true" id="feedback">
<p>Let Us Know Your Thoughts!</p>
<input type="text" name="Name" placeholder="Your Name" required />
<input
type="email"
name="Email"
placeholder="Your Email ID"
required
/>
<input
name="Feedback"
placeholder="Your Feedback"
required
></input>
<input type="email" name="Email" placeholder="Your Email ID" required />
<input name="Feedback" placeholder="Your Feedback" required></input>
<button type="submit" id="send">Send</button>
</form>

</div>
</footer>
<div class="last">
<p>
Designed & Developed by Tejas Gupta<br /><a
href="https://github.com/multiverseweb/CodeIt/blob/main/LICENSE">&copy; 2024 Tejas Gupta</a>
</p>
<div class="links">
<button class="footer_logo" onclick="copylink()" id="link">
<img src="https://icons.veryicon.com/png/o/miscellaneous/foundation-icon-5/link-86.png" alt="" />
</button>
<a href="https://github.com/multiverseweb/CodeIt" class="footer_logo"><img
src="https://pngimg.com/d/github_PNG83.png" alt="" id="link2" /></a>

</div>
</footer>
<div class="last">
<p>
Designed & Developed by Tejas Gupta<br /><a
href="https://github.com/multiverseweb/CodeIt/blob/main/LICENSE">&copy; 2024 Tejas Gupta</a>
</p>
<div class="links">
<button class="footer_logo" onclick="copylink()" id="link">
<img src="https://icons.veryicon.com/png/o/miscellaneous/foundation-icon-5/link-86.png" alt="" />
</button>
<a href="https://github.com/multiverseweb/CodeIt" class="footer_logo"><img
src="https://pngimg.com/d/github_PNG83.png" alt="" id="link2" /></a>

</div>
<script src="resources/homeScript.js"></script>
<script src="resources/common_functions.js"></script>
</body>
</html>
<script src="resources/common_functions.js"></script>
</body>

</html>
71 changes: 40 additions & 31 deletions resources/homeScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,57 +4,66 @@ var cities = ["Pune", "Moradabad", "Dehradun","Ujjain","Vijaywada","Rampur","Syd
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
function changeCss() {
}
function changeCss() {
var top = document.getElementById("top");
var scroll_icon = document.getElementById("scroll_icon");
(this.scrollY > 30 && this.scrollY < 2450) ? top.style.opacity = 1 : top.style.opacity = 0;
(this.scrollY > 0) ? scroll_icon.style.opacity = 0 : scroll_icon.style.opacity = 1;
}
window.addEventListener("scroll", changeCss, false);
}

window.addEventListener("scroll", changeCss, false);


var map = L.map('map', {
center: [23.7937, 80.9629],
zoom: 5,
zoomControl: false
center: [23.7937, 80.9629],
zoom: 5,
zoomControl: false
});

// Add OpenStreetMap tile layer
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);

var redIcon = L.icon({
iconUrl: 'https://img1.picmix.com/output/stamp/normal/2/5/4/3/873452_376bb.png',
iconSize: [25, 25],
iconAnchor: [12, 12],
popupAnchor: [1, -34],
shadowSize: [41, 41]
iconUrl: 'https://img1.picmix.com/output/stamp/normal/2/5/4/3/873452_376bb.png',
iconSize: [25, 25],
iconAnchor: [12, 12],
popupAnchor: [1, -34],
shadowSize: [41, 41]
});

// Function to get coordinates for a city and add a marker
function addMarker(city) {
var url = `https://nominatim.openstreetmap.org/search?format=json&q=${city}`;
fetch(url)
.then(response => response.json())
.then(data => {
if (data.length > 0) {
var lat = data[0].lat;
var lon = data[0].lon;
L.marker([lat, lon], { icon: redIcon }).addTo(map)
.bindPopup(city);
} else {
console.log("No results found for " + city);
}
})
.catch(error => console.error("Error fetching coordinates for " + city + ": " + error));
async function addMarker(city) {
var url = `https://nominatim.openstreetmap.org/search?format=json&q=${city}`;

try {
const response = await fetch(url, {
headers: {
'User-Agent': 'YourAppName/1.0' // Replace with your app name
}
});
const data = await response.json();

if (data.length > 0) {
var lat = data[0].lat;
var lon = data[0].lon;
L.marker([lat, lon], { icon: redIcon }).addTo(map)
.bindPopup(city);
} else {
console.log("No results found for " + city);
}
} catch (error) {
console.error("Error fetching coordinates for " + city + ": " + error);
}
}

// Add markers for each city
cities.forEach(city => addMarker(city));



function feedbackVerify(){
document.getElementById('feedback').addEventListener('submit',(event)=>{

Expand Down

0 comments on commit b6ac384

Please sign in to comment.