mirror of
https://github.com/Cian-H/am-d-model.eu.git
synced 2025-12-23 05:51:57 +00:00
Made shared button component and implemented usage
This commit is contained in:
@@ -1,15 +1,22 @@
|
|||||||
<script>
|
<script>
|
||||||
import "./BottomCall.scss";
|
import "./BottomCall.scss";
|
||||||
|
import Button from "../shared_components/Button.svelte";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="btmcall">
|
<div class="btmcall">
|
||||||
<div class="btmcall-text">Interested in the project?</div>
|
<div class="btmcall-text">Interested in the project?</div>
|
||||||
<div class="btmcall-buttons">
|
<div class="btmcall-buttons">
|
||||||
<div class="btmcall-button1">
|
<Button
|
||||||
<div class="btmcall-get-involved">Get Involved!</div>
|
class="btmcall-button1"
|
||||||
</div>
|
text="Get Involved!"
|
||||||
<div class="btmcall-button2">
|
inner_class="btmcall-get-involved"
|
||||||
<div class="btmcall-contact-us">Contact Us</div>
|
hotkey="g"
|
||||||
</div>
|
/>
|
||||||
|
<Button
|
||||||
|
class="btmcall-button2"
|
||||||
|
text="Contact Us"
|
||||||
|
inner_class="btmcall-contact-us"
|
||||||
|
hotkey="c"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import "./Splash.scss";
|
import "./Splash.scss";
|
||||||
|
import Button from "../shared_components/Button.svelte";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="splash">
|
<div class="splash">
|
||||||
@@ -18,8 +19,11 @@
|
|||||||
the collaboration and innovation that will build the future of this
|
the collaboration and innovation that will build the future of this
|
||||||
technology.
|
technology.
|
||||||
</div>
|
</div>
|
||||||
<div class="splash-button">
|
<Button
|
||||||
<div class="splash-get-involved">Get Involved!</div>
|
class="splash-button"
|
||||||
</div>
|
text="Get Involved!"
|
||||||
|
inner_class="splash-get-involved"
|
||||||
|
hotkey="g"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
28
src/shared_components/Button.svelte
Normal file
28
src/shared_components/Button.svelte
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<script>
|
||||||
|
export let text = "Button_Text";
|
||||||
|
export let inner_class = "";
|
||||||
|
export let redirectFunc = () => {};
|
||||||
|
export let hotkey = "";
|
||||||
|
|
||||||
|
function handleKeypress(event) {
|
||||||
|
if (
|
||||||
|
event.key === hotkey ||
|
||||||
|
event.key === "Enter" ||
|
||||||
|
event.key === " "
|
||||||
|
) {
|
||||||
|
event.preventDefault();
|
||||||
|
redirectFunc();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="cursor-pointer select-none {$$props.class}"
|
||||||
|
style="cursor: pointer;"
|
||||||
|
on:click={redirectFunc}
|
||||||
|
on:keydown={handleKeypress}
|
||||||
|
tabindex="0"
|
||||||
|
role="button"
|
||||||
|
>
|
||||||
|
<div class={inner_class}>{text}</div>
|
||||||
|
</div>
|
||||||
Reference in New Issue
Block a user