Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .rusty-hook.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[hooks]
pre-commit = "cargo fmt --all && leptosfmt src"
pre-commit = "cargo fmt --all && cargo make cargo-format && cargo make leptos-format"
post-commit = "echo yay"

[logging]
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
"strings": true
},
"css.validate": false,
"rust-analyzer.cargo.features": ["development", "ssr"]
}
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ npm install
cargo install cargo-make
```

### Si usas nix

> [!NOTE]
> Asegúrate de tener los flakes activados.

Expand Down Expand Up @@ -72,7 +70,8 @@ Agrega esto en tu `settings.json`
"comments": "on",
"strings": true
},
"css.validate": false
"css.validate": false,
"rust-analyzer.cargo.features": ["development", "ssr"]
}
```

Expand Down
Binary file added assets/RustLang_uwu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Rust_Transparent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[toolchain]
components = ["rust-analyzer", "rustfmt", "clippy"]
channel = "nightly-2024-02-12"
profile = "minimal"
targets = ["wasm32-unknown-unknown"]
16 changes: 6 additions & 10 deletions src/app.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use leptos::{component, view, IntoView};
use leptos_meta::{provide_meta_context, Body};
use leptos_router::{Router, Routes, StaticParamsMap, StaticRoute};
use leptos_router::{Route, Router, Routes, StaticParamsMap, StaticRoute};

