#development

1 messages Β· Page 233 of 1

pearl trail
#

ah

sharp geyser
#

It doesn't return you an id

pearl trail
#

yeah i use my own api rn

#

i give up with nextauth

sharp geyser
#

lol

pearl trail
#

i am a certified web designer

lament rock
#

Yeah. I'm just gonna make my own file server software. This seems like a very fun project and I've already written a white paper on hypothetical implementation details and features. I'm sure the Windows remote FS is sensible to work with! :)

sharp geyser
#

Ah yes

#

windows api

pearl trail
#

ok i got it working

#

took a few minutes to figure it out

sharp geyser
#

Oh you got nextauth to send you an id?

sharp geyser
#

I am at my wits end

#

Everything is centered except for Login

#

wtf

radiant kraken
#

why he running away

sharp geyser
#

ONG

pearl trail
#

need a bit tweaking on the conf

#

i don't want to use external api for auth because i want to render the page on the server

#

since my vps is a bit far, so sending 2 requests just to get user data is a waste KEK

pearl trail
#
  • page
  • user data
sharp geyser
#

icic

pearl trail
#

by using next auth, i only request once

sharp geyser
#

fair

#

I return user data on login

#

then store it in a store

pearl trail
#

on the cookie or local storage

sharp geyser
#

wym

pearl trail
sharp geyser
#

like state

#

I use svelte stores

pearl trail
#

oooo yes

sharp geyser
#
import { writable } from 'svelte/store'

interface User {
    id: number,
    email: string,
    is_verified: boolean,
    is_premium: boolean,
    is_staff: boolean
}

function createStore(user: User | null) {
    // Will likely need update
    const { subscribe, set } = writable(user);

    function add(user: User) {
        set(user);
    }

    function remove() {
        set(null)
    }

    function get(): User | null {
        let user: User | null;

        const unsubscribe = subscribe(value => user = value);

        unsubscribe()

        return user!;
    }

    return { subscribe, add, remove, get }
}

export const user = createStore(null);
#

oh I forgot first_name and last_name

#

oh well

#

πŸ’€

pearl trail
#

o

#

does it still have the data when you refresh?

sharp geyser
#

yes

#

It is also shared amongst any components that import user

pearl trail
sharp geyser
#

local storage

#

most likely

pearl trail
#

yeah

sharp geyser
#

Im redesigning my entire site already

#

πŸ’€

#

I am building it from responsive up

#

that way its responsive first before anything

pearl trail
#

😎

sharp geyser
#

Ignore the hello

#

its me testing the navbar

#

for some reason the text hides behind it

#

I read its because im using fixed

#

but idk

#
<div class="relative">
    <Navbar class={`flex items-center w-full h-16 fixed border-b md:text-xl bg-white ${dark('bg-gray-900')}`}>
        <NavBrand href='/'>
            <span class="">Vidcord</span>
        </NavBrand>
        <div class='order-2'>
            <Button color='none' class='lg:hidden'>
                <SearchOutline />
            </Button>
            <div class={`hidden w-[38rem] lg:block`}>
                <Input placeholder='Search' />
            </div>
        </div>
        <NavUl class='order-last'>
            <NavLi>
                <DarkMode size='lg' />
            </NavLi>
        </NavUl>
    </Navbar>
</div>
#

its because im using fixed ig

pearl trail
#

oh yeah it is

#

just add padding top on the content with the size of your navbar's height

#

i usually do this

sharp geyser
#

so p-16?

pearl trail
#

pt-16

#

p will add padding 16 to every direction

#

it's still recommended to use pl and pr like at least 2 so it doesnt stick with the edge

#

add box-sizing too, otherwise overflow-x will appear when you use 100% on child iirc

sharp geyser
#

box-sizing?

pearl trail
#

yes

#

"If you set box-sizing: border-box; on an element, padding and border are included in the width and height:"

sharp geyser
#

like box-border?

pearl trail
#

oh yeah box-border mb 😭

#

technically they're box-sizing: border-box

sharp geyser
#

what are you telling me to add box-border to

pearl trail
#

to the content you're adding padding in

sharp geyser
#

oh

#

yea

#

idk how to even pad the content tbh

#

svelte is weird

pearl trail
sharp geyser
#

figured it out

#

thanks so much takiyo

pearl trail
#

your welcome :3

dusky idol
#

Anyway know a python library to make/manipulate gifs using discord bot?
Like I've seen some bots do it
I can manipulate images using PIL but i've no idea about how gifs work

pearl trail
#

frame = Image.open(inGif) it gives frames on gif

#

using PIL

#

then you can do smth similar like this to combine the frames im1.save("out.gif", save_all=True, append_images=[this is the images], duration=100, loop=0)

lyric mountain
#

semitransparent surfaces will basically steal 50% of your color palette, and depending on complex the gif is you're heavily constrained in both size and duration

sharp geyser
#

What you guys think

#

I have no plans to change it rn because i've been working on the backend + frontend for the past 12h but any feedback is nice

#

I think I might get rid of the vidcord in the mobile view and replace it with the search outline

#

