Skip to content

Commit

Permalink
version 10
Browse files Browse the repository at this point in the history
  • Loading branch information
omega5300 committed Mar 5, 2023
1 parent 88747b9 commit 1eabfb0
Show file tree
Hide file tree
Showing 393 changed files with 3,595 additions and 756 deletions.
3 changes: 0 additions & 3 deletions app/anime-search/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
<title>anime search</title>
<!-- normalize -->
<link rel="stylesheet" href="../../node_modules/normalize.css/normalize.css" />
<!-- material icons -->
<link rel="stylesheet" href="../../node_modules/material-design-icons/iconfont/material-icons.css" />
<!-- global styles -->
<link rel="stylesheet" href="../styles/global.css" />
<!-- main css -->
Expand All @@ -22,7 +20,6 @@
<section class="app-glass">
<form id="anime-search">
<fieldset class="input-field col s12">
<i class="material-icons prefix">search</i>
<input
type="search"
id="anime"
Expand Down
1 change: 0 additions & 1 deletion app/anime-search/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ async function animeTool(query) {
animeCard.rating = anime.rating
animeCard.episodes = anime.episodes
animeCard.debut = anime.aired.from
animeCard.sypnosis = anime.synopsis

if(anime.aired?.to) {
animeCard.finish = anime.aired.to
Expand Down
4 changes: 0 additions & 4 deletions app/bitly-info/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
<title>bitly info</title>
<!-- normalize css -->
<link rel="stylesheet" href="../../node_modules/normalize.css/normalize.css" />
<!-- material icons -->
<link rel="stylesheet" href="../../node_modules/material-design-icons/iconfont/material-icons.css" />
<!-- scrollbar css -->
<link rel="stylesheet" href="../styles/global.css" />
<!-- main css -->
Expand All @@ -19,7 +17,6 @@
<section class="app-glass">
<form id="analyze">
<fieldset class="input-field">
<i class="material-icons prefix">web</i>
<input
name="text"
id="url"
Expand All @@ -31,7 +28,6 @@
/>
</fieldset>
<fieldset class="input-field">
<i class="material-icons prefix">visibility_off</i>
<input
type="password"
name="token"
Expand Down
65 changes: 65 additions & 0 deletions app/bundlephobia/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>bundlephobia info</title>
<!-- normalize -->
<link rel="stylesheet" href="../../node_modules/normalize.css/normalize.css" />
<!-- global styles -->
<link rel="stylesheet" href="../styles/global.css" />
<!-- main css -->
<link rel="stylesheet" href="main.css" />
<script defer src="renderer.js"></script>
</head>

<body>
<navbar-stack></navbar-stack>
<main class="container">
<section class="app-glass">
<form id="bundlephobia-search">
<fieldset class="input-field col s12">
<input
type="search"
id="pkg-name"
class="input-field-text"
autocomplete="off"
placeholder="enter a npm pkg name"
required
/>
</fieldset>
<fieldset class="input-field">
<button class="btn-submit full-btn" type="submit">
search pkg
</button>
</fieldset>
</form>
</section>

<section class="glass module">
<h2 class="module-title">
<span id="module_name">no module</span> - <span id="module_ver"></span>
</h2>

<p id="module_description" class="module-description">
no description
</p>

<ul class="module-details">
<li>
size: <span id="module_size"></span>
</li>
<li>
gzip: <span id="module_gzip"></span>
</li>
</ul>

<a id="module_repo" class="btn" href="#">
no repo
</a>
</section>
</main>
</body>

</html>
39 changes: 39 additions & 0 deletions app/bundlephobia/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.module {
margin-block: 10px;
padding: 12px;
}

.module-title {
text-align: center;
}

.module-description {}

.module-details {
list-style: none;
display: flex;
justify-content: space-around;
}

.btn {
all: unset;
cursor: pointer;
display: block;
font-weight: bold;
max-width: 100%;
width: 96%;
height: 2%;
padding: 2px;
border-radius: 15px;
text-align: center;
outline: 2px solid #00f;
margin-inline: auto;
}

@media(hover: hover) {
.btn:hover {
background-color: #00f;
color: #fff;
text-decoration: underline;
}
}
76 changes: 76 additions & 0 deletions app/bundlephobia/renderer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// modules
const { ipcRenderer, shell } = require('electron')
const axios = require('axios')

const toast = require('../scripts/toast')

// DOM modules
const form = document.querySelector('#bundlephobia-search')
const pkgInput = document.querySelector('#pkg-name')
const moduleName = document.querySelector('#module_name')
const moduleVer = document.querySelector('#module_ver')
const moduleDescription = document.querySelector('#module_description')
const moduleSize = document.querySelector('#module_size')
const moduleGzip = document.querySelector('#module_gzip')
const moduleRepo = document.querySelector('#module_repo')

// convert size
const kilobyteConvert = size => (
size < 1024 ? `${size} B` : `${(size / 1024).toFixed(2)} KB`
)

// loaded
document.addEventListener('DOMContentLoaded', () => {
moduleVer.textContent = '0.0.0'
moduleSize.textContent = kilobyteConvert(0)
moduleGzip.textContent = kilobyteConvert(0)
});

const bundlephobia = async () => {
try {
const { data } = await axios.get('https://bundlephobia.com/api/size', {
params: { package: pkgInput.value }
});

moduleName.textContent = data.name
moduleVer.textContent = data.version
moduleDescription.textContent = data.description
moduleSize.textContent = kilobyteConvert(data.size)
moduleGzip.textContent = kilobyteConvert(data.gzip)

moduleRepo.textContent = `${data.name} repo`
moduleRepo.href = data.repository
moduleRepo.target = '_blank'
} catch (err) {
toast(err.message)
}
}

// sumbit
form.addEventListener('submit', e => {
bundlephobia()

e.preventDefault()
form.reset()
})

// open external browser
moduleRepo.addEventListener('click', e => {
if(e.target.href.startsWith('http')) {
e.preventDefault()
shell.openExternal(e.target.href)
}
})

// anime clear
ipcRenderer.on('clear-stack', () => {
moduleName.textContent = 'no module'
moduleVer.textContent = '0.0.0'
moduleDescription.textContent = 'no description'
moduleSize.textContent = kilobyteConvert(0)
moduleGzip.textContent = kilobyteConvert(0)

moduleRepo.textContent = 'no repo'
moduleRepo.href = '#'
moduleRepo.removeAttribute('target')
})
9 changes: 2 additions & 7 deletions app/components/animeCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ class AnimeCard extends HTMLElement {
this.name
this.subname
this.episodes
this.sypnosis
this.debut
this.finish
this.status
}

static get observedAttributes() {
return ['image', 'type', 'rating', 'name', 'subname', 'episodes', 'sypnosis', 'debut', 'finish', 'status']
return ['image', 'type', 'rating', 'name', 'subname', 'episodes', 'debut', 'finish', 'status']
}

attributeChangedCallback(name, oldValue, newValue) {
Expand Down Expand Up @@ -103,10 +102,6 @@ class AnimeCard extends HTMLElement {
const cardSubtitle = document.createElement('strong')
cardSubtitle.textContent = this.subname

const cardSypnosis = document.createElement('p')
cardSypnosis.classList.add('card-sypnosis')
cardSypnosis.textContent = this.sypnosis

const cardFooter = document.createElement('footer')
cardFooter.classList.add('card-footer')

Expand Down Expand Up @@ -135,7 +130,7 @@ class AnimeCard extends HTMLElement {
cardFooter.append(finishDate)
}

cardContainer.append(cardHeader, cardTitle, cardSubtitle, cardSypnosis, cardFooter)
cardContainer.append(cardHeader, cardTitle, cardSubtitle, cardFooter)

shadowRoot.append(styles, cardContainer)
}
Expand Down
4 changes: 4 additions & 0 deletions app/components/links.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ module.exports = [
page: '../crypto-market/index.html',
title: 'crypto market'
},
{
page: '../bundlephobia/index.html',
title: 'bundlephobia info'
},
]
},
{
Expand Down
3 changes: 0 additions & 3 deletions app/crypto-market/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
<title>crypto market</title>
<!-- normalize -->
<link rel="stylesheet" href="../../node_modules/normalize.css/normalize.css" />
<!-- material icons -->
<link rel="stylesheet" href="../../node_modules/material-design-icons/iconfont/material-icons.css" />
<!-- scrollbar css -->
<link rel="stylesheet" href="../styles/global.css" />
<!-- local css -->
Expand All @@ -17,7 +15,6 @@
<navbar-stack></navbar-stack>
<main class="container">
<fieldset class="input-field">
<i class="material-icons prefix">visibility_off</i>
<input
type="search"
name="coin"
Expand Down
3 changes: 0 additions & 3 deletions app/github-info/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
<title>github user info</title>
<!-- normalize -->
<link rel="stylesheet" href="../../node_modules/normalize.css/normalize.css" />
<!-- material icons -->
<link rel="stylesheet" href="../../node_modules/material-design-icons/iconfont/material-icons.css" />
<!-- global css -->
<link rel="stylesheet" href="../styles/global.css" />
<!-- main css -->
Expand All @@ -22,7 +20,6 @@
<section class="app-glass">
<form id="git-info">
<fieldset class="input-field">
<i class="material-icons prefix">web</i>
<input type="text" id="user" class="analyze-gituser input-field-text" placeholder="enter a github user" required />
</fieldset>
<fieldset class="input-field">
Expand Down
2 changes: 0 additions & 2 deletions app/hardware-information/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
<title>hardware information</title>
<!-- normalize -->
<link rel="stylesheet" href="../../node_modules/normalize.css/normalize.css">
<!-- material icons -->
<link rel="stylesheet" href="../../node_modules/material-design-icons/iconfont/material-icons.css">
<!-- global stylesheet-->
<link rel="stylesheet" href="../styles/global.css">
<!-- main stylesheet-->
Expand Down
3 changes: 0 additions & 3 deletions app/html-validator/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
<title>validator Tool</title>
<!-- normalize -->
<link rel="stylesheet" href="../../node_modules/normalize.css/normalize.css">
<!-- material icons -->
<link rel="stylesheet" href="../../node_modules/material-design-icons/iconfont/material-icons.css">
<!-- global stylesheet-->
<link rel="stylesheet" href="../styles/global.css">
<!-- main stylesheet-->
Expand All @@ -23,7 +21,6 @@
<section class="app-glass">
<form id="validator">
<fieldset class="input-field">
<i class="material-icons prefix">web</i>
<input
type="url"
id="website"
Expand Down
4 changes: 4 additions & 0 deletions app/images/5centsCDN.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions app/images/AWS Certificate Manager.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions app/images/AWS WAF Captcha.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion app/images/AdRoll.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1eabfb0

Please sign in to comment.