-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
147 lines (132 loc) · 6.21 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Mobile Redirection Script at the start of the head for speed -->
<script>
// Immediately redirect mobile users to the mobile site
if (/Mobi|Android|iPhone/i.test(navigator.userAgent)) {
window.location.replace("index_mobile.html");
}
</script>
<meta charset="UTF-8">
<meta name="description" content="Homepage of Subhransu Sekhar Bhattacharjee, PhD Student at the Australian National University.">
<meta name="author" content="Subhransu S. Bhattacharjee">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=yes">
<title>Subhransu Sekhar Bhattacharjee</title>
<link rel="stylesheet" rel="preload" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<link rel="icon" type="image/x-icon" href="https://1ssb.github.io/favicon.ico?v=2">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jpswalsh/academicons@1/css/academicons.min.css">
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap" rel="stylesheet">
<!-- Early catching -->
<!-- Mobile-Detect Library -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mobile-detect/1.4.5/mobile-detect.min.js"></script>
<link rel="stylesheet" href="./main-style.css">
<style>
<style>
.ai-google-scholar {
font-size: 1.25rem;
}
</style>
</head>
<body>
<div id="wrapper">
<header id="header">
<h1>Subhransu S. Bhattacharjee</h1>
<br>
<h3>Ph.D. Student @ Intelligent Systems Cluster</h3>
<h3>The Australian National University</h3>
<ul class="icons">
<li><a href="./Resume.pdf" title="Curriculum Vitae" class="ai ai-cv"></a></li>
<li><a href="https://github.com/1ssb" title="GitHub" target="_blank" class="fab fa-github"></a></li>
<li><a href="https://www.linkedin.com/in/1ssb/" target="_blank" title="LinkedIn" class="fab fa-linkedin-in"></a></li>
<li><a href="https://scholar.google.com.au/citations?hl=en&pli=1&user=Ngk4emsAAAAJ" title="Publications" target="_blank"><i class="ai ai-google-scholar"></i>
</a>
</li>
</ul>
<div class="separator"></div>
<div class="update-box" id="update-box">
<h2>UPDATES</h2>
<p>Loading content...</p>
</div>
<nav>
<ul>
<li><a href="https://1ssb.github.io/bio/">ABOUT ME</a></li>
<li><a href="https://1ssb.github.io/exp/">EXPERIENCES</a></li>
<li><a href="https://1ssb.github.io/contact/">CONTACT</a></li>
</ul>
</nav>
</header>
<footer id="footer">
<p>© S. S. Bhattacharjee | Last Updated: <span id="lastUpdated"></span></p>
</footer>
</div>
<div id="theme-toggle" class="fas fa-moon"></div>
<script type="module">
import { SHOW_UPDATE_BOX } from './constants.js';
// Function to control the visibility of updates
function showUpdates() {
const updateBox = document.getElementById('update-box');
if (SHOW_UPDATE_BOX) {
updateBox.style.display = 'block';
} else {
updateBox.style.display = 'none';
}
}
// Function to fetch and insert content from the external HTML file
async function loadUpdateContent() {
try {
const response = await fetch('update-box.html');
const text = await response.text();
// Insert the fetched HTML into the update-box div
document.getElementById('update-box').innerHTML = text;
} catch (error) {
console.error('Error loading update content:', error);
}
}
// Late catching
document.addEventListener('DOMContentLoaded', function() {
// Redirect mobile users
if (/Mobi|Android|iPhone/i.test(navigator.userAgent)) {
window.location.href = "index_mobile.html";
}
// Update the last modified date
var lastMod = new Date(document.lastModified);
// Get the month name and truncate it to the first 4 letters
var options = { year: 'numeric', month: 'long' };
var formattedDate = lastMod.toLocaleDateString('en-US', options);
var month = lastMod.toLocaleString('en-US', { month: 'long' }).slice(0, 3);
// Replace the full month name with the truncated version
document.getElementById('lastUpdated').textContent = month + ' ' + lastMod.getFullYear();
// Theme toggle functionality
const themeToggle = document.getElementById('theme-toggle');
themeToggle.addEventListener('click', function() {
const isDarkMode = document.body.classList.toggle('dark-mode');
themeToggle.classList.toggle('fa-sun', isDarkMode);
themeToggle.classList.toggle('fa-moon', !isDarkMode);
});
// Display updates if applicable
showUpdates();
// Ensure all images are loaded before showing the body
const images = document.images;
const totalImages = images.length;
let loadedImages = 0;
function imageLoaded() {
loadedImages++;
if (loadedImages === totalImages) {
document.body.style.visibility = 'visible';
}
}
if (totalImages === 0) {
document.body.style.visibility = 'visible'; // Show body if no images are present
} else {
for (let i = 0; i < totalImages; i++) {
images[i].addEventListener('load', imageLoaded);
images[i].addEventListener('error', imageLoaded); // Consider an error as a loaded image
}
}
// Load the content once the DOM is fully loaded
loadUpdateContent();
});
</script>
</body>
</html>