Skip to content

Commit

Permalink
minor change in blog post
Browse files Browse the repository at this point in the history
  • Loading branch information
ThinLiquid committed Sep 1, 2024
1 parent 92acd1e commit f9fde7a
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 38 deletions.
6 changes: 3 additions & 3 deletions root.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ <h4 style="margin: 0;">&copy; 2023-2024 ThinLiquid</h4>
<br/>
<a href="https://github.com/ThinLiquid/site">source code</a>
<br/><br/>
<a href="https://thinliquid.dev"><img src="https://thinliquid.dev/thnlqd.png" alt="thinliquid's button" /></a>
<a href="https://nekoweb.org"><img src="https://raw.githubusercontent.com/ThinLiquid/buttons/main/img/nekoweb12.gif" alt="nekoweb.org"></a>
<a href="https://archlinux.org"><img src="https://raw.githubusercontent.com/ThinLiquid/buttons/main/img/archlinux.gif" href="i use arch btw"></a>
<a class="no-style" href="https://thinliquid.dev"><img src="https://thinliquid.dev/thnlqd.png" alt="thinliquid's button" /></a>
<a class="no-style" href="https://nekoweb.org"><img src="https://raw.githubusercontent.com/ThinLiquid/buttons/main/img/nekoweb12.gif" alt="nekoweb.org"></a>
<a class="no-style" href="https://archlinux.org"><img src="https://raw.githubusercontent.com/ThinLiquid/buttons/main/img/archlinux.gif" href="i use arch btw"></a>
<img src="https://raw.githubusercontent.com/ThinLiquid/buttons/main/img/handcoded.gif" alt="completely hand-coded!">
<br/><br/>
<p style="margin: 0;">last commit hash: <code style="user-select: all;"><!-- variable:commit-hash --></code></p>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/blog/[31-08-2024] making a search engine.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ styles:
- /style.css
---

so (yet again) the other day, it was around 2am... i was programming on mobile data (cuz my mother unplugged the wifi that night) and i was using **"EE Stay Connected"** (the slowest unlimited data plan everrr). just to make a simple web search on any search engine, it would take around 5 minutes to load the page. so i thought to myself, "why not make a search engine that's super lightweight and fast?" and that's how i started making my own "search engine".
so (yet again) the other day, it was around 2am... i was programming on mobile data (cuz my mother unplugged the wifi that night) and i was using **EE Stay Connected** (the slowest unlimited data plan everrr). just to make a simple web search on any search engine, it would take around 5 minutes to load the page. so i thought to myself, "why not make a search engine that's super lightweight and fast?" and that's how i started making my own "search engine".

so i started by scraping DuckDuckGo with a library called `duck-duck-scrape`. i then made a simple html page using **bun** and **elysia's jsx plugin** (god i love bun) with a search bar and a list of search results. i then added a little bit of css to make it look nice and voilà! i had my own search engine.

Expand Down
26 changes: 15 additions & 11 deletions src/pages/socials.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,21 @@ styles:

# socials

