chore: examples button visibility

This commit is contained in:
Ibrahima G. Coulibaly
2025-07-09 17:47:44 +01:00
parent 4f0f648efe
commit 143a5684cf
5 changed files with 118 additions and 86 deletions

149
.idea/workspace.xml generated
View File

@@ -4,14 +4,12 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="b30e2810-c4c1-4aad-b134-794e52cc1c7d" name="Changes" comment="feat: convert to jpg"> <list default="true" id="b30e2810-c4c1-4aad-b134-794e52cc1c7d" name="Changes" comment="fix: favicons">
<change afterPath="$PROJECT_DIR$/src/pages/tools/image/generic/editor/index.tsx" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/pages/tools/image/generic/editor/meta.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/package-lock.json" afterDir="false" /> <change beforePath="$PROJECT_DIR$/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/package-lock.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" /> <change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/components/ToolInputAndResult.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/ToolInputAndResult.tsx" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/components/ToolHeader.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/ToolHeader.tsx" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/pages/tools/image/generic/index.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/tools/image/generic/index.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/pages/tools/pdf/index.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/tools/pdf/index.ts" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -233,56 +231,56 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent">{
"keyToString": { &quot;keyToString&quot;: {
"ASKED_ADD_EXTERNAL_FILES": "true", &quot;ASKED_ADD_EXTERNAL_FILES&quot;: &quot;true&quot;,
"ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true", &quot;ASKED_SHARE_PROJECT_CONFIGURATION_FILES&quot;: &quot;true&quot;,
"Docker.Dockerfile build.executor": "Run", &quot;Docker.Dockerfile build.executor&quot;: &quot;Run&quot;,
"Docker.Dockerfile.executor": "Run", &quot;Docker.Dockerfile.executor&quot;: &quot;Run&quot;,
"Playwright.Create transparent PNG.should make png color transparent.executor": "Run", &quot;Playwright.Create transparent PNG.should make png color transparent.executor&quot;: &quot;Run&quot;,
"Playwright.JoinText Component.executor": "Run", &quot;Playwright.JoinText Component.executor&quot;: &quot;Run&quot;,
"Playwright.JoinText Component.should merge text pieces with specified join character.executor": "Run", &quot;Playwright.JoinText Component.should merge text pieces with specified join character.executor&quot;: &quot;Run&quot;,
"RunOnceActivity.OpenProjectViewOnStart": "true", &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
"RunOnceActivity.ShowReadmeOnStart": "true", &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
"RunOnceActivity.git.unshallow": "true", &quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;,
"Vitest.compute function (1).executor": "Run", &quot;Vitest.compute function (1).executor&quot;: &quot;Run&quot;,
"Vitest.compute function.executor": "Run", &quot;Vitest.compute function.executor&quot;: &quot;Run&quot;,
"Vitest.mergeText.executor": "Run", &quot;Vitest.mergeText.executor&quot;: &quot;Run&quot;,
"Vitest.mergeText.should merge lines and preserve blank lines when deleteBlankLines is false.executor": "Run", &quot;Vitest.mergeText.should merge lines and preserve blank lines when deleteBlankLines is false.executor&quot;: &quot;Run&quot;,
"Vitest.mergeText.should merge lines, preserve blank lines and trailing spaces when both deleteBlankLines and deleteTrailingSpaces are false.executor": "Run", &quot;Vitest.mergeText.should merge lines, preserve blank lines and trailing spaces when both deleteBlankLines and deleteTrailingSpaces are false.executor&quot;: &quot;Run&quot;,
"Vitest.parsePageRanges.executor": "Run", &quot;Vitest.parsePageRanges.executor&quot;: &quot;Run&quot;,
"Vitest.removeDuplicateLines function.executor": "Run", &quot;Vitest.removeDuplicateLines function.executor&quot;: &quot;Run&quot;,
"Vitest.removeDuplicateLines function.newlines option.executor": "Run", &quot;Vitest.removeDuplicateLines function.newlines option.executor&quot;: &quot;Run&quot;,
"Vitest.removeDuplicateLines function.newlines option.should filter newlines when newlines is set to filter.executor": "Run", &quot;Vitest.removeDuplicateLines function.newlines option.should filter newlines when newlines is set to filter.executor&quot;: &quot;Run&quot;,
"Vitest.replaceText function (regexp mode).should return the original text when passed an invalid regexp.executor": "Run", &quot;Vitest.replaceText function (regexp mode).should return the original text when passed an invalid regexp.executor&quot;: &quot;Run&quot;,
"Vitest.replaceText function.executor": "Run", &quot;Vitest.replaceText function.executor&quot;: &quot;Run&quot;,
"Vitest.timeBetweenDates.executor": "Run", &quot;Vitest.timeBetweenDates.executor&quot;: &quot;Run&quot;,
"git-widget-placeholder": "main", &quot;git-widget-placeholder&quot;: &quot;main&quot;,
"ignore.virus.scanning.warn.message": "true", &quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
"kotlin-language-version-configured": "true", &quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
"last_opened_file_path": "C:/Users/Ibrahima/IdeaProjects/omni-tools/public", &quot;last_opened_file_path&quot;: &quot;C:/Users/Ibrahima/IdeaProjects/omni-tools/public&quot;,
"node.js.detected.package.eslint": "true", &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
"node.js.detected.package.tslint": "true", &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
"node.js.selected.package.eslint": "(autodetect)", &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
"node.js.selected.package.tslint": "(autodetect)", &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
"nodejs_package_manager_path": "npm", &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
"npm.build.executor": "Run", &quot;npm.build.executor&quot;: &quot;Run&quot;,
"npm.dev.executor": "Run", &quot;npm.dev.executor&quot;: &quot;Run&quot;,
"npm.lint.executor": "Run", &quot;npm.lint.executor&quot;: &quot;Run&quot;,
"npm.prebuild.executor": "Run", &quot;npm.prebuild.executor&quot;: &quot;Run&quot;,
"npm.script:create:tool.executor": "Run", &quot;npm.script:create:tool.executor&quot;: &quot;Run&quot;,
"npm.test.executor": "Run", &quot;npm.test.executor&quot;: &quot;Run&quot;,
"npm.test:e2e.executor": "Run", &quot;npm.test:e2e.executor&quot;: &quot;Run&quot;,
"npm.test:e2e:run.executor": "Run", &quot;npm.test:e2e:run.executor&quot;: &quot;Run&quot;,
"prettierjs.PrettierConfiguration.Package": "C:\\Users\\Ibrahima\\IdeaProjects\\omni-tools\\node_modules\\prettier", &quot;prettierjs.PrettierConfiguration.Package&quot;: &quot;C:\\Users\\Ibrahima\\IdeaProjects\\omni-tools\\node_modules\\prettier&quot;,
"project.structure.last.edited": "Problems", &quot;project.structure.last.edited&quot;: &quot;Problems&quot;,
"project.structure.proportion": "0.0", &quot;project.structure.proportion&quot;: &quot;0.0&quot;,
"project.structure.side.proportion": "0.2", &quot;project.structure.side.proportion&quot;: &quot;0.2&quot;,
"settings.editor.selected.configurable": "refactai_advanced_settings", &quot;settings.editor.selected.configurable&quot;: &quot;refactai_advanced_settings&quot;,
"ts.external.directory.path": "C:\\Users\\Ibrahima\\IdeaProjects\\omni-tools\\node_modules\\typescript\\lib", &quot;ts.external.directory.path&quot;: &quot;C:\\Users\\Ibrahima\\IdeaProjects\\omni-tools\\node_modules\\typescript\\lib&quot;,
"vue.rearranger.settings.migration": "true" &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
} }
}]]></component> }</component>
<component name="ReactDesignerToolWindowState"> <component name="ReactDesignerToolWindowState">
<option name="myId2Visible"> <option name="myId2Visible">
<map> <map>
@@ -494,22 +492,9 @@
<workItem from="1748282636141" duration="478000" /> <workItem from="1748282636141" duration="478000" />
<workItem from="1749047510481" duration="879000" /> <workItem from="1749047510481" duration="879000" />
<workItem from="1751846528195" duration="4358000" /> <workItem from="1751846528195" duration="4358000" />
</task> <workItem from="1752070315115" duration="19000" />
<task id="LOCAL-00162" summary="feat: trim video"> <workItem from="1752071020011" duration="1599000" />
<option name="closed" value="true" /> <workItem from="1752077170501" duration="2423000" />
<created>1741580004784</created>
<option name="number" value="00162" />
<option name="presentableId" value="LOCAL-00162" />
<option name="project" value="LOCAL" />
<updated>1741580004784</updated>
</task>
<task id="LOCAL-00163" summary="feat: trim video">
<option name="closed" value="true" />
<created>1741580736359</created>
<option name="number" value="00163" />
<option name="presentableId" value="LOCAL-00163" />
<option name="project" value="LOCAL" />
<updated>1741580736359</updated>
</task> </task>
<task id="LOCAL-00164" summary="refactor: file inputs"> <task id="LOCAL-00164" summary="refactor: file inputs">
<option name="closed" value="true" /> <option name="closed" value="true" />
@@ -887,7 +872,23 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1752026153328</updated> <updated>1752026153328</updated>
</task> </task>
<option name="localTasksCounter" value="211" /> <task id="LOCAL-00211" summary="feat: edit image">
<option name="closed" value="true" />
<created>1752032092273</created>
<option name="number" value="00211" />
<option name="presentableId" value="LOCAL-00211" />
<option name="project" value="LOCAL" />
<updated>1752032092274</updated>
</task>
<task id="LOCAL-00212" summary="fix: favicons">
<option name="closed" value="true" />
<created>1752071147050</created>
<option name="number" value="00212" />
<option name="presentableId" value="LOCAL-00212" />
<option name="project" value="LOCAL" />
<updated>1752071147050</updated>
</task>
<option name="localTasksCounter" value="213" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@@ -934,8 +935,6 @@
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" /> <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
<option name="CHECK_NEW_TODO" value="false" /> <option name="CHECK_NEW_TODO" value="false" />
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" /> <option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
<MESSAGE value="fix: vite worker format" />
<MESSAGE value="fix: tests" />
<MESSAGE value="chore: uninstall @jspawn/ghostscript-wasm" /> <MESSAGE value="chore: uninstall @jspawn/ghostscript-wasm" />
<MESSAGE value="feat: protect pdf" /> <MESSAGE value="feat: protect pdf" />
<MESSAGE value="feat: image to text" /> <MESSAGE value="feat: image to text" />
@@ -959,7 +958,9 @@
<MESSAGE value="chore: png icon" /> <MESSAGE value="chore: png icon" />
<MESSAGE value="fix: remove xml viewer" /> <MESSAGE value="fix: remove xml viewer" />
<MESSAGE value="feat: convert to jpg" /> <MESSAGE value="feat: convert to jpg" />
<option name="LAST_COMMIT_MESSAGE" value="feat: convert to jpg" /> <MESSAGE value="feat: edit image" />
<MESSAGE value="fix: favicons" />
<option name="LAST_COMMIT_MESSAGE" value="fix: favicons" />
</component> </component>
<component name="VgoProject"> <component name="VgoProject">
<integration-enabled>false</integration-enabled> <integration-enabled>false</integration-enabled>