Not sure

lyric mountain
#

it needs a logout button

sharp geyser
#

well yes

#

That is all test stuff

#

:p

#

Sorry forgot to mention its still slightly WIP

lyric mountain
#

ah

sharp geyser
#

Im thinking of just making logout appear in the settings tab

#

idk tho

#

I feel like if I add too much to the navbar it will start looking cluttered

#

πŸ˜”

lyric mountain
#

nonono please dont

#

logout at popup menu

#

the worst thing is having to go to a whole different page to find the logout button

sharp geyser
#

fair enough

#

I can add it as its own divider

#

right below settings

lyric mountain
#

in red

sharp geyser
#

yuh

#

Making a note cuz im too tired to do it rn

#

I've been working on the frontend and backend for 12h

#

my protected routes on the backend was broken for like 4h

#

and it was because of a typo

#

😭

lyric mountain
#

lul

sharp geyser
#

turns out my surrealdb query

#

I needed to specify users not user

#

which was why it was failing to get the user so it was like "Oh you aren't logged in fuck outta here"

hasty falcon
#

hi, how to make interval at topgg-autoposter

const { AutoPoster } = require("topgg-autoposter");

module.exports = (client, logger) => {
  const ap = AutoPoster(
    "secret",
    client
  );

  ap.on("posted", () => {});

  ap.post();

  setInterval(() => {
    ap.post();
  }, 21600000);

  return ap;
};```
doesn't work
quartz kindle
#

the name "autoposter" already tells you that it posts automatically

surreal sage
#

why did youtube delete my HD versions of videos

#

shit is just 480p now πŸ’”

deft wolf
hasty falcon
#

I added the interval because in the console log topgg-autoposter was spamming, and it resulted in being limited to the API lol

#

but after i added interval nothing changed

quartz kindle
#

is your bot sharded?

hasty falcon
quartz kindle
#

is your bot sharded?

hasty falcon
quartz kindle
#

idk then

hasty falcon
#

but I think now the problem is solved because I moved it to main.js (maybe it works)

const { AutoPoster } = require("topgg-autoposter");
  const ap = AutoPoster(topGGToken, client);

  ap.on("posted", (stats) => {
    logger.info(`Posted stats to Top.gg | ${stats.serverCount} servers`);
  });```
quartz kindle
#

maybe

neon leaf
hasty falcon
#

its work πŸ˜„

deft wolf
lyric mountain
quartz kindle
#

user+pass login disabled

#

:^)

neon leaf
#

yes

neon leaf
quartz kindle
#

i mean, OwO?

neon leaf
#

is that a yes

quartz kindle
#

now you have an owo version :^)

sharp geyser
#

Do tailwind breakpoints just not matter?

#
        <div class="sm:hidden">
            <NavBrand href="/">
                <span class="">Vidcord</span>
            </NavBrand>
        </div>
#

I am fairly certain that sm:hidden does not mean to fucking hide it on my not so small screen

#

Its literally 2x as much as what the breakpoint is for sm

#

yet it hides until I go into dev tools and emulate a smaller device

lament rock
#

unpredictable frameworks :(

#

Just use sass or pure css

sharp geyser
#

Its like all of a sudden the breakpoints broke

#

and idek how

sharp geyser
lament rock
#

sass is actually just a more fun version of css

sharp geyser
#

Wait a second

#

why is it back now

#

bro what is my frontend doing

scenic kelp
#

it needs a default to fall back to

sharp geyser
#

yea

#

otherway around

scenic kelp
#

or maybe not visible but whatever the equivalent is

sharp geyser
#

hidden md:block

#

or smth

#

it needs a default since tailwind is mobile first

scenic kelp
sharp geyser
#

it applies to all screens then you are to set breakpoints are larger screens to change its default behaviour

#

Well it looks better on mobile :)

scenic kelp
#

"i am getting a logical error in this framework"
"uhhhhh errr don't use the framework"

surreal sage
#

retardlint

#

(should use @typescript-eslint/no-shadow)

quartz kindle
#

nested css is so damn nice to work with

lament rock
#

It is nice which was the main draw for sass for me

#

but then I learned how to do it in raw css and just decided to ditch the build step since I have too much tooling

quartz kindle
#

but out of anything, LESS is one of the nicest things i ever tried, its basically just raw CSS but nestable

lament rock
#

Sass is the same except braces are also optional

quartz kindle
#

sass also has some more advanced stuff like variables and expressions no?

lament rock
#

a co dev of my bot at the time we were using sass preferred that

#

Uh idr

#

It's been a while since I just compiled to css and just styled

quartz kindle
#

ye its been a while for me too

sharp geyser
#

not plugging

#

lmk if it works for you

deft wolf
#

Cute puppies

sharp geyser
#

what are you viewing on?

#

pc or mobile?

quartz kindle
#

want a full bug report?

#

(desktop)

sharp geyser
#

I mean sure

#

lmk if you notice anything

#

:D

deft wolf
sharp geyser
#

Huh

#

is it overflow-x

#

I wonder what's causing that

quartz kindle
#

