Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
vazw committed May 31, 2024
1 parent 356180a commit 9000f05
Show file tree
Hide file tree
Showing 8 changed files with 785 additions and 761 deletions.
107 changes: 56 additions & 51 deletions src/app/components/donate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,66 +8,71 @@ const LNURL: &str = "LNURL1DP68GURN8GHJ7EM9W3SKCCNE9E3K7MF0D3H82UNVWQHHVCT6WU7PK
pub fn QrCodeCmp() -> impl IntoView {
if leptos::leptos_dom::is_browser() {
let svgs = view! { <div></div> };
let result: String = qrcode_generator::to_svg_to_string(LNURL, QrCodeEcc::Medium, 256, None::<&str>).unwrap();
let result: String =
qrcode_generator::to_svg_to_string(LNURL, QrCodeEcc::Medium, 256, None::<&str>)
.expect("QR Loaded");
svgs.set_inner_html(&result);
svgs
} else {
view! { <div></div> }
}

}

#[component]
pub fn Donate() -> impl IntoView {
view! {
<div class="flex flex-col mt-8 w-9/12 bg-white border border-gray-200 rounded-lg shadow dark:bg-gray-800 dark:border-gray-700 text-center items-center justify-items-center p-5 place-content-center content-center">
<label class="text-xs sm:text-xs md:text-sm text-black dark:text-white">
"บริการนี้ฟรี หากท่านต้องการสนับสนุนค่ากาแฟ และโดเมน."
<br/>
"สามารถใช้ Bitcoin lightning ⚡ เพื่อสนับสนุนเสรีภาพของสังคมพวกเราต่อไป."
<br/> "This service is free, but operating it costs a bit of money and time." <br/>
"If you like it, please consider a small lightning ⚡ donation to keep it alive."
<br/> "Zap me:⚡[email protected]"
</label>
<div class="rounded-lg justify-center items-center border-2 text-white text-xl font-bold p-2 m-2 w-fit self-center">
<QrCodeCmp/>
</div>
<label class="block my-1 text-sm font-medium text-gray-900 dark:text-white">
- หรือ -
</label>
<div class="flex flex-col sm:flex-col md:flex-row lg:flex-row xl:flex-row 2xl:flex-row w-full lg:w-3/4 sm:w-full md:w-full 2xl:w-1/2 xl:w-1/2 text-center items-center justify-items-center p-5 place-content-center content-center">
<div class="w-9/12 flex flex-row">
<input
type="text"
class="text-xs sm:text-xs md:text-sm bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 text-center"
prop:value=LNURL
/>
<button
class="btn btn-accent w-fit text-xs sm:text-xs md:text-sm text-black dark:text-white"
on:click=move |_| {
if let Some(clipboard) = window().navigator().clipboard() {
let _ = clipboard.write_text(LNURL);
} else {
window().alert_with_message("Something went wrong :(").unwrap();
}
}
>
<div class="flex flex-col mt-8 w-9/12 bg-white border border-gray-200 rounded-lg shadow dark:bg-gray-800 dark:border-gray-700 text-center items-center justify-items-center p-5 place-content-center content-center">
<label class="text-xs sm:text-xs md:text-sm text-black dark:text-white">
"บริการนี้ฟรี หากท่านต้องการสนับสนุนค่ากาแฟ และโดเมน."
<br/>
"สามารถใช้ Bitcoin lightning ⚡ เพื่อสนับสนุนเสรีภาพของสังคมพวกเราต่อไป."
<br/>
"This service is free, but operating it costs a bit of money and time."
<br/>
"If you like it, please consider a small lightning ⚡ donation to keep it alive."
<br/> "Zap me:⚡[email protected]"
</label>
<div class="rounded-lg justify-center items-center border-2 text-white text-xl font-bold p-2 m-2 w-fit self-center">
<QrCodeCmp/>
</div>
<label class="block my-1 text-sm font-medium text-gray-900 dark:text-white">
- หรือ -
</label>
<div class="flex flex-col sm:flex-col md:flex-row lg:flex-row xl:flex-row 2xl:flex-row w-full lg:w-3/4 sm:w-full md:w-full 2xl:w-1/2 xl:w-1/2 text-center items-center justify-items-center p-5 place-content-center content-center">
<div class="w-9/12 flex flex-row">
<input
type="text"
class="text-xs sm:text-xs md:text-sm bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 text-center"
prop:value={LNURL}
/>
<button
class="btn btn-accent w-fit text-xs sm:text-xs md:text-sm text-black dark:text-white"
on:click={move |_| {
if let Some(clipboard) = window().navigator().clipboard() {
let _ = clipboard.write_text(LNURL);
} else {
window()
.alert_with_message("Something went wrong :(")
.unwrap();
}
}}
>

"📋"
</button>
</div>
<div>
<button
class="btn btn-accent w-full text-xs sm:text-xs md:text-sm text-black dark:text-white"
data-npub="npub1tr66yvqghfdgwv9yxhmg7xx6pvgvu5uvdc42tgdhsys8vvzdt8msev06fl"
data-relays="wss://relay.damus.io,wss://relay.siamstr.com,wss://relay.notoshi.win,wss://relay.nostr.band"
>
"Zapเลย⚡️"
</button>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
</div>
</div>
</div>
}
}
"📋"
</button>
</div>
<div>
<button
class="btn btn-accent w-full text-xs sm:text-xs md:text-sm text-black dark:text-white"
data-npub="npub1tr66yvqghfdgwv9yxhmg7xx6pvgvu5uvdc42tgdhsys8vvzdt8msev06fl"
data-relays="wss://relay.damus.io,wss://relay.siamstr.com,wss://relay.notoshi.win,wss://relay.nostr.band"
>
"Zapเลย⚡️"
</button>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
</div>

