31 Commits

Author SHA1 Message Date
johannes.vos 08c3de5cb2 Add Link Style 2026-05-14 12:36:57 +02:00
johannes.vos 61e4f3d1f2 Rename class 'slogan' to 'error-message' 2026-05-14 12:27:15 +02:00
johannes.vos 6aca8a6087 Add RouterLink to Searchview.vue 2026-05-14 12:25:45 +02:00
johannes.vos fb5985dcb1 Remove unnecesary script 2026-05-14 12:24:02 +02:00
johannes.vos 78679fe03b Add script 2026-05-14 12:22:58 +02:00
johannes.vos 06f7037e11 chore: update package-lock.json 2026-05-14 12:22:08 +02:00
johannes.vos 9b04b00c11 merge: resolve conflict, add NotFound route 2026-05-14 12:21:48 +02:00
johannes.vos 2956c54496 Make .slogan bigger 2026-05-14 12:19:47 +02:00
johannes.vos ba6e8e652d Copy style from SearchView.vue 2026-05-14 12:17:12 +02:00
johannes.vos 237fcd33dc Remove unnecessary Form 2026-05-14 12:15:50 +02:00
jakob.scheid cda4d58486 Merge pull request 'Add search form submit #32' (#45) from feature/search-form-submit into main
Reviewed-on: #45
Reviewed-by: Jakob Gregory
2026-05-14 11:29:18 +02:00
jakob.scheid e7986146a1 Merge branch 'main' into feature/search-form-submit 2026-05-14 11:28:42 +02:00
jakob.scheid c1f1099848 Use CSS variables 2026-05-11 18:41:25 +02:00
jakob.scheid 926c1fc463 Merge branch 'main' into feature/search-form-submit 2026-05-11 15:20:05 +02:00
jakob.scheid 49d4401d00 Add search results error message outline 2026-05-11 00:12:27 +02:00
jakob.scheid 587a97fa03 Add search results error message animation 2026-05-11 00:11:04 +02:00
jakob.scheid 4d5ddfd7ea Add search results error message 2026-05-11 00:10:49 +02:00
jakob.scheid c5af7366a9 Update search bar width at the start page 2026-05-11 00:06:45 +02:00
jakob.scheid cab550051f Add search bar with search query to the search results view 2026-05-10 19:47:23 +02:00
jakob.scheid d407c2f0e9 Add padding to the main content 2026-05-10 19:46:46 +02:00
jakob.scheid 261657d343 Move search form to the search bar component 2026-05-10 19:45:56 +02:00
jakob.scheid e3117110e9 Move flexbox to the start page view 2026-05-10 19:04:49 +02:00
jakob.scheid 1097694a8e Add router link to the startpage in the navbar 2026-05-10 17:27:57 +02:00
jakob.scheid 9f60c23c60 Add search submit callback 2026-05-10 17:22:11 +02:00
jakob.scheid 399d7caabc Add search query model 2026-05-10 17:11:35 +02:00
jakob.scheid 679adb4cf9 Use class instead of ID for the search form 2026-05-10 16:52:25 +02:00
jakob.scheid 8f48f3dcb5 Add page title router hook 2026-05-10 16:50:29 +02:00
jakob.scheid 8cdf16f144 Add search results route 2026-05-10 16:40:48 +02:00
jakob.scheid 24926b7312 Add search results view 2026-05-10 16:09:51 +02:00
jakob.scheid 2ed25157e3 Rename startpage route to startPage 2026-05-10 16:07:21 +02:00
jakob.scheid f7f8cda2a5 Add @ alias 2026-05-10 16:06:45 +02:00
10 changed files with 276 additions and 41 deletions
+7
View File
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
}
}
+1
View File
@@ -2060,6 +2060,7 @@
"resolved": "https://registry.npmjs.org/vite-plugin-html/-/vite-plugin-html-3.2.2.tgz",
"integrity": "sha512-vb9C9kcdzcIo/Oc3CLZVS03dL5pDlOFuhGlZYDCJ840BhWl/0nGeZWf3Qy7NlOayscY4Cm/QRgULCQkEZige5Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"@rollup/pluginutils": "^4.2.0",
"colorette": "^2.0.16",
+4 -5
View File
@@ -31,11 +31,10 @@ import Footer from './features/footer/components/Footer.vue';
<style scoped>
.main-content {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
gap: 60px;
--main-content-padding-x: 30px;
--main-content-padding-y: 40px;
padding: var(--main-content-padding-y) var(--main-content-padding-x);
width: calc(100% - var(--main-content-padding-x) * 2);
flex-grow: 1;
}
</style>
+3 -1
View File
@@ -16,7 +16,9 @@ limitations under the License.
<template>
<nav class="global-nav">
<span id="logo">Seekra</span>
<RouterLink to="/" class="link button link">
<span id="logo">Seekra</span>
</RouterLink>
<ul class="right-links">
</ul>
</nav>
+31 -6
View File
@@ -14,12 +14,37 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<script setup>
const searchQuery = defineModel();
import { useRouter } from 'vue-router';
const router = useRouter()
const props = defineProps(['autoSubmit'])
const submitSearch = function () {
if (props.autoSubmit !== undefined) {
router.push({
name: 'searchResults',
query: { q: searchQuery.value }
});
};
}
</script>
<template>
<div class="search-wrapper">
<input type="search" name="search" placeholder="Search..." required />
<button type="submit" class="search-button">Search</button>
</div>
</template>
<form @submit.prevent="submitSearch">
<div class="search-wrapper">
<input
v-model="searchQuery"
type="search"
placeholder="Search..."
required
/>
<button type="submit" class="search-button">Search</button>
</div>
</form>
</template>
<style scoped>
.search-wrapper {
@@ -53,7 +78,7 @@ limitations under the License.
border: none;
padding: var(--submit-button-padding-y) 20px;
background: var(--primary-color);
color: white;
color: var(--white);
cursor: pointer;
white-space: nowrap;
}
@@ -0,0 +1,86 @@
<script setup>
import Searchbar from '@/features/search/components/Searchbar.vue';
const props = defineProps(['searchQuery']);
const searchQueryModel = defineModel();
searchQueryModel.value = props.searchQuery;
</script>
<template>
<Searchbar class="search-bar" v-model="searchQueryModel" auto-submit />
<div class="search-results-error-message-container">
<div class="search-results-error-message">
<p>Search is not available right now.</p>
<p>Please try again to another time.</p>
</div>
</div>
<div class="search-results-container">
</div>
</template>
<style scoped>
.search-bar {
width: 50%;
}
@media (max-width: 67.5rem) {
.search-bar {
width: 100%;
}
}
.search-results-container {
margin-top: 56px;
}
.search-results-error-message-container {
--error-message-height: 100px;
--error-message-padding: 2em;
display: flex;
justify-content: center;
width: calc(100% - 2 * var(--main-content-padding-x));
position: absolute;
top: calc(50vh - 0.5 * var(--error-message-height) - var(--error-message-padding));
}
.search-results-error-message {
padding: var(--error-message-padding);
font-size: 18px;
box-shadow: 0px 0px 42px #cdcdcdb3;
border-radius: 28px;
text-align: center;
background-color: #f7f7f7;
animation: fade-in 0.8s ease-out;
height: var(--error-message-height);
display: flex;
justify-content: center;
flex-direction: column;
outline: 1px solid var(--light-d-2);
}
@media (max-width: 48rem) {
.search-results-error-message-container {
--error-message-height: 150px;
}
.search-results-error-message {
padding: 1em;
width: 100%;
}
}
@keyframes fade-in {
0% {
opacity: 0;
}
10% {
opacity: 0;
transform: scale(1.02);
}
100% {
opacity: 100;
transform: scale(1);
}
}
</style>
+49 -7
View File
@@ -1,24 +1,66 @@
import { createRouter, createWebHistory } from 'vue-router'
/*
Copyright 2026 Seekra
import SearchView from '../views/SearchView.vue'
import NotFound from '../views/NotFound.vue'
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { createRouter, createWebHistory } from 'vue-router';
import SearchView from '../views/SearchView.vue';
import SearchResultsView from '@/features/search/views/SearchResultsView.vue';
import NotFound from '../views/NotFound.vue';
const routes = [
{
path: '/',
name: 'search',
name: 'startPage',
component: SearchView
},
{
path: '/search',
name: 'searchResults',
component: SearchResultsView,
props: route => ({
searchQuery: route.query.q
}),
meta: {
title: (route) => route.query.q
}
},
{
path: '/:pathMatch(.*)*',
name: 'not-found',
component: NotFound
},
]
];
const router = createRouter({
history: createWebHistory(),
routes
})
});
export default router
// set page title
router.afterEach(to => {
const title =
typeof to.meta.title === 'function'
? to.meta.title(to)
: to.meta.title;
if (title) {
document.title = `${title} - Seekra`;
} else {
document.title = 'Seekra';
};
});
export default router;
+8
View File
@@ -24,3 +24,11 @@ body {
display: flex;
flex-direction: column;
}
.link {
text-decoration: none;
}
.link:hover:not(.button-link) {
text-decoration: underline;
}
+49 -10
View File
@@ -1,12 +1,51 @@
<template>
<header class="global-header">
<h1>Seekra</h1>
<span class="slogan">
ERROR: 404 Not Found
</span>
</header>
<form id="search-form">
<Searchbar />
</form>
<div class="search-content">
<header class="global-header">
<h1>Seekra</h1>
<span class="error-message">
ERROR 404: Page Not Found
</span>
</header>
<RouterLink to="/" id="link">Back to Search</RouterLink>
</div>
</template>
<style scoped>
.global-header {
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
padding-top: 40px;
}
.global-header h1 {
display: inline-block;
margin: 0;
line-height: 1;
background: linear-gradient(
to right,
var(--primary-color-l-4),
var(--primary-color),
var(--primary-color-d-4)
);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
font-size: 6rem;
}
.error-message{
margin: 0;
font-weight: 600;
font-size: 2vw;
}
#link {
align-items: center;
display: flex;
justify-content: center;
margin-top: 20px;
padding: 10px 20px;
text-decoration: none;
}
</style>
+37 -11
View File
@@ -15,23 +15,43 @@ limitations under the License.
-->
<script setup>
import Searchbar from '../features/search/components/Searchbar.vue'
import Searchbar from '../features/search/components/Searchbar.vue';
import { ref } from 'vue';
import { useRouter } from 'vue-router';
const router = useRouter();
const searchQuery = ref('');
const submitSearch = function () {
};
</script>
<template>
<header class="global-header">
<h1>Seekra</h1>
<span class="slogan">
Built to search.
</span>
</header>
<div class="search-content">
<header class="global-header">
<h1>Seekra</h1>
<span class="slogan">
Built to search.
</span>
</header>
<form id="search-form">
<Searchbar />
</form>
<div class="search-container">
<Searchbar v-model="searchQuery" ref="searchbar" class="search-bar" auto-submit />
</div>
</div>
</template>
<style scoped>
.search-content {
display: flex;
flex-direction: column;
align-items: center;
gap: 60px;
}
.global-header {
text-align: center;
display: flex;
@@ -61,8 +81,14 @@ import Searchbar from '../features/search/components/Searchbar.vue'
font-size: small;
}
#search-form {
.search-container {
width: 70%;
max-width: 624px;
}
@media (max-width: 67.5rem) {
.search-container {
width: 100%;
}
}
</style>