squares not centered on screen, horizontal scroll bar appears, search bar moves by itself once page loads

sharp geyser
#

the search bar is something even I dont know how to fix

#

horizontal search bar is weird because its not replicating for me

#

I can try and look into it

quartz kindle
sharp geyser
#

lmk if the horizontal is still there

quartz kindle
sharp geyser
#

πŸ™

#

Now then

#

the squares

#

Which ones?

quartz kindle
sharp geyser
quartz kindle
#

only happens at some widths

sharp geyser
#

Wtf is happening

#

can you try refreshing?

#

Its not happening on my end

#

I made some changes

quartz kindle
#

nop

sharp geyser
#

wtf is happening

#

It has to with grids

quartz kindle
#

idk much about grids

#

flexbox better

sharp geyser
#

idk how to do this in flexbox

#

πŸ’€

#

grids are easier

quartz kindle
sharp geyser
#

yea

#

Im seeing that now

quartz kindle
#

is there a max width defined somewhere for the images?

sharp geyser
#

nope

quartz kindle
#

also this

#

the search bar moves on load

sharp geyser
#

Yea

#

idk how to fix that atm

#

I was looking into it

#

right so

#

ima fix 1 problem first and move on

#

If you refresh the site

#

you will notice some changes

#

flex flex-row flex-wrap gap-2 lg:gap-4

#

this is the current css for it

#

problem is

#

empty space on large screens

#

as well as other sizes too

#

I can use justify-center to center it, but that wates a lot of space

quartz kindle
#

justify-content: space-evenly;

sharp geyser
#

yikes

quartz kindle
#

hmmm

sharp geyser
#

Even the gap on larger screens is kinda much

quartz kindle
#

add that to the items

sharp geyser
#

wow

#

basis-content isn't a fucking thing

#

πŸ˜”

quartz kindle
#

wat

sharp geyser
#

its a tailwind thing

#

sorry

#

you'd think tailwind would have basis-content but ig not

quartz kindle
#

lel

sharp geyser
#

that did nothing

sharp geyser
quartz kindle
#

not the container

sharp geyser
#

wait what

quartz kindle
#

flex-grow and flex-basis are child properties

sharp geyser
#

thats a lot of classes

#

I have to add that to every single card?

quartz kindle
#

yes

sharp geyser
#

alright

#

w

scenic kelp
#

???

#

are you manually typing out the cards?

sharp geyser
#

rn I am

#

it will be automated ofc

quartz kindle
#

typical css framework user

scenic kelp
#

