first commit: gustavoo-portfolio theme + gustavoo-portfolio-core plugin
@@ -0,0 +1,57 @@
|
||||
@font-face {
|
||||
font-family: "Inter";
|
||||
font-style: normal;
|
||||
font-weight: 100 900;
|
||||
font-display: swap;
|
||||
src: url("../fonts/inter-variable.woff2") format("woff2-variations");
|
||||
}
|
||||
|
||||
.editor-styles-wrapper {
|
||||
color: #d4dde3;
|
||||
background: #071624;
|
||||
font-family: "Inter", system-ui, sans-serif;
|
||||
font-size: 17px;
|
||||
line-height: 1.75;
|
||||
}
|
||||
|
||||
.editor-styles-wrapper .wp-block {
|
||||
max-width: 760px;
|
||||
}
|
||||
|
||||
.editor-styles-wrapper .wp-block[data-align="wide"] {
|
||||
max-width: 1160px;
|
||||
}
|
||||
|
||||
.editor-styles-wrapper h1,
|
||||
.editor-styles-wrapper h2,
|
||||
.editor-styles-wrapper h3,
|
||||
.editor-styles-wrapper h4,
|
||||
.editor-styles-wrapper h5,
|
||||
.editor-styles-wrapper h6 {
|
||||
color: #f5f8fa;
|
||||
font-weight: 750;
|
||||
line-height: 1.1;
|
||||
letter-spacing: -0.035em;
|
||||
}
|
||||
|
||||
.editor-styles-wrapper a {
|
||||
color: #74d5c7;
|
||||
}
|
||||
|
||||
.editor-styles-wrapper blockquote {
|
||||
padding-left: 1.5rem;
|
||||
color: #b8c5ce;
|
||||
border-left: 3px solid #74d5c7;
|
||||
}
|
||||
|
||||
.editor-styles-wrapper code,
|
||||
.editor-styles-wrapper pre {
|
||||
color: #d9fdf7;
|
||||
background: #040d16;
|
||||
border-radius: 8px;
|
||||
font-family: "SFMono-Regular", Consolas, monospace;
|
||||
}
|
||||
|
||||
.editor-styles-wrapper img {
|
||||
border-radius: 10px;
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
Copyright 2020 The Inter Project Authors (https://github.com/rsms/inter)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 492 KiB |
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 9.5 KiB |
|
After Width: | Height: | Size: 38 KiB |
@@ -0,0 +1,273 @@
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
const ready = (callback) => {
|
||||
if (document.readyState === "loading") {
|
||||
document.addEventListener("DOMContentLoaded", callback, { once: true });
|
||||
return;
|
||||
}
|
||||
|
||||
callback();
|
||||
};
|
||||
|
||||
ready(function () {
|
||||
const header = document.querySelector(".site-header");
|
||||
const toggle = document.querySelector("[data-nav-toggle], .nav-toggle, .menu-toggle");
|
||||
const navigation = document.querySelector("[data-primary-nav], .primary-nav, .primary-navigation");
|
||||
const reduceMotion = window.matchMedia("(prefers-reduced-motion: reduce)");
|
||||
let lastFocusedElement = null;
|
||||
|
||||
const updateHeader = () => {
|
||||
if (!header) {
|
||||
return;
|
||||
}
|
||||
|
||||
header.classList.toggle("is-scrolled", window.scrollY > 24);
|
||||
};
|
||||
|
||||
updateHeader();
|
||||
window.addEventListener("scroll", updateHeader, { passive: true });
|
||||
|
||||
if (toggle && navigation) {
|
||||
const drawerClose = navigation.querySelector("[data-nav-close]");
|
||||
const navigationParent = navigation.parentNode;
|
||||
const navigationNextSibling = navigation.nextSibling;
|
||||
let navigationIsDrawer = false;
|
||||
|
||||
const placeNavigation = (asDrawer) => {
|
||||
if (asDrawer && !navigationIsDrawer) {
|
||||
document.body.appendChild(navigation);
|
||||
navigationIsDrawer = true;
|
||||
} else if (!asDrawer && navigationIsDrawer) {
|
||||
navigationParent.insertBefore(navigation, navigationNextSibling);
|
||||
navigationIsDrawer = false;
|
||||
}
|
||||
};
|
||||
|
||||
if (!navigation.id) {
|
||||
navigation.id = "site-navigation";
|
||||
}
|
||||
|
||||
toggle.setAttribute("aria-controls", navigation.id);
|
||||
toggle.setAttribute("aria-expanded", "false");
|
||||
navigation.setAttribute("aria-hidden", "true");
|
||||
|
||||
const focusableSelector = [
|
||||
"a[href]",
|
||||
"button:not([disabled])",
|
||||
"input:not([disabled])",
|
||||
"select:not([disabled])",
|
||||
"textarea:not([disabled])",
|
||||
"[tabindex]:not([tabindex='-1'])",
|
||||
].join(",");
|
||||
|
||||
const closeMenu = (restoreFocus) => {
|
||||
toggle.setAttribute("aria-expanded", "false");
|
||||
const toggleLabel = toggle.querySelector(".menu-toggle__label");
|
||||
if (toggleLabel && window.gustavooPortfolioNavigation) {
|
||||
toggleLabel.textContent = window.gustavooPortfolioNavigation.expand;
|
||||
}
|
||||
navigation.setAttribute("aria-hidden", "true");
|
||||
navigation.classList.remove("is-open");
|
||||
navigation.classList.remove("has-more-content");
|
||||
document.body.classList.remove("nav-open");
|
||||
|
||||
if (restoreFocus && lastFocusedElement) {
|
||||
lastFocusedElement.focus();
|
||||
}
|
||||
};
|
||||
|
||||
const openMenu = () => {
|
||||
lastFocusedElement = document.activeElement;
|
||||
toggle.setAttribute("aria-expanded", "true");
|
||||
const toggleLabel = toggle.querySelector(".menu-toggle__label");
|
||||
if (toggleLabel && window.gustavooPortfolioNavigation) {
|
||||
toggleLabel.textContent = window.gustavooPortfolioNavigation.collapse;
|
||||
}
|
||||
navigation.setAttribute("aria-hidden", "false");
|
||||
navigation.classList.add("is-open");
|
||||
document.body.classList.add("nav-open");
|
||||
|
||||
window.requestAnimationFrame(function () {
|
||||
updateNavigationScrollHint();
|
||||
});
|
||||
|
||||
const firstFocusable = navigation.querySelector(focusableSelector);
|
||||
if (firstFocusable) {
|
||||
window.requestAnimationFrame(() => firstFocusable.focus());
|
||||
}
|
||||
};
|
||||
|
||||
const updateNavigationScrollHint = () => {
|
||||
const hasMoreContent = navigation.scrollHeight > navigation.clientHeight + 4
|
||||
&& navigation.scrollTop + navigation.clientHeight < navigation.scrollHeight - 4;
|
||||
navigation.classList.toggle("has-more-content", hasMoreContent);
|
||||
};
|
||||
|
||||
toggle.addEventListener("click", function () {
|
||||
if (toggle.getAttribute("aria-expanded") === "true") {
|
||||
closeMenu(false);
|
||||
} else {
|
||||
openMenu();
|
||||
}
|
||||
});
|
||||
|
||||
if (drawerClose) {
|
||||
drawerClose.addEventListener("click", function () {
|
||||
closeMenu(true);
|
||||
});
|
||||
}
|
||||
|
||||
navigation.addEventListener("click", function (event) {
|
||||
if (event.target.closest("a")) {
|
||||
closeMenu(false);
|
||||
}
|
||||
});
|
||||
|
||||
navigation.addEventListener("scroll", updateNavigationScrollHint, { passive: true });
|
||||
window.addEventListener("resize", updateNavigationScrollHint, { passive: true });
|
||||
|
||||
document.addEventListener("keydown", function (event) {
|
||||
if (toggle.getAttribute("aria-expanded") !== "true") {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.key === "Escape") {
|
||||
event.preventDefault();
|
||||
closeMenu(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.key !== "Tab") {
|
||||
return;
|
||||
}
|
||||
|
||||
const focusable = Array.from(navigation.querySelectorAll(focusableSelector));
|
||||
focusable.push(toggle);
|
||||
|
||||
if (!focusable.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
const first = focusable[0];
|
||||
const last = focusable[focusable.length - 1];
|
||||
|
||||
if (event.shiftKey && document.activeElement === first) {
|
||||
event.preventDefault();
|
||||
last.focus();
|
||||
} else if (!event.shiftKey && document.activeElement === last) {
|
||||
event.preventDefault();
|
||||
first.focus();
|
||||
}
|
||||
});
|
||||
|
||||
const desktopQuery = window.matchMedia("(min-width: 921px)");
|
||||
const handleDesktop = (event) => {
|
||||
placeNavigation(!event.matches);
|
||||
|
||||
if (event.matches) {
|
||||
closeMenu(false);
|
||||
navigation.removeAttribute("aria-hidden");
|
||||
} else if (toggle.getAttribute("aria-expanded") !== "true") {
|
||||
navigation.setAttribute("aria-hidden", "true");
|
||||
}
|
||||
};
|
||||
|
||||
handleDesktop(desktopQuery);
|
||||
desktopQuery.addEventListener("change", handleDesktop);
|
||||
}
|
||||
|
||||
if (window.location.hash.length > 1) {
|
||||
const hashId = decodeURIComponent(window.location.hash.slice(1));
|
||||
const hashTarget = document.getElementById(hashId);
|
||||
|
||||
if (hashTarget) {
|
||||
window.requestAnimationFrame(function () {
|
||||
window.setTimeout(function () {
|
||||
hashTarget.scrollIntoView({ behavior: "auto", block: "start" });
|
||||
}, 120);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
document.querySelectorAll('a[href^="#"]:not([href="#"])').forEach(function (link) {
|
||||
link.addEventListener("click", function (event) {
|
||||
const id = link.getAttribute("href").slice(1);
|
||||
const target = document.getElementById(id);
|
||||
|
||||
if (!target) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
// The header becomes fixed after the page is scrolled, so
|
||||
// scrollIntoView() cannot scroll the document when targeting it.
|
||||
if (id === "masthead") {
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
behavior: reduceMotion.matches ? "auto" : "smooth",
|
||||
});
|
||||
} else {
|
||||
target.scrollIntoView({
|
||||
behavior: reduceMotion.matches ? "auto" : "smooth",
|
||||
block: "start",
|
||||
});
|
||||
}
|
||||
|
||||
if (window.history && window.history.replaceState) {
|
||||
window.history.replaceState(null, "", `#${id}`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const revealItems = Array.from(document.querySelectorAll("[data-reveal]"));
|
||||
|
||||
if (revealItems.length && "IntersectionObserver" in window && !reduceMotion.matches) {
|
||||
document.documentElement.classList.add("has-reveal");
|
||||
|
||||
const revealObserver = new IntersectionObserver(
|
||||
function (entries, observer) {
|
||||
entries.forEach(function (entry) {
|
||||
if (!entry.isIntersecting) {
|
||||
return;
|
||||
}
|
||||
|
||||
const delay = Number.parseInt(entry.target.dataset.revealDelay || "0", 10);
|
||||
if (delay > 0) {
|
||||
entry.target.style.transitionDelay = `${Math.min(delay, 500)}ms`;
|
||||
}
|
||||
|
||||
entry.target.classList.add("is-visible");
|
||||
observer.unobserve(entry.target);
|
||||
});
|
||||
},
|
||||
{ rootMargin: "0px 0px -8%", threshold: 0.12 }
|
||||
);
|
||||
|
||||
revealItems.forEach((item) => revealObserver.observe(item));
|
||||
} else {
|
||||
revealItems.forEach((item) => item.classList.add("is-visible"));
|
||||
}
|
||||
|
||||
const progress = document.querySelector("[data-reading-progress]");
|
||||
const article = document.querySelector(".entry-content");
|
||||
|
||||
if (progress && article) {
|
||||
const updateProgress = () => {
|
||||
const articleTop = article.getBoundingClientRect().top + window.scrollY;
|
||||
const articleHeight = article.offsetHeight;
|
||||
const viewportHeight = window.innerHeight;
|
||||
const distance = articleHeight - viewportHeight;
|
||||
const current = window.scrollY - articleTop;
|
||||
const percentage = distance > 0 ? Math.min(100, Math.max(0, (current / distance) * 100)) : 100;
|
||||
progress.style.setProperty("--reading-progress", `${percentage}%`);
|
||||
progress.setAttribute("aria-valuenow", String(Math.round(percentage)));
|
||||
};
|
||||
|
||||
updateProgress();
|
||||
window.addEventListener("scroll", updateProgress, { passive: true });
|
||||
window.addEventListener("resize", updateProgress, { passive: true });
|
||||
}
|
||||
});
|
||||
})();
|
||||