Skip to content

Commit

Permalink
Update URLs
Browse files Browse the repository at this point in the history
Signed-off-by: Glenn Lewis <[email protected]>
  • Loading branch information
gmlewis committed Sep 17, 2024
1 parent c77dd69 commit c739c52
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<template>
<h1>Personalized Puzzle Books by Glenn Lewis</h1>
<h2>Featuring 100,851 unique books!</h2>
<div class="paragraphs">
<p>Are you searching for the perfect personalized gift for someone who enjoys puzzles?</p>
<p>You found it!</p>
<p><strong>You found it!</strong></p>
<p>What better way to surprise your friends, coworkers, or loved ones? Show them that you care by sending them their
own personalized puzzle books today!</p>
<p>Search for a name to see what books are available:</p>
Expand Down
5 changes: 4 additions & 1 deletion src/components/DisplayBook.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="book-container">
<a :href="`https://lulu.com/${book[1]}`">
<a :href="`https://on-demand-books.com/products/${url2handle(book[1])}`">
<img :src="book[3]" width="384" height="576">
<span class="book-info">{{ book[0] }}
(ISBN: {{ book[2] }})</span>
Expand All @@ -13,6 +13,9 @@ const props = defineProps({
book: Array,
})
const url2handle = (url) => {
return url.replace(/^.*product\-/, '').replace(/\.html$/, '')
}
</script>

<style lang="scss" scoped>
Expand Down
7 changes: 4 additions & 3 deletions src/components/SearchBooks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<input v-model="name" placeholder="Name">
<span></span>
</span>
<div v-if="!!shortcut" class="shortcut">Shortcut: <a :href="shortcut">{{ shortcut }}</a></div>
<div v-if="!!similarMatches" class="shortcut">{{ similarMatches }}</div>
<div class="books">
<div v-for="book in books" class="book">
Expand All @@ -13,6 +12,8 @@
</template>

<script setup>
// <div v-if="!!shortcut" class="shortcut">Shortcut: <a :href="shortcut">{{ shortcut }}</a></div>
import { onMounted, ref, watch } from 'vue'
import DisplayBook from './DisplayBook.vue'
Expand All @@ -30,15 +31,15 @@ const newSearch = async () => {
const lookup = await fetchName(name.value.toLowerCase())
if (!lookup?.length) {
books.value = []
document.title = `Personalized books by Glenn Lewis`
document.title = `Personalized books`
shortcut.value = ''
similarMatches.value = ''
return
}
books.value = lookup
const queryName = name.value.charAt(0).toUpperCase() + name.value.slice(1)
if (lookup.length === 9 && lookup[0][0].includes(` ${queryName} `)) {
document.title = `Personalized books for ${name.value} by Glenn Lewis`
document.title = `Personalized books for ${name.value}`
shortcut.value = `https://gmlewis.github.io/personalized-books/?q=${queryName}`
similarMatches.value = ''
} else {
Expand Down

0 comments on commit c739c52

Please sign in to comment.