Skip to content

Instantly share code, notes, and snippets.

@newmedia2
Created July 16, 2022 22:18
Show Gist options
  • Save newmedia2/b4d572e326afd23c1abd846cff081f2f to your computer and use it in GitHub Desktop.
Save newmedia2/b4d572e326afd23c1abd846cff081f2f to your computer and use it in GitHub Desktop.
Software Developer Homepage
<div class="vignette">
</div>
<div class="content come-in">
<header>
<div class="buttons">
<div></div>
<div></div>
<div></div>
</div>
<h1>gschier@Gregorys-Macbook-Pro: ~/projects (zsh)</h1>
</header>
<section class="container">
<p class="prompt">
<span class="green">website</span>
<span class="yellow">(master)</span>
<span class="red">⇒</span> cat ./about.txt
</p>
<p>
Hi, I'm Greg!
</p>
<p>
I'm an independent software developer currently working on
<a href="https://insomnia.rest/" target="_blank">Insomnia</a>. I reside in Victoria BC and love building tools to help make life easier.
</p>
<p>
Be sure to check out my <a href="/projects">Projects</a> and read my
<a href="./post.html">Blog</a> while you're here.
</p>
<p>
Thanks!
</p>
<p class="prompt">
<span class="green">website</span>
<span class="yellow">(master)</span>
<span class="red">⇒ </span> while $alive; do everything(); done
</p>
</section>
</div>
const angle = Math.round(Math.random() * 30) + 10;
const hue = Math.round(Math.random() * 255);
const colorA = `HSL(${hue}, 80%, 70%)`;
const colorB = `HSL(${hue - 255 / 2}, 80%, 70%)`;
document.body.style.background = `linear-gradient(${angle}deg, ${colorA}, ${colorB})`;
const container = document.querySelector('.container');
const ps = container.querySelectorAll('p');
const nodes = [];
for (let i = ps.length - 1; i < ps.length; i++) {
const p = ps[i];
for (let j = p.childNodes.length - 1; j < p.childNodes.length; j++) {
const node = p.childNodes[j];
node._saved = node.textContent.replace(/ {2,}/g, ' ').trim();
node._index = 0;
node.textContent = '';
if (node._saved) {
nodes.push(node);
}
}
}
const cursor = document.createElement('span');
cursor.innerHTML = '_';
cursor.className = 'cursor blink';
let nodeIndex = nodes.length - 1;
nodes[nodeIndex].parentNode.appendChild(cursor);
setTimeout(() => {
const i = setInterval(() => {
const node = nodes[nodeIndex];
if (!node) {
clearInterval(i);
return;
}
node.textContent = node._saved.slice(0, node._index);
if (node._index === node._saved.length) {
nodeIndex++;
cursor.className = 'cursor blink';
const br = document.createElement('br');
setTimeout(() => {
node.parentNode.appendChild(br);
node.parentNode.appendChild(cursor);
}, 1000);
} else {
node.parentNode.appendChild(cursor);
node._index++;
cursor.className = 'cursor';
}
}, 140);
}, 3000);
html {
height: 100%;
width: 100%;
}
html,
body {
font-size: 14px;
font-family: Lato, sans-serif;
min-height: 100% !important;
width: 100%;
margin: 0;
padding: 0;
line-height: 1.4em;
}
h1 {
font-size: 1em;
}
h1,
h2,
h3,
h4,
h5,
p {
margin-bottom: 1em;
}
a {
color: #98d7ff;
text-decoration: none;
}
a:hover {
opacity: 1;
border-bottom: 1px solid #5db0e5;
}
/*a[target="_blank"]::after {*/
/*font-family: sans-serif !important;*/
/*content: '⧉';*/
/*font-size: 0.9em;*/
/*padding-left: 0.2em;*/
/*}*/
img {
display: block;
max-width: 100%;
}
body {
background: linear-gradient(20deg, #FF5733 30%, #3498DB 30%);
background-size: cover;
margin: 0;
padding: 1rem;
display: flex;
flex-direction: row;
align-items: center;
box-sizing: border-box;
}
.vignette {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: radial-gradient(transparent 0, rgba(0, 0, 0, 0.2));
z-index: 0;
}
.content {
min-height: 22rem;
border-radius: 0.3rem;
background: linear-gradient(10deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.6));
max-width: 100%;
width: 50em;
box-sizing: border-box;
color: #eee;
margin: 0 auto;
box-shadow: 0 0 5rem rgba(0, 0, 0, 0.4);
border: 1px solid rgba(0, 0, 0, 0.1);
border-bottom-color: rgba(0, 0, 0, 0.4);
border-top: none;
font-size: 0.9em;
position: relative;
z-index: 1;
}
.content header {
width: 100%;
height: 2rem;
position: relative;
opacity: 0.8;
box-sizing: border-box;
padding: 0 4rem 0 0.8rem;
}
.content header h1 {
font-size: 0.9rem;
margin: 0 auto;
text-align: center;
max-width: 100%;
box-sizing: border-box;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding-left: 0.3rem;
padding-right: 0.3rem;
padding-top: 0.4rem;
}
.content header .buttons {
width: auto;
float: left;
padding-top: 0.5rem;
display: inline-block;
}
.content header .buttons > * {
display: inline-block;
border-radius: 50%;
width: 12px;
height: 12px;
margin-right: 0.6rem;
padding: 0.25rem;
box-sizing: border-box;
background: lightblue;
}
.content header .buttons > *:nth-child(1) {
background-color: hsl(0, 80%, 60%);
}
.content header .buttons > *:nth-child(2) {
background-color: hsl(50, 80%, 51%);
}
.content header .buttons > *:nth-child(3) {
background-color: hsl(86, 58%, 44%);
}
.container {
font-family: 'Fira Mono', monospace;
font-size: 0.8rem;
padding: 1rem;
}
.container .prompt .green {
color: hsl(85, 72%, 55%);
}
.container .prompt .yellow {
color: hsl(50, 100%, 61%);
}
.container .prompt .red {
color: hsl(359, 100%, 67%);
}
.container > *:last-child {
margin-bottom: 0;
}
.cursor {
display: inline-block;
background: #bbb;
height: 1.2em;
overflow: hidden;
vertical-align: text-bottom;
color: transparent;
}
.blink {
animation: blinker steps(1) 500ms infinite alternate;
}
.come-in {
animation: come-in 500ms cubic-bezier(0.39, 0.575, 0.565, 1);
}
@keyframes blinker {
0% {
opacity: 1;
}
50% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes come-in {
from {
opacity: 0;
transform: scale(0.9) translateY(5rem);
box-shadow: none;
}
to {
opacity: 1;
}
}
@media only screen and (min-width: 500px) {
html {
font-size: 15px;
}
}
@media only screen and (min-width: 1000px) {
html {
font-size: 16px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment