Skip to content

Commit d6d0846

Browse files
committed
version 15
1 parent b2d11ba commit d6d0846

8 files changed

Lines changed: 164 additions & 9 deletions

File tree

app/aboutTools.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ module.exports = {
2424
- twitch info (now twitch search): npm version 1.1.7
2525
- webscraping: npm version 1.1.9
2626
- password generator: npm versions 1.2.0 - 1.2.1
27+
- bundlephobia: npm version 1.2.3
28+
- pokemon info: npm version 1.2.5
29+
- wallpapers: npm version 1.2.7
30+
- css validate: npm version 1.2.9
31+
- deezer search: npm versions 1.3.0 - 1.3.1
32+
- potter search: npm version 1.3.3
2733
`
2834
})
2935
}

app/anime-search/renderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async function animeTool(query) {
2020
params: { q: query }
2121
})
2222

23-
animeData.data.map((anime) => {
23+
animeData.data.forEach((anime) => {
2424
// row element
2525
const animeCard = document.createElement('anime-card')
2626

app/components/links.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ module.exports = [
6767
{
6868
page: '../deezer/index.html',
6969
title: 'deezer search'
70+
},
71+
{
72+
page: '../potter-search/index.html',
73+
title: 'potter search'
7074
}
7175
]
7276
},

app/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const createWindow = () => {
111111
const menu = Menu.buildFromTemplate(templateMenu)
112112

113113
// Set The Menu to the Main Window
114-
// Menu.setApplicationMenu(menu)
114+
Menu.setApplicationMenu(menu)
115115
}
116116

117117
app.whenReady().then(() => {

app/potter-search/index.html

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>potter search</title>
8+
<!-- normalize -->
9+
<link rel="stylesheet" href="../../node_modules/normalize.css/normalize.css" />
10+
<!-- global styles -->
11+
<link rel="stylesheet" href="../styles/global.css" />
12+
<!-- main css -->
13+
<link rel="stylesheet" href="main.css" />
14+
</head>
15+
16+
<body>
17+
<navbar-stack></navbar-stack>
18+
19+
<main class="container">
20+
<section class="app-glass">
21+
<form id="potter-search">
22+
<fieldset class="input-field col s12">
23+
<input
24+
type="search"
25+
id="keyword-search"
26+
class="input-field-text"
27+
autocomplete="off"
28+
placeholder="enter a keyword for search"
29+
required
30+
/>
31+
</fieldset>
32+
33+
<fieldset class="input-field">
34+
<button id="" class="btn-submit full-btn" type="submit">
35+
search characters
36+
</button>
37+
</fieldset>
38+
</form>
39+
</section>
40+
41+
<section class="character-list" id="character-list"></section>
42+
</main>
43+
44+
<script async src="renderer.js"></script>
45+
</body>
46+
47+
</html>

app/potter-search/main.css

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
.character-list {
2+
margin-top: 8px;
3+
}
4+
5+
.info {
6+
display: flex;
7+
align-items: center;
8+
justify-content: space-between;
9+
padding: 10px;
10+
color: #fff;
11+
12+
&:not(:last-child) {
13+
margin-bottom: 6px;
14+
}
15+
}
16+
17+
.info-img {
18+
width: 14%;
19+
grid-area: image;
20+
}
21+
22+
.info-title {
23+
grid-area: title;
24+
}
25+
26+
.info-desc {
27+
grid-area: desc;
28+
}
29+
30+
.info-birthdate {
31+
grid-area: datetime;
32+
}

app/potter-search/renderer.js

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// modules
2+
const { ipcRenderer } = require('electron')
3+
const axios = require('axios')
4+
5+
const toast = require('../scripts/toast')
6+
7+
// DOM elements
8+
const keywordSearch = document.querySelector('#keyword-search')
9+
const startSearch = document.querySelector('#potter-search')
10+
const characterList = document.querySelector('#character-list')
11+
12+
// potter character search info
13+
const getCharacters = async () => {
14+
try {
15+
const { data } = await axios.get("https://potterapi-fedeperin.vercel.app/en/characters", {
16+
params: { search: keywordSearch.value }
17+
})
18+
19+
data.forEach((character) => {
20+
const container = document.createElement('article')
21+
container.classList.add('app-glass', 'info')
22+
23+
const image = document.createElement('img')
24+
image.classList.add('info-img')
25+
image.src = character.image
26+
image.alt = character.nickname
27+
28+
/* const characterName = document.createElement('strong')
29+
characterName.classList.add('info-title')
30+
characterName.textContent = `${character.fullName} - "${character.nickname}"` */
31+
32+
const desc = document.createElement('p')
33+
desc.classList.add('info-desc')
34+
desc.innerHTML = `
35+
<strong>${character.fullName} - "${character.nickname}"</strong>
36+
hogwarts house: ${ character.hogwartsHouse }<br>
37+
interpreted by: ${ character.interpretedBy }
38+
`
39+
40+
const birthdate = document.createElement('time')
41+
birthdate.classList.add('info-birthdate')
42+
birthdate.textContent = character.birthdate
43+
birthdate.dateTime = character.birthdate
44+
45+
46+
container.append(image, desc, birthdate)
47+
48+
characterList.append(container)
49+
})
50+
} catch(err) {
51+
toast(err.message)
52+
}
53+
}
54+
55+
// events
56+
startSearch.addEventListener('submit', (e) => {
57+
characterList.innerHTML = ''
58+
59+
getCharacters()
60+
61+
e.preventDefault()
62+
startSearch.reset()
63+
})
64+
65+
66+
ipcRenderer.on('clear-stack', () => (characterList.innerHTML = ''))

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gui-stack-analyze",
3-
"version": "14.0.0",
3+
"version": "15.0.0",
44
"description": "GUI version inspired from npm module stack-analyze 1.0.5 and browser extension",
55
"main": "app/main.js",
66
"repository": {
@@ -26,19 +26,19 @@
2626
"author": "Intermachine Developers",
2727
"license": "MIT",
2828
"dependencies": {
29-
"axios": "^1.7.2",
30-
"chart.js": "^4.4.3",
29+
"axios": "^1.7.7",
30+
"chart.js": "^4.4.6",
3131
"css-validator": "^0.11.0",
3232
"html-validator": "^6.0.1",
3333
"normalize.css": "^8.0.1",
34-
"systeminformation": "^5.22.11",
34+
"systeminformation": "^5.23.5",
3535
"timeago.js": "^4.0.2",
3636
"w3c-css-validator": "^1.3.2",
3737
"wapalyzer": "^6.10.65"
3838
},
3939
"devDependencies": {
40-
"electron": "^31.2.0",
41-
"electron-builder": "^24.13.3",
42-
"eslint": "^9.6.0"
40+
"electron": "^33.2.0",
41+
"electron-builder": "^25.1.8",
42+
"eslint": "^9.15.0"
4343
}
4444
}

0 commit comments

Comments
 (0)