Skip to content

Commit

Permalink
LOTS of fixes + small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
strayfade committed Feb 22, 2024
1 parent f791c9d commit 71c069b
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 313 deletions.
4 changes: 2 additions & 2 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const AvailablePages = {
Home: Symbol('Home'),
Dynamic: Symbol('Article'),
R: Symbol('R'),
NonstandardPages: ['R'],
}
const IrregularPages = ['R']

const WrapAsync = (Function) => {
return (req, res, next) => {
Expand Down Expand Up @@ -81,7 +81,7 @@ App.get(
Lang = require('./localization/' + req.params.localization + '.json')
else Lang = require(GetLanguagePath(req))

let IsNotArticle = AvailablePages.NonstandardPages.includes(req.params.path.toUpperCase())
let IsNotArticle = IrregularPages.includes(req.params.path.toUpperCase())
if (IsNotArticle) {
switch (req.params.path.toUpperCase()) {
case 'R':
Expand Down
35 changes: 4 additions & 31 deletions Build.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
const fs = require('fs')
const Log = require('./Log').Log
const Obfuscator = require('js-obfuscator')
const ObfuscatorOptions = {
keepLinefeeds: false,
keepIndentations: false,
encodeStrings: true,
encodeNumbers: true,
moveStrings: true,
replaceNames: true,
variableExclusions: ['^_get_', '^_set_', '^_mtd_'],
}
const Obfuscate = !process.argv[2] || !process.argv[2].includes('--skipobfuscation')

const PackStylesheets = async () => {
Log('[BUILD] - Merging CSS files...')
Expand Down Expand Up @@ -50,26 +39,10 @@ const PackScripts = async () => {
}
}

if (Obfuscate && false) {
Obfuscator(Script, ObfuscatorOptions).then(
(ObfuscatedContent) => {
let p = __dirname + '/build/production.js'
Log('[BUILD] - Obfuscated file: ' + p)
fs.mkdir('./Production', (err) => {})
fs.writeFileSync(p, ObfuscatedContent, { recursive: true })

Log('[BUILD] - Finished file: ' + p)
},
(Error) => {
console.error(Error)
},
)
} else {
Log('[BUILD] - Skipping obfuscation')
fs.mkdir('./Production', (err) => {})
let p = __dirname + '/build/production.js'
fs.writeFileSync(p, Script, { recursive: true })
}
Log('[BUILD] - Skipping obfuscation')
fs.mkdir('./Production', (err) => {})
let p = __dirname + '/build/production.js'
fs.writeFileSync(p, Script, { recursive: true })
}

PackStylesheets()
Expand Down
2 changes: 1 addition & 1 deletion build/production.css

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions build/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if (window.location.pathname != '/') {
let EffectBox = document.createElement('div')
EffectBox.classList.add('CoverBox')
EffectBox.style.top = '-' + ElementLocation.top + 'px'
EffectBox.style.left = '0px'
EffectBox.style.right = '0px'
EffectBox.style.width = ElementLocation.right - ElementLocation.left + 'px'
EffectBox.style.height = ElementLocation.bottom - ElementLocation.top + 'px'
EffectBox.style.marginTop = '-' + (ElementLocation.bottom - ElementLocation.top) + 'px'
Expand All @@ -44,7 +44,7 @@ if (window.location.pathname != '/') {
}

// Animate effect boxes
document.querySelector(':root').style.setProperty('--transition-length', '1.0s')
document.querySelector(':root').style.setProperty('--transition-length', '0.75s')

let AllBoxes = []
for (const Box of document.getElementsByClassName('CoverBox')) {
Expand All @@ -66,14 +66,14 @@ if (window.location.pathname != '/') {
)
let Iterator = 0
const ref = setInterval(() => {
AllBoxes[Iterator].style.marginLeft = parseInt(AllBoxes[Iterator].getAttribute('initialwidth')) + 'px'
AllBoxes[Iterator].style.marginRight = parseInt(AllBoxes[Iterator].getAttribute('initialwidth')) + 'px'
AllBoxes[Iterator].style.width = '0px'
Iterator++
if (Iterator == AllBoxes.length) {
clearInterval(ref)
setTimeout(() => {
for (const Box of document.getElementsByClassName('CoverBox')) {
Box.remove()
//Box.remove()
}
}, 1000)
}
Expand Down Expand Up @@ -478,8 +478,8 @@ const DecryptElements = (Elements) => {
}

document.addEventListener('DOMContentLoaded', async () => {
let Elements = GetElements()
DecryptElements(Elements)
//let Elements = GetElements()
//DecryptElements(Elements)
})


Expand Down
13 changes: 4 additions & 9 deletions css/Blockquote.css
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
blockquote {
margin-left: 0px;
padding-left: 20px;
border-left: 3px solid var(--accent-color);
border-left-width: 5px;
border-left-style: solid;
margin-right: 0px;
padding-top: 10px;
padding-bottom: 10px;
background: linear-gradient(45deg, var(--accent-color-very-transparent), var(--accent-color-transparent));
padding: 0px 20px;
margin: 20px 0px;
border-left: 5px solid var(--accent-color);
}

blockquote * {
text-shadow: var(--default-shadow);
}
4 changes: 3 additions & 1 deletion css/Fonts.css
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
h1 {
font-size: 60px;
}
@media screen and (max-width: 800px) {

@media screen and (max-width: 960px) {
h1 {
font-size: 30px;
}
Expand Down Expand Up @@ -122,4 +123,5 @@ em,
strong {
margin-top: 0px;
margin-bottom: 0px;
font-weight: 400;
}
12 changes: 7 additions & 5 deletions css/Presentation.css
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@
width: 50vw;
}

@media screen and (max-width: 800px) {
@media screen and (max-width: 960px) {
.Slide .SlideInner {
width: 70vw;
margin-top: 7.5vh;
}
}

Expand Down Expand Up @@ -222,7 +223,7 @@ a {
border-radius: 6px;
}

@media screen and (max-width: 800px) {
@media screen and (max-width: 960px) {
.SidebarScrollPercentage {
display: none;
}
Expand Down Expand Up @@ -301,7 +302,7 @@ a {
margin-bottom: 5px;
}

@media screen and (max-width: 800px) {
@media screen and (max-width: 960px) {
.Flexbox {
display: block;
}
Expand Down Expand Up @@ -346,7 +347,7 @@ a {
margin-top: 10px;
}

@media screen and (max-width: 800px) {
@media screen and (max-width: 960px) {
.SlideInner p {
font-size: 14px;
margin-top: 10px;
Expand Down Expand Up @@ -387,14 +388,15 @@ strong {

.ArticleTitle {
font-size: 60px;
font-weight: 400;
}

.ArticleTitleDate {
opacity: 0.5;
font-weight: lighter;
}

@media screen and (max-width: 800px) {
@media screen and (max-width: 960px) {
.ArticleTitle {
font-size: 30px;
}
Expand Down
29 changes: 19 additions & 10 deletions generators/Assemble.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const AvailablePages = {
Home: Symbol('Home'),
Dynamic: Symbol('Article'),
R: Symbol('R'),
NonstandardPages: ['R'],
}

const CalculateAge = () => {
Expand Down Expand Up @@ -210,7 +209,7 @@ const GenerateBodyV2 = async (Article2, Locale, AvailablePages, AvailablePageSel
Output += `<div class="ArticleItem Slide1 Slide1Visible" style="margin-top: 20px">`
Output +=
`
<div class="GridItem Slide1 Slide1Visible" style="padding-bottom: 0px; width: max-content; padding-right: 0px;">
<div class="GridItem Slide1 Slide1Visible" style="padding-bottom: 0px; padding-right: 0px;">
<a href="/` +
Post.file.replace('.md', '') +
`">
Expand All @@ -219,7 +218,13 @@ const GenerateBodyV2 = async (Article2, Locale, AvailablePages, AvailablePageSel
// Article Titles
if (x == 0) {
Output +=
`<h3 style="margin-top: 0px; color: black; background-color: var(--accent-color); padding: 5px; padding-right: 7px; padding-left: 7px; width: max-content; height: max-content; margin-top: 5px;">` +
`<h3 style="color: black;
background: var(--accent-color);
padding: 7px 5px 4px 7px;
width: max-content;
height: max-content;
margin-top: 3px;
font-weight: bold;">` +
JSON.title +
`</h3>`
} else {
Expand All @@ -229,14 +234,18 @@ const GenerateBodyV2 = async (Article2, Locale, AvailablePages, AvailablePageSel
`</h3>`
}
Output +=
`<p style="font-size: 14px; margin-top: 0px; color: white; opacity: 0.5; margin: 14px; margin-left: 8px">` +
`<p style="font-size: 16px;
color: white;
opacity: 0.2;
margin: 14px;
font-weight: 300; ">` +
JSON.date +
`</p></div>`

// Article Descriptions
if (x == 0) {
Output +=
`<p style="color: white; margin: 0px; width: max-content">` +
`<p style="color: white; margin: 0px; max-width: 100%;">` +
JSON.description +
`</p>`
} else {
Expand Down Expand Up @@ -275,7 +284,7 @@ const GenerateBodyV2 = async (Article2, Locale, AvailablePages, AvailablePageSel
<p><strong>Full-stack web development</strong> building <strong>modern, dynamic interfaces</strong> and <strong>modular, secure backends</strong>.</p>
<div class="Icobox">
<a class="Link" href="https://github.com/Strayfade/Website">Source Code
<svg class="Link" style="margin-bottom: -4px; margin-left: -1px;" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 5 50 40"><path d="M22.5 34H14q-4.15 0-7.075-2.925T4 24q0-4.15 2.925-7.075T14 14h8.5v3H14q-2.9 0-4.95 2.05Q7 21.1 7 24q0 2.9 2.05 4.95Q11.1 31 14 31h8.5Zm-6.25-8.5v-3h15.5v3ZM25.5 34v-3H34q2.9 0 4.95-2.05Q41 26.9 41 24q0-2.9-2.05-4.95Q36.9 17 34 17h-8.5v-3H34q4.15 0 7.075 2.925T44 24q0 4.15-2.925 7.075T34 34Z"/></svg>
<svg class="Link" style="margin-bottom: -4px; margin-left: -1px;" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" width="24"><path d="M647-440H160v-80h487L423-744l57-56 320 320-320 320-57-56 224-224Z"/></svg>
</a>
</div>
</div>
Expand All @@ -290,7 +299,7 @@ const GenerateBodyV2 = async (Article2, Locale, AvailablePages, AvailablePageSel
<p>Created <strong>neural network/AI</strong> frameworks for task automation and experimentation <strong>from scratch in C++</strong>.</p>
<div class="Icobox">
<a class="Link" href="/FeedForward">Article
<svg class="Link" style="margin-bottom: -4px; margin-left: -1px;" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 5 50 40"><path d="M22.5 34H14q-4.15 0-7.075-2.925T4 24q0-4.15 2.925-7.075T14 14h8.5v3H14q-2.9 0-4.95 2.05Q7 21.1 7 24q0 2.9 2.05 4.95Q11.1 31 14 31h8.5Zm-6.25-8.5v-3h15.5v3ZM25.5 34v-3H34q2.9 0 4.95-2.05Q41 26.9 41 24q0-2.9-2.05-4.95Q36.9 17 34 17h-8.5v-3H34q4.15 0 7.075 2.925T44 24q0 4.15-2.925 7.075T34 34Z"/></svg>
<svg class="Link" style="margin-bottom: -4px; margin-left: -1px;" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" width="24"><path d="M647-440H160v-80h487L423-744l57-56 320 320-320 320-57-56 224-224Z"/></svg>
</a>
</div>
</div>
Expand Down Expand Up @@ -381,7 +390,7 @@ const GenerateBodyV2 = async (Article2, Locale, AvailablePages, AvailablePageSel
MarkdownHtml = MarkdownHtml.replace('";', '"')
}
let ArticleTags = ''
if (Article.tags) {
if (Article.tags && false) {
ArticleTags += `<div class="ArticleTagContainer" style="margin-top: 20px;">`
for (let y = 0; y < Article.tags.length; y++) {
ArticleTags += `<span class="ArticleTag">` + Article.tags[y] + `</span>`
Expand Down Expand Up @@ -419,13 +428,13 @@ const GenerateBodyV2 = async (Article2, Locale, AvailablePages, AvailablePageSel
<h1 class="ArticleTitle" style="margin-top: 12px">` +
Article.title +
`</h1>
<h4 style="margin-top: 0px; font-weight: normal; margin-top: 10px;">` +
<h4 style="margin-top: 0px; font-weight: 300; margin-top: 10px;">` +
Article.description +
`</h4>` +
(Article.showTitle
? ArticleTags +
`
<p style="margin-top: 24px; padding-bottom: 50px; margin-bottom: 50px; border-bottom: 3px solid white;">Written by <strong>` +
<p style="margin-top: 24px; padding-bottom: 50px; margin-bottom: 50px; border-bottom: 3px solid white; font-weight: 300;">Written by <strong>` +
Article.author +
`</strong></p>`
: ``) +
Expand Down
2 changes: 1 addition & 1 deletion localization/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"share_section_header": "Share This Page",
"view_on_github": "View on GitHub",
"view_original": "View Raw",
"pageTitle1": "Blog",
"pageTitle1": "Posts",
"pageTitle2": "Skills",
"pageTitle3": "Contact Me"
}
Loading

0 comments on commit 71c069b

Please sign in to comment.