Skip to content

Commit

Permalink
Overhaul website styling and interactivity
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjdean committed Dec 7, 2024
1 parent 5edf2ed commit e12b33f
Show file tree
Hide file tree
Showing 7 changed files with 484 additions and 15 deletions.
24 changes: 22 additions & 2 deletions books.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,24 @@
<link rel="stylesheet" href="styles/index.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Alex Dean</title>

<script src="scripts/theme.js"></script>
<script src="scripts/mobile-nav.js"></script>
</head>

<body>
<button class="mobile-nav-toggle" aria-label="Toggle navigation menu">
<span></span>
<span></span>
<span></span>
</button>

<div class="mobile-menu">
<a href="index.html">Home</a>
<a href="books.html">Books</a>
<a href="engineering.html">Engineering</a>
<a href="research.html">Research</a>
</div>

<div class="front-page">
<div class="page-navigation">
Expand All @@ -17,9 +32,14 @@
</div>

<div class="page-description">
<div class="back-navigation">
<a href="index.html" class="back-button">
<span class="back-arrow"></span>
<span class="back-text">Back</span>
</a>
</div>
<h1>Alex Dean</h1>
<a href="index.html">Back</a>


<p>
There's nothing quite like a book that changes how you see the world. There's
nothing quite like perceiving life through some unspoken lens, and then having
Expand Down
24 changes: 22 additions & 2 deletions engineering.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,24 @@
<link rel="stylesheet" href="styles/index.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Alex Dean</title>

<script src="scripts/theme.js"></script>
<script src="scripts/mobile-nav.js"></script>
</head>

<body>
<button class="mobile-nav-toggle" aria-label="Toggle navigation menu">
<span></span>
<span></span>
<span></span>
</button>

<div class="mobile-menu">
<a href="index.html">Home</a>
<a href="books.html">Books</a>
<a href="engineering.html">Engineering</a>
<a href="research.html">Research</a>
</div>

<div class="front-page">
<div class="page-navigation">
Expand All @@ -17,9 +32,14 @@
</div>

<div class="page-description">
<div class="back-navigation">
<a href="index.html" class="back-button">
<span class="back-arrow"></span>
<span class="back-text">Back</span>
</a>
</div>
<h1>Alex Dean</h1>
<a href="index.html">Back</a>


<p>What follows is a list of my personal projects. This list is ordered from most to
least recent.</p>

Expand Down
32 changes: 25 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,24 @@
<link rel="stylesheet" href="styles/index.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Alex Dean</title>

<script src="scripts/theme.js"></script>
<script src="scripts/mobile-nav.js"></script>
</head>

<body>
<button class="mobile-nav-toggle" aria-label="Toggle navigation menu">
<span></span>
<span></span>
<span></span>
</button>

<div class="mobile-menu">
<a href="index.html">Home</a>
<a href="books.html">Books</a>
<a href="engineering.html">Engineering</a>
<a href="research.html">Research</a>
</div>
<div class="front-page">
<div class="page-navigation">
<a href="books.html">Books</a> <br/>
Expand All @@ -20,16 +35,19 @@
<h1>Alex Dean</h1>

<p>
I'm a software engineer interested in large-scale distributed machine learning
systems. I studied computer science at the University of Illinois
Urbana-Champaign.
I'm a software engineer at Amazon Web Services. I'm interested in large-scale
distributed machine learning systems. I studied computer science at the
University of Illinois Urbana-Champaign.
</p>

<!-- <p>
Work at AWS
</p> -->

<p>
At Capital One, I work on developing and deploying NLP models for call intent
prediction, transcription, and sentiment analysis. I strongly believe in the
power of self-directed personal projects to expand your engineering abilities.
For more information, see <a href="engineering.html">my projects</a> and
I strongly believe in the power of self-directed personal projects to expand your
engineering abilities. For more information, see
<a href="engineering.html">my projects</a> and
<a href="https://github.com/alexjdean">my GitHub</a>.
</p>

Expand Down
22 changes: 21 additions & 1 deletion research.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,24 @@
<link rel="stylesheet" href="styles/index.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Alex Dean</title>

<script src="scripts/theme.js"></script>
<script src="scripts/mobile-nav.js"></script>
</head>

<body>
<button class="mobile-nav-toggle" aria-label="Toggle navigation menu">
<span></span>
<span></span>
<span></span>
</button>

<div class="mobile-menu">
<a href="index.html">Home</a>
<a href="books.html">Books</a>
<a href="engineering.html">Engineering</a>
<a href="research.html">Research</a>
</div>

<div class="front-page">
<div class="page-navigation">
Expand All @@ -17,8 +32,13 @@
</div>

<div class="page-description">
<div class="back-navigation">
<a href="index.html" class="back-button">
<span class="back-arrow"></span>
<span class="back-text">Back</span>
</a>
</div>
<h1>Alex Dean</h1>
<a href="index.html">Back</a>

<h2>Papers & Publications</h2>

Expand Down
32 changes: 32 additions & 0 deletions scripts/mobile-nav.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
document.addEventListener('DOMContentLoaded', function() {
const mobileNavToggle = document.querySelector('.mobile-nav-toggle');
const mobileMenu = document.querySelector('.mobile-menu');
const toggleSpans = mobileNavToggle.querySelectorAll('span');

mobileNavToggle.addEventListener('click', function() {
mobileMenu.classList.toggle('active');

// Animate hamburger to X
toggleSpans[0].style.transform = mobileMenu.classList.contains('active')
? 'rotate(45deg) translate(5px, 6px)'
: 'none';
toggleSpans[1].style.opacity = mobileMenu.classList.contains('active')
? '0'
: '1';
toggleSpans[2].style.transform = mobileMenu.classList.contains('active')
? 'rotate(-45deg) translate(5px, -6px)'
: 'none';
});

// Close menu when clicking outside
document.addEventListener('click', function(event) {
if (!mobileMenu.contains(event.target) &&
!mobileNavToggle.contains(event.target) &&
mobileMenu.classList.contains('active')) {
mobileMenu.classList.remove('active');
toggleSpans[0].style.transform = 'none';
toggleSpans[1].style.opacity = '1';
toggleSpans[2].style.transform = 'none';
}
});
});
38 changes: 38 additions & 0 deletions scripts/theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
function initializeTheme() {
// Check for saved theme preference or default to dark
const savedTheme = localStorage.getItem('theme') || 'dark';
document.documentElement.setAttribute('data-theme', savedTheme);

// Create and append the toggle button
const toggleButton = document.createElement('button');
toggleButton.className = 'theme-toggle';

// Use more reliable Unicode characters with fallback
const sunIcon = '☀️';
const moonIcon = '🌙';

// Set initial button text with fallback
function updateButtonText(theme) {
if (theme === 'dark') {
toggleButton.innerHTML = `${sunIcon} <span>Light</span>`;
} else {
toggleButton.innerHTML = `${moonIcon} <span>Dark</span>`;
}
}

updateButtonText(savedTheme);

toggleButton.addEventListener('click', () => {
const currentTheme = document.documentElement.getAttribute('data-theme');
const newTheme = currentTheme === 'dark' ? 'light' : 'dark';

document.documentElement.setAttribute('data-theme', newTheme);
localStorage.setItem('theme', newTheme);
updateButtonText(newTheme);
});

document.body.appendChild(toggleButton);
}

// Initialize theme when DOM is loaded
document.addEventListener('DOMContentLoaded', initializeTheme);
Loading

0 comments on commit e12b33f

Please sign in to comment.