Compare commits

...
Author SHA1 Message Date
sharevb 37693a57ec feat(new tools): IES Guidelines and Illuminance converter
IES Guidelines searcher and Illuminance units converter

Fix #1475
2025-03-09 22:56:19 +01:00
Isaiah 80e46c9292 fix(camera-recorder): stop camera on navigation (#782)
* Stopping camera when user switches to another page

* Missing ;
2023-11-29 13:58:07 +01:00
Richard "EpicKitty" Bowey 7a70dbbe0c fix(doc): updated create new tool command in readme (#762) 2023-11-22 20:27:46 +01:00
lzb16 2e56641398 feat(i18n): improve chinese i18n (#757) 2023-11-16 18:27:51 +01:00
lzb16 a1037cf8f1 feat(i18n): add tooltip and favoriteButton i18n (#756) 2023-11-16 08:20:42 +00:00
renovate[bot]andCorentin Thomasset 0fe9a20329 chore(deps): switched from oui to oui-data for mac address lookup (#693)
* fix(deps): update dependency oui to v13

* chore(deps): switched from oui to oui-data for mac address lookup

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Corentin Thomasset <corentin.thomasset74@gmail.com>
2023-11-14 23:44:23 +00:00
renovate[bot] 2e396d8776 chore(deps): update unocss monorepo to ^0.57.0 (#638)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-15 00:19:09 +01:00
Corentin THOMASSET bd3edcb528 refactor(about, i18n): improved i18n dx with markdown (#753) 2023-11-14 23:15:41 +00:00
Corentin THOMASSET de1ee69ef9 refactor(token, i18n): complete fr translation (#752) 2023-11-14 23:14:05 +00:00
Gary 8f99eb6017 feat(i18n): add Chinese translation base (#718)
* Create zh_CN.yml

* rename

* Update zh.yml

* Update zh.yml

* Update zh.yml

* Update zh.yml

* Update zh.yml
2023-11-15 00:09:36 +01:00
Corentin THOMASSET 38586caab7 refactor(uuid generator): uuid version picker (#751) 2023-11-13 21:38:01 +00:00
Corentin THOMASSETandakharlov 043e4f0a08 fix(base64-file-converter): fix downloading of index.html content without data preambula (#750)
* fix(base64-file-converter): fix downloading of index.html content without data preambula

* feat(base64-file-converter): infer mime type from base64 signature

---------

Co-authored-by: akharlov <harl_aa@skbkontur.ru>
2023-11-13 10:44:23 +00:00
Corentin THOMASSET ca43a25569 refactor(case converter): no split on lowercase, uppercase and mocking case (#748) 2023-11-13 00:00:55 +00:00
Corentin THOMASSET 7fe47b3be4 refactor(ui): replaced legacy n-upload with c-file-upload (#747) 2023-11-13 00:56:51 +01:00
Corentin THOMASSET 16ffe6b5c9 refactor(token): added password in token generator keywords (#746) 2023-11-12 22:54:13 +00:00
Corentin THOMASSET 478192065e feat(new tool): pdf signature checker (#745) 2023-11-12 22:22:41 +00:00
Corentin THOMASSET 205e360400 fix(docker): rollback armv7 in docker releases (#741) 2023-11-09 13:33:19 +00:00
Steltek 821cbea2bf fix(eta): corrected example (#737) 2023-11-08 19:56:58 +01:00
Oceansdeep7androbin.li 093ff311fd refactor(bcrypt): fix input label align (#721)
Co-authored-by: robin.li <robin.li@webeye.com>
2023-11-07 09:10:52 +01:00
Corentin THOMASSET e07e2ae5bc feat(new tool): numeronym generator (#729) 2023-11-05 21:59:31 +00:00
Corentin THOMASSET fe1de8c5c9 chore(docker): added armv7 plateform for docker releases (#722) 2023-11-03 08:06:11 +00:00
Corentin Thomasset b2614990e3 chore(version): release 2023.11.02-7d94e11 2023-11-02 09:11:26 +01:00
Corentin Thomasset 79646375f3 docs(changelog): update changelog for 2023.11.02-7d94e11 2023-11-02 09:11:26 +01:00
Andrii Bratanin 7d94e11cee fix(dockerfile): revert replacement of nginx image with non-privileged one (#716)
Fixes https://github.com/CorentinTh/it-tools/issues/714
2023-11-02 09:10:13 +01:00
swishkin e87f4b1837 refactor(math-evaluator): improved description
Improved description.
2023-11-01 23:07:51 +01:00
Corentin THOMASSET e86fd96ae3 feat(i18n): language selector (#710) 2023-11-01 15:38:19 +01:00
Corentin THOMASSET 58de8970f5 refactor(math-evaluator): improved search and UX (#713)
* refactor(math-evaluator): added keywords for search

* refactor(math-evaluator): improved input
2023-11-01 14:23:46 +00:00
Corentin THOMASSETandcode2933 02b0d0d1a1 fix(encryption): alert on decryption error (#711)
* update(c-alert): Add variant 'error'

* fix(encryption): Alert decryption error (#652)

* feat(c-alert): added title

* refactor(composable): mutualized computedCatch

---------

Co-authored-by: code2933 <code2933@outlook.com>
2023-11-01 10:11:51 +00:00
74 changed files with 2437 additions and 600 deletions

No files matched your search

+13
View File
@@ -2,6 +2,19 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## Version 2023.11.02-7d94e11
### Features
- **i18n**: language selector (#710) (e86fd96)
### Bug fixes
- **dockerfile**: revert replacement of nginx image with non-privileged one (#716) (7d94e11)
- **encryption**: alert on decryption error (#711) (02b0d0d)
### Refactoring
- **math-evaluator**: improved description (e87f4b1)
- **math-evaluator**: improved search and UX (#713) (58de897)
## Version 2023.11.01-e164afb
### Features
+2 -2
View File
@@ -10,8 +10,8 @@ COPY . .
RUN pnpm build
# production stage
FROM nginxinc/nginx-unprivileged:stable-alpine AS production-stage
FROM nginx:stable-alpine AS production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
CMD ["nginx", "-g", "daemon off;"]
+1 -1
View File
@@ -100,7 +100,7 @@ pnpm lint
To create a new tool, there is a script that generate the boilerplate of the new tool, simply run:
```sh
pnpm run script:create-new-tool my-tool-name
pnpm run script:create:tool my-tool-name
```
It will create a directory in `src/tools` with the correct files, and a the import in `src/tools/index.ts`. You will just need to add the imported tool in the proper category and develop the tool.
+18 -28
View File
@@ -29,7 +29,11 @@ declare module '@vue/runtime-core' {
'CButtonsSelect.demo': typeof import('./src/ui/c-buttons-select/c-buttons-select.demo.vue')['default']
CCard: typeof import('./src/ui/c-card/c-card.vue')['default']
'CCard.demo': typeof import('./src/ui/c-card/c-card.demo.vue')['default']
CCollapse: typeof import('./src/ui/c-collapse/c-collapse.vue')['default']
'CCollapse.demo': typeof import('./src/ui/c-collapse/c-collapse.demo.vue')['default']
CDiffEditor: typeof import('./src/ui/c-diff-editor/c-diff-editor.vue')['default']
CFileUpload: typeof import('./src/ui/c-file-upload/c-file-upload.vue')['default']
'CFileUpload.demo': typeof import('./src/ui/c-file-upload/c-file-upload.demo.vue')['default']
ChmodCalculator: typeof import('./src/tools/chmod-calculator/chmod-calculator.vue')['default']
Chronometer: typeof import('./src/tools/chronometer/chronometer.vue')['default']
CInputText: typeof import('./src/ui/c-input-text/c-input-text.vue')['default']
@@ -39,8 +43,12 @@ declare module '@vue/runtime-core' {
CLabel: typeof import('./src/ui/c-label/c-label.vue')['default']
CLink: typeof import('./src/ui/c-link/c-link.vue')['default']
'CLink.demo': typeof import('./src/ui/c-link/c-link.demo.vue')['default']
CMarkdown: typeof import('./src/ui/c-markdown/c-markdown.vue')['default']
'CMarkdown.demo': typeof import('./src/ui/c-markdown/c-markdown.demo.vue')['default']
CModal: typeof import('./src/ui/c-modal/c-modal.vue')['default']
'CModal.demo': typeof import('./src/ui/c-modal/c-modal.demo.vue')['default']
CModalValue: typeof import('./src/ui/c-modal-value/c-modal-value.vue')['default']
'CModalValue.demo': typeof import('./src/ui/c-modal-value/c-modal-value.demo.vue')['default']
CollapsibleToolMenu: typeof import('./src/components/CollapsibleToolMenu.vue')['default']
ColorConverter: typeof import('./src/tools/color-converter/color-converter.vue')['default']
ColoredCard: typeof import('./src/components/ColoredCard.vue')['default']
@@ -80,25 +88,19 @@ declare module '@vue/runtime-core' {
HttpStatusCodes: typeof import('./src/tools/http-status-codes/http-status-codes.vue')['default']
IbanValidatorAndParser: typeof import('./src/tools/iban-validator-and-parser/iban-validator-and-parser.vue')['default']
'IconMdi:brushVariant': typeof import('~icons/mdi/brush-variant')['default']
'IconMdi:contentCopy': typeof import('~icons/mdi/content-copy')['default']
'IconMdi:kettleSteamOutline': typeof import('~icons/mdi/kettle-steam-outline')['default']
IconMdiArrowRightBottom: typeof import('~icons/mdi/arrow-right-bottom')['default']
IconMdiCamera: typeof import('~icons/mdi/camera')['default']
IconMdiChevronDown: typeof import('~icons/mdi/chevron-down')['default']
IconMdiChevronRight: typeof import('~icons/mdi/chevron-right')['default']
IconMdiClose: typeof import('~icons/mdi/close')['default']
IconMdiContentCopy: typeof import('~icons/mdi/content-copy')['default']
IconMdiDeleteOutline: typeof import('~icons/mdi/delete-outline')['default']
IconMdiDownload: typeof import('~icons/mdi/download')['default']
IconMdiEye: typeof import('~icons/mdi/eye')['default']
IconMdiEyeOff: typeof import('~icons/mdi/eye-off')['default']
IconMdiHeart: typeof import('~icons/mdi/heart')['default']
IconMdiPause: typeof import('~icons/mdi/pause')['default']
IconMdiPlay: typeof import('~icons/mdi/play')['default']
IconMdiRecord: typeof import('~icons/mdi/record')['default']
IconMdiRefresh: typeof import('~icons/mdi/refresh')['default']
IconMdiSearch: typeof import('~icons/mdi/search')['default']
IconMdiVideo: typeof import('~icons/mdi/video')['default']
IconMdiTranslate: typeof import('~icons/mdi/translate')['default']
IconMdiTriangleDown: typeof import('~icons/mdi/triangle-down')['default']
IesLightingGuidelines: typeof import('./src/tools/ies-lighting-guidelines/ies-lighting-guidelines.vue')['default']
IlluminanceConverter: typeof import('./src/tools/illuminance-converter/illuminance-converter.vue')['default']
InputCopyable: typeof import('./src/components/InputCopyable.vue')['default']
IntegerBaseConverter: typeof import('./src/tools/integer-base-converter/integer-base-converter.vue')['default']
Ipv4AddressConverter: typeof import('./src/tools/ipv4-address-converter/ipv4-address-converter.vue')['default']
@@ -114,6 +116,7 @@ declare module '@vue/runtime-core' {
JwtParser: typeof import('./src/tools/jwt-parser/jwt-parser.vue')['default']
KeycodeInfo: typeof import('./src/tools/keycode-info/keycode-info.vue')['default']
ListConverter: typeof import('./src/tools/list-converter/list-converter.vue')['default']
LocaleSelector: typeof import('./src/modules/i18n/components/locale-selector.vue')['default']
LoremIpsumGenerator: typeof import('./src/tools/lorem-ipsum-generator/lorem-ipsum-generator.vue')['default']
MacAddressGenerator: typeof import('./src/tools/mac-address-generator/mac-address-generator.vue')['default']
MacAddressLookup: typeof import('./src/tools/mac-address-lookup/mac-address-lookup.vue')['default']
@@ -124,43 +127,30 @@ declare module '@vue/runtime-core' {
MenuLayout: typeof import('./src/components/MenuLayout.vue')['default']
MetaTagGenerator: typeof import('./src/tools/meta-tag-generator/meta-tag-generator.vue')['default']
MimeTypes: typeof import('./src/tools/mime-types/mime-types.vue')['default']
NAlert: typeof import('naive-ui')['NAlert']
NA: typeof import('naive-ui')['NA']
NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default']
NCheckbox: typeof import('naive-ui')['NCheckbox']
NCode: typeof import('naive-ui')['NCode']
NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
NColorPicker: typeof import('naive-ui')['NColorPicker']
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
NDatePicker: typeof import('naive-ui')['NDatePicker']
NDivider: typeof import('naive-ui')['NDivider']
NDynamicInput: typeof import('naive-ui')['NDynamicInput']
NEllipsis: typeof import('naive-ui')['NEllipsis']
NForm: typeof import('naive-ui')['NForm']
NFormItem: typeof import('naive-ui')['NFormItem']
NGi: typeof import('naive-ui')['NGi']
NGrid: typeof import('naive-ui')['NGrid']
NH1: typeof import('naive-ui')['NH1']
NH2: typeof import('naive-ui')['NH2']
NH3: typeof import('naive-ui')['NH3']
NIcon: typeof import('naive-ui')['NIcon']
NImage: typeof import('naive-ui')['NImage']
NInputGroup: typeof import('naive-ui')['NInputGroup']
NInputGroupLabel: typeof import('naive-ui')['NInputGroupLabel']
NInputNumber: typeof import('naive-ui')['NInputNumber']
NLayout: typeof import('naive-ui')['NLayout']
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
NMenu: typeof import('naive-ui')['NMenu']
NProgress: typeof import('naive-ui')['NProgress']
NScrollbar: typeof import('naive-ui')['NScrollbar']
NSlider: typeof import('naive-ui')['NSlider']
NStatistic: typeof import('naive-ui')['NStatistic']
NSwitch: typeof import('naive-ui')['NSwitch']
NP: typeof import('naive-ui')['NP']
NTable: typeof import('naive-ui')['NTable']
NTag: typeof import('naive-ui')['NTag']
NUpload: typeof import('naive-ui')['NUpload']
NUploadDragger: typeof import('naive-ui')['NUploadDragger']
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default']
PasswordStrengthAnalyser: typeof import('./src/tools/password-strength-analyser/password-strength-analyser.vue')['default']
PdfSignatureChecker: typeof import('./src/tools/pdf-signature-checker/pdf-signature-checker.vue')['default']
PdfSignatureDetails: typeof import('./src/tools/pdf-signature-checker/components/pdf-signature-details.vue')['default']
PercentageCalculator: typeof import('./src/tools/percentage-calculator/percentage-calculator.vue')['default']
PhoneParserAndFormatter: typeof import('./src/tools/phone-parser-and-formatter/phone-parser-and-formatter.vue')['default']
QrCodeGenerator: typeof import('./src/tools/qr-code-generator/qr-code-generator.vue')['default']
+36 -16
View File
@@ -7,6 +7,7 @@ home:
toggleMenu: 'Toggle menu'
home: Home
uiLib: 'UI Lib'
support: 'Support IT Tools development'
buyMeACoffee: 'Buy me a coffee'
follow:
title: 'You like it-tools?'
@@ -26,26 +27,45 @@ home:
lightMode: 'Light mode'
mode: 'Toggle dark/light mode'
about:
h1: 'About IT-Tools'
h1p1: 'This wonderful website, made with ❤ by'
h1p2: ', aggregates useful tools for developer and people working in IT. If you find it useful, please feel free to share it to people you think may find it useful too and don''''t forget to bookmark it in your shortcut bar!'
h1p3: 'IT Tools is open-source (under the MIT license) and free, and will always be, but it costs me money to host and renew the domain name. If you want to support my work, and encourage me to add more tools, please consider supporting by'
h1p4: 'sponsoring me'
h2: Technologies
h2p1: 'IT Tools is made in Vue.js (Vue 3) with the the Naive UI component library and is hosted and continuously deployed by Vercel. Third-party open-source libraries are used in some tools, you may find the complete list in the'
h2p2: 'file of the repository.'
h3: 'Found a bug? A tool is missing?'
h3p1: 'If you need a tool that is currently not present here, and you think can be useful, you are welcome to submit a feature request in the'
h3p2: 'issues section'
h3p3: 'in the GitHub repository.'
h3p4: 'And if you found a bug, or something doesn''''t work as expected, please file a bug report in the'
h3p5: 'issues section'
h3p6: 'in the GitHub repository.'
content: >
# About IT-Tools
This wonderful website, made with ❤ by [Corentin Thomasset](https://github.com/CorentinTh) , aggregates useful tools for developer and people working in IT. If you find it useful, please feel free to share it to people you think may find it useful too and don't forget to bookmark it in your shortcut bar!
IT Tools is open-source (under the MIT license) and free, and will always be, but it costs me money to host and renew the domain name. If you want to support my work, and encourage me to add more tools, please consider supporting by [sponsoring me](https://www.buymeacoffee.com/cthmsst).
## Technologies
IT Tools is made in Vue.js (Vue 3) with the the Naive UI component library and is hosted and continuously deployed by Vercel. Third-party open-source libraries are used in some tools, you may find the complete list in the [package.json](https://github.com/CorentinTh/it-tools/blob/main/package.json) file of the repository.
## Found a bug? A tool is missing?
If you need a tool that is currently not present here, and you think can be useful, you are welcome to submit a feature request in the [issues section](https://github.com/CorentinTh/it-tools/issues/new/choose) in the GitHub repository.
And if you found a bug, or something doesn't work as expected, please file a bug report in the [issues section](https://github.com/CorentinTh/it-tools/issues/new/choose) in the GitHub repository.
404:
notFound: '404 Not Found'
sorry: 'Sorry, this page does not seem to exist'
maybe: 'Maybe the cache is doing tricky things, try force-refreshing?'
backHome: 'Back home'
favoriteButton:
remove: 'Remove from favorites'
add: 'Add to favorites'
toolCard:
new: New
search:
label: Search
tools:
categories:
favorite-tools: 'Your favorite tools'
crypto: Crypto
converter: Converter
web: Web
images and videos: 'Images & Videos'
development: Development
network: Network
math: Math
measurement: Measurement
text: Text
data: Data
+63 -1
View File
@@ -1,3 +1,65 @@
home:
categories:
newestTools: "Nouveaux outils"
newestTools: 'Les nouveaux outils'
favoriteTools: 'Vos outils favoris'
allTools: 'Tous les outils'
subtitle: 'Outils pour les développeurs'
toggleMenu: 'Menu'
home: Accueil
uiLib: 'UI Lib'
buyMeACoffee: 'Soutenez IT-Tools'
follow:
title: 'Vous aimez it-tools ?'
p1: 'Soutenez-nous avec une star sur'
githubRepository: "le dépôt GitHub d'IT-Tools"
p2: 'ou suivez-nous sur'
twitterAccount: "le compte Twitter d'IT-Tools"
thankYou: 'Merci !'
nav:
github: 'Dépôt GitHub'
githubRepository: "Dépôt GitHub d'IT-Tools"
twitter: 'Compte Twitter'
twitterAccount: "Compte Twitter d'IT-Tools"
about: "À propos d'IT-Tools"
aboutLabel: 'À propos'
darkMode: 'Mode sombre'
lightMode: 'Mode clair'
mode: 'Basculer le mode sombre/clair'
about:
content: >
# À propos de IT-Tools
Ce merveilleux site, fait avec ❤ par [Corentin Thomasset](https://github.com/CorentinTh), regroupe des outils utiles pour les développeurs et les personnes travaillant dans l'informatique. Si vous le trouvez utile, n'hésitez pas à le partager et n'oubliez pas de le mettre dans vos favoris !
IT Tools est open-source (sous licence MIT) et gratuit, et le restera toujours, mais cela me coûte de l'argent pour l'héberger et renouveler le nom de domaine. Si vous voulez soutenir mon travail, et m'encourager à ajouter plus d'outils, n'hésitez pas à me [soutenir](https://www.buymeacoffee.com/cthmsst).
## Technologies
IT Tools est fait en Vue.js (Vue 3) avec la bibliothèque de composants Naive UI et est hébergé et déployé en continu par Vercel. Des bibliothèques open-source tierces sont utilisées dans certains outils, vous pouvez trouver la liste complète dans le fichier [package.json](https://github.com/CorentinTh/it-tools/blob/main/package.json) du dépôt.
## Vous avez trouvé un bug ? Un outil manque ?
Si vous avez besoin d'un outil qui n'est pas encore présent ici, et que vous pensez qu'il peut être utile, vous êtes invité à soumettre une demande de fonctionnalité dans la [section issue](https://github.com/CorentinTh/it-tools/issues/new/choose) du dépôt GitHub.
404:
notFound: '404 Not Found'
sorry: "Désolé, cette page n'existe pas"
maybe: 'Peut-être que le cache fait des siennes, essayez de forcer le rafraîchissement ?'
backHome: "Retour à l'accueil"
toolCard:
new: Nouveau
search:
label: Rechercher
tools:
categories:
favorite-tools: 'Vos outils favoris'
crypto: Cryptographie
converter: Convertisseur
web: Web
images and videos: 'Images & Vidéos'
development: Développement
network: Réseau
math: Math
measurement: Mesure
text: Texte
data: Données
+71
View File
@@ -0,0 +1,71 @@
home:
categories:
newestTools: '最新工具'
favoriteTools: '我的收藏'
allTools: '全部工具'
subtitle: '助力开发人员和 IT 工作者'
toggleMenu: '切换菜单'
home: '主页'
uiLib: 'UI 库'
support: '支持 IT 工具开发'
buyMeACoffee: '赞助'
follow:
title: '关注我们'
p1: '给我们 Star'
githubRepository: 'GitHub 仓库'
p2: '关注我们的'
twitterAccount: 'Twitter'
thankYou: '感谢您的支持!'
nav:
github: 'GitHub 仓库'
githubRepository: 'GitHub 仓库'
twitter: 'Twitter 账号'
twitterAccount: 'Twitter 账号'
about: '关于 IT-Tools'
aboutLabel: '关于'
darkMode: '深色模式'
lightMode: '浅色模式'
mode: '颜色模式'
about:
content: >
# 关于 IT-Tools
IT-Tools 由 [Corentin Thomasset](https://github.com/CorentinTh) 用 ❤ 开发,汇集了对开发人员和 IT 从业者有用的工具。如果对您有帮助,请将其分享给您的朋友,并且添加到收藏夹中!
IT-Tools 永久免费且开源(MIT 许可证),但需要资金用于托管和续订域名。如果您想支持我的工作,并鼓励我添加更多工具,请考虑通过 [赞助我](https://www.buymeacoffee.com/cthmsst) 进行支持。
## 技术
IT-Tools 采用 Vue.js(Vue 3)和 Naive UI 组件库开发,并由 Vercel 托管和持续部署。某些工具使用了第三方开源库,您可以在仓库的 [package.json](https://github.com/CorentinTh/it-tools/blob/main/package.json) 文件中找到完整的列表。
## 发现了 Bug?缺少工具?
如果目前这里没有您需要的工具,并且您认为它可能有用,欢迎在 GitHub 仓库的 [issues](https://github.com/CorentinTh/it-tools/issues/new/choose) 中提交新增功能的请求。
如果您发现了 Bug,或者某些功能未能按预期工作,请在 GitHub 仓库的 [issues](https://github.com/CorentinTh/it-tools/issues/new/choose) 中提交错误报告。
404:
notFound: '404 页面不存在'
sorry: '抱歉,该页面似乎不存在'
maybe: '也许缓存出现了一些问题,试试强制刷新页面?'
backHome: '返回主页'
favoriteButton:
remove: '取消收藏'
add: '加入收藏'
toolCard:
new: '新'
search:
label: '搜索'
tools:
categories:
favorite-tools: '我的收藏'
crypto: '加密'
converter: '转换器'
web: Web
images and videos: '图片和视频'
development: '开发'
network: '网络'
math: '数学'
measurement: '测量'
text: '文本'
data: '数据'
+8 -4
View File
@@ -1,6 +1,6 @@
{
"name": "it-tools",
"version": "2023.11.1-e164afb",
"version": "2023.11.2-7d94e11",
"description": "Collection of handy online tools for developers, with great UX. ",
"keywords": [
"productivity",
@@ -55,6 +55,7 @@
"cronstrue": "^2.26.0",
"crypto-js": "^4.1.1",
"date-fns": "^2.29.3",
"dompurify": "^3.0.6",
"emojilib": "^3.0.10",
"figue": "^1.2.0",
"fuse.js": "^6.6.2",
@@ -65,13 +66,15 @@
"jwt-decode": "^3.1.2",
"libphonenumber-js": "^1.10.28",
"lodash": "^4.17.21",
"marked": "^10.0.0",
"mathjs": "^11.9.1",
"mime-types": "^2.1.35",
"monaco-editor": "^0.43.0",
"naive-ui": "^2.35.0",
"netmask": "^2.0.2",
"node-forge": "^1.3.1",
"oui": "^12.0.52",
"oui-data": "^1.0.10",
"pdf-signature-reader": "^1.4.2",
"pinia": "^2.0.34",
"plausible-tracker": "^0.3.8",
"qrcode": "^1.5.1",
@@ -97,6 +100,7 @@
"@tsconfig/node18": "^18.2.0",
"@types/bcryptjs": "^2.4.2",
"@types/crypto-js": "^4.1.1",
"@types/dompurify": "^3.0.5",
"@types/jsdom": "^21.0.0",
"@types/lodash": "^4.14.192",
"@types/mime-types": "^2.1.1",
@@ -106,7 +110,7 @@
"@types/qrcode": "^1.5.0",
"@types/ua-parser-js": "^0.7.36",
"@types/uuid": "^9.0.0",
"@unocss/eslint-config": "^0.55.0",
"@unocss/eslint-config": "^0.57.0",
"@vitejs/plugin-vue": "^4.3.2",
"@vitejs/plugin-vue-jsx": "^3.0.2",
"@vue/compiler-sfc": "^3.2.47",
@@ -120,7 +124,7 @@
"less": "^4.1.3",
"prettier": "^3.0.0",
"typescript": "~5.2.0",
"unocss": "^0.55.0",
"unocss": "^0.57.0",
"unocss-preset-scrollbar": "^0.2.1",
"unplugin-icons": "^0.17.0",
"unplugin-vue-components": "^0.25.0",
+323 -368
View File
File diff suppressed because it is too large. Load diff
+7
View File
@@ -11,6 +11,13 @@ const styleStore = useStyleStore();
const theme = computed(() => (styleStore.isDarkTheme ? darkTheme : null));
const themeOverrides = computed(() => (styleStore.isDarkTheme ? darkThemeOverrides : lightThemeOverrides));
const { locale } = useI18n();
syncRef(
locale,
useStorage('locale', locale),
);
</script>
<template>
+2 -2
View File
@@ -36,7 +36,7 @@ const menuOptions = computed(() =>
tools: components.map(tool => ({
label: makeLabel(tool),
icon: makeIcon(tool),
key: tool.name,
key: tool.path,
})),
})),
);
@@ -62,7 +62,7 @@ const themeVars = useThemeVars();
<n-menu
class="menu"
:value="route.name as string"
:value="route.path"
:collapsed-width="64"
:collapsed-icon-size="22"
:options="tools"
+1 -1
View File
@@ -24,7 +24,7 @@ function toggleFavorite(event: MouseEvent) {
</script>
<template>
<c-tooltip :tooltip="isFavorite ? 'Remove from favorites' : 'Add to favorites' ">
<c-tooltip :tooltip="isFavorite ? $t('favoriteButton.remove') : $t('favoriteButton.add') ">
<c-button
variant="text"
circle
@@ -0,0 +1,22 @@
import { type Ref, ref, watchEffect } from 'vue';
export { computedCatch };
function computedCatch<T, D>(getter: () => T, { defaultValue }: { defaultValue: D; defaultErrorMessage?: string }): [Ref<T | D>, Ref<string | undefined>];
function computedCatch<T, D>(getter: () => T, { defaultValue, defaultErrorMessage = 'Unknown error' }: { defaultValue?: D; defaultErrorMessage?: string } = {}) {
const error = ref<string | undefined>();
const value = ref<T | D | undefined>();
watchEffect(() => {
try {
error.value = undefined;
value.value = getter();
}
catch (err) {
error.value = err instanceof Error ? err.message : err?.toString() ?? defaultErrorMessage;
value.value = defaultValue;
}
});
return [value, error] as const;
}
+21
View File
@@ -0,0 +1,21 @@
import _ from 'lodash';
function useDebouncedRef<T>(initialValue: T, delay: number, immediate: boolean = false) {
const state = ref(initialValue);
const debouncedRef = customRef((track, trigger) => ({
get() {
track();
return state.value;
},
set: _.debounce(
(value) => {
state.value = value;
trigger();
},
delay,
{ leading: immediate },
),
}));
return debouncedRef;
}
export default useDebouncedRef;
+32
View File
@@ -0,0 +1,32 @@
import { describe, expect, it } from 'vitest';
import { getMimeTypeFromBase64 } from './downloadBase64';
describe('downloadBase64', () => {
describe('getMimeTypeFromBase64', () => {
it('when the base64 string has a data URI, it returns the mime type', () => {
expect(getMimeTypeFromBase64({ base64String: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA' })).to.deep.equal({ mimeType: 'image/png' });
expect(getMimeTypeFromBase64({ base64String: 'data:image/jpg;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA' })).to.deep.equal({ mimeType: 'image/jpg' });
});
it('when the base64 string has no data URI, it try to infer the mime type from the signature', () => {
// https://en.wikipedia.org/wiki/List_of_file_signatures
// PNG
expect(getMimeTypeFromBase64({ base64String: 'iVBORw0KGgoAAAANSUhEUgAAAAUA' })).to.deep.equal({ mimeType: 'image/png' });
// GIF
expect(getMimeTypeFromBase64({ base64String: 'R0lGODdh' })).to.deep.equal({ mimeType: 'image/gif' });
expect(getMimeTypeFromBase64({ base64String: 'R0lGODlh' })).to.deep.equal({ mimeType: 'image/gif' });
// JPG
expect(getMimeTypeFromBase64({ base64String: '/9j/' })).to.deep.equal({ mimeType: 'image/jpg' });
// PDF
expect(getMimeTypeFromBase64({ base64String: 'JVBERi0' })).to.deep.equal({ mimeType: 'application/pdf' });
});
it('when the base64 string has no data URI and no signature, it returns an undefined mimeType', () => {
expect(getMimeTypeFromBase64({ base64String: 'JVBERi' })).to.deep.equal({ mimeType: undefined });
});
});
});
+40 -12
View File
@@ -1,32 +1,60 @@
import { extension as getExtensionFromMime } from 'mime-types';
import type { Ref } from 'vue';
import _ from 'lodash';
function getFileExtensionFromBase64({
base64String,
export { getMimeTypeFromBase64, useDownloadFileFromBase64 };
const commonMimeTypesSignatures = {
'JVBERi0': 'application/pdf',
'R0lGODdh': 'image/gif',
'R0lGODlh': 'image/gif',
'iVBORw0KGgo': 'image/png',
'/9j/': 'image/jpg',
};
function getMimeTypeFromBase64({ base64String }: { base64String: string }) {
const [,mimeTypeFromBase64] = base64String.match(/data:(.*?);base64/i) ?? [];
if (mimeTypeFromBase64) {
return { mimeType: mimeTypeFromBase64 };
}
const inferredMimeType = _.find(commonMimeTypesSignatures, (_mimeType, signature) => base64String.startsWith(signature));
if (inferredMimeType) {
return { mimeType: inferredMimeType };
}
return { mimeType: undefined };
}
function getFileExtensionFromMimeType({
mimeType,
defaultExtension = 'txt',
}: {
base64String: string
mimeType: string | undefined
defaultExtension?: string
}) {
const hasMimeType = base64String.match(/data:(.*?);base64/i);
if (hasMimeType) {
return getExtensionFromMime(hasMimeType[1]) || defaultExtension;
if (mimeType) {
return getExtensionFromMime(mimeType) ?? defaultExtension;
}
return defaultExtension;
}
export function useDownloadFileFromBase64({ source, filename }: { source: Ref<string>; filename?: string }) {
function useDownloadFileFromBase64({ source, filename }: { source: Ref<string>; filename?: string }) {
return {
download() {
const base64String = source.value;
if (base64String === '') {
if (source.value === '') {
throw new Error('Base64 string is empty');
}
const cleanFileName = filename ?? `file.${getFileExtensionFromBase64({ base64String })}`;
const { mimeType } = getMimeTypeFromBase64({ base64String: source.value });
const base64String = mimeType
? source.value
: `data:text/plain;base64,${source.value}`;
const cleanFileName = filename ?? `file.${getFileExtensionFromMimeType({ mimeType })}`;
const a = document.createElement('a');
a.href = base64String;
+16 -8
View File
@@ -4,10 +4,10 @@ import { NIcon, useThemeVars } from 'naive-ui';
import { RouterLink } from 'vue-router';
import { Heart, Home2, Menu2 } from '@vicons/tabler';
import { storeToRefs } from 'pinia';
import HeroGradient from '../assets/hero-gradient.svg?component';
import MenuLayout from '../components/MenuLayout.vue';
import NavbarButtons from '../components/NavbarButtons.vue';
import { toolsByCategory } from '@/tools';
import { useStyleStore } from '@/stores/style.store';
import { config } from '@/config';
import type { ToolCategory } from '@/tools/tools.types';
@@ -21,12 +21,14 @@ const version = config.app.version;
const commitSha = config.app.lastCommitSha.slice(0, 7);
const { tracker } = useTracker();
const { t } = useI18n();
const toolStore = useToolStore();
const { favoriteTools, toolsByCategory } = storeToRefs(toolStore);
const tools = computed<ToolCategory[]>(() => [
...(toolStore.favoriteTools.length > 0 ? [{ name: 'Your favorite tools', components: toolStore.favoriteTools }] : []),
...toolsByCategory,
...(favoriteTools.value.length > 0 ? [{ name: t('tools.categories.favorite-tools'), components: favoriteTools.value }] : []),
...toolsByCategory.value,
]);
</script>
@@ -47,8 +49,12 @@ const tools = computed<ToolCategory[]>(() => [
</RouterLink>
<div class="sider-content">
<div v-if="styleStore.isSmallScreen" flex justify-center>
<NavbarButtons />
<div v-if="styleStore.isSmallScreen" flex flex-col items-center>
<locale-selector w="90%" />
<div flex justify-center>
<NavbarButtons />
</div>
</div>
<CollapsibleToolMenu :tools-by-category="tools" />
@@ -94,13 +100,13 @@ const tools = computed<ToolCategory[]>(() => [
<NIcon size="25" :component="Menu2" />
</c-button>
<c-tooltip tooltip="Home" position="bottom">
<c-tooltip :tooltip="$t('home.home')" position="bottom">
<c-button to="/" circle variant="text" :aria-label="$t('home.home')">
<NIcon size="25" :component="Home2" />
</c-button>
</c-tooltip>
<c-tooltip tooltip="UI Lib" position="bottom">
<c-tooltip :tooltip="$t('home.uiLib')" position="bottom">
<c-button v-if="config.app.env === 'development'" to="/c-lib" circle variant="text" :aria-label="$t('home.uiLib')">
<icon-mdi:brush-variant text-20px />
</c-button>
@@ -108,11 +114,13 @@ const tools = computed<ToolCategory[]>(() => [
<command-palette />
<locale-selector v-if="!styleStore.isSmallScreen" />
<div>
<NavbarButtons v-if="!styleStore.isSmallScreen" />
</div>
<c-tooltip position="bottom" tooltip="Support IT Tools development">
<c-tooltip position="bottom" :tooltip="$t('home.support')">
<c-button
round
href="https://www.buymeacoffee.com/cthmsst"
@@ -116,7 +116,7 @@ function activateOption(option: PaletteOption) {
<span flex items-center gap-3 op-40>
<icon-mdi-search />
Search...
{{ $t('search.label') }}
<span hidden flex-1 border border-current border-op-40 rounded border-solid px-5px py-3px sm:inline>
{{ isMac ? 'Cmd' : 'Ctrl' }}&nbsp;+&nbsp;K
@@ -0,0 +1,28 @@
<script setup lang="ts">
const { availableLocales, locale } = useI18n();
const localesLong: Record<string, string> = {
en: 'English',
es: 'Español',
fr: 'Français',
pt: 'Português',
ru: 'Русский',
zh: '中文',
};
const localeOptions = computed(() =>
availableLocales.map(locale => ({
label: localesLong[locale] ?? locale,
value: locale,
})),
);
</script>
<template>
<c-select
v-model:value="locale"
:options="localeOptions"
placeholder="Select a language"
w-100px
/>
</template>
+1 -55
View File
@@ -1,63 +1,9 @@
<script setup lang="ts">
import { useHead } from '@vueuse/head';
import { useTracker } from '@/modules/tracker/tracker.services';
useHead({ title: 'About - IT Tools' });
const { tracker } = useTracker();
</script>
<template>
<div mx-auto mt-50px max-w-600px>
<h1>{{ $t('about.h1') }}</h1>
<p text-justify>
{{ $t('about.h1p1') }}
<c-link href="https://github.com/CorentinTh" target="_blank" rel="noopener">
Corentin Thomasset
</c-link>{{ $t('about.h1p2') }}
</p>
<p text-justify>
{{ $t('about.h1p3') }}
<c-link
href="https://www.buymeacoffee.com/cthmsst"
rel="noopener"
target="_blank"
@click="() => tracker.trackEvent({ eventName: 'Support button clicked' })"
>
{{ $t('about.h1p4') }}
</c-link>.
</p>
<h2>{{ $t('about.h2') }}</h2>
<p text-justify>
{{ $t('about.h2p1') }}
<c-link href="https://github.com/CorentinTh/it-tools/blob/main/package.json" rel="noopener" target="_blank">
package.json
</c-link>
{{ $t('about.h2p2') }}
</p>
<h2>{{ $t('about.h3') }}</h2>
<p text-justify>
{{ $t('about.h3p1') }}
<c-link
href="https://github.com/CorentinTh/it-tools/issues/new/choose"
rel="noopener"
target="_blank"
>
{{ $t('about.h3p2') }}
</c-link>
{{ $t('about.h3p3') }}
</p>
<p text-justify>
{{ $t('about.h3p4') }}
<c-link
href="https://github.com/CorentinTh/it-tools/issues/new/choose"
rel="noopener"
target="_blank"
>
{{ $t('about.h3p5') }}
</c-link>
{{ $t('about.h3p6') }}
</p>
</div>
<c-markdown :markdown="$t('about.content')" mx-auto mt-50px max-w-600px />
</template>
+2 -1
View File
@@ -31,7 +31,8 @@ const { t } = useI18n();
rel="noopener"
target="_blank"
:aria-label="$t('home.follow.twitterAccount')"
>Twitter</a>{{ $t('home.follow.thankYou') }}
>Twitter</a>.
{{ $t('home.follow.thankYou') }}
<n-icon :component="Heart" />
</ColoredCard>
</n-gi>
+6
View File
@@ -32,4 +32,10 @@ declare module 'unicode-emoji-json' {
}>;
export default emoji;
}
declare module 'pdf-signature-reader' {
const verifySignature: (pdf: ArrayBuffer) => ({signatures: SignatureInfo[]});
export default verifySignature;
}
@@ -1,7 +1,5 @@
<script setup lang="ts">
import { Upload } from '@vicons/tabler';
import { useBase64 } from '@vueuse/core';
import type { UploadFileInfo } from 'naive-ui';
import type { Ref } from 'vue';
import { useCopy } from '@/composable/copy';
import { useDownloadFileFromBase64 } from '@/composable/downloadBase64';
@@ -33,14 +31,12 @@ function downloadFile() {
}
}
const fileList = ref();
const fileInput = ref() as Ref<File>;
const { base64: fileBase64 } = useBase64(fileInput);
const { copy: copyFileBase64 } = useCopy({ source: fileBase64, text: 'Base64 string copied to the clipboard' });
async function onUpload({ file: { file } }: { file: UploadFileInfo }) {
async function onUpload(file: File) {
if (file) {
fileList.value = [];
fileInput.value = file;
}
}
@@ -65,18 +61,8 @@ async function onUpload({ file: { file } }: { file: UploadFileInfo }) {
</c-card>
<c-card title="File to base64">
<n-upload v-model:file-list="fileList" :show-file-list="true" :on-before-upload="onUpload" list-type="image">
<n-upload-dragger>
<div mb-2>
<n-icon size="35" :depth="3" :component="Upload" />
</div>
<div op-60>
Click or drag a file to this area to upload
</div>
</n-upload-dragger>
</n-upload>
<c-input-text :value="fileBase64" multiline readonly placeholder="File in base64 will be here" rows="5" mb-2 />
<c-file-upload title="Drag and drop a file here, or click to select a file" @file-upload="onUpload" />
<c-input-text :value="fileBase64" multiline readonly placeholder="File in base64 will be here" rows="5" my-2 />
<div flex justify-center>
<c-button @click="copyFileBase64()">
+1
View File
@@ -23,6 +23,7 @@ const compareMatch = computed(() => compareSync(compareString.value, compareHash
raw-text
label="Your string: "
label-position="left"
label-align="right"
label-width="120px"
mb-2
/>
@@ -28,6 +28,7 @@ const permissionCannotBePrompted = ref(false);
const {
stream,
start,
stop,
enabled: isMediaStreamAvailable,
} = useUserMedia({
constraints: computed(() => ({
@@ -83,6 +84,8 @@ watchEffect(() => {
}
});
onBeforeUnmount(() => stop());
async function requestPermissions() {
try {
await ensurePermissions();
+3 -3
View File
@@ -23,11 +23,11 @@ const input = ref('lorem ipsum dolor sit amet');
const formats = computed(() => [
{
label: 'Lowercase:',
value: noCase(input.value, baseConfig).toLocaleLowerCase(),
value: input.value.toLocaleLowerCase(),
},
{
label: 'Uppercase:',
value: noCase(input.value, baseConfig).toLocaleUpperCase(),
value: input.value.toLocaleUpperCase(),
},
{
label: 'Camelcase:',
@@ -75,7 +75,7 @@ const formats = computed(() => [
},
{
label: 'Mockingcase:',
value: noCase(input.value, baseConfig)
value: input.value
.split('')
.map((char, index) => (index % 2 === 0 ? char.toUpperCase() : char.toLowerCase()))
.join(''),
+9 -3
View File
@@ -1,5 +1,6 @@
<script setup lang="ts">
import { AES, RC4, Rabbit, TripleDES, enc } from 'crypto-js';
import { computedCatch } from '@/composable/computed/catchedComputed';
const algos = { AES, TripleDES, Rabbit, RC4 };
@@ -11,9 +12,10 @@ const cypherOutput = computed(() => algos[cypherAlgo.value].encrypt(cypherInput.
const decryptInput = ref('U2FsdGVkX1/EC3+6P5dbbkZ3e1kQ5o2yzuU0NHTjmrKnLBEwreV489Kr0DIB+uBs');
const decryptAlgo = ref<keyof typeof algos>('AES');
const decryptSecret = ref('my secret key');
const decryptOutput = computed(() =>
algos[decryptAlgo.value].decrypt(decryptInput.value, decryptSecret.value).toString(enc.Utf8),
);
const [decryptOutput, decryptError] = computedCatch(() => algos[decryptAlgo.value].decrypt(decryptInput.value, decryptSecret.value).toString(enc.Utf8), {
defaultValue: '',
defaultErrorMessage: 'Unable to decrypt your text',
});
</script>
<template>
@@ -63,7 +65,11 @@ const decryptOutput = computed(() =>
/>
</div>
</div>
<c-alert v-if="decryptError" type="error" mt-12 title="Error while decrypting">
{{ decryptError }}
</c-alert>
<c-input-text
v-else
label="Your decrypted text:"
:value="decryptOutput"
placeholder="Your string hash"
+2 -2
View File
@@ -26,8 +26,8 @@ const endAt = computed(() =>
<template>
<div>
<div text-justify op-70>
With a concrete example, if you wash 3 plates in 5 minutes and you have 500 plates to wash, it will take you 5
hours and 10 minutes to wash them all.
With a concrete example, if you wash 5 plates in 3 minutes and you have 500 plates to wash, it will take you 5
hours to wash them all.
</div>
<n-divider />
<div flex gap-2>
@@ -60,9 +60,11 @@ const ibanExamples = [
<div>
<c-input-text v-model:value="rawIban" placeholder="Enter an IBAN to check for validity..." test-id="iban-input" />
<c-key-value-list :items="ibanInfo" my-5 data-test-id="iban-info" />
<c-card v-if="ibanInfo.length > 0" mt-5>
<c-key-value-list :items="ibanInfo" data-test-id="iban-info" />
</c-card>
<c-card title="Valid IBAN examples">
<c-card title="Valid IBAN examples" mt-5>
<div v-for="iban in ibanExamples" :key="iban">
<c-text-copyable :value="iban" font-mono :displayed-value="friendlyFormatIBAN(iban)" />
</div>
@@ -0,0 +1,740 @@
[
{
"industryType": "Airplane Manufacturing",
"industryApplication": "Drilling, riveting, screw fastening",
"footCandlesRange": "75",
"recommendedLighting": "High Bay"
},
{
"industryType": "Airplane Manufacturing",
"industryApplication": "Final assembly, hangar",
"footCandlesRange": "100",
"recommendedLighting": "High Bay"
},
{
"industryType": "Airplane Manufacturing",
"industryApplication": "Inspection",
"footCandlesRange": "50-200",
"recommendedLighting": "High Bay"
},
{
"industryType": "Airplane Manufacturing",
"industryApplication": "Welding",
"footCandlesRange": "50",
"recommendedLighting": "High Bay"
},
{
"industryType": "Assembly",
"industryApplication": "Rough easy seeing",
"footCandlesRange": "20-50",
"recommendedLighting": "High Bay"
},
{
"industryType": "Assembly",
"industryApplication": "Rough difficult seeing",
"footCandlesRange": "50-100",
"recommendedLighting": "High Bay"
},
{
"industryType": "Assembly",
"industryApplication": "Medium",
"footCandlesRange": "100-200",
"recommendedLighting": "High Bay"
},
{
"industryType": "Auditoriums",
"industryApplication": "Social Activities",
"footCandlesRange": "05-oct",
"recommendedLighting": "Flat Panel/Troffer"
},
{
"industryType": "Auditoriums",
"industryApplication": "Assembly Only",
"footCandlesRange": "oct-20",
"recommendedLighting": "Flat Panel/Troffer"
},
{
"industryType": "Auditoriums",
"industryApplication": "Exhibitions",
"footCandlesRange": "15-25",
"recommendedLighting": "Flat Panel/Troffer"
},
{
"industryType": "Automotive Manufacturing",
"industryApplication": "Frame Assembly",
"footCandlesRange": "50",
"recommendedLighting": "High Bay"
},
{
"industryType": "Automotive Manufacturing",
"industryApplication": "Body & chassis assembly",
"footCandlesRange": "100",
"recommendedLighting": "High Bay"
},
{
"industryType": "Automotive Manufacturing",
"industryApplication": "Body parts assembly",
"footCandlesRange": "100",
"recommendedLighting": "High Bay"
},
{
"industryType": "Automotive Manufacturing",
"industryApplication": "Final Assembly, finishing, inspecting",
"footCandlesRange": "200",
"recommendedLighting": "High Bay"
},
{
"industryType": "Banks",
"industryApplication": "Lobby General",
"footCandlesRange": "oct-50",
"recommendedLighting": "Flat Panel/Troffer"
},
{
"industryType": "Banks",
"industryApplication": "Writing Areas",
"footCandlesRange": "20-70",
"recommendedLighting": "Flat Panel/Troffer"
},
{
"industryType": "Banks",
"industryApplication": "Teller Stations, Posting & Keypunch",
"footCandlesRange": "50-150",
"recommendedLighting": "Flat Panel/Troffer"
},
{
"industryType": "Barber Shop",
"industryApplication": "Beauty Parlors",
"footCandlesRange": "50-100",
"recommendedLighting": "Flat Panel"
},
{
"industryType": "Chemical Works",
"industryApplication": "Chemical Works",
"footCandlesRange": "30",
"recommendedLighting": "Vapor Tight/Hazardous"
},
{
"industryType": "Clothing Manufacturer",
"industryApplication": "Receiving, storing, shipping, winding, measuring",
"footCandlesRange": "20-50",
"recommendedLighting": "Flat Panel/Troffer"
},
{
"industryType": "Clothing Manufacturer",
"industryApplication": "Pattern making, trimming",
"footCandlesRange": "50-100",
"recommendedLighting": "Flat Panel/Troffer"
},
{
"industryType": "Clothing Manufacturer",
"industryApplication": "Shops, Marking",
"footCandlesRange": "50-200",
"recommendedLighting": "Flat Panel/Troffer/High Bay"
},
{
"industryType": "Clothing Manufacturer",
"industryApplication": "Cutting, Pressing",
"footCandlesRange": "100-500",
"recommendedLighting": "Flat Panel/Troffer/High Bay"
},
{
"industryType": "Clothing Manufacturer",
"industryApplication": "Sewing, Inspection",
"footCandlesRange": "200-500",
"recommendedLighting": "Flat Panel/Troffer/High Bay"
},
{
"industryType": "Electrical Equipment Manufacturing",
"industryApplication": "Impregnating",
"footCandlesRange": "20-50",
"recommendedLighting": "High Bay"
},
{
"industryType": "Electrical Equipment Manufacturing",
"industryApplication": "Insulating coil winding, testing",
"footCandlesRange": "50-100",
"recommendedLighting": "High Bay"
},
{
"industryType": "Food Service Facility",
"industryApplication": "Dining areas, cashier",
"footCandlesRange": "20-50",
"recommendedLighting": "Troffer/Recessed"
},
{
"industryType": "Food Service Facility",
"industryApplication": "Cleaning",
"footCandlesRange": "oct-20",
"recommendedLighting": "Recessed"
},
{
"industryType": "Food Service Facility",
"industryApplication": "Dining",
"footCandlesRange": "mai-20",
"recommendedLighting": "Troffer/Recessed"
},
{
"industryType": "Food Service Facility",
"industryApplication": "Food Displays",
"footCandlesRange": "30-100",
"recommendedLighting": "Recessed"
},
{
"industryType": "Food Service Facility",
"industryApplication": "Kitchen",
"footCandlesRange": "50-100",
"recommendedLighting": "IP65 High Bay"
},
{
"industryType": "Foundries",
"industryApplication": "Annealing Furnaces",
"footCandlesRange": "20-50",
"recommendedLighting": "High Bay"
},
{
"industryType": "Foundries",
"industryApplication": "Cleaning",
"footCandlesRange": "20-50",
"recommendedLighting": "High Bay"
},
{
"industryType": "Foundries",
"industryApplication": "Core Making",
"footCandlesRange": "50-200",
"recommendedLighting": "High Bay"
},
{
"industryType": "Foundries",
"industryApplication": "Inspection Fine",
"footCandlesRange": "100-200",
"recommendedLighting": "High Bay"
},
{
"industryType": "Foundries",
"industryApplication": "Inspection Medium",
"footCandlesRange": "50-100",
"recommendedLighting": "High Bay"
},
{
"industryType": "Foundries",
"industryApplication": "Molding",
"footCandlesRange": "50-200",
"recommendedLighting": "High Bay"
},
{
"industryType": "Foundries",
"industryApplication": "Pouring, Sorting",
"footCandlesRange": "50-100",
"recommendedLighting": "High Bay/Hazardous"
},
{
"industryType": "Garages-Motor Vehicles",
"industryApplication": "Storage",
"footCandlesRange": "5",
"recommendedLighting": "Garage"
},
{
"industryType": "Garages-Motor Vehicles",
"industryApplication": "Parking Garage",
"footCandlesRange": "10",
"recommendedLighting": "Garage /.Strip"
},
{
"industryType": "Garages-Motor Vehicles",
"industryApplication": "Service Garage",
"footCandlesRange": "oct-20",
"recommendedLighting": "Garage"
},
{
"industryType": "Garages-Motor Vehicles",
"industryApplication": "Entrances",
"footCandlesRange": "50",
"recommendedLighting": "High Bay"
},
{
"industryType": "Garages-Motor Vehicles",
"industryApplication": "Repair Area",
"footCandlesRange": "50-100",
"recommendedLighting": "High Bay"
},
{
"industryType": "Gymnasiums",
"industryApplication": "Assemblies",
"footCandlesRange": "10",
"recommendedLighting": "Flat Panel/High Bay"
},
{
"industryType": "Gymnasiums",
"industryApplication": "General Exercise & Recreation",
"footCandlesRange": "30",
"recommendedLighting": "Flat Panel/High Bay"
},
{
"industryType": "Gymnasiums",
"industryApplication": "Exhibitions, Matches",
"footCandlesRange": "50",
"recommendedLighting": "Flat Panel/High Bay"
},
{
"industryType": "Hospitals",
"industryApplication": "Rooms",
"footCandlesRange": "oct-30",
"recommendedLighting": "Troffer/Flat Panel"
},
{
"industryType": "Hospitals",
"industryApplication": "Corridors",
"footCandlesRange": "mai-30",
"recommendedLighting": "Troffer/Flat Panel"
},
{
"industryType": "Hospitals",
"industryApplication": "Emergency Rooms",
"footCandlesRange": "50-100",
"recommendedLighting": "NA"
},
{
"industryType": "Hospitals",
"industryApplication": "Operating Rooms",
"footCandlesRange": "100-200",
"recommendedLighting": "NA"
},
{
"industryType": "Hotels",
"industryApplication": "Bathrooms",
"footCandlesRange": "20-50",
"recommendedLighting": "Recessed"
},
{
"industryType": "Hotels",
"industryApplication": "Bedrooms for Reading",
"footCandlesRange": "oct-20",
"recommendedLighting": "NA"
},
{
"industryType": "Hotels",
"industryApplication": "Corridors, elevators and stairs",
"footCandlesRange": "oct-20",
"recommendedLighting": "Recessed"
},
{
"industryType": "Hotels",
"industryApplication": "Front Desk",
"footCandlesRange": "50-100",
"recommendedLighting": "Recessed"
},
{
"industryType": "Hotels",
"industryApplication": "Linen Room: Sewing",
"footCandlesRange": "100-200",
"recommendedLighting": "High Bay"
},
{
"industryType": "Hotels",
"industryApplication": "Linen Room: General",
"footCandlesRange": "oct-20",
"recommendedLighting": "High Bay"
},
{
"industryType": "Hotels",
"industryApplication": "Lobby: General Lighting",
"footCandlesRange": "oct-20",
"recommendedLighting": "Recessed"
},
{
"industryType": "Hotels",
"industryApplication": "Lobby: Reading and working areas",
"footCandlesRange": "20-50",
"recommendedLighting": "Recessed/Flat Panel"
},
{
"industryType": "Iron & Steel Manufacturing",
"industryApplication": "Stock, hot top, checker, cellar, calcining",
"footCandlesRange": "oct-30",
"recommendedLighting": "UFO/Hazardous/Flood"
},
{
"industryType": "Iron & Steel Manufacturing",
"industryApplication": "Building, slag pits, Stripping yard",
"footCandlesRange": "20",
"recommendedLighting": "UFO/Hazardous/Flood"
},
{
"industryType": "Iron & Steel Manufacturing",
"industryApplication": "Control platform, repairs, mixer building",
"footCandlesRange": "30",
"recommendedLighting": "UFO/Hazardous/Flood"
},
{
"industryType": "Iron & Steel Manufacturing",
"industryApplication": "Rolling mills",
"footCandlesRange": "30-50",
"recommendedLighting": "UFO/Hazardous/Flood"
},
{
"industryType": "Iron & Steel Manufacturing",
"industryApplication": "Shearing",
"footCandlesRange": "50",
"recommendedLighting": "UFO/Hazardous/Flood"
},
{
"industryType": "Iron & Steel Manufacturing",
"industryApplication": "Tin Plate",
"footCandlesRange": "50",
"recommendedLighting": "UFO/Hazardous/Flood"
},
{
"industryType": "Iron & Steel Manufacturing",
"industryApplication": "Motor Room, Machine Room",
"footCandlesRange": "30",
"recommendedLighting": "UFO/Hazardous/Flood"
},
{
"industryType": "Iron & Steel Manufacturing",
"industryApplication": "Inspection",
"footCandlesRange": "100",
"recommendedLighting": "UFO/Hazardous/Flood"
},
{
"industryType": "Library",
"industryApplication": "Ordinary Reading, Stacks",
"footCandlesRange": "20-50",
"recommendedLighting": "Troffer/Flat Panel"
},
{
"industryType": "Library",
"industryApplication": "Book Repair and Binding",
"footCandlesRange": "20-50",
"recommendedLighting": "Troffer/Flat Panel"
},
{
"industryType": "Library",
"industryApplication": "Study & Notes, Cataloging",
"footCandlesRange": "20-100",
"recommendedLighting": "Troffer/Flat Panel"
},
{
"industryType": "Library",
"industryApplication": "Card Files, Check Desk",
"footCandlesRange": "20-100",
"recommendedLighting": "Troffer/Flat Panel"
},
{
"industryType": "Laundries",
"industryApplication": "Washing",
"footCandlesRange": "20-50",
"recommendedLighting": "High Bay"
},
{
"industryType": "Laundries",
"industryApplication": "Ironing",
"footCandlesRange": "20-100",
"recommendedLighting": "High Bay"
},
{
"industryType": "Machine Shops",
"industryApplication": "Rough Bench",
"footCandlesRange": "20-50",
"recommendedLighting": "High Bay"
},
{
"industryType": "Machine Shops",
"industryApplication": "Medium Bench, Rough Grinding, Buffing",
"footCandlesRange": "50-100",
"recommendedLighting": "High Bay"
},
{
"industryType": "Machine Shops",
"industryApplication": "Fine Bench and Work",
"footCandlesRange": "200-500",
"recommendedLighting": "High Bay"
},
{
"industryType": "Materials Handling",
"industryApplication": "Loading Trucking",
"footCandlesRange": "oct-20",
"recommendedLighting": "High Bay/Temporary"
},
{
"industryType": "Materials Handling",
"industryApplication": "Picking Stock Classifying",
"footCandlesRange": "20-50",
"recommendedLighting": "High Bay"
},
{
"industryType": "Materials Handling",
"industryApplication": "Wrapping, Packing, Labeling",
"footCandlesRange": "20-50",
"recommendedLighting": "High Bay"
},
{
"industryType": "Offices",
"industryApplication": "Accounting",
"footCandlesRange": "50-100",
"recommendedLighting": "Flat Panel/Troffer"
},
{
"industryType": "Offices",
"industryApplication": "Audio-Visual Areas",
"footCandlesRange": "20-50",
"recommendedLighting": "Flat Panel/Troffer"
},
{
"industryType": "Offices",
"industryApplication": "Conference Areas",
"footCandlesRange": "20-70",
"recommendedLighting": "Flat Panel/Troffer"
},
{
"industryType": "Offices",
"industryApplication": "Corridors, Stairways",
"footCandlesRange": "20",
"recommendedLighting": "Flat Panel/Troffer"
},
{
"industryType": "Offices",
"industryApplication": "Drafting",
"footCandlesRange": "50-200",
"recommendedLighting": "Flat Panel/Troffer"
},
{
"industryType": "Offices",
"industryApplication": "General and Private Offices",
"footCandlesRange": "50-100",
"recommendedLighting": "Flat Panel/Troffer"
},
{
"industryType": "Offices",
"industryApplication": "Lobbies, Lounges, & Reception Areas",
"footCandlesRange": "mai-20",
"recommendedLighting": "Flat Panel/Troffer"
},
{
"industryType": "Offices",
"industryApplication": "Mail Sorting",
"footCandlesRange": "50-100",
"recommendedLighting": "Flat Panel/Troffer"
},
{
"industryType": "Offices",
"industryApplication": "Off-set printing & duplicating areas",
"footCandlesRange": "20-50",
"recommendedLighting": "Flat Panel/Troffer/High Bay"
},
{
"industryType": "Offices",
"industryApplication": "Spaces with VDT's",
"footCandlesRange": "75",
"recommendedLighting": "Flat Panel/Troffer"
},
{
"industryType": "Paint Shop",
"industryApplication": "Spraying, Rubbing",
"footCandlesRange": "20-50",
"recommendedLighting": "High Bay"
},
{
"industryType": "Paint Shop",
"industryApplication": "Hand Art, Stencil",
"footCandlesRange": "20-50",
"recommendedLighting": "High Bay"
},
{
"industryType": "Paint Shop",
"industryApplication": "Fine Hand Painting & Finishing",
"footCandlesRange": "50-100",
"recommendedLighting": "High Bay"
},
{
"industryType": "Paper Manufacturing",
"industryApplication": "Beaters, Grinding",
"footCandlesRange": "20-50",
"recommendedLighting": "UFO"
},
{
"industryType": "Paper Manufacturing",
"industryApplication": "Finishing, Cutting",
"footCandlesRange": "50-100",
"recommendedLighting": "UFO"
},
{
"industryType": "Paper Manufacturing",
"industryApplication": "Hand Counting",
"footCandlesRange": "50-100",
"recommendedLighting": "UFO"
},
{
"industryType": "Paper Manufacturing",
"industryApplication": "Paper machine reel, Inspection",
"footCandlesRange": "100-200",
"recommendedLighting": "UFO"
},
{
"industryType": "Paper Manufacturing",
"industryApplication": "Rewinder",
"footCandlesRange": "100-200",
"recommendedLighting": "UFO"
},
{
"industryType": "Printing",
"industryApplication": "Welding",
"footCandlesRange": "50",
"recommendedLighting": "High Bay/Flood"
},
{
"industryType": "Printing",
"industryApplication": "Color Inspecting",
"footCandlesRange": "100-200",
"recommendedLighting": "High Bay/Flood"
},
{
"industryType": "Printing",
"industryApplication": "Presses",
"footCandlesRange": "50-100",
"recommendedLighting": "High Bay/Flood"
},
{
"industryType": "Printing",
"industryApplication": "Proofreading",
"footCandlesRange": "100-200",
"recommendedLighting": "High Bay/Flood"
},
{
"industryType": "Printing",
"industryApplication": "Composing Room",
"footCandlesRange": "50-100",
"recommendedLighting": "High Bay/Flood"
},
{
"industryType": "Schools",
"industryApplication": "Reading",
"footCandlesRange": "20-100",
"recommendedLighting": "Flat Panel/Troffer"
},
{
"industryType": "Schools",
"industryApplication": "Typing",
"footCandlesRange": "20-100",
"recommendedLighting": "Flat Panel/Troffer"
},
{
"industryType": "Schools",
"industryApplication": "Demonstrations",
"footCandlesRange": "100-200",
"recommendedLighting": "Flat Panel/Troffer"
},
{
"industryType": "Schools",
"industryApplication": "Sewing",
"footCandlesRange": "20-100",
"recommendedLighting": "Flat Panel/Troffer"
},
{
"industryType": "Sheet Metal Works",
"industryApplication": "General",
"footCandlesRange": "100",
"recommendedLighting": "High Bay/Flood"
},
{
"industryType": "Sheet Metal Works",
"industryApplication": "Tin Plate Inspection",
"footCandlesRange": "100-200",
"recommendedLighting": "High Bay/Flood"
},
{
"industryType": "Sheet Metal Works",
"industryApplication": "Galvanizing, Scribing",
"footCandlesRange": "100-200",
"recommendedLighting": "High Bay/Flood"
},
{
"industryType": "Stores",
"industryApplication": "Circulation Area Stockroom",
"footCandlesRange": "oct-30",
"recommendedLighting": "Recessed"
},
{
"industryType": "Stores",
"industryApplication": "Merchandising, Servicing",
"footCandlesRange": "30-100",
"recommendedLighting": "Recessed/Troffer"
},
{
"industryType": "Stores",
"industryApplication": "Merchandising, Self-Servicing",
"footCandlesRange": "200",
"recommendedLighting": "Recessed/Troffer"
},
{
"industryType": "Textile Mills",
"industryApplication": "Cotton Picking, Carding, Roving, Spinning",
"footCandlesRange": "50",
"recommendedLighting": "High Bay"
},
{
"industryType": "Textile Mills",
"industryApplication": "Beaming & Slashing",
"footCandlesRange": "150",
"recommendedLighting": "High Bay"
},
{
"industryType": "Textile Mills",
"industryApplication": "Drawing",
"footCandlesRange": "200",
"recommendedLighting": "High Bay"
},
{
"industryType": "Textile Mills",
"industryApplication": "Others",
"footCandlesRange": "100",
"recommendedLighting": "High Bay"
},
{
"industryType": "Warehouse & Storage",
"industryApplication": "Inactive",
"footCandlesRange": "05-oct",
"recommendedLighting": "High Bay"
},
{
"industryType": "Warehouse & Storage",
"industryApplication": "Active Rough Bulky",
"footCandlesRange": "oct-20",
"recommendedLighting": "High Bay"
},
{
"industryType": "Warehouse & Storage",
"industryApplication": "Active Medium",
"footCandlesRange": "20",
"recommendedLighting": "High Bay"
},
{
"industryType": "Warehouse & Storage",
"industryApplication": "Active Fine",
"footCandlesRange": "20-50",
"recommendedLighting": "High Bay"
},
{
"industryType": "Welding",
"industryApplication": "General",
"footCandlesRange": "20-50",
"recommendedLighting": "High Bay/Flood"
},
{
"industryType": "Woodworking",
"industryApplication": "Sizing, planning, rough sanding, medium quality machine and bench work, gluing, veneering, cooperage",
"footCandlesRange": "20-50",
"recommendedLighting": "High Bay/Strip"
},
{
"industryType": "Woodworking",
"industryApplication": "Fine bench and machine work, fine sanding and finishing",
"footCandlesRange": "50-100",
"recommendedLighting": "High Bay/Strip"
},
{
"industryType": "Woodworking",
"industryApplication": "Rough sawing and bench work",
"footCandlesRange": "20-50",
"recommendedLighting": "High Bay/Strip"
}
]
@@ -0,0 +1,84 @@
<script setup lang="ts">
import iesData from './ies-lighting-data.json';
import { useFuzzySearch } from '@/composable/fuzzySearch';
import useDebouncedRef from '@/composable/debouncedref';
const data = iesData.map(i => ({ ...i, all: `${i.industryType} - ${i.industryApplication}` }));
const searchQuery = useDebouncedRef('', 500);
const { searchResult } = useFuzzySearch({
search: searchQuery,
data,
options: {
keys: ['all'],
threshold: 0.2,
isCaseSensitive: false,
minMatchCharLength: 3,
useExtendedSearch: true,
filterEmpty: false,
},
});
</script>
<template>
<div mx-auto max-w-2400px important:flex-1>
<div flex items-center gap-3>
<c-input-text
v-model:value="searchQuery"
placeholder="Search IES recommandation by industry or application"
mx-auto max-w-600px
>
<template #prefix>
<icon-mdi-search mr-6px color-black op-70 dark:color-white />
</template>
</c-input-text>
</div>
<n-p style="text-align: center">
Individual applications will determine exact foot-candle levels. Please refer to the <n-a href="https://www.ies.org/standards/lighting-library/" target="_blank">
IES Lighting Handbook
</n-a> for a more detailed evaluation
</n-p>
<div>
<div
v-if="searchResult.length === 0"
mt-4 text-center text-20px font-bold
>
No results
</div>
<div v-else>
<div mt-4 text-20px font-bold>
Search result
</div>
<n-table>
<thead>
<th>Industry</th>
<th>Application</th>
<th>Foot Candles</th>
<th>Lighting type</th>
</thead>
<tbody>
<tr v-for="(result, ix) in searchResult" :key="ix">
<td>
<input-copyable :value="result.industryType" />
</td>
<td>
<input-copyable :value="result.industryApplication" />
</td>
<td>
<input-copyable :value="result.footCandlesRange" />
</td>
<td>
<input-copyable :value="result.recommendedLighting" />
</td>
</tr>
</tbody>
</n-table>
</div>
</div>
</div>
</template>
@@ -0,0 +1,12 @@
import { BuildingLighthouse } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'IES Lighting Guidelines',
path: '/ies-lighting-guidelines',
description: 'Search in the Illuminating Engineering Society’s (IES) current illuminance recommendations.',
keywords: ['ies', 'illuminance', 'lighting', 'guideline'],
component: () => import('./ies-lighting-guidelines.vue'),
icon: BuildingLighthouse,
createdAt: new Date('2025-02-09'),
});
@@ -0,0 +1,11 @@
export const convertNoxToLux = (illuminance: number) => illuminance * 0.001;
export const convertLuxToNox = (illuminance: number) => illuminance * 1000;
export const convertFootCandlesToLux = (illuminance: number) => illuminance * 10.7639104167;
export const convertLuxToFootCandles = (illuminance: number) => illuminance * 0.09290304;
export const convertFlameToLux = (illuminance: number) => illuminance * 43.0556416668;
export const convertLuxToFlame = (illuminance: number) => illuminance * 0.02322576;
export const convertPhotToLux = (illuminance: number) => illuminance * 10000;
export const convertLuxToPhot = (illuminance: number) => illuminance * 0.0001;
@@ -0,0 +1,84 @@
<script setup lang="ts">
import _ from 'lodash';
import { convertFlameToLux, convertFootCandlesToLux, convertLuxToFlame, convertLuxToFootCandles, convertLuxToNox, convertLuxToPhot, convertNoxToLux, convertPhotToLux } from './illuminance-converter.service';
type IlluminanceScale = 'lux' | 'footcandles' | 'nox' | 'phot' | 'flame';
const units = reactive<
Record<
string | IlluminanceScale,
{ title: string; unit: string; ref: number; toLux: (v: number) => number; fromLux: (v: number) => number }
>
>({
lux: {
title: 'Lux',
unit: 'lx',
ref: 20000,
toLux: _.identity,
fromLux: _.identity,
},
footcandles: {
title: 'Foot-Candles',
unit: 'ft*c, fc',
ref: 0,
toLux: convertFootCandlesToLux,
fromLux: convertLuxToFootCandles,
},
nox: {
title: 'Nox',
unit: 'nox',
ref: 0,
toLux: convertNoxToLux,
fromLux: convertLuxToNox,
},
phot: {
title: 'Phot',
unit: 'ph',
ref: 0,
toLux: convertPhotToLux,
fromLux: convertLuxToPhot,
},
flame: {
title: 'Flame',
unit: 'flame',
ref: 0,
toLux: convertFlameToLux,
fromLux: convertLuxToFlame,
},
});
function update(key: IlluminanceScale) {
const { ref: value, toLux } = units[key];
const luxs = toLux(value) ?? 0;
_.chain(units)
.omit(key)
.forEach(({ fromLux }, index) => {
units[index].ref = Math.floor((fromLux(luxs) ?? 0) * 1000000) / 1000000;
})
.value();
}
update('lux');
</script>
<template>
<div>
<n-input-group v-for="[key, { title, unit }] in Object.entries(units)" :key="key" mb-3 w-full>
<n-input-group-label style="width: 100px">
{{ title }}
</n-input-group-label>
<n-input-number
v-model:value="units[key].ref"
style="flex: 1"
@update:value="() => update(key as IlluminanceScale)"
/>
<n-input-group-label style="width: 75px">
{{ unit }}
</n-input-group-label>
</n-input-group>
</div>
</template>
+12
View File
@@ -0,0 +1,12 @@
import { Brightness2 } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'Illuminance Converter',
path: '/illuminance-converter',
description: 'Illuminance units converter (Lux, Foot Candles, Nox, Phot, Flame)',
keywords: ['illuminance', 'converter', 'lux', 'lx', 'foot', 'candles', 'fc', 'flame', 'nox', 'phot'],
component: () => import('./illuminance-converter.vue'),
icon: Brightness2,
createdAt: new Date('2025-02-09'),
});
+13 -3
View File
@@ -1,6 +1,10 @@
import { tool as base64FileConverter } from './base64-file-converter';
import { tool as base64StringConverter } from './base64-string-converter';
import { tool as basicAuthGenerator } from './basic-auth-generator';
import { tool as iesLightingGuidelines } from './ies-lighting-guidelines';
import { tool as illuminanceConverter } from './illuminance-converter';
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
import { tool as numeronymGenerator } from './numeronym-generator';
import { tool as macAddressGenerator } from './mac-address-generator';
import { tool as textToBinary } from './text-to-binary';
import { tool as ulidGenerator } from './ulid-generator';
@@ -77,7 +81,7 @@ import { tool as xmlFormatter } from './xml-formatter';
export const toolsByCategory: ToolCategory[] = [
{
name: 'Crypto',
components: [tokenGenerator, hashText, bcrypt, uuidGenerator, ulidGenerator, cypher, bip39, hmacGenerator, rsaKeyPairGenerator, passwordStrengthAnalyser],
components: [tokenGenerator, hashText, bcrypt, uuidGenerator, ulidGenerator, cypher, bip39, hmacGenerator, rsaKeyPairGenerator, passwordStrengthAnalyser, pdfSignatureChecker],
},
{
name: 'Converter',
@@ -149,11 +153,17 @@ export const toolsByCategory: ToolCategory[] = [
},
{
name: 'Measurement',
components: [chronometer, temperatureConverter, benchmarkBuilder],
components: [
chronometer,
temperatureConverter,
benchmarkBuilder,
iesLightingGuidelines,
illuminanceConverter,
],
},
{
name: 'Text',
components: [loremIpsumGenerator, textStatistics, emojiPicker, stringObfuscator, textDiff],
components: [loremIpsumGenerator, textStatistics, emojiPicker, stringObfuscator, textDiff, numeronymGenerator],
},
{
name: 'Data',
@@ -1,12 +1,12 @@
<script setup lang="ts">
import db from 'oui/oui.json';
import db from 'oui-data';
import { macAddressValidationRules } from '@/utils/macAddress';
import { useCopy } from '@/composable/copy';
const getVendorValue = (address: string) => address.trim().replace(/[.:-]/g, '').toUpperCase().substring(0, 6);
const macAddress = ref('20:37:06:12:34:56');
const details = computed<string | undefined>(() => db[getVendorValue(macAddress.value)]);
const details = computed<string | undefined>(() => (db as Record<string, string>)[getVendorValue(macAddress.value)]);
const { copy } = useCopy({ source: () => details.value ?? '', text: 'Vendor info copied to the clipboard' });
</script>
-4
View File
@@ -1,4 +0,0 @@
declare module 'oui/oui.json' {
const db: Record<string, string>;
export default db;
}
+5 -1
View File
@@ -4,10 +4,13 @@ import { defineTool } from '../tool';
export const tool = defineTool({
name: 'Math evaluator',
path: '/math-evaluator',
description: 'Evaluate math expression, like a calculator on steroid (you can use function like sqrt, cos, sin, abs, ...)',
description: 'A calculator for evaluating mathematical expressions. You can use functions like sqrt, cos, sin, abs, etc.',
keywords: [
'math',
'evaluator',
'calculator',
'expression',
'abs',
'acos',
'acosh',
'acot',
@@ -31,6 +34,7 @@ export const tool = defineTool({
'sech',
'sin',
'sinh',
'sqrt',
'tan',
'tanh',
],
@@ -16,6 +16,9 @@ const result = computed(() => withDefaultOnError(() => evaluate(expression.value
multiline
placeholder="Your math expression (ex: 2*sqrt(6) )..."
raw-text
monospace
autofocus
autosize
/>
<c-card v-if="result !== ''" title="Result " mt-5>
+12
View File
@@ -0,0 +1,12 @@
import { defineTool } from '../tool';
import n7mIcon from './n7m-icon.svg?component';
export const tool = defineTool({
name: 'Numeronym generator',
path: '/numeronym-generator',
description: 'A numeronym is a word where a number is used to form an abbreviation. For example, "i18n" is a numeronym of "internationalization" where 18 stands for the number of letters between the first i and the last n in the word.',
keywords: ['numeronym', 'generator', 'abbreviation', 'i18n', 'a11y', 'l10n'],
component: () => import('./numeronym-generator.vue'),
icon: n7mIcon,
createdAt: new Date('2023-11-05'),
});
@@ -0,0 +1,3 @@
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" >
<path id="n7m" fill="currentColor" aria-label="n7m" d="m0.7 35v-16.7q1.1-0.2 2.8-0.5 1.7-0.3 4-0.3 2.1 0 3.4 0.6 1.4 0.5 2.2 1.6 0.8 1 1.1 2.5 0.4 1.4 0.4 3.2v9.6h-3.1v-9q0-1.6-0.2-2.7-0.2-1.1-0.7-1.8-0.5-0.7-1.4-1-0.8-0.3-2-0.3-0.5 0-1 0-0.6 0-1 0.1-0.5 0-0.9 0.1-0.4 0.1-0.5 0.1v14.5zm18.8 0h-3.2q0.2-2.6 0.9-5.5 0.8-3 1.9-5.7 1.1-2.8 2.4-5.1 1.3-2.4 2.5-3.9h-11.1v-2.7h14.6v2.6q-1.1 1.2-2.4 3.4-1.4 2.2-2.6 5-1.1 2.7-2 5.8-0.8 3-1 6.1zm6.6 0v-16.7q1.1-0.2 2.8-0.5 1.8-0.3 4-0.3 1.7 0 2.8 0.4 1.1 0.5 1.9 1.3 0.2-0.1 0.7-0.4 0.5-0.3 1.2-0.6 0.8-0.3 1.7-0.5 0.8-0.2 1.9-0.2 1.9 0 3.2 0.6 1.3 0.5 2 1.6 0.7 1 0.9 2.5 0.3 1.4 0.3 3.2v9.6h-3.1v-9q0-1.5-0.2-2.6-0.1-1.1-0.5-1.8-0.4-0.7-1.1-1.1-0.7-0.3-1.9-0.3-1.5 0-2.5 0.4-1 0.4-1.4 0.7 0.3 0.9 0.4 1.9 0.1 1 0.1 2.2v9.6h-3v-9q0-1.5-0.2-2.6-0.2-1.1-0.6-1.8-0.4-0.7-1.1-1.1-0.7-0.3-1.8-0.3-0.5 0-1 0-0.5 0-1 0.1-0.5 0-0.9 0.1-0.4 0.1-0.5 0.1v14.5z"/>
</svg>

After

Width:  |  Height:  |  Size: 982 B

@@ -0,0 +1,25 @@
import { expect, test } from '@playwright/test';
test.describe('Tool - Numeronym generator', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/numeronym-generator');
});
test('Has correct title', async ({ page }) => {
await expect(page).toHaveTitle('Numeronym generator - IT Tools');
});
test('a numeronym is generated when a word is entered', async ({ page }) => {
await page.getByTestId('word-input').fill('internationalization');
const numeronym = await page.getByTestId('numeronym').inputValue();
expect(numeronym).toEqual('i18n');
});
test('when a word has 3 letters or less, the numeronym is the word itself', async ({ page }) => {
await page.getByTestId('word-input').fill('abc');
const numeronym = await page.getByTestId('numeronym').inputValue();
expect(numeronym).toEqual('abc');
});
});
@@ -0,0 +1,15 @@
import { describe, expect, it } from 'vitest';
import { generateNumeronym } from './numeronym-generator.service';
describe('numeronym-generator service', () => {
describe('generateNumeronym', () => {
it('a numeronym of a word is the first letter, the number of letters between the first and the last letter, and the last letter', () => {
expect(generateNumeronym('internationalization')).toBe('i18n');
expect(generateNumeronym('accessibility')).toBe('a11y');
expect(generateNumeronym('localization')).toBe('l10n');
});
it('a numeronym of a word with 3 letters is the word itself', () => {
expect(generateNumeronym('abc')).toBe('abc');
});
});
});
@@ -0,0 +1,11 @@
export { generateNumeronym };
function generateNumeronym(word: string): string {
const wordLength = word.length;
if (wordLength <= 3) {
return word;
}
return `${word.at(0)}${wordLength - 2}${word.at(-1)}`;
}
@@ -0,0 +1,17 @@
<script setup lang="ts">
import { generateNumeronym } from './numeronym-generator.service';
const word = ref('');
const numeronym = computed(() => generateNumeronym(word.value));
</script>
<template>
<div flex flex-col items-center gap-4>
<c-input-text v-model:value="word" placeholder="Enter a word, e.g. 'internationalization'" size="large" clearable test-id="word-input" />
<icon-mdi-arrow-down text-30px />
<input-copyable :value="numeronym" size="large" readonly placeholder="Your numeronym will be here, e.g. 'i18n'" test-id="numeronym" />
</div>
</template>
@@ -0,0 +1,99 @@
<script setup lang="ts">
import type { SignatureInfo } from '../pdf-signature-checker.types';
const props = defineProps<{ signature: SignatureInfo }>();
const { signature } = toRefs(props);
const tableHeaders = {
validityPeriod: 'Validity period',
issuedBy: 'Issued by',
issuedTo: 'Issued to',
pemCertificate: 'PEM certificate',
};
const certs = computed(() => signature.value.meta.certs.map((certificate, index) => ({
...certificate,
validityPeriod: {
notBefore: new Date(certificate.validityPeriod.notBefore).toLocaleString(),
notAfter: new Date(certificate.validityPeriod.notAfter).toLocaleString(),
},
certificateName: `Certificate ${index + 1}`,
})),
);
</script>
<template>
<div flex flex-col gap-2>
<c-table :data="certs" :headers="tableHeaders">
<template #validityPeriod="{ value }">
<c-key-value-list
:items="[{
label: 'Not before',
value: value.notBefore,
}, {
label: 'Not after',
value: value.notAfter,
}]"
/>
</template>
<template #issuedBy="{ value }">
<c-key-value-list
:items="[{
label: 'Common name',
value: value.commonName,
}, {
label: 'Organization name',
value: value.organizationName,
}, {
label: 'Country name',
value: value.countryName,
}, {
label: 'Locality name',
value: value.localityName,
}, {
label: 'Organizational unit name',
value: value.organizationalUnitName,
}, {
label: 'State or province name',
value: value.stateOrProvinceName,
}]"
/>
</template>
<template #issuedTo="{ value }">
<c-key-value-list
:items="[{
label: 'Common name',
value: value.commonName,
}, {
label: 'Organization name',
value: value.organizationName,
}, {
label: 'Country name',
value: value.countryName,
}, {
label: 'Locality name',
value: value.localityName,
}, {
label: 'Organizational unit name',
value: value.organizationalUnitName,
}, {
label: 'State or province name',
value: value.stateOrProvinceName,
}]"
/>
</template>
<template #pemCertificate="{ value }">
<c-modal-value :value="value" label="View PEM cert">
<template #value>
<div break-all text-xs>
{{ value }}
</div>
</template>
</c-modal-value>
</template>
</c-table>
</div>
</template>
+12
View File
@@ -0,0 +1,12 @@
import { defineTool } from '../tool';
import FileCertIcon from '~icons/mdi/file-certificate-outline';
export const tool = defineTool({
name: 'PDF signature checker',
path: '/pdf-signature-checker',
description: 'Verify the signatures of a PDF file. A signed PDF file contains one or more signatures that may be used to determine whether the contents of the file have been altered since the file was signed.',
keywords: ['pdf', 'signature', 'checker', 'verify', 'validate', 'sign'],
component: () => import('./pdf-signature-checker.vue'),
icon: FileCertIcon,
createdAt: new Date('2023-12-09'),
});
@@ -0,0 +1,11 @@
import { expect, test } from '@playwright/test';
test.describe('Tool - Pdf signature checker', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/pdf-signature-checker');
});
test('Has correct title', async ({ page }) => {
await expect(page).toHaveTitle('PDF signature checker - IT Tools');
});
});
@@ -0,0 +1,39 @@
export interface SignatureInfo {
verified: boolean
authenticity: boolean
integrity: boolean
expired: boolean
meta: {
certs: {
clientCertificate?: boolean
issuedBy: {
commonName: string
organizationalUnitName?: string
organizationName: string
countryName?: string
localityName?: string
stateOrProvinceName?: string
}
issuedTo: {
commonName: string
serialNumber?: string
organizationalUnitName?: string
organizationName: string
countryName?: string
localityName?: string
stateOrProvinceName?: string
}
validityPeriod: {
notBefore: string
notAfter: string
}
pemCertificate: string
}[]
signatureMeta: {
reason: string
contactInfo: string | null
location: string
name: string | null
}
}
}
@@ -0,0 +1,59 @@
<script setup lang="ts">
import verifyPDF from 'pdf-signature-reader';
import type { SignatureInfo } from './pdf-signature-checker.types';
import { formatBytes } from '@/utils/convert';
const signatures = ref<SignatureInfo[]>([]);
const status = ref<'idle' | 'parsed' | 'error' | 'loading'>('idle');
const file = ref<File | null>(null);
async function onVerifyClicked(uploadedFile: File) {
file.value = uploadedFile;
const fileBuffer = await uploadedFile.arrayBuffer();
status.value = 'loading';
try {
const { signatures: parsedSignatures } = verifyPDF(fileBuffer);
signatures.value = parsedSignatures;
status.value = 'parsed';
}
catch (e) {
signatures.value = [];
status.value = 'error';
}
}
</script>
<template>
<div style="flex: 0 0 100%">
<div mx-auto max-w-600px>
<c-file-upload title="Drag and drop a PDF file here, or click to select a file" accept=".pdf" @file-upload="onVerifyClicked" />
<c-card v-if="file" mt-4 flex gap-2>
<div font-bold>
{{ file.name }}
</div>
<div>
{{ formatBytes(file.size) }}
</div>
</c-card>
<div v-if="status === 'error'">
<c-alert mt-4>
No signatures found in the provided file.
</c-alert>
</div>
</div>
</div>
<div v-if="status === 'parsed' && signatures.length" style="flex: 0 0 100%" mt-5 flex flex-col gap-4>
<div v-for="(signature, index) of signatures" :key="index">
<div mb-2 font-bold>
Signature {{ index + 1 }} certificates :
</div>
<pdf-signature-details :signature="signature" />
</div>
</div>
</template>
+1 -1
View File
@@ -6,7 +6,7 @@ export const tool = defineTool({
name: translate('tools.token-generator.title'),
path: '/token-generator',
description: translate('tools.token-generator.description'),
keywords: ['token', 'random', 'string', 'alphanumeric', 'symbols', 'number', 'letters', 'lowercase', 'uppercase'],
keywords: ['token', 'random', 'string', 'alphanumeric', 'symbols', 'number', 'letters', 'lowercase', 'uppercase', 'password'],
component: () => import('./token-generator.tool.vue'),
icon: ArrowsShuffle,
});
+9 -2
View File
@@ -1,9 +1,16 @@
tools:
token-generator:
title: Générateur de token
description: Génère une chaîne aléatoire avec les caractères que vous voulez, lettres majuscules ou minuscules, chiffres et/ou symboles.
description: >-
Génère une chaîne aléatoire avec les caractères que vous voulez, lettres
majuscules ou minuscules, chiffres et/ou symboles.
uppercase: Majuscules (ABC...)
lowercase: Minuscules (abc...)
numbers: Chiffres (123...)
symbols: Symboles (!-;...)
button:
copy: Copier
refresh: Rafraichir
copied: Le token a été copié
length: Longueur
tokenPlaceholder: Le token...
+39 -26
View File
@@ -1,44 +1,57 @@
import { type MaybeRef, get, useStorage } from '@vueuse/core';
import { defineStore } from 'pinia';
import type { Ref } from 'vue';
import type { Tool, ToolWithCategory } from './tools.types';
import _ from 'lodash';
import type { Tool, ToolCategory, ToolWithCategory } from './tools.types';
import { toolsWithCategory } from './index';
export const useToolStore = defineStore('tools', {
state: () => ({
favoriteToolsName: useStorage('favoriteToolsName', []) as Ref<string[]>,
}),
getters: {
favoriteTools(state) {
return state.favoriteToolsName
.map(favoriteName => toolsWithCategory.find(({ name }) => name === favoriteName))
.filter(Boolean) as ToolWithCategory[]; // cast because .filter(Boolean) does not remove undefined from type
},
export const useToolStore = defineStore('tools', () => {
const favoriteToolsName = useStorage('favoriteToolsName', []) as Ref<string[]>;
const { t } = useI18n();
notFavoriteTools(state): ToolWithCategory[] {
return toolsWithCategory.filter(tool => !state.favoriteToolsName.includes(tool.name));
},
const tools = computed<ToolWithCategory[]>(() => toolsWithCategory.map((tool) => {
const toolI18nKey = tool.path.replace(/\//g, '');
tools(): ToolWithCategory[] {
return toolsWithCategory;
},
return ({
...tool,
name: t(`tools.${toolI18nKey}.title`, tool.name),
description: t(`tools.${toolI18nKey}.description`, tool.description),
category: t(`tools.categories.${tool.category.toLowerCase()}`, tool.category),
});
}));
newTools(): ToolWithCategory[] {
return this.tools.filter(({ isNew }) => isNew);
},
},
const toolsByCategory = computed<ToolCategory[]>(() => {
return _.chain(tools.value)
.groupBy('category')
.map((components, name) => ({
name,
components,
}))
.value();
});
const favoriteTools = computed(() => {
return favoriteToolsName.value
.map(favoriteName => tools.value.find(({ name }) => name === favoriteName))
.filter(Boolean) as ToolWithCategory[]; // cast because .filter(Boolean) does not remove undefined from type
});
return {
tools,
favoriteTools,
toolsByCategory,
newTools: computed(() => tools.value.filter(({ isNew }) => isNew)),
actions: {
addToolToFavorites({ tool }: { tool: MaybeRef<Tool> }) {
this.favoriteToolsName.push(get(tool).name);
favoriteToolsName.value.push(get(tool).name);
},
removeToolFromFavorites({ tool }: { tool: MaybeRef<Tool> }) {
this.favoriteToolsName = this.favoriteToolsName.filter(name => get(tool).name !== name);
favoriteToolsName.value = favoriteToolsName.value.filter(name => get(tool).name !== name);
},
isToolFavorite({ tool }: { tool: MaybeRef<Tool> }) {
return this.favoriteToolsName.includes(get(tool).name);
return favoriteToolsName.value.includes(get(tool).name);
},
},
};
});
+2 -2
View File
@@ -2,11 +2,11 @@ import { Fingerprint } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'UUIDs v4 generator',
name: 'UUIDs generator',
path: '/uuid-generator',
description:
'A Universally Unique Identifier (UUID) is a 128-bit number used to identify information in computer systems. The number of possible UUIDs is 16^32, which is 2^128 or about 3.4x10^38 (which is a lot!).',
keywords: ['uuid', 'v4', 'random', 'id', 'alphanumeric', 'identity', 'token', 'string', 'identifier', 'unique'],
keywords: ['uuid', 'v4', 'random', 'id', 'alphanumeric', 'identity', 'token', 'string', 'identifier', 'unique', 'v1', 'v3', 'v5', 'nil'],
component: () => import('./uuid-generator.vue'),
icon: Fingerprint,
});
+79 -7
View File
@@ -1,22 +1,94 @@
<script setup lang="ts">
import { v4 as generateUUID } from 'uuid';
import { v1 as generateUuidV1, v3 as generateUuidV3, v4 as generateUuidV4, v5 as generateUuidV5, NIL as nilUuid } from 'uuid';
import { useCopy } from '@/composable/copy';
import { computedRefreshable } from '@/composable/computedRefreshable';
import { withDefaultOnError } from '@/utils/defaults';
const versions = ['NIL', 'v1', 'v3', 'v4', 'v5'] as const;
const version = useStorage<typeof versions[number]>('uuid-generator:version', 'v4');
const count = useStorage('uuid-generator:quantity', 1);
const v35Args = ref({ namespace: '6ba7b811-9dad-11d1-80b4-00c04fd430c8', name: '' });
const [uuids, refreshUUIDs] = computedRefreshable(() =>
Array.from({ length: count.value }, () => generateUUID()).join('\n'),
);
const validUuidRules = [
{
message: 'Invalid UUID',
validator: (value: string) => {
if (value === nilUuid) {
return true;
}
return Boolean(value.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/));
},
},
];
const generators = {
NIL: () => nilUuid,
v1: (index: number) => generateUuidV1({
clockseq: index,
msecs: Date.now(),
nsecs: Math.floor(Math.random() * 10000),
node: Array.from({ length: 6 }, () => Math.floor(Math.random() * 256)),
}),
v3: () => generateUuidV3(v35Args.value.name, v35Args.value.namespace),
v4: () => generateUuidV4(),
v5: () => generateUuidV5(v35Args.value.name, v35Args.value.namespace),
};
const [uuids, refreshUUIDs] = computedRefreshable(() => withDefaultOnError(() =>
Array.from({ length: count.value }, (_ignored, index) => {
const generator = generators[version.value] ?? generators.NIL;
return generator(index);
}).join('\n'), ''));
const { copy } = useCopy({ source: uuids, text: 'UUIDs copied to the clipboard' });
</script>
<template>
<div>
<div flex items-center justify-center gap-3>
Quantity :
<n-input-number v-model:value="count" :min="1" :max="50" placeholder="UUID quantity" />
<c-buttons-select v-model:value="version" :options="versions" label="UUID version" label-width="100px" mb-2 />
<div mb-2 flex items-center>
<span w-100px>Quantity </span>
<n-input-number v-model:value="count" flex-1 :min="1" :max="50" placeholder="UUID quantity" />
</div>
<div v-if="version === 'v3' || version === 'v5'">
<div>
<c-buttons-select
v-model:value="v35Args.namespace"
:options="{
DNS: '6ba7b810-9dad-11d1-80b4-00c04fd430c8',
URL: '6ba7b811-9dad-11d1-80b4-00c04fd430c8',
OID: '6ba7b812-9dad-11d1-80b4-00c04fd430c8',
X500: '6ba7b814-9dad-11d1-80b4-00c04fd430c8',
}"
label="Namespace"
label-width="100px"
mb-2
/>
</div>
<div flex-1>
<c-input-text
v-model:value="v35Args.namespace"
placeholder="Namespace"
label-width="100px"
label-position="left"
label=" "
:validation-rules="validUuidRules"
mb-2
/>
</div>
<c-input-text
v-model:value="v35Args.name"
placeholder="Name"
label="Name"
label-width="100px"
label-position="left"
mb-2
/>
</div>
<c-input-text
+9 -1
View File
@@ -1,11 +1,19 @@
<script lang="ts" setup>
const variants = ['warning'] as const;
const variants = ['warning', 'error'] as const;
</script>
<template>
<h2>Basic</h2>
<c-alert v-for="variant in variants" :key="variant" :type="variant" mb-4>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Magni reprehenderit itaque enim? Suscipit magni optio velit
quia, eveniet repellat pariatur quaerat laudantium dignissimos natus, beatae deleniti adipisci, atque necessitatibus
odio!
</c-alert>
<h2>With title</h2>
<c-alert v-for="variant in variants" :key="variant" :type="variant" title="This is the title" mb-4>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Magni reprehenderit itaque enim? Suscipit magni optio velit
quia, eveniet repellat pariatur quaerat laudantium dignissimos natus, beatae deleniti adipisci, atque necessitatibus
odio!
</c-alert>
</template>
+13
View File
@@ -3,6 +3,7 @@ import { defineThemes } from '../theme/theme.models';
import { appThemes } from '../theme/themes';
import WarningIcon from '~icons/mdi/alert-circle-outline';
import ErrorIcon from '~icons/mdi/close-circle-outline';
export const { useTheme } = defineThemes({
dark: {
@@ -12,6 +13,12 @@ export const { useTheme } = defineThemes({
textColor: appThemes.dark.warning.color,
icon: WarningIcon,
},
error: {
backgroundColor: appThemes.dark.error.colorFaded,
borderColor: appThemes.dark.error.color,
textColor: appThemes.dark.error.color,
icon: ErrorIcon,
},
},
light: {
warning: {
@@ -20,5 +27,11 @@ export const { useTheme } = defineThemes({
textColor: darken(appThemes.light.warning.color, 40),
icon: WarningIcon,
},
error: {
backgroundColor: appThemes.light.error.colorFaded,
borderColor: appThemes.light.error.color,
textColor: darken(appThemes.light.error.color, 40),
icon: ErrorIcon,
},
},
});
+5 -2
View File
@@ -1,8 +1,8 @@
<script lang="ts" setup>
import { useTheme } from './c-alert.theme';
const props = withDefaults(defineProps<{ type?: 'warning' }>(), { type: 'warning' });
const { type } = toRefs(props);
const props = withDefaults(defineProps<{ type?: 'warning'; title?: string }>(), { type: 'warning', title: undefined });
const { type, title } = toRefs(props);
const theme = useTheme();
const variantTheme = computed(() => theme.value[type.value]);
@@ -17,6 +17,9 @@ const variantTheme = computed(() => theme.value[type.value]);
</div>
<div class="c-alert--content">
<div v-if="title" class="c-alert--title" text-15px fw-600>
{{ title }}
</div>
<slot />
</div>
</div>
@@ -4,11 +4,18 @@ const optionsA = [
{ label: 'Option B', value: 'b', tooltip: 'This is a tooltip' },
{ label: 'Option C', value: 'c' },
];
const optionB = {
'Option A': 'a',
'Option B': 'b',
'Option C': 'c',
};
const valueA = ref('a');
</script>
<template>
<c-buttons-select v-model:value="valueA" :options="optionsA" label="Label: " />
<c-buttons-select v-model:value="valueA" :options="optionsA" label="Label: " label-position="left" mt-2 />
<c-buttons-select v-model:value="valueA" :options="optionsA" label="Label: " label-position="left" mt-2 />
<c-buttons-select v-model:value="valueA" :options="optionB" label="Options object: " />
</template>
+13 -8
View File
@@ -1,10 +1,11 @@
<script setup lang="ts" generic="T extends unknown">
import _ from 'lodash';
import type { CLabelProps } from '../c-label/c-label.types';
import type { CButtonSelectOption } from './c-buttons-select.types';
const props = withDefaults(
defineProps<{
options?: CButtonSelectOption<T>[] | string[]
options?: CButtonSelectOption<T>[] | string[] | Record<string, T>
value?: T
size?: 'small' | 'medium' | 'large'
} & CLabelProps >(),
@@ -20,14 +21,18 @@ const emits = defineEmits(['update:value']);
const { options: rawOptions, size } = toRefs(props);
const options = computed(() => {
return rawOptions.value.map((option: string | CButtonSelectOption<T>) => {
if (typeof option === 'string') {
return { label: option, value: option };
}
const options = computed<CButtonSelectOption<T>[]>(() => {
if (_.isArray(rawOptions.value)) {
return rawOptions.value.map((option: string | CButtonSelectOption<T>) => {
if (typeof option === 'string') {
return { label: option, value: option };
}
return option;
});
return option;
}) as CButtonSelectOption<T>[];
}
return _.map(rawOptions.value, (value, label) => ({ label, value })) as CButtonSelectOption<T>[];
});
const value = useVModel(props, 'value', emits);
+5
View File
@@ -0,0 +1,5 @@
<template>
<c-collapse title="Collapse title">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquet iaculis class cubilia metus per nullam gravida ad venenatis. Id elementum elementum enim orci elementum justo facilisi habitant consequat. Justo eget ligula purus laoreet penatibus eros quisque fusce sociis. In eget amet sagittis dignissim eleifend proin lacinia potenti tellus. Interdum vulputate condimentum molestie pulvinar praesent accumsan quisque venenatis imperdiet.
</c-collapse>
</template>
+25
View File
@@ -0,0 +1,25 @@
<script lang="ts" setup>
const props = withDefaults(defineProps<{ title?: string }>(), { title: '' });
const { title } = toRefs(props);
const isCollapsed = ref(true);
</script>
<template>
<div>
<div flex cursor-pointer items-center @click="isCollapsed = !isCollapsed">
<icon-mdi-triangle-down :class="{ 'transform-rotate--90': isCollapsed }" op-50 transition />
<slot name="title">
<span class="ml-2" font-bold>{{ title }}</span>
</slot>
</div>
<div
v-show="!isCollapsed"
mt-2
>
<slot />
</div>
</div>
</template>
@@ -0,0 +1,3 @@
<template>
<c-file-upload />
</template>
+95
View File
@@ -0,0 +1,95 @@
<script lang="ts" setup>
import _ from 'lodash';
const props = withDefaults(defineProps<{
multiple?: boolean
accept?: string
title?: string
}>(), {
multiple: false,
accept: undefined,
title: 'Drag and drop files here, or click to select files',
});
const emit = defineEmits<{
(event: 'filesUpload', files: File[]): void
(event: 'fileUpload', file: File): void
}>();
const { multiple } = toRefs(props);
const isOverDropZone = ref(false);
const fileInput = ref<HTMLInputElement | null>(null);
function triggerFileInput() {
fileInput.value?.click();
}
function handleFileInput(event: Event) {
const files = (event.target as HTMLInputElement).files;
handleUpload(files);
}
function handleDrop(event: DragEvent) {
event.preventDefault();
const files = event.dataTransfer?.files;
handleUpload(files);
}
function handleUpload(files: FileList | null | undefined) {
if (_.isNil(files) || _.isEmpty(files)) {
return;
}
if (multiple.value) {
emit('filesUpload', Array.from(files));
return;
}
emit('fileUpload', files[0]);
}
</script>
<template>
<div
class="flex flex-col cursor-pointer items-center justify-center border-2px border-gray-300 border-opacity-50 rounded-lg border-dashed p-8 transition-colors"
:class="{
'border-primary border-opacity-100': isOverDropZone,
}"
@click="triggerFileInput"
@drop.prevent="handleDrop"
@dragover.prevent
@dragenter="isOverDropZone = true"
@dragleave="isOverDropZone = false"
>
<input
ref="fileInput"
type="file"
class="hidden"
:multiple="multiple"
:accept="accept"
@change="handleFileInput"
>
<slot>
<span op-70>
{{ title }}
</span>
<!-- separator -->
<div my-4 w-full flex items-center justify-center op-70>
<div class="h-1px max-w-100px flex-1 bg-gray-300 op-50" />
<div class="mx-2 text-gray-400">
or
</div>
<div class="h-1px max-w-100px flex-1 bg-gray-300 op-50" />
</div>
<c-button>
Browse files
</c-button>
</slot>
</div>
</template>
+4 -4
View File
@@ -9,13 +9,13 @@ const formattedItems = computed(() => items.value.filter(item => !_.isNil(item.v
</script>
<template>
<div my-5>
<div v-for="item in formattedItems" :key="item.label" flex gap-2 py-1 class="c-key-value-list__item">
<div flex-basis-180px text-right font-bold class="c-key-value-list__key">
<div flex flex-col gap-2>
<div v-for="item in formattedItems" :key="item.label" class="c-key-value-list__item">
<div class="c-key-value-list__key" text-13px lh-normal>
{{ item.label }}
</div>
<c-key-value-list-item :item="item" class="c-key-value-list__value" />
<c-key-value-list-item :item="item" class="c-key-value-list__value" font-bold lh-normal />
</div>
</div>
</template>
+18
View File
@@ -0,0 +1,18 @@
<script setup lang="ts">
const md = `
# IT Tools
## About
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod, nisl quis
mollis blandit, nunc nisl aliquam nunc, vitae aliquam nisl nunc vitae nisl.
- Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- Sed euismod, nisl quis mollis blandit, nunc nisl aliquam nunc, vitae aliquam nisl nunc vitae nisl.
[it-tools](https://it-tools.tech)
`;
</script>
<template>
<c-markdown :markdown="md" />
</template>
+21
View File
@@ -0,0 +1,21 @@
<script setup lang="ts">
import { marked } from 'marked';
import DomPurify from 'dompurify';
const props = withDefaults(defineProps<{ markdown?: string }>(), { markdown: '' });
const { markdown } = toRefs(props);
marked.use({
renderer: {
link(href, title, text) {
return `<a class="text-primary transition decoration-none hover:underline" href="${href}" target="_blank" rel="noopener">${text}</a>`;
},
},
});
const html = computed(() => DomPurify.sanitize(marked(markdown.value), { ADD_ATTR: ['target'] }));
</script>
<template>
<div v-html="html" />
</template>
@@ -0,0 +1,21 @@
<template>
<div flex gap-2>
<c-modal-value value="lorem ipsum" label="test" />
<c-modal-value>
<template #label="{ toggleModal }">
<c-button class="text-left" size="small" @click="toggleModal">
Bonjour
</c-button>
</template>
<template #value>
<pre>
Lorem ipsum dolor sit amet consectetur adipisicing elit.
Molestias, quisquam vitae saepe dolores quas debitis ab r
ecusandae suscipit ex dignissimos minus quam repellat sunt.
Molestiae culpa blanditiis totam sapiente dignissimos.
</pre>
</template>
</c-modal-value>
</div>
</template>
+31
View File
@@ -0,0 +1,31 @@
<script lang="ts" setup>
import { useCopy } from '@/composable/copy';
const props = withDefaults(defineProps<{ value: string; label?: string; copyable?: boolean }>(), { label: undefined, copyable: true });
const { value, label } = toRefs(props);
const { copy, isJustCopied } = useCopy({ source: value });
const isModalOpen = ref(false);
const toggleModal = useToggle(isModalOpen);
</script>
<template>
<slot name="label" :value="value" :toggle-modal="toggleModal" :is-modal-open="isModalOpen">
<c-button class="text-left" @click="isModalOpen = true">
{{ label }}
</c-button>
</slot>
<c-modal v-model:open="isModalOpen">
<slot name="value" :value="value" :toggle-modal="toggleModal" :is-modal-open="isModalOpen">
{{ value }}
</slot>
<div mt-4 flex justify-center>
<c-button class="w-full" @click="copy">
{{ isJustCopied ? 'Copied!' : 'Copy' }}
</c-button>
</div>
</c-modal>
</template>
+15
View File
@@ -33,4 +33,19 @@ const value = ref('');
<c-select label="Label" label-position="left" label-align="left" mb-2 label-width="200px" />
<c-select label="Label" label-position="left" label-align="center" mb-2 label-width="200px" />
<c-select label="Label" label-position="left" label-align="right" mb-2 label-width="200px" />
<h2>Custom displayed value</h2>
<c-select v-model:value="value" :options="optionsA" mb-2>
<template #displayed-value>
<span class="font-bold lh-normal">Hello</span>
</template>
</c-select>
<c-select v-model:value="value" :options="optionsA">
<template #displayed-value>
<span lh-normal>
<icon-mdi-translate />
</span>
</template>
</c-select>
</template>
+9 -7
View File
@@ -150,13 +150,15 @@ function onSearchInput() {
@keydown="handleKeydown"
>
<div flex-1 truncate>
<input v-if="searchable && isOpen" ref="searchInputRef" v-model="searchQuery" type="text" placeholder="Search..." class="search-input" w-full lh-normal color-current @input="onSearchInput">
<span v-else-if="selectedOption" lh-normal>
{{ selectedOption.label }}
</span>
<span v-else class="placeholder" lh-normal>
{{ placeholder ?? 'Select an option' }}
</span>
<slot name="displayed-value">
<input v-if="searchable && isOpen" ref="searchInputRef" v-model="searchQuery" type="text" placeholder="Search..." class="search-input" w-full lh-normal color-current @input="onSearchInput">
<span v-else-if="selectedOption" lh-normal>
{{ selectedOption.label }}
</span>
<span v-else class="placeholder" lh-normal>
{{ placeholder ?? 'Select an option' }}
</span>
</slot>
</div>
<icon-mdi-chevron-down class="chevron" />
+2 -2
View File
@@ -39,7 +39,7 @@ const headers = computed(() => {
<template>
<div class="relative overflow-x-auto rounded">
<table class="w-full border-collapse text-left text-sm text-gray-500 dark:text-gray-400" role="table" :aria-label="description">
<thead v-if="!hideHeaders" class="bg-#ffffff uppercase text-gray-700 dark:bg-#333333 dark:text-gray-400">
<thead v-if="!hideHeaders" class="bg-#ffffff uppercase text-gray-700 dark:bg-#333333 dark:text-gray-400" border-b="1px solid dark:transparent #efeff5">
<tr>
<th v-for="header in headers" :key="header.key" scope="col" class="px-6 py-3 text-xs">
{{ header.label }}
@@ -54,7 +54,7 @@ const headers = computed(() => {
}"
>
<td v-for="header in headers" :key="header.key" class="px-6 py-4">
<slot :name="header" :row="row" :headers="headers" :value="row[header.key]">
<slot :name="header.key" :row="row" :headers="headers" :value="row[header.key]">
{{ row[header.key] }}
</slot>
</td>
+2
View File
@@ -15,11 +15,13 @@ export default defineConfig({
theme: {
colors: {
primary: '#1ea54c',
},
},
shortcuts: {
'pretty-scrollbar': 'scrollbar scrollbar-rounded scrollbar-thumb-color-gray-300 scrollbar-track-color-gray-100 dark:scrollbar-thumb-color-#424242 dark:scrollbar-track-color-#686868',
'divider': 'h-1px bg-current op-10',
'bg-surface': 'bg-#ffffff dark:bg-#232323',
'bg-background': 'bg-#f1f5f9 dark:bg-#1c1c1c',
},
});