use crate::{
components::{Footer, HeadInformation, Header},
Expand All @@ -19,19 +19,15 @@ pub fn App() -> impl IntoView {

view! {
<Router>
<HeadInformation/>
<HeadInformation />
<Body class=format!(
"bg-orange-200 dark:bg-[#131313]/90 bg-center bg-fixed {} dark:bri dark:bg-cover dark:bg-blend-darken dark:backdrop-blur-xl overflow-x-hidden dark:text-[#e2cea9]",
bg_in_dark_mode,
)/>
<Header/>
) />
<Header />
<main>
<Routes>
<StaticRoute
path="/"
view=Index
static_params=move || Box::pin(async move { StaticParamsMap::default() })
/>
<Route path="/" view=Index />
<StaticRoute
path="/comunidades"
view=Communities
Expand Down Expand Up @@ -59,7 +55,7 @@ pub fn App() -> impl IntoView {
/>
</Routes>
</main>
<Footer/>
<Footer />
</Router>
}
}
10 changes: 5 additions & 5 deletions src/components/cards/community_card.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ pub fn CommunityCard(
loading="lazy"
alt=brand_alt
/>
<CardTitle texts=name/>
<CardTitle texts=name />
<p class="font-work-sans text-black dark:text-white">{description}</p>
</div>
<span class="ml-auto">
{move || match icon {
"discord" => view! { <DiscordIcon size=30/> },
"github" => view! { <GithubIcon size=30/> },
"telegram" => view! { <TelegramIcon size=30/> },
"web" => view! { <WebIcon size=30/> },
"discord" => view! { <DiscordIcon size=30 /> },
"github" => view! { <GithubIcon size=30 /> },
"telegram" => view! { <TelegramIcon size=30 /> },
"web" => view! { <WebIcon size=30 /> },
_ => unreachable!(),
}}

Expand Down
11 changes: 5 additions & 6 deletions src/components/cards/contributor_card.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ pub fn ContributorCard(
</span>
</span>
<div class="flex flex-col gap-y-2">
<img src=brand_src width="60" class="rounded-full mb-4" alt=name.clone()/>
<img src=brand_src width="60" class="rounded-full mb-4" alt=name.clone() />
<h2 class="font-work-sans text-black dark:text-white text-xl">{name}</h2>
{location
.map(|location| {
view! {
<div class="flex gap-2 items-center bg-slate-200/20 dark:bg-neutral-500/40 rounded-md p-1">
<LocationIcon size=16/>
<LocationIcon size=16 />
<p class="font-work-sans text-black dark:text-white text-sm">
{location}
</p>
Expand All @@ -43,12 +43,11 @@ pub fn ContributorCard(
.map(|twitter| {
view! {
<a href=format!("https://twitter.com/{}", twitter) target="_blank">
<TwitterIcon size=30/>
<TwitterIcon size=30 />
</a>
}
})}
<a href=link target="_blank">
<GithubIcon size=30/>
})} <a href=link target="_blank">
<GithubIcon size=30 />
</a>
</div>
</article>
Expand Down
5 changes: 2 additions & 3 deletions src/components/cards/project_card.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ pub fn ProjectCard(
/>
}
.into_any()
}}
<CardTitle texts=name/>
}} <CardTitle texts=name />
<p class="mt-2 font-work-sans text-black dark:text-white">{description}</p>
</div>
<div class="flex gap-4 sm:gap-0 justify-around items-center mt-4">
Expand All @@ -57,7 +56,7 @@ pub fn ProjectCard(

</ButtonLink>
<span class="px-1">
<GithubIcon size=30/>
<GithubIcon size=30 />
</span>
</div>
</a>
Expand Down
2 changes: 1 addition & 1 deletion src/components/community_projects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub fn CommunityProjects(#[prop(default = false)] show_more: bool) -> impl IntoV
>
"Ver todos los proyectos"
<span class="inline-block ml-2">
<NextIcon class="fill-current" size=20/>
<NextIcon class="fill-current" size=20 />
</span>
</A>
</div>
Expand Down
32 changes: 16 additions & 16 deletions src/components/head_information.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,37 @@ pub fn HeadInformation() -> impl IntoView {

view! {
<>
<Html lang="es"/>
<Meta charset="utf-8"/>
<Meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#fed7aa"/>
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#181811"/>
<Stylesheet id="fonts" href=format!("{}/fonts.css", assets_folder)/>
<Stylesheet id="leptos" href="/pkg/leptos_start.css"/>
<Title text="Rust Lang en Español"/>
<Html lang="es" />
<Meta charset="utf-8" />
<Meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#fed7aa" />
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#181811" />
<Stylesheet id="fonts" href=format!("{}/fonts.css", assets_folder) />
<Stylesheet id="leptos" href="/pkg/leptos_start.css" />
<Title text="Rust Lang en Español" />
<Meta
name="description"
content="Únete a nuestra comunidad de Rust en español. Promovemos el aprendizaje y la difusión de Rust, compartiendo conocimientos y proyectos emocionantes."
/>

<Meta name="og:site_name" content="Rust Lang en Español"/>
<Meta name="og:title" content="Bienvenidos a Rust Lang en Español"/>
<Meta name="og:site_name" content="Rust Lang en Español" />
<Meta name="og:title" content="Bienvenidos a Rust Lang en Español" />
<Meta
name="og:description"
content="Únete a nuestra comunidad de Rust en español. Promovemos el aprendizaje y la difusión de Rust, compartiendo conocimientos y proyectos emocionantes."
/>
<Meta name="og:url" content="https://rustlang-es.org"/>
<Meta name="og:url" content="https://rustlang-es.org" />

<Meta name="twitter:card" content="summary_large_image"/>
<Meta name="twitter:site" content="@rustlang"/>
<Meta name="twitter:card" content="summary_large_image" />
<Meta name="twitter:site" content="@rustlang" />
<Meta
name="google-site-verification"
content="OntIe2SKuQalaapGvxdded9tU4G2p57h0A6e0Rkoni0"
/>

<Meta name="og:image" content=format!("https://rustlang-es.org/{preview}")/>
<Meta name="twitter:image" content=format!("https://rustlang-es.org/{preview}")/>
<Link rel="canonical" href=format!("https://rustlang-es.org{}", path)/>
<Meta name="og:image" content=format!("https://rustlang-es.org/{preview}") />
<Meta name="twitter:image" content=format!("https://rustlang-es.org/{preview}") />
<Link rel="canonical" href=format!("https://rustlang-es.org{}", path) />
<script type="text/javascript">
(function(c,l,a,r,i,t,y){
if ("localhost0.0.0.0::0192.168.0.1192.168.1.1".includes(document.location.hostname)) return;
Expand Down
2 changes: 1 addition & 1 deletion src/components/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub fn Header() -> impl IntoView {
<div class="container mx-auto px-4 flex items-center justify-between flex-col lg:flex-row">
<div class="flex justify-between w-full lg:w-auto">
<a href="/" exact=true class="flex items-center gap-x-4">
<LogoRustPageIcon size=80/>
<LogoRustPageIcon size=80 />
</a>
<button
class="lg:hidden"
Expand Down
74 changes: 49 additions & 25 deletions src/components/hero.rs
Original file line number Diff line number Diff line change
@@ -1,38 +1,62 @@
use crate::components::SloganButton;
use leptos::{component, view, IntoView};
use leptos::{island, view, IntoView, SignalGet};
use leptos_router::use_query_map;

#[component]
#[island]
pub fn Hero() -> impl IntoView {
let image_src = if cfg!(debug_assertions) {
"./assets/ferris-hero.avif"
let query_params = use_query_map();

let image_src = if query_params.get().get("uwu").is_some() && cfg!(debug_assertions) {
"./assets/RustLang_Uwu.png"
} else {
"/ferris-hero.avif"
"./assets/ferris-hero.avif"
};

let uwu = query_params.get().get("uwu").is_some();

view! {
<section class="grid items-center py-14 lg:py-32 px-4 gap-x-20 gap-y-10 lg:grid-cols-2 w-full">
<section
class=(
"grid items-center py-14 lg:py-32 px-4 gap-x-20 gap-y-10 lg:grid-cols-2 w-full",
move || uwu == false,
)
class="grid items-center justify-center"
>
<figure class="w-80 mx-auto lg:w-full">
<img
src=image_src
alt="Rust Lang en Español"
height="300"
width="500"
class="ml-auto"
/>
{if !uwu {
view! {
<img
src=image_src
alt="Rust Lang en Español"
height="300"
width="500"
class="ml-auto"
/>
}
} else {
view! {
<img src=image_src alt="Rust Lang en Español" height="700" width="700" />
}
}}
</figure>
<div>
<h1 class="flex flex-col mb-4 gap-y-2">
<span class="font-work-sans text-4xl font-light text-center lg:text-left">
"Bienvenidos a"
</span>
<span class="font-alfa-slab text-orange-500 dark:text-orange_(pantone)-500 text-6xl sm:text-7xl lg:text-8xl text-center lg:text-left">
"Rust Lang"
</span>
<span class="font-work-sans text-5xl font-semibold text-center lg:text-left">
"En Español"
</span>
</h1>
<SloganButton/>
{if !uwu {
view! {
<h1 class="flex flex-col mb-4 gap-y-2">
<span class="font-work-sans text-4xl font-light text-center lg:text-left">
"Bienvenidos a"
</span>
<span class="font-alfa-slab text-orange-500 dark:text-orange_(pantone)-500 text-6xl sm:text-7xl lg:text-8xl text-center lg:text-left">
"Rust Lang"
</span>
<span class="font-work-sans text-5xl font-semibold text-center lg:text-left">
"En Español"
</span>
</h1>
}
} else {
view! { <h1 class="hidden">"UwU"</h1> }
}} <SloganButton uwu=uwu />
</div>
</section>
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/other_communities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub fn OtherCommunities(
>
"Ver todas las comunidades"
<span class="inline-block ml-2">
<NextIcon class="fill-current" size=20/>
<NextIcon class="fill-current" size=20 />
</span>
</a>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/components/our_communities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub fn OurCommunities() -> impl IntoView {
color="white"
size="big"
>
<DiscordIcon size=30/>
<DiscordIcon size=30 />
"Discord"
</ButtonLink>
<ButtonLink
Expand All @@ -31,7 +31,7 @@ pub fn OurCommunities() -> impl IntoView {
color="white"
size="big"
>
<GithubIcon size=30/>
<GithubIcon size=30 />
"Github"
</ButtonLink>
<ButtonLink
Expand All @@ -40,7 +40,7 @@ pub fn OurCommunities() -> impl IntoView {
size="big"
shadow="box"
>
<LinkedinIcon size=30/>
<LinkedinIcon size=30 />
"Linkedin"
</ButtonLink>
<ButtonLink
Expand All @@ -49,7 +49,7 @@ pub fn OurCommunities() -> impl IntoView {
color="white"
size="big"
>
<TelegramIcon size=30/>
<TelegramIcon size=30 />
"Telegram"
</ButtonLink>
</div>
Expand Down
6 changes: 5 additions & 1 deletion src/components/slogan_button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use leptos::{create_signal, island, view, IntoView, SignalUpdate};
use rand::seq::SliceRandom;

#[island]
pub fn SloganButton() -> impl IntoView {
pub fn SloganButton(#[prop(into)] uwu: Option<bool>) -> impl IntoView {
let slogans = [
"Una comunidad de gente mal intencionada y tonta.",
"Rust the lang, not the game",
Expand Down Expand Up @@ -41,6 +41,10 @@ pub fn SloganButton() -> impl IntoView {

view! {
<div
class=(
"flex select-none justify-center lg:justify-center dark:text-white drop-shadow-[7px_7px_2px_rgba(0,0,0,.5)] hover:drop-shadow-none dark:transition-all dark:ease-in-out dark:delay-75 ",
move || uwu == Some(true),
)
class="flex select-none items-center justify-center lg:justify-start group dark:text-white drop-shadow-[7px_7px_2px_rgba(0,0,0,.5)] hover:drop-shadow-none dark:transition-all dark:ease-in-out dark:delay-75 "
on:click=click_handler
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/sponsors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub fn Sponsors() -> impl IntoView {
view! {
<div class="bg-orange-50 dark:bg-transparent">
<div class="max-w-full overflow-clip">
<Separator/>
<Separator />
</div>
<section class="bg-orange-400/30 dark:bg-gray-800/50">
<div class="container mx-auto py-20 px-8">
Expand Down
Loading
Loading