just do an {#each} for now

sharp geyser
#

idk how that works

#

O

scenic kelp
#

are you using svelte?

sharp geyser
#

yes

quartz kindle
#

why create css rules for your specific use case when you can slap 500 class names with generic rules instead

sharp geyser
#

I dont have any actual data to display rn, I just want to make sure that when I do display it, it will look fine

scenic kelp
#
{#each [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] as i}
  <div>{i}</div>
{/each}```
#

where you replace the inner part with your video cards

sharp geyser
#

do I have to do as i?

scenic kelp
#

yes

#

as is necessary

sharp geyser
#

ewwwww

#

😭

scenic kelp
#

looking at how youtube does it is probably the best ngl

#

from the looks of how they do it it's just a flex grid

sharp geyser
#

I was using grids at first

#

but I was having problems as well

scenic kelp
#

grid is more suited to this than flex

quartz kindle
#

i mean, isnt this what you wanted?

sharp geyser
#

no

#

not at all

quartz kindle
scenic kelp
#

the last row though

sharp geyser
#

thats not the issue tim

#

its the last row

scenic kelp
#

which would be avoided if you use grid

sharp geyser
#

is there like a grid-cols-max or smth in tailwind

scenic kelp
#

you just set different cols with breakpoints

#

i would say it looks annoying trying to make it so that when you resize it keeps your scroll position but youtube also gives up on that so it's a non issue

sharp geyser
#

yea no

#

thats annoying

sharp geyser
#

I got it looking fine on every other common resolution

#

and yet on mobile it looks shit

scenic kelp
#

center the container

sharp geyser
#

how do you center a grid container?

#

I thought it was only possible with flexbox

scenic kelp
#

parent flex container idk

quartz kindle
#

and remove the max-width from the items

sharp geyser
#

I got it

#

good ol m-auto and justify-center

#

Right tim try it out now

quartz kindle
#

i removed this and it fixed the mobile problem

sharp geyser
#

idk where thats being applied

#

as it does it automatically

#

thats not in my css class tree

#

so it must be tailwind applying it somehow

#

or flowbite

quartz kindle
#

idk its in the class list

sharp geyser
#

im not using max-w-sm anywhere myself

#

I just did a project wide search

#

yea no im not using it myself

#

unless one of the classes I use uses it under the hood

#

and or flowbite

quartz kindle
#

add another class to override it then

#

exdee

sharp geyser
#

I found something that works

#

You can try it out now if you want

#

Some widths will be broken because I don’t have the mental capacity to try and cover them all

#

I covered all the common screen widths

#

Mobile tablet laptop desktop and even larger screens

quartz kindle
#

width:100% works well for me

#

except for the 1 column layout

#

removing the max-width fixes the 1col layoiut for me

sharp geyser
#

I wish the content would grow to fit the screen on smaller screens

#

Oh well

#

now i have a layout for it

#

I can always change it in the future

quartz kindle
#

it does no?

sharp geyser
#

not really the cards remain 1 fixed size

#

only shrinking or growing if there are too many in the col/row

quartz kindle
#

or what size are you talking about

#

the text?

sharp geyser
#

the card itself

#

On a mobile screen when its 1 columb

#

i want the card to fit the screen

quartz kindle
#

like this no?

sharp geyser
#

yea

quartz kindle
#

or you want it to grow vertically?

sharp geyser
#

nah just fit the screen like that

quartz kindle
#

well i just showed you how i did it lol

sharp geyser
#

right

#

but idfk whats causing it

quartz kindle
#

the max-width rule

sharp geyser
#

yea no

#

I just did max-w-none

#

and it changed nothing

quartz kindle
#

you need to combine it with width:100% on the grid

sharp geyser
#

oh pog

#

it worked

#

:D

#

oh yikes on the Iphone pro max its going to look weird

#

πŸ’€

quartz kindle
#

did you save? still old width for me

sharp geyser
#

yea

#

just refresh

quartz kindle
#

already did

#

still like this for me lol

sharp geyser
#

oh thats applying to the card's themselves

#

you should of told me that

#

I thought it was on the entire grid

#

like

#

grid level

quartz kindle
#

i thought you saw it on the video

#

exdee

sharp geyser
#

Now try again

#

I had to apply both properties to the grid and the grid items

#

πŸ’€

quartz kindle
#

ok now it looks good

sharp geyser
#

Also

#

It fixes the brokeness between breakpoints it looks like

quartz kindle
#

ye

#

i also dont see the problem on iphone max

sharp geyser
#

Yuh

#

I had to apply it at grid level

#

and on the items themselves

#

I hate repeating things

quartz kindle
#

:^)

sharp geyser
#

I wish css applied everything to its children

#

ig its to give you more control

#

but like

quartz kindle
#

some rules do, others dont because the children already have defaults

#

like, some rules have fixed defaults, others have "get it from the parent" default

sharp geyser
#

icic

#

makes sense

#

BUT

#

IT WORKS NOW

#

SO IDC

#

TIM

#

WHILE YOU ARE HERE

#

shit

#

I hit caps lock

quartz kindle
#

took you a whole roadtrip to flexbox land (my fault kinda) but you did it xD

sharp geyser
#
import { writable } from 'svelte/store'

interface User {
    id: number,
    email: string,
    first_name: string,
    last_name: string,
    is_verified: boolean,
    is_premium: boolean,
    is_staff: boolean
}

function createStore(user: User | null) {
    // Will likely need update
    const { subscribe, set } = writable(user);

    function add(user: User) {
        set(user);
    }

    function remove() {
        set(null)
    }

    function get(): User | null {
        let user: User | null;

        const unsubscribe = subscribe(value => user = value);

        unsubscribe()

        return user!;
    }

    return { subscribe, add, remove, get }
}

export const user = createStore(null);

is this how you use stores?

#

and when I go to say log them in

#

i'd call user.add(detailsFromApi)

#

and then i can dispaly that on the navbar

#

with user.get().first_name

#

As well as anywhere else I need access to their user profile?

#

All it takes is importing user right?

quartz kindle
#

uh

#

no idea xD

#

this is the docs example tho:

<script>
    import { writable } from 'svelte/store';

    const count = writable(0);
    console.log($count); // logs 0

    count.set(1);
    console.log($count); // logs 1

    $count = 2;
    console.log($count); // logs 2
</script>
#

so you technically shouldnt need the subscribe function, unless you want to use it for something more advanced

#

but the whole reactivity thing is to allow you to directly bind the variables to your html

#

and do for example ```html
<p>{$user.first_name}</p>

#

and have that html autoupdate when you do user.set(data)

sharp geyser
#

hm

#

I see thanks

#

oh god tim

quartz kindle
#

disclaimer: i like svelte, and talk a lot about svelte, but i have actually never used svelte myself

sharp geyser
#

the responsiveness

#

sucks on the join page

quartz kindle
#

what part?

sharp geyser
#

one sec

#

can you see if it looks for you?

#

Idrk how to test responsiveness that well

quartz kindle
#

its fine for a login box to have a fixed size, but if you wanna make it autoscale do something that scales very little

quartz kindle
sharp geyser
quartz kindle
#

but i usually do a combination of minwidth maxwidth and calc

#

ie width: calc(12rem +(100% / 6));

sharp geyser
#

Ive never used calc

quartz kindle
sharp geyser
#

Right but why 100% /6

quartz kindle
#

100% width divided by 6

sharp geyser
#

Right but for what? Why 6

quartz kindle
#

to make it scale less

sharp geyser
#

So 6 is a random number

quartz kindle
#

ye

sharp geyser
#

I see

quartz kindle
#

like if you increase window size by 500px

sharp geyser
#

Ill give it a try when i get home

quartz kindle
#

width = 100% would be width = 500

#

but width = 100% / 5 would increase width by 100 instead of by 500

sharp geyser
#

Yea

#

Makes sense

quartz kindle
#

so basically thats what i usually go for:
min-width for minimum size
max-width for maximum size
width: calc(some fixed px + (some window percentage / some number))

#

to create a certain "level" of scaling, ie controlling the steepeness of the scaling

#

like for every 100 px of window, change width of element by 15px

sharp geyser
#

I see

#

thanks :)

#

Also should my backend do redirecting on success, or should I send status codes and what not then handle that on frontend

quartz kindle
#

personal preference

#

i personally like handling things on the frontend more

sharp geyser
#

Well error stuff I want to handle on the backend I think

quartz kindle
#

make a fetch request, handle result, change page or redirect if needed

sharp geyser
#

It would be kind of hard to do so on the frontend I think

#

because errors can happen for any reason

quartz kindle
#

yes but you need to send them to the client anyway

#

so instead of sending a full html response, send a json response and make the client paint/draw the html

sharp geyser
#

well yea

#

thats what im doing

#

What I mean is

#

say they aren't logged in and visit a page requesting protected content

#

the backend should do the redirecting then

#

not the frontend

quartz kindle
#

if you have such a page, ye

#

but for things like

#

the same page with different content whether user is logged in or not

#

(ie displaying the username in the nav bar)

#

that can be done on the frontend

sharp geyser
#

oh yea no

#

Im doing that 100% on the frontend

#

Right

#

I think i made it scale nicer

#

UGH

#

I hate this

#

I am trying to center the login form

#

but when I do it makes it overflow-x

quartz kindle
#

wasnt it already centered?

sharp geyser
#

I mean

#

centered x wise yea

#

ig it doesn't matter if its directly in the center

#

uh oh stinky

#

I have to refresh for the form to be there

#

I hope its a me issue

quartz kindle
#

you mean vertical centering?

sharp geyser
#

ok yea its a me issue

#

if I visit login in incognito it pops up fine

#

phew

sharp geyser
#

I swear I can never remember which is which

#

😭

#

wait

quartz kindle
#

no like

sharp geyser
#

no

quartz kindle
#

horizontal is <->

sharp geyser
#

horizontal is going left to right

quartz kindle
#

vertical is up down

#

lmao

sharp geyser
#

vertical is up and down

#

bruh im dumb

#

excuse me

#

😭

#

but yea I wanted it vertically centered

quartz kindle
#

so you want up-down centering?

sharp geyser
#

but ig it doesnt matter

#

yuh

quartz kindle
#

height: calc(100vh - 5rem)

#

100vh = 100% view height
5rem = height of the topbar (or rather, the current margin-top)

sharp geyser
#

what should I apply that too?

#

the main div that has the <slot></slot> in it

#
<div class="box-border flex h-full w-full pl-2 pr-2 pt-20">
    <slot></slot>
</div>

#

looks like this

quartz kindle
#

the box-border has pt-20, which is padding top 5rem
so the child element has the entire page of space, minus that margin top

sharp geyser
#

yea

#

that pt-20 is for the navbar

#

since its fixed

quartz kindle
#

ye

#

so you can calculate the height as 100% minus 5rem

#

but percentage height doesnt work very well, so you use 100vh instead

#

vh is view height, aka window height

sharp geyser
#

hmm

#

that didnt work

quartz kindle
#

you put it on the parent

#

put it on the child

#

the <slot> element

sharp geyser
#

you cant

#

stuff doesnt apply on it

quartz kindle
#

wut

sharp geyser
#

thats why I wrapped it in a div

#

because nothing was applying to the slot itself when I put it on it

quartz kindle
#

i mean

#

this is how it renders for me

#

you have to put it in that flex h-full div

#

the one that contains gthe form

sharp geyser
#

you said put it on the slot

quartz kindle
#

thats what you showed me

quartz kindle
#

i imagined the <slot> is whatrever goes inside that div

sharp geyser
#

ah

#

no

#

slot is the content of the pages

quartz kindle
#

yeah thats what i meant

#

put it on the child of the box-border element

sharp geyser
#

gotcha

#

well

#

either I am doing smth wrong still

#

or you can't use calc in tailwind

quartz kindle
#

you added it to the form now

#

lol

sharp geyser
#

no

quartz kindle
#

ah nvm

#

thats the width calc

sharp geyser
#

yea

#

which also doesnt work

quartz kindle
#

yeah the height calc is not therer

sharp geyser
#

refresh

#

its there form e

#

for some reason its not hot reloading

#

so you have to refresh

quartz kindle
#

i am refreshing

sharp geyser
#

wtf

#

Its there for me

quartz kindle
#

ah

#

im on the join page

#

you're on login page

#

xD

sharp geyser
quartz kindle
#

yeah that class doesnt seem to work

sharp geyser
#

I guess calc + tailwind

#

dont mix

#

πŸ’€

quartz kindle
#

try witrhout spaces

#

w-[calc(100vh-5rem)]

#

i mean

sharp geyser
#

yea that was the case

quartz kindle
#

of course you have to do it wouthout spaces

sharp geyser
#

spaces dont mix

quartz kindle
#

space = multiple classes

sharp geyser
#

idk what I was thinking

#

😭

quartz kindle
#

lmao

sharp geyser
#

Thanks

#

Now to fix that fucking search bar

quartz kindle
#

my dude added classes h-[calc(100vh, + and 5rem)]

#

nice

sharp geyser
#

whats that

#

O

#

yea

#

I was fucking with shit

#

I dont know if i told you but im ding all my dev on the server

#

cuz cors

#

fuck that

quartz kindle
#

xD

sharp geyser
#

my api and backend couldnt respond to each other on my machine

#

cuz of cors

#

πŸ˜”

#

Right now to fix that search bar

#

idfk why it wont just make up its mind on where to be

#

OHHHH

#

Its because

#

it is deciding on if it should display the outline or the actual search bar

quartz kindle
#

its also moving when the font loads

#

font loading is known to make a page act weird

sharp geyser
#

how tf do I fix that

quartz kindle
#

only way is to wait until the font loads, which also means longer "white page" time

sharp geyser
#
<div class="flex flex-row items-center gap-4">
  <Button color="none" class="md:hidden">
    <SearchOutline />
  </Button>
  <div class={`order-2 hidden md:block md:w-80 lg:w-[38rem]`}>
    <Input id="search-navbar" placeholder="Search" />
  </div>
</div>
#

well this is my current search bar setup

#

πŸ’€

#

its hidden on screens larger than md

#

Looking at the html

#

it moves because it hasn't het fully loaded the Input

#

at least thats what it looks like

quartz kindle
#

if you look at the network tab

#

it moves exactly then the google fonts file loads

#

https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap

lyric mountain
#

I mean, try opening a youtube video in anonymous tab (so u dont get cache) and pause/mute the video

#

youtube page jumps around for like 10 seconds before everything loads

sharp geyser
#

why tf is this available

#

That seems like very bad

quartz kindle
#

ye you shouldnt publish the src files

#

only the build files

#

also

sharp geyser
#

ah wait

#

im running this on dev

quartz kindle
#

i tried reloading the page without dev tools, whcih means without clearing cache

sharp geyser
#

so it probably wont when I build it

quartz kindle
#

and the search bar still moves

#

even tho the fonts dont change

sharp geyser
#

πŸ˜”

quartz kindle
#

wtf

sharp geyser
#

I really dont know

#

I would pay someone (with the money I dont have) to fix it for me

#

πŸ’€

quartz kindle
#

try removing these

#

leave only the width: 100%

sharp geyser
#

what is that on

quartz kindle
#

on the mx-auto flex container

sharp geyser
#

im not seeing one

quartz kindle
#

:^)))

