Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/button and input #14

Merged
merged 12 commits into from
Dec 20, 2023
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.tabSize": 2
}
392 changes: 199 additions & 193 deletions src/composer.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/resources/vue/Icons/scan-item.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions src/resources/vue/components/Box.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<template>
<div class="box" :style="{ backgroundColor: color }">
<slot></slot>
</div>
</template>
<script>
export default {
name: 'Box',
props: {
color: {
type: String,
default: '#f2f2f2',
},
},
};
</script>
<style lang="scss">
.box {
padding: 30px;
border-radius: 5px;
width: fit-content;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
}
</style>
57 changes: 57 additions & 0 deletions src/resources/vue/components/Button.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<template>
<div class="button" :class="{disabled : disabled}" :style="{ backgroundColor: color }" @click="buttonAction">
{{ content }}
</div>
</template>

<script>
export default {
name: 'Button',
props: {
color: {
type: String,
default: '#FF8C00',
},
disabled: {
type: Boolean,
default: false,
},
content: {
type: String,
default: 'Button',
},
buttonAction: {
type: Function,
default: () => {},
},
},
methods: {
handleClick() {
if (this.buttonAction) {
this.buttonAction();
} else {
console.log('No button action defined');
}
},
},
};
</script>

<style lang="scss">
.button {
display: flex;
justify-content: center;
align-items: center;
width: 206px;
height: 50px;
cursor: pointer;
border-radius: 12px;
font-size: 24px;
font-weight: 500;

&.disabled {
opacity: 0.5;
cursor: not-allowed;
}
}
</style>
74 changes: 74 additions & 0 deletions src/resources/vue/components/Input.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<template>
<div>
<input :id="id" :name="name" :type="type" :placeholder="placeholder" class="inputfield" :class="class" v-model="value">
</div>
</template>

<script>
export default {
name: 'Input',
props: {
id: {
type: String,
default: 'id',
},
name: {
type: String,
default: 'name',
},
type: {
type: String,
default: 'text',
},
placeholder: {
type: String,
default: 'Placeholder',
},
class: {
type: String,
default: 'text-medium',
},
},
data() {
return {
value: '',
};
},
};
</script>

<style lang="scss">
.inputfield {
background-color: #D9D9D9;
border: none;
border-radius: 5px;
padding: 8px 16px;
font-size: 24px;
font-weight: 300;
text-align: center;
color: #000;
width: fit-content;

&:focus {
outline: 2px solid #000;
background-color: #c8c8c8;
}

&::placeholder {
color: #000;
opacity: 0.5;
}

&.text-small {
font-size: 16px;
}

&.text-medium {
font-size: 24px;
}

&.text-large {
font-size: 32px;
}
}
</style>
61 changes: 61 additions & 0 deletions src/resources/vue/components/terminal-scan.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<template>
<div>
<Box>
<div class="content">
<svg class="scan-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M15 3H21V8H19V5H15V3ZM9 3V5H5V8H3V3H9ZM15 21V19H19V16H21V21H15ZM9 21H3V16H5V19H9V21ZM3 11H21V13H3V11Z"></path>
</svg>
<span class="text">Scan een artikel om te lenen</span>
</div>
<Input type="text" placeholder="Voer wat in" class="text-medium" />
<Button content="Zoek" :buttonAction="searchInput" />
</Box>
</div>
</template>
<script>
import Box from '../components/Box.vue';
import Button from '../components/Button.vue';
import Input from '../components/Input.vue';

export default {
name: 'index',
components: {
Box,
Button,
Input
},
methods: {
searchInput() {
// TODO: Implement search input
console.log('Search input');
},
},
};

</script>
<style lang="scss">
.content {
display: flex;
align-items: center;
flex-direction: row;
gap: 40px;
margin-bottom: 17px;

.text {
color: #000;
max-width: 245px;
font-size: 28px;
font-weight: 700;
text-align: center;
}

.scan-icon {
width: 54px;
height: 53px;
}
}

.button {
margin-top: 15px;
}
</style>
7 changes: 2 additions & 5 deletions src/resources/vue/pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<template>
<h1>Hello World!</h1>
<h1>Hello World!</h1>
</template>

<script>

</script>

<style>

</style>
</style>
2 changes: 1 addition & 1 deletion src/routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
return $request->user();
});
});
Loading