Skip to content

Commit

Permalink
better styles organization
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua T Kalis committed Sep 20, 2024
1 parent 701907b commit 79d66dd
Show file tree
Hide file tree
Showing 24 changed files with 414 additions and 468 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ See `deno.jsonc` for documentation on available commands.

## TODO

* [ ] portfolio page including descriptions of big projects
* [ ] -
* [ ] Fix "Quirks Mode" issue with slides styling
* [ ] Unit test public/js/slides.js
6 changes: 0 additions & 6 deletions admin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@ deno run --allow-env --allow-read=./ --allow-write=$PUB_DIR ./sanguine/index.ts
# copy public content
cp -r ./public/* $PUB_DIR

# compile css file if running locally and not in a CI environment
if [ -z $CI ];then
npx sass --style=compressed ./styles/kalisjoshua.scss $PUB_DIR/css/kalisjoshua.css
fi

# create cname file
echo kalisjoshua.me > $PUB_DIR/CNAME


echo "Build complete."
6 changes: 3 additions & 3 deletions admin/dev-server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { loadSync } from "deno/dotenv/mod.ts";
import { loadSync } from "../deno.deps.ts";

const PUB_DIR = loadSync()["PUB_DIR"];
const server = Deno.listen({ port: 8080 });
Expand Down Expand Up @@ -52,15 +52,15 @@ async function serveHttp(conn: Deno.Conn) {
new Response(decoder.decode(data), {
headers: { ...mime },
status: 200,
}),
})
);
} catch (error) {
if (error.name === Deno.errors.NotFound.name) {
console.log(`[404] File not found: "${filePath}`);
req.respondWith(new Response("Not found.", { status: 404 }));
} else {
req.respondWith(
new Response("Sorry, something went wrong.", { status: 500 }),
new Response("Sorry, something went wrong.", { status: 500 })
);
throw error;
}
Expand Down
16 changes: 13 additions & 3 deletions admin/watchDev.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
const DELAY = 300;
let taskRunning = false;
const watched = ["admin", "content", "public", "sanguine", "styles"];
const watched = ["admin", "content", "public", "sanguine"];

for await (const { paths } of Deno.watchFs(watched)) {
if (!taskRunning) {
taskRunning = true;
console.log("Change detected.", paths);
console.log("Change detected.", ...paths);

await Deno.run({ cmd: ["deno", "task", "build"] }).status();
const command = new Deno.Command(Deno.execPath(), {
args: ["task", "build"],
stdin: "piped",
});

const child = command.spawn();

// manually close stdin
child.stdin.close();

await child.status;

setTimeout(() => {
taskRunning = false;
Expand Down
2 changes: 1 addition & 1 deletion content/contact.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
* kalisjoshua@gmail.com
* github.com/[kalisjoshua](https://github.com/kalisjoshua)
* linkedin.com/in/[kalisjoshua](https://linkedin.com/in/kalisjoshua)
* twitter.com/[kalisjoshua](https://twitter.com/kalisjoshua)
<!-- * twitter.com/[kalisjoshua](https://twitter.com/kalisjoshua) -->
81 changes: 52 additions & 29 deletions content/template.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html />
<!DOCTYPE html>
<html class="no-js" lang="en-US" />
<head>
<meta charset="utf-8" />
Expand All @@ -12,14 +12,25 @@
<link href="${rel}favicon.ico" rel="icon" />
<link href="${rel}jk-logo.svg" rel="icon" type="image/svg+xml" />

<link href="${rel}css/kalisjoshua.css" rel="stylesheet" />
<link href="${rel}styles/kalisjoshua.css" rel="stylesheet" />

<body class="section-${section}">
<p class="sr-only"><a href="#main">Skip navigation</a></p>

<div class="layout">
<main class="main" id="main" role="main">
<main id="main" role="main">
<header role="banner">
{{?isResume}}
<div style="float: right; font-size: 90%; text-align: right">
<a
href="https://docs.google.com/document/d/16GFGZeztNEwdKGehjKxG0H2y9EbETrOUOW5qHBXa42c/edit?usp=sharing"
target="_blank"
title="This page also has a print style sheet so ctrl+p will also be printable to PDF"
>Google Document</a
>
</div>
{{?/}}

<h1><a href="${rel}index.html">${header}</a></h1>

<p>I build great teams and excellent software.</p>
Expand All @@ -33,31 +44,33 @@ <h1><a href="${rel}index.html">${header}</a></h1>
</main>

<aside role="banner">
<nav class="navigation" role="navigation">
<nav role="navigation">
<ul>
${navigation .map(({href, text}) => `
${navigation.map(({href, text}) => `
<li class="${isActive(href)}">
<a href="${rel}${href}">${text}</a>
</li>
`) .join("")}
<li>
<a
href="https://docs.google.com/document/d/16GFGZeztNEwdKGehjKxG0H2y9EbETrOUOW5qHBXa42c/edit?usp=sharing"
target="_blank"
>Resume (Google Doc)</a
>
</li>
</ul>
</nav>

<footer role="contentinfo">${contact}</footer>

<div class="projects">${projects}</div>

<a href="${rel}index.html" id="jk-logo">
<img height="138px" src="${rel}images/jk-logo-square.svg"
title="Joshua Kalis" logo" width="138px" />
</a>
<figure id="pride-ally">
<a href="https://queerintheworld.com/straight-ally-pride-flag/">
<img
alt="Pride Ally Flag"
height="116px"
src="${rel}images/pride-progress.svg"
width="221px"
/>
</a>
<br />
<br />
<figcaption>Proud to be a Pride Ally</figcaption>
</figure>

<figure class="dev-icons" title="Common web technologies I use.">
<img
Expand Down Expand Up @@ -110,25 +123,35 @@ <h1><a href="${rel}index.html">${header}</a></h1>
/>
</figure>

<figure id="pride-ally">
<a href="https://queerintheworld.com/straight-ally-pride-flag/">
<img
alt="Pride Ally Flag"
height="116px"
src="${rel}images/pride-progress.svg"
width="221px"
/>
</a>
<br />
<br />
<figcaption>Proud to be a Pride Ally</figcaption>
</figure>
<a href="${rel}index.html" id="jk-logo">
<figure>
<img height="138px" src="${rel}images/jk-logo-square.svg"
title="Joshua Kalis" logo" width="138px" />
</figure>
</a>
</aside>
</div>

<div class="cicada"></div>

<script defer src="${rel}js/highlighter.js"></script>
<script defer src="${rel}js/slides.js"></script>

<script>
addEventListener("click", (event) => {
const isContactLink = /^contact$/.test(
event.target.parentElement.parentElement.previousElementSibling?.id
);

if (isContactLink && event.altKey) {
event.preventDefault();

navigator.clipboard
.writeText(event.target.href)
.catch(() => "Failed to copy link href.")
.then((str = event.target.href) => alert(str));
}
});
</script>
</body>
</head>
6 changes: 2 additions & 4 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
"fmt": {
"files": {
"include": [],
"exclude": [
"."
]
"exclude": ["."]
}
},
"tasks": {
Expand All @@ -13,7 +11,7 @@
// run test coverage report
"cover": "./admin/cover.sh",
// watch files for changes and run build after files have been changed
"dev": "deno run --allow-read=./ --allow-run ./admin/watchDev.ts",
"dev": "deno run --allow-read --allow-run ./admin/watchDev.ts",
// host published files at http://localhost:8080
"serve": "deno run --allow-env --allow-net --allow-read ./admin/dev-server.ts",
// run unit tests
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"name": "kalisjoshua.me",
"description": "Personal website and resume for Joshua Kalis.",
"version": "11.2.1",
"version": "11.2.2",
"homepage": "https://kalisjoshua.me",
"repository": {
"type": "git",
Expand Down
53 changes: 53 additions & 0 deletions public/styles/cicada.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
.cicada {
position: absolute;
z-index: -1;

&:after {
--grad: linear-gradient(
90deg,
var(--teal) 0%,
var(--teal) 10%,
transparent 10%,
transparent 20%,
var(--magenta) 20%,
var(--magenta) 30%,
transparent 30%,
transparent 40%,
var(--gold) 40%,
var(--gold) 50%,
transparent 50%,
transparent 60%,
var(--green) 60%,
var(--green) 70%,
var(--pink) 70%,
var(--pink) 80%,
var(--purple) 80%,
var(--purple) 90%,
transparent 90%
);

background-color: var(--bg);
background-image: var(--grad), var(--grad), var(--grad), var(--grad);
background-blend-mode: darken, color-burn, multiply;
background-size: 17%, 19%, 33%, 33%;
content: "";
height: 100%;
left: 0;
position: fixed;
top: 0;
width: 100%;
z-index: 0;
}

&:before {
background-image: linear-gradient(180deg, transparent, var(--bg) 30%);
box-shadow: inset 0 3em 3em 0 rgba(0, 0, 0, 0.2);
content: "";
height: 100%;
left: 0;
position: fixed;
top: 0;
width: 100%;
z-index: 1;
}
}
Loading

0 comments on commit 79d66dd

Please sign in to comment.