sharp geyser
#

so thats something flowbite adds itself then

#

kind of annoying ngl

sharp geyser
#

Like

#

I really cant

#

πŸ’€

#

Its something flowbite puts in itself

#

I can't control it

#

Honestly tim

#

idrc anymore

#

Who cares it needs like 1s to adjust

#

Well ig my ocd does

#

becaus now I cant get it off my mind

quartz kindle
#

lel

sharp geyser
#

tbh

#

flowbite is so fucking annoying

#

makes me want to rewrite my entire site AGAIN

#

This is the one I almost went with

#

I should of listened to my gut

#

πŸ˜”

quartz kindle
#

xD

sharp geyser
#

right tim

#

should I

#

cuz

#

this searchbar is annoying

#

and I cant modify what flowbite puts in

#

unless I do so at the package level

#

fuck that

frosty gale
#

in case they thought i was lacking

#

security people never lack this hard

quartz kindle
sharp geyser
#

well

#

you are

#

Look at that wide gap between Thank you for using nginx

#

not pro

frosty gale
#

because i added a <br> between it

#

so it stands out more

lyric mountain
#

A BR indeed stands out among others

quartz kindle
#

a Brazilian indeed stands out among others

lament rock
#

Battle Royales dont stand out

proven lantern
#

should i switch to zig from rust?

