proudyyyy
proudyyyy
Explore posts from servers
HHono
Created by sanner on 9/2/2024 in #help
Knex + Hono + Bun Connection Errors
What if you try writing it uppercase? Something like this simple with just a local file is working for me.
import Knex from "knex";

export const db = Knex({
client: 'sqlite3',
connection: {
filename: "./db.sqlite"
},
useNullAsDefault: true
})

db.schema.hasTable('users').then(exists => {
if (!exists) {
return db.schema.createTable('users', table => {
table.increments('id').primary();
table.string('username').notNullable();
table.string('email').unique().notNullable();
table.string('password').notNullable();
table.datetime('created_at').notNullable().defaultTo(db.fn.now());
table.datetime('updated_at').notNullable().defaultTo(db.fn.now());
table.text('appearance').notNullable().defaultTo("default");
table.string('icon');
table.text('biography');
});
}
});
import Knex from "knex";

export const db = Knex({
client: 'sqlite3',
connection: {
filename: "./db.sqlite"
},
useNullAsDefault: true
})

db.schema.hasTable('users').then(exists => {
if (!exists) {
return db.schema.createTable('users', table => {
table.increments('id').primary();
table.string('username').notNullable();
table.string('email').unique().notNullable();
table.string('password').notNullable();
table.datetime('created_at').notNullable().defaultTo(db.fn.now());
table.datetime('updated_at').notNullable().defaultTo(db.fn.now());
table.text('appearance').notNullable().defaultTo("default");
table.string('icon');
table.text('biography');
});
}
});
@sanner
2 replies
KPCKevin Powell - Community
Created by proudyyyy on 9/21/2024 in #front-end
background fontstyle black index number inside flex-col container
there's no other way though with sidely aligned texts. you have to align it center because the hitbox of the element remains full width and ignores white space sadly..
70 replies
KPCKevin Powell - Community
Created by proudyyyy on 9/21/2024 in #front-end
background fontstyle black index number inside flex-col container
No description
70 replies
KPCKevin Powell - Community
Created by proudyyyy on 9/21/2024 in #front-end
background fontstyle black index number inside flex-col container
I just dislike having all the time text-align: center; which is why I try having justify or left align and then centered with margin-inline: auto;
70 replies
KPCKevin Powell - Community
Created by proudyyyy on 9/21/2024 in #front-end
background fontstyle black index number inside flex-col container
but yeah I see what you mean, description has to be centered.
70 replies
KPCKevin Powell - Community
Created by proudyyyy on 9/21/2024 in #front-end
background fontstyle black index number inside flex-col container
No description
70 replies
KPCKevin Powell - Community
Created by proudyyyy on 9/21/2024 in #front-end
background fontstyle black index number inside flex-col container
ah yes already done. this was just a sketch
70 replies
KPCKevin Powell - Community
Created by proudyyyy on 9/21/2024 in #front-end
background fontstyle black index number inside flex-col container
This would laso be great for potential bigger texts, this one wouldn't suit for them right now as it's desired that the index number is being outstanding of title + description 😄
70 replies
KPCKevin Powell - Community
Created by proudyyyy on 9/21/2024 in #front-end
background fontstyle black index number inside flex-col container
only annoying thing remaining right now is that I have to use a static font size with any unit.. I'd prefer having a negative offset both at bottom and top so that this one would work out of the box adaptive and responsive and not require any unit value.
70 replies
KPCKevin Powell - Community
Created by proudyyyy on 9/21/2024 in #front-end
background fontstyle black index number inside flex-col container
Thanks a lot! 🙂
70 replies
KPCKevin Powell - Community
Created by proudyyyy on 9/21/2024 in #front-end
background fontstyle black index number inside flex-col container
the one ("1") isn't perfect but I am fine with this one. way more suitable and flexible than any other approach so far.
70 replies
KPCKevin Powell - Community
Created by proudyyyy on 9/21/2024 in #front-end
background fontstyle black index number inside flex-col container
this does work fine without any pseudo elements.
70 replies
KPCKevin Powell - Community
Created by proudyyyy on 9/21/2024 in #front-end
background fontstyle black index number inside flex-col container
No description
70 replies
KPCKevin Powell - Community
Created by proudyyyy on 9/21/2024 in #front-end
background fontstyle black index number inside flex-col container
No description
70 replies
KPCKevin Powell - Community
Created by proudyyyy on 9/21/2024 in #front-end
background fontstyle black index number inside flex-col container
yeah wont follow that approach anymore because taking too long, imma try again grid one with regular element.
70 replies
KPCKevin Powell - Community
Created by proudyyyy on 9/21/2024 in #front-end
background fontstyle black index number inside flex-col container
therefore I prefer relying on entire element cuz it can be conditionally rendered by astro.. 😄
70 replies
KPCKevin Powell - Community
Created by proudyyyy on 9/21/2024 in #front-end
background fontstyle black index number inside flex-col container
yup got it.
70 replies
KPCKevin Powell - Community
Created by proudyyyy on 9/21/2024 in #front-end
background fontstyle black index number inside flex-col container
yeah
70 replies
KPCKevin Powell - Community
Created by proudyyyy on 9/21/2024 in #front-end
background fontstyle black index number inside flex-col container
looks fire, imma take this one.
70 replies
KPCKevin Powell - Community
Created by proudyyyy on 9/21/2024 in #front-end
background fontstyle black index number inside flex-col container
Huhm I am assuming i'm still doing something wrong. Before pseudo element ain't even appear inside html tree 😄
---
import type { GenericItem } from '@models/generic-item'

interface Props {
feature: GenericItem,
index?: number
}
const { feature, index } = Astro.props
---

<div class="relative max-w-screen-lg">
{index && <div data-feature-index={index}></div>}
<div class="z-10 flex flex-col items-center gap-2">
<h3 class="text-lg font-semibold">{feature.title}</h3>
<p class="prose row-span-2 col-start-2 text-gray-600" set:html={feature.description}></p>
</div>
</div>

<style define:vars={{index}}>
div[data-feature-index] ::before {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
height: 100%;
width: 100%;
font-size: 14rem;
content: var(--index);
font-weight: 900;
text-align: center;
}
</style>
---
import type { GenericItem } from '@models/generic-item'

interface Props {
feature: GenericItem,
index?: number
}
const { feature, index } = Astro.props
---

<div class="relative max-w-screen-lg">
{index && <div data-feature-index={index}></div>}
<div class="z-10 flex flex-col items-center gap-2">
<h3 class="text-lg font-semibold">{feature.title}</h3>
<p class="prose row-span-2 col-start-2 text-gray-600" set:html={feature.description}></p>
</div>
</div>

<style define:vars={{index}}>
div[data-feature-index] ::before {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
height: 100%;
width: 100%;
font-size: 14rem;
content: var(--index);
font-weight: 900;
text-align: center;
}
</style>
70 replies