[
![Discord](https://raw.githubusercontent.com/ThinLiquid/buttons/main/img/discord.gif)
](https://discord.com/users/620492146406981642)[
![GitHub](https://raw.githubusercontent.com/ThinLiquid/buttons/main/img/github.gif)
](https://github.com/ThinLiquid)[
![Reddit](https://raw.githubusercontent.com/ThinLiquid/buttons/main/img/reddit.gif)
](https://www.reddit.com/user/JuiciiYT)[
![X](https://raw.githubusercontent.com/ThinLiquid/buttons/main/img/twitterbutton.gif)
](https://x.com/thnlqd)[
![PGP](https://raw.githubusercontent.com/ThinLiquid/buttons/main/img/pgp-now.gif)
](https://github.com/ThinLiquid.gpg)
<a href="https://discord.com/users/620492146406981642" class="no-style">
<img src="https://raw.githubusercontent.com/ThinLiquid/buttons/main/img/discord.gif" alt="Discord">
</a>
<a href="https://github.com/ThinLiquid" class="no-style">
<img src="https://raw.githubusercontent.com/ThinLiquid/buttons/main/img/github.gif" alt="GitHub">
</a>
<a href="https://www.reddit.com/user/JuiciiYT" class="no-style">
<img src="https://raw.githubusercontent.com/ThinLiquid/buttons/main/img/reddit.gif" alt="Reddit">
</a>
<a href="https://x.com/thnlqd" class="no-style">
<img src="https://raw.githubusercontent.com/ThinLiquid/buttons/main/img/twitterbutton.gif" alt="X">
</a>
<a href="https://github.com/ThinLiquid.gpg" class="no-style">
<img src="https://raw.githubusercontent.com/ThinLiquid/buttons/main/img/pgp-now.gif" alt="PGP">
</a>

email: [thnlqd@gmail.com](mailto:thnlqd@gmail.com)

Expand Down
34 changes: 18 additions & 16 deletions src/pages/stats.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,24 @@ styles:
const LEVEL_FACTOR = 0.025


const data = await fetchStats()
;(async () => {
const data = await fetchStats()

const languages = Object.entries(data.languages).sort((a, b) => b[1].xps - a[1].xps)
const languages = Object.entries(data.languages).sort((a, b) => b[1].xps - a[1].xps)

for (const [key, value] of languages) {
const xp = value.xps
const lang = document.createElement('div')
lang.style.width = 'calc(50% - 10px)'
lang.innerHTML = `
<h3>${key}</h3>
<b>Level ${getLevel(xp)}</b> (${xp} XP)${value.new_xps > 0 ? ` (+${value.new_xps})` : ''}
<div style="position:relative;height:20px;margin-top: 5px;">
<span style="position:absolute;left:50%;top:0px;transform:translateX(-50%);color:rgb(var(--color));z-index:5;mix-blend-mode:difference;">${getLevelProgress(xp)}%</span>
<progress value="${getLevelProgress(xp)}" max="100" style="width:100%"></progress>
</div>
`
document.querySelector('.container').appendChild(lang)
}
for (const [key, value] of languages) {
const xp = value.xps
const lang = document.createElement('div')
lang.style.width = 'calc(50% - 10px)'
lang.innerHTML = `
<h3>${key}</h3>
<b>Level ${getLevel(xp)}</b> (${xp} XP)${value.new_xps > 0 ? ` (+${value.new_xps})` : ''}
<div style="position:relative;height:20px;margin-top: 5px;">
<span style="position:absolute;left:50%;top:0px;transform:translateX(-50%);color:rgb(var(--color));z-index:5;mix-blend-mode:difference;">${getLevelProgress(xp)}%</span>
<progress value="${getLevelProgress(xp)}" max="100" style="width:100%"></progress>
</div>
`
document.querySelector('.container').appendChild(lang)
}
})()
</script>
12 changes: 6 additions & 6 deletions src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ footer {
}
}

#nekowebring a {
border: none!important;
padding: 0;
}

a {
user-select: none;
display: inline-flex;
Expand All @@ -210,7 +215,7 @@ a {

transition: all .5s var(--bounce), color .25s, border-color .25s;

&:has(img), &.no-style {
&.no-style {
border: none!important;
padding: 0;
}
Expand All @@ -230,11 +235,6 @@ a {
color: rgb(var(--sapphire));
}
}

&:has(button) {
padding: 0;
border: none;
}
}

button {
Expand Down
2 changes: 1 addition & 1 deletion ssg.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ ${dedent`
title: string;
link: string;
emoji: string;
}) => `<a href="${link}"><button>${parseEmojis(emoji)} ${title}</button></a>`).join(''),
}) => `<a href="${link}" class="no-style"><button>${parseEmojis(emoji)} ${title}</button></a>`).join(''),

color: ({ color = 'blue' }: {
color?: keyof typeof colors;
Expand Down

0 comments on commit f9fde7a

Please sign in to comment.