quartz kindle
#

why

#

because bun used it?

proven lantern
#

my builds would probably be much faster

quartz kindle
#

lmao

sharp geyser
#

:p

#

search bar don't move

#

πŸ˜‰

quartz kindle
#

nice

#

xD

sharp geyser
#

what do you think of the color theme

#

I kind of like it

frosty gale
#

svelte page detected

#

10/10

sharp geyser
#

then again I like purple

#

πŸ’€

#

idk if everyone will like hte purple sadly

#

but I like it

#

πŸ˜”

frosty gale
#

sveltekit in dev mode being open to public detected

sharp geyser
#

I got tired of cors issues with my backend and frontend

#

so I moved both to the server

quartz kindle
#

xD

frosty gale
#

server being vulnerable to regresshion vulnerability detected

#

jk haven't checked

sharp geyser
#

it probably is

#

check for me

#

Idk how to update anything

#

πŸ’€

frosty gale
#

not on pc so can't run nmap

#

literally just ssh -V

sharp geyser
#

πŸ˜”

#

bro

#

where you hitting random endpoints

#

😭

#

I have so many errors in the console

sharp geyser
frosty gale
#

not sure but that may indeed be vulnerable

#

definitely not the latest patch at least

sharp geyser
#

how do I update

#

πŸ˜”

