Skip to content

Commit

Permalink
@astro update; remove Warpspeed
Browse files Browse the repository at this point in the history
  • Loading branch information
nicosalm committed Nov 27, 2024
1 parent 41dfd3f commit 1364e2c
Show file tree
Hide file tree
Showing 7 changed files with 382 additions and 474 deletions.
2 changes: 1 addition & 1 deletion .astro/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"_variables": {
"lastUpdateCheck": 1730334071931
"lastUpdateCheck": 1732722965747
}
}
759 changes: 339 additions & 420 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/rss": "^4.0.8",
"@astrojs/rss": "^4.0.9",
"@expressive-code/plugin-collapsible-sections": "^0.37.0",
"@expressive-code/plugin-line-numbers": "^0.37.0",
"astro": "^4.16.2",
"astro": "^4.16.16",
"astro-expressive-code": "^0.37.0",
"mdast-util-to-string": "^4.0.0",
"reading-time": "^1.5.0"
Expand Down
72 changes: 36 additions & 36 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const { title, description, blog, isMainPage = false } = Astro.props as Props;
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<title>{title}</title>
<meta name="description" content={description} />
<script is:inline>
Expand All @@ -44,44 +44,44 @@ const { title, description, blog, isMainPage = false } = Astro.props as Props;
{isMainPage && <canvas id="warpspeed"></canvas>}
</main>
<Footer />
{isMainPage && (
<script>
function loadWarpspeedScript(theme) {
console.log('Loading warpspeed script for theme:', theme);
const existingScript = document.getElementById('warpspeed-script');
if (existingScript) {
existingScript.remove();
}
<!-- {isMainPage && ( -->
<!-- <script> -->
<!-- function loadWarpspeedScript(theme) { -->
<!-- console.log('Loading warpspeed script for theme:', theme); -->
<!-- const existingScript = document.getElementById('warpspeed-script'); -->
<!-- if (existingScript) { -->
<!-- existingScript.remove(); -->
<!-- } -->

const script = document.createElement('script');
script.id = 'warpspeed-script';
script.src = theme === 'dark' ? '/scripts/warpspeed-dark.min.js' : '/scripts/warpspeed-light.min.js';
script.onload = initWarpspeed;
script.onerror = (e) => console.error(`Failed to load script: ${script.src}`, e);
document.body.appendChild(script);
}
<!-- const script = document.createElement('script'); -->
<!-- script.id = 'warpspeed-script'; -->
<!-- script.src = theme === 'dark' ? '/scripts/warpspeed-dark.min.js' : '/scripts/warpspeed-light.min.js'; -->
<!-- script.onload = initWarpspeed; -->
<!-- script.onerror = (e) => console.error(`Failed to load script: ${script.src}`, e); -->
<!-- document.body.appendChild(script); -->
<!-- } -->

function initWarpspeed() {
if (window.WarpSpeed) {
const theme = document.documentElement.classList.contains('dark') ? 'dark' : 'light';
const config = theme === 'dark'
? {"speed":3,"speedAdjFactor":0.01,"density":0.5,"shape":"circle","warpEffect":true,"warpEffectLength":5,"depthFade":true,"starSize":3,"backgroundColor":"hsl(263,45%,7%)","starColor":"#ffd096"}
: {"speed":3,"speedAdjFactor":0.01,"density":0.5,"shape":"circle","warpEffect":true,"warpEffectLength":5,"depthFade":true,"starSize":3,"backgroundColor":"hsl(44, 52%, 94%)","starColor":"#000000"};
new window.WarpSpeed("warpspeed", config);
} else {
console.error('WarpSpeed is not defined');
}
}
<!-- function initWarpspeed() { -->
<!-- if (window.WarpSpeed) { -->
<!-- const theme = document.documentElement.classList.contains('dark') ? 'dark' : 'light'; -->
<!-- const config = theme === 'dark' -->
<!-- ? {"speed":3,"speedAdjFactor":0.01,"density":0.5,"shape":"circle","warpEffect":true,"warpEffectLength":5,"depthFade":true,"starSize":3,"backgroundColor":"hsl(263,45%,7%)","starColor":"#ffd096"} -->
<!-- : {"speed":3,"speedAdjFactor":0.01,"density":0.5,"shape":"circle","warpEffect":true,"warpEffectLength":5,"depthFade":true,"starSize":3,"backgroundColor":"hsl(44, 52%, 94%)","starColor":"#000000"}; -->

<!-- new window.WarpSpeed("warpspeed", config); -->
<!-- } else { -->
<!-- console.error('WarpSpeed is not defined'); -->
<!-- } -->
<!-- } -->

// Initial load
loadWarpspeedScript(getInitialTheme());
<!-- // Initial load -->
<!-- loadWarpspeedScript(getInitialTheme()); -->

// Listen for theme changes
document.addEventListener('themeChanged', (e) => {
loadWarpspeedScript(e.detail.theme);
});
</script>
)}
<!-- // Listen for theme changes -->
<!-- document.addEventListener('themeChanged', (e) => { -->
<!-- loadWarpspeedScript(e.detail.theme); -->
<!-- }); -->
<!-- </script> -->
<!-- )} -->
</body>
</html>
11 changes: 0 additions & 11 deletions src/pages/blog/the-hollow-path/index.md

This file was deleted.

4 changes: 2 additions & 2 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ let socialMedia = [
</a>
)
))
}
}
</div>
</section>

Expand All @@ -75,7 +75,7 @@ let socialMedia = [
<h2>Recent Articles</h2>
<ul class="article-list">
{
recentPosts.map((post) => (
recentPosts.map((post) => (
<li class="article-item">
<a href={post.url} class="article-link">
<h3 class="article-title">{post.frontmatter.title}</h3>
Expand Down
4 changes: 2 additions & 2 deletions src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
--font-serif: "Merriweather", Georgia, "Times New Roman", serif;
--max-width: 850px;
--side-padding: 1rem;

/* light mode colors */
--color-bg-light: #f8f4e9;
--color-text-light: #333333;
Expand Down Expand Up @@ -70,7 +70,7 @@ body {

/* Layout */
html {
scrollbar-gutter: stable;
scrollbar-gutter: stable both-edges;
}

.container {
Expand Down

1 comment on commit 1364e2c

@astro
Copy link

@astro astro commented on 1364e2c Nov 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't @ me

Please sign in to comment.