11
package-lock.json generated
View File

@@ -18,6 +18,7 @@
"@mui/icons-material": "^5.15.20", "@mui/icons-material": "^5.15.20",
"@mui/material": "^5.15.20", "@mui/material": "^5.15.20",
"@playwright/test": "^1.45.0", "@playwright/test": "^1.45.0",
"@simplepdf/react-embed-pdf": "^1.9.0",
"@types/ffmpeg": "^1.0.7", "@types/ffmpeg": "^1.0.7",
"@types/js-quantities": "^1.6.6", "@types/js-quantities": "^1.6.6",
"@types/lodash": "^4.17.5", "@types/lodash": "^4.17.5",
@@ -2968,6 +2969,16 @@
"integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==", "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==",
"dev": true "dev": true
}, },
"node_modules/@simplepdf/react-embed-pdf": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/@simplepdf/react-embed-pdf/-/react-embed-pdf-1.9.0.tgz",
"integrity": "sha512-qp0K5Fh8E+Zk7m3vyHtvksNlozOUyYRG2wR/TiEjhNh12kj+ar4N+1rEJA7BOsf/M2HnSplwjNOPuci2CKkKGg==",
"license": "MIT",
"peerDependencies": {
"react": "^18.2.0 || ^19.0.0",
"react-dom": "^18.2.0 || ^19.0.0"
}
},
"node_modules/@sinclair/typebox": { "node_modules/@sinclair/typebox": {
"version": "0.27.8", "version": "0.27.8",
"resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz",

View File

@@ -35,6 +35,7 @@
"@mui/icons-material": "^5.15.20", "@mui/icons-material": "^5.15.20",
"@mui/material": "^5.15.20", "@mui/material": "^5.15.20",
"@playwright/test": "^1.45.0", "@playwright/test": "^1.45.0",
"@simplepdf/react-embed-pdf": "^1.9.0",
"@types/ffmpeg": "^1.0.7", "@types/ffmpeg": "^1.0.7",
"@types/js-quantities": "^1.6.6", "@types/js-quantities": "^1.6.6",
"@types/lodash": "^4.17.5", "@types/lodash": "^4.17.5",

View File

@@ -6,6 +6,7 @@ import Grid from '@mui/material/Grid';
import { Icon, IconifyIcon } from '@iconify/react'; import { Icon, IconifyIcon } from '@iconify/react';
import { categoriesColors } from '../config/uiConfig'; import { categoriesColors } from '../config/uiConfig';
import { getToolsByCategory } from '@tools/index'; import { getToolsByCategory } from '@tools/index';
import { useEffect, useState } from 'react';
const StyledButton = styled(Button)(({ theme }) => ({ const StyledButton = styled(Button)(({ theme }) => ({
backgroundColor: 'white', backgroundColor: 'white',
@@ -23,11 +24,25 @@ interface ToolHeaderProps {
} }
function ToolLinks() { function ToolLinks() {
const theme = useTheme(); const [examplesVisible, setExamplesVisible] = useState(false);
useEffect(() => {
const timeout = setTimeout(() => {
const element = document.getElementById('examples');
if (element && isVisible(element)) {
setExamplesVisible(true);
}
}, 500);
return () => clearTimeout(timeout);
}, []);
const scrollToElement = (id: string) => { const scrollToElement = (id: string) => {
document.getElementById(id)?.scrollIntoView({ behavior: 'smooth' }); document.getElementById(id)?.scrollIntoView({ behavior: 'smooth' });
}; };
function isVisible(elm: HTMLElement | null) {
return !!elm;
}
return ( return (
<Grid container spacing={2} mt={1}> <Grid container spacing={2} mt={1}>
<Grid item md={12} lg={6}> <Grid item md={12} lg={6}>
@@ -40,6 +55,7 @@ function ToolLinks() {
Use This Tool Use This Tool
</StyledButton> </StyledButton>
</Grid> </Grid>
{examplesVisible && (
<Grid item md={12} lg={6}> <Grid item md={12} lg={6}>
<StyledButton <StyledButton
fullWidth fullWidth
@@ -50,6 +66,7 @@ function ToolLinks() {
See Examples See Examples
</StyledButton> </StyledButton>
</Grid> </Grid>
)}
{/*<Grid item md={12} lg={4}>*/} {/*<Grid item md={12} lg={4}>*/}
{/* <StyledButton fullWidth variant="outlined" href="#tour">*/} {/* <StyledButton fullWidth variant="outlined" href="#tour">*/}
{/* Learn How to Use*/} {/* Learn How to Use*/}

View File

@@ -6,6 +6,7 @@ import { DefinedTool } from '@tools/defineTool';
import { tool as compressPdfTool } from './compress-pdf/meta'; import { tool as compressPdfTool } from './compress-pdf/meta';
import { tool as protectPdfTool } from './protect-pdf/meta'; import { tool as protectPdfTool } from './protect-pdf/meta';
import { meta as pdfToEpub } from './pdf-to-epub/meta'; import { meta as pdfToEpub } from './pdf-to-epub/meta';
import { tool as pdfEditor } from './editor/meta';
export const pdfTools: DefinedTool[] = [ export const pdfTools: DefinedTool[] = [
splitPdfMeta, splitPdfMeta,
@@ -14,5 +15,6 @@ export const pdfTools: DefinedTool[] = [
protectPdfTool, protectPdfTool,
mergePdf, mergePdf,
pdfToEpub, pdfToEpub,
pdfPdfToPng pdfPdfToPng,
pdfEditor
]; ];