frosty gale
#

run sudo apt get and sudo apt upgrade

sharp geyser
#

Literally the same fucking version

#

😭

quartz kindle
#

are you sure?

#

run ssh -V again

quartz kindle
sharp geyser
#

im running the cmds again

#

but ssh -V indeed shows the same version

quartz kindle
#

your version should be OpenSSH_8.9p1 Ubuntu-3ubuntu0.10

#

literally the same thing but with .10 at the end

sharp geyser
#

its still .7

quartz kindle
#

whats your distro?

sharp geyser
#

ubuntu

quartz kindle
#

22?

sharp geyser
#

there we go

#

I had to re-run the cmds to update and upgrade

#

πŸ’€

quartz kindle
#

ye update then upgrade

sharp geyser
#

alright ima work on the login form now

#

for the 4th time

#

Hopefully I can get the backend and frontend tied together at least when logging in

#

cuz im getting tired of this

green kestrel
#

heads up, theres a guy with the nickname 'alanfoster' going around large bot support servers asking if he can buy your bots if you want to get out of bot dev because of the new monetisation policies. The concent of hoovering up bots like this smells sus to me and possibly a scam. be on your guard!

#

im betting if it IS a scam, hes going to be first of many

sharp geyser
#

@frosty gale are you sniffing around my site again

#

πŸ’€

eternal osprey
#

hey guys, is there any tool and or way to find out how much traffic a wesite is getting?

pearl trail
#

google analytics

#

or just cloudflare

eternal osprey
#

It’s not for a site I own

#

It’s just a random site

sharp geyser
#

I hate my life

harsh nova
sharp geyser
eternal osprey
#

I want to extract how much traffic a site has. Whether it’s life time or just in a span of 1h

#

Based on that I can gain insight on how much a site is being visited

sharp geyser
#

good luck

eternal osprey
#

I am asking for help no luck Mann

pearl trail
#

i don't think that's possible

#

idk law shits but i think if a tracker scraps random website's traffic and much stats, it'd be illegal, wouldn't it?

#

unless the site's company allow it or make it publicly available

sharp geyser
#

Yea I mean

#

Unless a company is willingly giving that information to the public its a good luck situation

sharp geyser
#

right

#

im obviously doing this state inside svelte thing completely wrong

#

I've logged in, login api endpoint returns user data, I call user.set(jsonData) and nothing seems to happen

#

I have my navbar reading this and will set an avatar if the data is not null otherwise it displays Login, well it never updates soooooo

#

user.ts file for storing the store

import { writable } from 'svelte/store'

export interface User {
    id: number,
    email: string,
    first_name: string,
    last_name: string,
    is_verified: boolean,
    is_premium: boolean,
    is_staff: boolean
}

export const user = writable<User | null>(null)

+page.server.ts file

export const actions = {
    default: async ({ request, fetch }) => {
        const { data: { email, password } } = await superValidate(request, zod(loginSchema))

        let response = await fetch('/api/auth/login', {
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            },
            method: 'post',
            body: new URLSearchParams({
                email,
                password
            })
        })

        user.set(await response.json() as User)
    }
}
#
        <svelte:fragment slot="trail">
            <div class="flex flex-row items-center gap-4">
                <LightSwitch class="hidden md:block" />
                {#if $user != null}
                    <button class="btn rounded-full p-0 pr-2" use:popup={avatarPopup}>
                        <Avatar src="" background="bg-secondary-500 w-[3rem]">J</Avatar>
                    </button>
                {:else}
                    <a href="/login">Login</a>
                {/if}
            </div>
        </svelte:fragment>
#

and then I use it like so inside my main +layout.svelte importing user from $lib

quartz kindle
earnest phoenix
#

today is not my day, im having a brain fart. what am i doing wrong

solemn latch
#

and this is why space based syntax is awful

earnest phoenix
#

i fixed it

#

but now its sending twice

#

it sends every minute after that only once

surreal sage
#

are there any tools for testing react sites

lyric mountain
#

well, depends on what u mean by "test"

solemn latch
#

yeah "react developer tools" its an extension for browsers.
If thats what youre asking for

surreal sage
#

oops

#

i mean like

#

cli

#

stuff

#

but now that i say it

#

there def isn't

solemn latch
#

The react compiler might come with some stuff you're looking for

past field
#

i know 422 lines is wild but it’s worth it.. haha

solemn latch
#

Wow, you've come a long way ^-^

quartz kindle
#

await i.deferUpdate(); // Ensure the interaction is acknowledged

lyric mountain
past field
lyric mountain
#

deferring is telling discord you received the event, but it'll take a while to answer

quartz kindle
#

you cannot use both on the same interaction

past field
#

ah

#

ok so I don't need line 253

quartz kindle
#

you either reply directly, or you defer and later on edit (not reply)

quartz kindle
past field
#

okay gotcha

past field
quartz kindle
past field
#

that would cause the error?

quartz kindle
#

yes

past field
#

thank you tim!

quartz kindle
#

if you want to use defer (although not really required here), this is the correct way of using it:

past field
#

@quartz kindle you should give the game a try haha

quartz kindle
#
// as soon as the interaction is received
await interaction.defer(); // replaces reply

// do other things

await interaction.editReply(); // editReply instead of reply because the defer is the original reply
quartz kindle
#

its actually a very creative game

#

been a while since ive seen something new that isnt the 768769879th copy of the same things

normal badge
#

@quartz kindle ur bot, astro uses d.js?

quartz kindle
normal badge
normal badge
quartz kindle
#

oh wut

#

works for me tho

normal badge
#

i just ran /command help and it's stuck on thinking/deferring -- that's the only other thing i've received

quartz kindle
past field
lyric mountain
quartz kindle
past field
#

so you didn’t see anything else that would possibly cause interaction failed?

past field
#

like any race conditions

quartz kindle
#

i didnt look for other issues

past field
quartz kindle
past field
past field
surreal sage
#

81.6% documentation

sharp geyser
sharp geyser
#

@frosty gale how the fuck does state work

#

It is not as easy as everyone makes it out to be

#

Not if you are wanting to store the user data after they login

#

because you can't do this on the server (e.g +page.server.ts)

digital swan
#

For auth I do an api fetch in the layout onMount then set it to a store

#

But obviously still checking server side for any auth protected stuff

sharp geyser
#

thing is im not using svelte's backend system

#

I am using an external backend api so I have to make fetches to it

#

which you can't do and store the user data

digital swan
#

Why not

sharp geyser
#

Well, because I just asked in the svelte server and they went on some speel about I can't and that I should use the svelte backend instead

digital swan
#

Peculiar

#

I mean I’m no web dev expert but that works best for my stuff and I haven’t ran into any trouble with it

#

Makes page data caching easy too

quartz kindle
#

using store + context

sharp geyser
#

im confused

#

that just shows react

sharp geyser
#

is it suggesting I do fetching in the +page.svelte itself?

#

I have no idea if its okay to do api fetches in the page itself

#

but fuck it we ball

eternal osprey
#

hey guys, currently i know only these languages:
haskell, assembly (just a bit), java, js, python, scala, c++/c, (htm/css, not really languages but whatever).
What language should i extend my stack with?
I am most likely a backend programmer that works with data as data engineer, though i also like to create websites in my spare time.

sharp geyser
#

That's like asking what should I put on my hotdog

#

It depends on what you want or like to do

#

If you want to do some webdev, then continue using html and css and js

#

if you want to do backend programming, pick a language that you are comfortable with and use it to make apis and applications

quartz kindle
#

rust, lua, zig, julia, nim

#

crystal, swift, elixir

#

php

sharp geyser
#

elixir is a fun one

quartz kindle
#

like forget about svelte for a second

#

at which point of the page loading do you want to fetch?

#

on which pages?

#

what do you want to do with the data after fetching?

sharp geyser
#

Well, I want to fetch when they submit the login form. Then I want to use this data on the navbar and any other pages like settings or dashboard that uses information about the user.

quartz kindle
#

you need to use either cookies or localstorage to persist the data between pages

#

unless you are going for an SPA (single page application)

sharp geyser
#

but

#

I am already setting a cookie for the session

quartz kindle
#

yes but the data itself, unless you want to fetch it again on every page load

sharp geyser
#

Right

quartz kindle
#

or include it from the server side

sharp geyser
#

but isn't that the point of stores/context?

quartz kindle
#

no

sharp geyser
#

Then what the fuck is the point of them

quartz kindle
#

svelte stores are not localstorage nor cookies

#

svelte stores are for sharing data between svelte components

#

but its all still js data

#

in memory

#

by default its not persistent

sharp geyser
#

Then why do people make svetle stores seem like some catch all solution

quartz kindle
#

because they dumb

sharp geyser
#

so wait

quartz kindle
#

but thats how frameworks work

#

frameworks have "components", which are independent pieces of content on a page

#

and they are supposed to be self-contained

#

and not bleed into each other

#

so frameworks have these kind of storage systems to enable data sharing between components

sharp geyser
#

What should I even do then?

quartz kindle
#

ie share the same data between footer and header

sharp geyser
#

set a cookie when they login containing the user data?

quartz kindle
#

a server-only cookie cannot be accessed from js

#

you usually use server-only cookies for sessions

#

for data you can use localstorage

sharp geyser
#

well here's the thing

#

what I use for form validations

#

requires a server action

#

πŸ’€

quartz kindle
#

yes

#

you have two types of client-server interactions

#

data that the server includes on page load

#

and data that you fetch from js

#

if you're working with pure html pages, no server side rendering, then you dont have the first one

#

but if you have server side rendering as well, then you can do both at once, login and add data to html