</div>
</div>
}
}
55 changes: 28 additions & 27 deletions src/app/components/footer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,33 @@ pub fn Footer(dark_mode: RwSignal<bool>) -> impl IntoView {
};
};
view! {
<footer class="bg-white dark:bg-gray-900 w-full z-3 bottom-0 end-0 border-t border-violet-500 dark:border-gray-600 max-h-10">
<div class="max-w-screen-xl flex flex-wrap items-center justify-between mx-auto">
<span class="text-sm text-gray-500 sm:text-center dark:text-gray-400">
"© 2023 " <a href="https://siamstr.com/" class="hover:underline">
"Siamtr"
</a>
</span>
<div class="flex flex-col space-y-2 flex md:order-2 space-x-3 md:space-x-1 rtl:space-x-reverse justify-items-center content-center items-center">
<button
type="button"
class="text-orange-700 border border-orange-700 hover:bg-orange-700 hover:text-white focus:ring-4 focus:outline-none focus:ring-orange-300 font-medium rounded-full text-sm p-2.5 text-center inline-flex items-center dark:border-orange-500 dark:text-orange-500 dark:hover:text-white dark:focus:ring-orange-800 dark:hover:bg-orange-500"
on:click=dark_mode_sw
>
<svg
class="text-black dark:text-white fill-orange-600"
xmlns="http://www.w3.org/2000/svg"
height="1em"
viewBox="0 0 384 512"
>
<path d="M144.7 98.7c-21 34.1-33.1 74.3-33.1 117.3c0 98 62.8 181.4 150.4 211.7c-12.4 2.8-25.3 4.3-38.6 4.3C126.6 432 48 353.3 48 256c0-68.9 39.4-128.4 96.8-157.3zm62.1-66C91.1 41.2 0 137.9 0 256C0 379.7 100 480 223.5 480c47.8 0 92-15 128.4-40.6c1.9-1.3 3.7-2.7 5.5-4c4.8-3.6 9.4-7.4 13.9-11.4c2.7-2.4 5.3-4.8 7.9-7.3c5-4.9 6.3-12.5 3.1-18.7s-10.1-9.7-17-8.5c-3.7 .6-7.4 1.2-11.1 1.6c-5 .5-10.1 .9-15.3 1c-1.2 0-2.5 0-3.7 0c-.1 0-.2 0-.3 0c-96.8-.2-175.2-78.9-175.2-176c0-54.8 24.9-103.7 64.1-136c1-.9 2.1-1.7 3.2-2.6c4-3.2 8.2-6.2 12.5-9c3.1-2 6.3-4 9.6-5.8c6.1-3.5 9.2-10.5 7.7-17.3s-7.3-11.9-14.3-12.5c-3.6-.3-7.1-.5-10.7-.6c-2.7-.1-5.5-.1-8.2-.1c-3.3 0-6.5 .1-9.8 .2c-2.3 .1-4.6 .2-6.9 .4z"></path>
</svg>
<span class="sr-only">Dark Mode</span>
</button>
</div>
</div>
</footer>
}
<footer class="bg-white dark:bg-gray-900 w-full z-3 bottom-0 end-0 border-t border-violet-500 dark:border-gray-600 max-h-10">
<div class="max-w-screen-xl flex flex-wrap items-center justify-between mx-auto">
<span class="text-sm text-gray-500 sm:text-center dark:text-gray-400">
"© 2023 "
<a href="https://siamstr.com/" class="hover:underline">
"Siamtr"
</a>
</span>
<div class="flex flex-col space-y-2 flex md:order-2 space-x-3 md:space-x-1 rtl:space-x-reverse justify-items-center content-center items-center">
<button
type="button"
class="text-orange-700 border border-orange-700 hover:bg-orange-700 hover:text-white focus:ring-4 focus:outline-none focus:ring-orange-300 font-medium rounded-full text-sm p-2.5 text-center inline-flex items-center dark:border-orange-500 dark:text-orange-500 dark:hover:text-white dark:focus:ring-orange-800 dark:hover:bg-orange-500"
on:click={dark_mode_sw}
>
<svg
class="text-black dark:text-white fill-orange-600"
xmlns="http://www.w3.org/2000/svg"
height="1em"
viewBox="0 0 384 512"
>
<path d="M144.7 98.7c-21 34.1-33.1 74.3-33.1 117.3c0 98 62.8 181.4 150.4 211.7c-12.4 2.8-25.3 4.3-38.6 4.3C126.6 432 48 353.3 48 256c0-68.9 39.4-128.4 96.8-157.3zm62.1-66C91.1 41.2 0 137.9 0 256C0 379.7 100 480 223.5 480c47.8 0 92-15 128.4-40.6c1.9-1.3 3.7-2.7 5.5-4c4.8-3.6 9.4-7.4 13.9-11.4c2.7-2.4 5.3-4.8 7.9-7.3c5-4.9 6.3-12.5 3.1-18.7s-10.1-9.7-17-8.5c-3.7 .6-7.4 1.2-11.1 1.6c-5 .5-10.1 .9-15.3 1c-1.2 0-2.5 0-3.7 0c-.1 0-.2 0-.3 0c-96.8-.2-175.2-78.9-175.2-176c0-54.8 24.9-103.7 64.1-136c1-.9 2.1-1.7 3.2-2.6c4-3.2 8.2-6.2 12.5-9c3.1-2 6.3-4 9.6-5.8c6.1-3.5 9.2-10.5 7.7-17.3s-7.3-11.9-14.3-12.5c-3.6-.3-7.1-.5-10.7-.6c-2.7-.1-5.5-.1-8.2-.1c-3.3 0-6.5 .1-9.8 .2c-2.3 .1-4.6 .2-6.9 .4z"></path>
</svg>
<span class="sr-only">Dark Mode</span>
</button>
</div>
</div>
</footer>
}
}

40 changes: 20 additions & 20 deletions src/app/components/loading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ use leptos::*;
#[component]
pub fn LoadingIndi() -> impl IntoView {
view! {
<div role="status">
<svg
aria-hidden="true"
class="inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600"
viewBox="0 0 100 101"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
fill="currentColor"
></path>
<path
d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
fill="currentFill"
></path>
</svg>
<span class="sr-only">Loading...</span>
</div>
}
<div role="status">
<svg
aria-hidden="true"
class="inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600"
viewBox="0 0 100 101"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
fill="currentColor"
></path>
<path
d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
fill="currentFill"
></path>
</svg>
<span class="sr-only">Loading...</span>
</div>
}
}
Loading

0 comments on commit 9000f05

Please sign in to comment.