Lofty!
Lofty!
Explore posts from servers
KPCKevin Powell - Community
Created by b1mind on 10/9/2024 in #resources
Google Font Alternative
check if you can subset fonts as per the license... might be a good thing to so as well 👀
16 replies
KPCKevin Powell - Community
Created by Zach on 8/29/2024 in #resources
Email is dead
"We only need one politician's emails not delivered due to poorly implemented or arbitrary hellbans and this will be a hot button issue." sure do hope someone sees this.
8 replies
KPCKevin Powell - Community
Created by Lofty! on 10/1/2024 in #front-end
How do you makes "emoji as a letter" accessible?
thanks <3
25 replies
KPCKevin Powell - Community
Created by Lofty! on 10/1/2024 in #front-end
How do you makes "emoji as a letter" accessible?
oh wow, I come back after a while and.. damn.
25 replies
KPCKevin Powell - Community
Created by Lofty! on 10/1/2024 in #front-end
How do you makes "emoji as a letter" accessible?
all good, got the idea!
25 replies
KPCKevin Powell - Community
Created by Lofty! on 10/1/2024 in #front-end
How do you makes "emoji as a letter" accessible?
Sounds kinda... silly but how would I hide it but ensure that the text remains centered(-ish)? Here's the current component that I have:
<section>
<p><span>I</span>deas go on pages,<br />not in bins.</p>
</section>

<style>
section {
max-width: var(--prose-width);
margin: 0 auto;
padding: 2rem 0.75rem 0 0.75rem;
}

p {
--font-hero-logo: clamp(1.56rem, 1.122rem + 2.19vw, 3.75rem);
font: var(--font-hero-logo) aclonica;
text-align: center;
}

span {
/* dunno what to put here */

&::before {
content: "💡";
}
}
</style>
<section>
<p><span>I</span>deas go on pages,<br />not in bins.</p>
</section>

<style>
section {
max-width: var(--prose-width);
margin: 0 auto;
padding: 2rem 0.75rem 0 0.75rem;
}

p {
--font-hero-logo: clamp(1.56rem, 1.122rem + 2.19vw, 3.75rem);
font: var(--font-hero-logo) aclonica;
text-align: center;
}

span {
/* dunno what to put here */

&::before {
content: "💡";
}
}
</style>
25 replies
KPCKevin Powell - Community
Created by Lofty! on 9/14/2024 in #front-end
How do I use matchMedia in svelte?
interface Params {
query: string;
initial: (matches: boolean) => void;
listener: (list: MediaQueryListEvent) => void;
}

export class MediaQuery {
#queryList: MediaQueryList | undefined;
#params: Params;

constructor(params: Params) {
this.#params = params;
}

mountMediaQuery = () => {
this.#queryList = window.matchMedia(this.#params.query);
this.#params.initial(this.#queryList.matches);

const instance = this.#params.listener.bind(this);
this.#queryList.addEventListener("change", instance);
return () => this.#queryList?.removeEventListener("change", instance);
}
}
interface Params {
query: string;
initial: (matches: boolean) => void;
listener: (list: MediaQueryListEvent) => void;
}

export class MediaQuery {
#queryList: MediaQueryList | undefined;
#params: Params;

constructor(params: Params) {
this.#params = params;
}

mountMediaQuery = () => {
this.#queryList = window.matchMedia(this.#params.query);
this.#params.initial(this.#queryList.matches);

const instance = this.#params.listener.bind(this);
this.#queryList.addEventListener("change", instance);
return () => this.#queryList?.removeEventListener("change", instance);
}
}
let ticking: number | boolean = false;
const onScrollListener = () => {
ticking ||= requestAnimationFrame(() => {
burger = window.scrollY === 0;
ticking = false;
});
};

const mediaQuery = new MediaQuery({
query: "(width >= 768px)",
initial(matches: boolean) {
if (matches) document.addEventListener("scroll", onScrollListener);
burger = matches;
},
listener(list: MediaQueryListEvent) {
burger = list.matches;
if (list.matches) document.addEventListener("scroll", onScrollListener);
else document.removeEventListener("scroll", onScrollListener);
},
});

onMount(mediaQuery.mountMediaQuery);
let ticking: number | boolean = false;
const onScrollListener = () => {
ticking ||= requestAnimationFrame(() => {
burger = window.scrollY === 0;
ticking = false;
});
};

const mediaQuery = new MediaQuery({
query: "(width >= 768px)",
initial(matches: boolean) {
if (matches) document.addEventListener("scroll", onScrollListener);
burger = matches;
},
listener(list: MediaQueryListEvent) {
burger = list.matches;
if (list.matches) document.addEventListener("scroll", onScrollListener);
else document.removeEventListener("scroll", onScrollListener);
},
});

onMount(mediaQuery.mountMediaQuery);
8 replies
KPCKevin Powell - Community
Created by Lofty! on 9/14/2024 in #front-end
How do I use matchMedia in svelte?
Oh, I didn't see this last night 😅 I wrote a tiny utility for this and it worked
8 replies
KPCKevin Powell - Community
Created by Lofty! on 9/14/2024 in #front-end
How do I use matchMedia in svelte?
svelte-match-media has a way to attach event listeners to it? Its docs dont give any examples
8 replies
KPCKevin Powell - Community
Created by Ontex on 8/10/2023 in #front-end
Conditional Type
the only way if extending a type would be like
type Matches<T> = T extends A ? B : T;
type Matches<T> = T extends A ? B : T;
3 replies
KPCKevin Powell - Community
Created by Lofty! on 8/9/2023 in #front-end
How to cause transition to happen from the center instead of top left?
transform's so cool
5 replies
KPCKevin Powell - Community
Created by Lofty! on 8/9/2023 in #front-end
How to cause transition to happen from the center instead of top left?
YES! Thanks a tonnn!
5 replies
KPCKevin Powell - Community
Created by CDL on 6/22/2023 in #os-and-tools
Github Pages
the file names also needa be changed in the html :) @CDL
3 replies
KPCKevin Powell - Community
Created by Lofty! on 4/15/2023 in #front-end
TsParticles, Astro and Svelte
Had none thus far tbh..
3 replies
KPCKevin Powell - Community
Created by Lofty! on 4/13/2023 in #front-end
How to recreate this background effect?
didn't know about it, thanks
5 replies
KPCKevin Powell - Community
Created by Lofty! on 4/13/2023 in #front-end
How to recreate this background effect?
Oh I was looking at a gif
5 replies
KPCKevin Powell - Community
Created by Lofty! on 4/13/2023 in #front-end
How to recreate this background effect?
5 replies
KPCKevin Powell - Community
Created by Lofty! on 3/31/2023 in #back-end
A general curriculum-path thing for Golang
Well, I'm glad it helped someone :D
19 replies
KPCKevin Powell - Community
Created by Lofty! on 3/31/2023 in #back-end
A general curriculum-path thing for Golang
welp, great waste of 90 minutes lol
19 replies