├── .eslintrc.js ├── .eslintrc.json ├── .github └── workflows │ ├── build.yml │ ├── deploy.yml │ └── release.yml ├── .gitignore ├── .hintrc ├── .prettierrc ├── .yarnrc.yml ├── CHANGELOG.md ├── LICENSE ├── README.md ├── android ├── .gitignore ├── app │ ├── .gitignore │ ├── build.gradle │ ├── capacitor.build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── getcapacitor │ │ │ └── myapp │ │ │ └── ExampleInstrumentedTest.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── yossthedev │ │ │ │ └── karbonized │ │ │ │ └── MainActivity.java │ │ └── res │ │ │ ├── drawable-land-hdpi │ │ │ └── splash.png │ │ │ ├── drawable-land-ldpi │ │ │ └── splash.png │ │ │ ├── drawable-land-mdpi │ │ │ └── splash.png │ │ │ ├── drawable-land-night-hdpi │ │ │ └── splash.png │ │ │ ├── drawable-land-night-ldpi │ │ │ └── splash.png │ │ │ ├── drawable-land-night-mdpi │ │ │ └── splash.png │ │ │ ├── drawable-land-night-xhdpi │ │ │ └── splash.png │ │ │ ├── drawable-land-night-xxhdpi │ │ │ └── splash.png │ │ │ ├── drawable-land-night-xxxhdpi │ │ │ └── splash.png │ │ │ ├── drawable-land-xhdpi │ │ │ └── splash.png │ │ │ ├── drawable-land-xxhdpi │ │ │ └── splash.png │ │ │ ├── drawable-land-xxxhdpi │ │ │ └── splash.png │ │ │ ├── drawable-night │ │ │ └── splash.png │ │ │ ├── drawable-port-hdpi │ │ │ └── splash.png │ │ │ ├── drawable-port-ldpi │ │ │ └── splash.png │ │ │ ├── drawable-port-mdpi │ │ │ └── splash.png │ │ │ ├── drawable-port-night-hdpi │ │ │ └── splash.png │ │ │ ├── drawable-port-night-ldpi │ │ │ └── splash.png │ │ │ ├── drawable-port-night-mdpi │ │ │ └── splash.png │ │ │ ├── drawable-port-night-xhdpi │ │ │ └── splash.png │ │ │ ├── drawable-port-night-xxhdpi │ │ │ └── splash.png │ │ │ ├── drawable-port-night-xxxhdpi │ │ │ └── splash.png │ │ │ ├── drawable-port-xhdpi │ │ │ └── splash.png │ │ │ ├── drawable-port-xxhdpi │ │ │ └── splash.png │ │ │ ├── drawable-port-xxxhdpi │ │ │ └── splash.png │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ ├── ic_launcher_background.xml │ │ │ └── splash.png │ │ │ ├── layout │ │ │ └── activity_main.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_background.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-ldpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_background.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_background.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_background.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_background.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_background.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── values │ │ │ ├── ic_launcher_background.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ │ └── xml │ │ │ └── file_paths.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── getcapacitor │ │ └── myapp │ │ └── ExampleUnitTest.java ├── build.gradle ├── capacitor.settings.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── variables.gradle ├── capacitor.config.ts ├── dev-dist ├── registerSW.js ├── sw.js ├── workbox-3625d7b0.js └── workbox-6e567876.js ├── dist-electron └── main.js ├── docs └── plugin_system.md ├── electron-builder.json ├── electron ├── .gitignore ├── .yarnrc.yml ├── assets │ ├── appIcon.ico │ ├── appIcon.png │ ├── splash.gif │ └── splash.png ├── capacitor.config.ts ├── electron-builder.config.json ├── live-runner.js ├── package-lock.json ├── package.json ├── resources │ └── electron-publisher-custom.js ├── src │ ├── index.ts │ ├── preload.ts │ ├── rt │ │ ├── electron-plugins.js │ │ └── electron-rt.ts │ └── setup.ts └── tsconfig.json ├── img ├── banner.png └── screen.png ├── index.html ├── logo.svg ├── news └── news.json ├── package.json ├── postcss.config.cjs ├── public ├── .well-known │ └── assetlinks.json ├── assets │ └── icons │ │ ├── icon-128.webp │ │ ├── icon-128x128.png │ │ ├── icon-144x144.png │ │ ├── icon-152x152.png │ │ ├── icon-192.webp │ │ ├── icon-192x192.png │ │ ├── icon-256.webp │ │ ├── icon-384x384.png │ │ ├── icon-48.webp │ │ ├── icon-48x48.png │ │ ├── icon-512.webp │ │ ├── icon-512x512.png │ │ ├── icon-72.webp │ │ ├── icon-72x72.png │ │ ├── icon-96.webp │ │ └── icon-96x96.png ├── image.png ├── karbonized.svg ├── logo.svg └── vite.svg ├── resources └── logo.svg ├── src-electron ├── assets │ ├── icon.icns │ ├── icon.ico │ └── icon.png ├── main.ts └── preload.ts ├── src-tauri ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── build.rs ├── icons │ ├── 128x128.png │ ├── 128x128@2x.png │ ├── 32x32.png │ ├── Square107x107Logo.png │ ├── Square142x142Logo.png │ ├── Square150x150Logo.png │ ├── Square284x284Logo.png │ ├── Square30x30Logo.png │ ├── Square310x310Logo.png │ ├── Square44x44Logo.png │ ├── Square71x71Logo.png │ ├── Square89x89Logo.png │ ├── StoreLogo.png │ ├── icon.icns │ ├── icon.ico │ └── icon.png ├── src │ └── main.rs └── tauri.conf.json ├── src ├── App.css ├── App.tsx ├── AppContext.tsx ├── assets │ ├── Arrow2.svg │ ├── Line.svg │ ├── Oval.svg │ ├── Polygon.svg │ ├── Rectangle.svg │ ├── Star.svg │ ├── Triangle.svg │ ├── arrow.svg │ ├── back.svg │ ├── blank_template.png │ ├── browser_template.png │ ├── code_template.png │ ├── device_mockups │ │ ├── galaxyS10.png │ │ ├── galaxyS10_thumb.png │ │ ├── galaxyS20.png │ │ ├── galaxyS20_thumb.png │ │ ├── galaxy_note10.png │ │ ├── galaxy_note10_thumb.png │ │ ├── google_pixel4.png │ │ ├── google_pixel4_thumb.png │ │ ├── google_pixel5.png │ │ ├── google_pixel5_thumb.png │ │ ├── iphone14.png │ │ ├── iphone14_thumb.png │ │ ├── iphone14pro.png │ │ ├── iphone14pro_thumb.png │ │ ├── iphonex.png │ │ └── iphonex_thumb.png │ ├── example-user.png │ ├── image-example.png │ ├── image_template.png │ ├── karbonized.svg │ ├── karbonized2.svg │ ├── karbonized_white.svg │ ├── logo.svg │ ├── promotion.png │ ├── promotion2.png │ ├── qvapay.svg │ ├── react.svg │ ├── wallpapers │ │ ├── 1.jpg │ │ ├── 10.jpg │ │ ├── 10_thumb.jpg │ │ ├── 11.jpg │ │ ├── 11_thumb.jpg │ │ ├── 12.jpg │ │ ├── 12_thumb.jpg │ │ ├── 13.jpg │ │ ├── 13_thumb.jpg │ │ ├── 14.jpg │ │ ├── 14_thumb.jpg │ │ ├── 1_thumb.jpg │ │ ├── 2.jpg │ │ ├── 2_thumb.jpg │ │ ├── 3.jpg │ │ ├── 3_thumb.jpg │ │ ├── 4.jpg │ │ ├── 4_thumb.jpg │ │ ├── 5.jpg │ │ ├── 5_thumb.jpg │ │ ├── 6.jpg │ │ ├── 6_thumb.jpg │ │ ├── 7.jpg │ │ ├── 7_thumb.jpg │ │ ├── 8.jpg │ │ ├── 8_thumb.jpg │ │ ├── 9.jpg │ │ └── 9_thumb.jpg │ └── yoss.png ├── components │ ├── Base │ │ ├── MenuBar.tsx │ │ ├── StatusBar.tsx │ │ ├── TabBar.tsx │ │ ├── TabsSelector.tsx │ │ ├── TitleBar.css │ │ └── TitleBar.tsx │ ├── Blocks │ │ ├── AvatarBlock.tsx │ │ ├── BadgeBlock.tsx │ │ ├── BlockLoader.tsx │ │ ├── CodeBlock.tsx │ │ ├── ControlHandler.tsx │ │ ├── ControlTemplate.tsx │ │ ├── CustomBlock.tsx │ │ ├── FaIconBlock.tsx │ │ ├── ImageBlock.tsx │ │ ├── LanguajeTabIcon.tsx │ │ ├── PhoneBlock.tsx │ │ ├── QrBlock.tsx │ │ ├── ShapeBlock.tsx │ │ ├── ShapeHandler.tsx │ │ ├── TextBlock.tsx │ │ ├── TweetBlock.css │ │ ├── TweetBlock.tsx │ │ └── WindowBlock.tsx │ ├── Canvas.tsx │ ├── CustomControls │ │ ├── ColorPicker.tsx │ │ ├── ContextMenu.tsx │ │ ├── CustomCollapse.tsx │ │ ├── DropMenu.tsx │ │ ├── NumberInput.tsx │ │ └── Tooltip.tsx │ ├── FaIcon.tsx │ ├── Misc │ │ ├── Icons.tsx │ │ └── SvgBackgrounds │ │ │ ├── Backgrounds.tsx │ │ │ ├── Chaos.tsx │ │ │ ├── Circular.tsx │ │ │ ├── Coil.tsx │ │ │ ├── Flux.tsx │ │ │ ├── Grayrate.tsx │ │ │ ├── Hirl.tsx │ │ │ ├── Horizon.tsx │ │ │ ├── Neon.tsx │ │ │ ├── Oscilate.tsx │ │ │ ├── Undulate.tsx │ │ │ └── Vortex.tsx │ ├── Mobile │ │ ├── NavBarMobile.tsx │ │ ├── NavBarMobileEditor.tsx │ │ └── SettingsButton.tsx │ ├── Modals │ │ ├── AboutModal.tsx │ │ ├── ChangelogModal.tsx │ │ ├── DonationsModal.tsx │ │ └── PreviewModal.tsx │ ├── Panels │ │ ├── ExtensionsPanel.tsx │ │ ├── HierarchyPanel.tsx │ │ ├── LeftPanel.tsx │ │ ├── MenuItem.tsx │ │ ├── NewsPanel.tsx │ │ ├── RightPanel.tsx │ │ └── WorkspacePanel.tsx │ ├── Portal.tsx │ ├── Workspace.tsx │ └── WorkspaceTexture.tsx ├── fonts │ ├── Borel-Regular.ttf │ ├── Poppins-Bold.ttf │ └── Poppins-Regular.ttf ├── hooks │ ├── useControlState.ts │ ├── useKeyPress.ts │ ├── useScreenDirection.ts │ ├── useTauriPlatform.ts │ ├── useTheme.ts │ └── useWindowsSize.ts ├── input.css ├── main.tsx ├── models │ └── Extension.ts ├── pages │ ├── Editor.tsx │ ├── Home.tsx │ └── ProjectWizard.tsx ├── stores │ ├── AppStore.ts │ └── Hooks.ts ├── utils.css ├── utils │ ├── Base64Utils.ts │ ├── Exporter.ts │ ├── FaIconList.tsx │ ├── Languages.ts │ ├── PrismThemes.tsx │ ├── getRandom.ts │ ├── isElectron.ts │ ├── isNative.ts │ ├── secrets.ts │ └── wallpapers.ts └── vite-env.d.ts ├── tailwind.config.cjs ├── tsconfig.json ├── tsconfig.node.json ├── vite.config.ts └── vite.electron.config.ts /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "env": { 3 | "browser": true, 4 | "es2021": true 5 | }, 6 | "extends": [ 7 | "standard-with-typescript", 8 | "plugin:react/recommended" 9 | ], 10 | "overrides": [ 11 | { 12 | "env": { 13 | "node": true 14 | }, 15 | "files": [ 16 | ".eslintrc.{js,cjs}" 17 | ], 18 | "parserOptions": { 19 | "sourceType": "script" 20 | } 21 | } 22 | ], 23 | "parserOptions": { 24 | "ecmaVersion": "latest", 25 | "sourceType": "module" 26 | }, 27 | "plugins": [ 28 | "react" 29 | ], 30 | "rules": { 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es2021": true 5 | }, 6 | "extends": [ 7 | "plugin:react/recommended", 8 | "standard-with-typescript", 9 | "plugin:prettier/recommended" 10 | ], 11 | "overrides": [], 12 | "parserOptions": { 13 | "ecmaVersion": "latest", 14 | "sourceType": "module" 15 | }, 16 | "plugins": ["react", "prettier"], 17 | "rules": { 18 | "prettier/prettier": "error", 19 | "arrow-body-style": "off", 20 | "prefer-arrow-callback": "off" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: 'publish' 2 | on: 3 | push: 4 | tags: 5 | - 'karbonized-v*' 6 | jobs: 7 | publish-tauri: 8 | permissions: 9 | contents: write 10 | strategy: 11 | fail-fast: false 12 | matrix: 13 | platform: [macos-latest, ubuntu-20.04, windows-latest] 14 | 15 | runs-on: ${{ matrix.platform }} 16 | steps: 17 | - uses: actions/checkout@v3 18 | - name: setup node 19 | uses: actions/setup-node@v3 20 | with: 21 | node-version: 16 22 | - name: install Rust stable 23 | uses: dtolnay/rust-toolchain@stable 24 | - name: install dependencies (ubuntu only) 25 | if: matrix.platform == 'ubuntu-20.04' 26 | run: | 27 | sudo apt-get update 28 | sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf 29 | - name: install frontend dependencies 30 | run: yarn install # change this to npm or pnpm depending on which one you use 31 | - uses: tauri-apps/tauri-action@v0 32 | env: 33 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 34 | with: 35 | tagName: karbonized-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version 36 | releaseName: 'Karbonized v__VERSION__' 37 | releaseBody: 'See the assets to download this version and install.' 38 | releaseDraft: true 39 | prerelease: false 40 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: 7 | - master 8 | 9 | permissions: 10 | contents: read 11 | pages: write 12 | id-token: write 13 | 14 | concurrency: 15 | group: 'pages' 16 | cancel-in-progress: true 17 | 18 | jobs: 19 | build: 20 | name: Build 21 | runs-on: ubuntu-latest 22 | 23 | steps: 24 | - name: Checkout repo 25 | uses: actions/checkout@v3 26 | 27 | - name: Setup Pages 28 | uses: actions/configure-pages@v2 29 | 30 | - name: Setup Node 31 | uses: actions/setup-node@v3 32 | with: 33 | node-version: 16 34 | 35 | - name: Install dependencies 36 | run: | 37 | npm install 38 | 39 | - name: Build project 40 | run: npm run build 41 | 42 | - name: Upload artifact 43 | uses: actions/upload-pages-artifact@v1 44 | with: 45 | path: ./dist 46 | 47 | deploy: 48 | environment: 49 | name: github-pages 50 | url: ${{ steps.deployment.outputs.page_url }} 51 | name: Deploy 52 | needs: build 53 | runs-on: ubuntu-latest 54 | 55 | steps: 56 | - name: Deploy to GitHub Pages 57 | id: deployment 58 | uses: actions/deploy-pages@v1 59 | with: 60 | token: ${{ secrets.GITHUB_TOKEN }} 61 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release Electron App 2 | 3 | on: 4 | push: 5 | tags: 6 | - 'v*' 7 | 8 | jobs: 9 | release: 10 | runs-on: ${{ matrix.os }} 11 | 12 | permissions: 13 | contents: write 14 | 15 | strategy: 16 | fail-fast: false 17 | matrix: 18 | os: [ubuntu-latest, macos-latest, windows-latest] 19 | 20 | steps: 21 | - name: Check out Git repository 22 | uses: actions/checkout@v3 23 | 24 | - name: Install Node.js 25 | uses: actions/setup-node@v3 26 | with: 27 | node-version: 16 28 | 29 | - name: Install Dependencies 30 | run: npm install --force 31 | 32 | - name: Install Linux Dependencies 33 | env: 34 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 35 | if: matrix.os == 'ubuntu-latest' 36 | run: | 37 | sudo apt-get update 38 | sudo apt-get install rpm libopenjp2-tools libarchive-tools 39 | sudo snap install snapcraft --classic 40 | 41 | - name: build-linux 42 | env: 43 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 44 | if: matrix.os == 'ubuntu-latest' 45 | run: | 46 | env SHELL=bash 47 | npm run build:linux 48 | 49 | - name: build-mac 50 | env: 51 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 52 | if: matrix.os == 'macos-latest' 53 | run: npm run build:mac 54 | 55 | - name: build-win 56 | env: 57 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 58 | if: matrix.os == 'windows-latest' 59 | run: npm run build:win 60 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | yarn.lock 10 | 11 | node_modules 12 | release 13 | .yarn/ 14 | dist 15 | dist-ssr 16 | dist-electron 17 | *.local 18 | 19 | # Editor directories and files 20 | .vscode/* 21 | !.vscode/extensions.json 22 | .idea 23 | .DS_Store 24 | *.suo 25 | *.ntvs* 26 | *.njsproj 27 | *.sln 28 | *.sw? 29 | -------------------------------------------------------------------------------- /.hintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "development" 4 | ] 5 | } -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["prettier-plugin-tailwindcss"], 3 | "tailwindConfig": "./tailwind.config.cjs", 4 | "useTabs": true, 5 | "singleQuote": true, 6 | "jsxSingleQuote": true 7 | } 8 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 |

Karbonized

3 | 4 | ![carbonizedscreen](./img/screen.png) 5 |

6 | Karbonized is a user-friendly app designed to help you create stunning visuals with ease. Our block-based system allows you to customize and arrange code snippets, text, images, QR codes, and more, giving you the freedom to bring your ideas to life.

7 |

Free and Open Source. Made with 💙 and ReactJS in 🇨🇺

8 | 9 |
10 | React Badge 11 | Electron Badge 12 | TypeScript Badge 13 | Tailwind CSS Badge 14 | Licence 15 |
16 | 17 | ## 🚀 Features 18 | 19 | * **🎨 Customization:** Easily personalize and arrange various elements to suit your unique style and preferences. 20 | * **💾 Export Options:** Save your designs as **SVG**, **PNG**, or **JPG** files, making it simple to share or use them in other projects. 21 | * **🔌 Extension Support:** Karbonized offers support for extensions, allowing you to enhance its functionality and extend its capabilities according to your needs. 22 | * **🖥 Multi-Platform Compatibility:** Access Karbonized as a Progressive Web App (PWA with **Offline** Support) via any web browser. We also provide downloadable versions for **Windows**, **Linux**, and **macOS**, ensuring a seamless experience across different platforms. 23 | * **🆓 Free and Open Source:** Karbonized is free to use and open source, allowing you to contribute and be part of the community. 24 | 25 | ## 🏗 Building 26 | 27 | ### 🛠️ Requirements 28 | 29 | * **Node** >= 16 30 | * **npm** or **yarn** 31 | 32 | ### 🌐 Run as Web App 33 | 34 | To start a development server run the following command: 35 | 36 | ``` bash 37 | yarn dev 38 | ``` 39 | 40 | ### 🖥️ Building for Desktop 41 | 42 | Run the following command to run **Karbonized** in your system in development mode: 43 | 44 | ``` bash 45 | yarn run electron:dev 46 | ``` 47 | 48 | and for building for production: 49 | 50 | ``` bash 51 | yarn run electron:build 52 | ``` 53 | 54 | The generated binaries for your system are in ./release/{version}/ 55 | 56 | ## 🔌 Installing Plugins 57 | 58 | See [plugins](/docs/plugin_system.md) docs 59 | 60 | ## ©️ Licence 61 | 62 | This project is under [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) Licence Terms and Conditions. 63 | 64 | ## 👥 Contribution 65 | 66 | > While **Karbonized** is still in its early stages, we're committed to continuous improvement and value your feedback 67 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | # Using Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore 2 | 3 | # Built application files 4 | *.apk 5 | *.aar 6 | *.ap_ 7 | *.aab 8 | 9 | # Files for the ART/Dalvik VM 10 | *.dex 11 | 12 | # Java class files 13 | *.class 14 | 15 | # Generated files 16 | bin/ 17 | gen/ 18 | out/ 19 | # Uncomment the following line in case you need and you don't have the release build type files in your app 20 | # release/ 21 | 22 | # Gradle files 23 | .gradle/ 24 | build/ 25 | 26 | # Local configuration file (sdk path, etc) 27 | local.properties 28 | 29 | # Proguard folder generated by Eclipse 30 | proguard/ 31 | 32 | # Log Files 33 | *.log 34 | 35 | # Android Studio Navigation editor temp files 36 | .navigation/ 37 | 38 | # Android Studio captures folder 39 | captures/ 40 | 41 | # IntelliJ 42 | *.iml 43 | .idea/workspace.xml 44 | .idea/tasks.xml 45 | .idea/gradle.xml 46 | .idea/assetWizardSettings.xml 47 | .idea/dictionaries 48 | .idea/libraries 49 | # Android Studio 3 in .gitignore file. 50 | .idea/caches 51 | .idea/modules.xml 52 | # Comment next line if keeping position of elements in Navigation Editor is relevant for you 53 | .idea/navEditor.xml 54 | 55 | # Keystore files 56 | # Uncomment the following lines if you do not want to check your keystore files in. 57 | #*.jks 58 | #*.keystore 59 | 60 | # External native build folder generated in Android Studio 2.2 and later 61 | .externalNativeBuild 62 | .cxx/ 63 | 64 | # Google Services (e.g. APIs or Firebase) 65 | # google-services.json 66 | 67 | # Freeline 68 | freeline.py 69 | freeline/ 70 | freeline_project_description.json 71 | 72 | # fastlane 73 | fastlane/report.xml 74 | fastlane/Preview.html 75 | fastlane/screenshots 76 | fastlane/test_output 77 | fastlane/readme.md 78 | 79 | # Version control 80 | vcs.xml 81 | 82 | # lint 83 | lint/intermediates/ 84 | lint/generated/ 85 | lint/outputs/ 86 | lint/tmp/ 87 | # lint/reports/ 88 | 89 | # Android Profiling 90 | *.hprof 91 | 92 | # Cordova plugins for Capacitor 93 | capacitor-cordova-android-plugins 94 | 95 | # Copied web assets 96 | app/src/main/assets/public 97 | 98 | # Generated Config files 99 | app/src/main/assets/capacitor.config.json 100 | app/src/main/assets/capacitor.plugins.json 101 | app/src/main/res/xml/config.xml 102 | -------------------------------------------------------------------------------- /android/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build/* 2 | !/build/.npmkeep 3 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | namespace "com.yossthedev.karbonized" 5 | compileSdkVersion rootProject.ext.compileSdkVersion 6 | defaultConfig { 7 | applicationId "com.yossthedev.karbonized" 8 | minSdkVersion rootProject.ext.minSdkVersion 9 | targetSdkVersion rootProject.ext.targetSdkVersion 10 | versionCode 240823 11 | versionName "1.12.0" 12 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 13 | aaptOptions { 14 | // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. 15 | // Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61 16 | ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~' 17 | } 18 | } 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | } 26 | 27 | repositories { 28 | flatDir{ 29 | dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs' 30 | } 31 | } 32 | 33 | dependencies { 34 | implementation fileTree(include: ['*.jar'], dir: 'libs') 35 | implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion" 36 | implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion" 37 | implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion" 38 | implementation project(':capacitor-android') 39 | testImplementation "junit:junit:$junitVersion" 40 | androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion" 41 | androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion" 42 | implementation project(':capacitor-cordova-android-plugins') 43 | } 44 | 45 | apply from: 'capacitor.build.gradle' 46 | 47 | try { 48 | def servicesJSON = file('google-services.json') 49 | if (servicesJSON.text) { 50 | apply plugin: 'com.google.gms.google-services' 51 | } 52 | } catch(Exception e) { 53 | logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work") 54 | } 55 | -------------------------------------------------------------------------------- /android/app/capacitor.build.gradle: -------------------------------------------------------------------------------- 1 | // DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN 2 | 3 | android { 4 | compileOptions { 5 | sourceCompatibility JavaVersion.VERSION_17 6 | targetCompatibility JavaVersion.VERSION_17 7 | } 8 | } 9 | 10 | apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle" 11 | dependencies { 12 | implementation project(':capacitor-community-media') 13 | implementation project(':capacitor-clipboard') 14 | implementation project(':capacitor-filesystem') 15 | implementation project(':capacitor-share') 16 | implementation project(':capacitor-status-bar') 17 | implementation project(':capacitor-toast') 18 | 19 | } 20 | 21 | 22 | if (hasProperty('postBuildExtras')) { 23 | postBuildExtras() 24 | } 25 | -------------------------------------------------------------------------------- /android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.getcapacitor.myapp; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import android.content.Context; 6 | import androidx.test.ext.junit.runners.AndroidJUnit4; 7 | import androidx.test.platform.app.InstrumentationRegistry; 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * @see Testing documentation 15 | */ 16 | @RunWith(AndroidJUnit4.class) 17 | public class ExampleInstrumentedTest { 18 | 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 23 | 24 | assertEquals("com.getcapacitor.app", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/yossthedev/karbonized/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.yossthedev.karbonized; 2 | 3 | import com.getcapacitor.BridgeActivity; 4 | 5 | public class MainActivity extends BridgeActivity {} 6 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-land-hdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-land-hdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-land-ldpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-land-ldpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-land-mdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-land-mdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-land-night-hdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-land-night-hdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-land-night-ldpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-land-night-ldpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-land-night-mdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-land-night-mdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-land-night-xhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-land-night-xhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-land-night-xxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-land-night-xxhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-land-night-xxxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-land-night-xxxhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-land-xhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-land-xhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-land-xxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-land-xxhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-land-xxxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-land-xxxhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-night/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-port-hdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-port-hdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-port-ldpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-port-ldpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-port-mdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-port-mdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-port-night-hdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-port-night-hdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-port-night-ldpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-port-night-ldpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-port-night-mdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-port-night-mdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-port-night-xhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-port-night-xhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-port-night-xxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-port-night-xxhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-port-night-xxxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-port-night-xxxhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-port-xhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-port-xhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-port-xxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-port-xxhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-port-xxxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable-port-xxxhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/drawable/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-ldpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-ldpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-ldpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-ldpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-ldpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-ldpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #141313 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | karbonized 4 | karbonized 5 | com.yossthedev.karbonized 6 | com.yossthedev.karbonized 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | 17 | 18 | 19 | 22 | -------------------------------------------------------------------------------- /android/app/src/main/res/xml/file_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.getcapacitor.myapp; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import org.junit.Test; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | 14 | @Test 15 | public void addition_isCorrect() throws Exception { 16 | assertEquals(4, 2 + 2); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | 5 | repositories { 6 | google() 7 | mavenCentral() 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:8.0.0' 11 | classpath 'com.google.gms:google-services:4.3.15' 12 | 13 | // NOTE: Do not place your application dependencies here; they belong 14 | // in the individual module build.gradle files 15 | } 16 | } 17 | 18 | apply from: "variables.gradle" 19 | 20 | allprojects { 21 | repositories { 22 | google() 23 | mavenCentral() 24 | } 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /android/capacitor.settings.gradle: -------------------------------------------------------------------------------- 1 | // DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN 2 | include ':capacitor-android' 3 | project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor') 4 | 5 | include ':capacitor-community-media' 6 | project(':capacitor-community-media').projectDir = new File('../node_modules/@capacitor-community/media/android') 7 | 8 | include ':capacitor-clipboard' 9 | project(':capacitor-clipboard').projectDir = new File('../node_modules/@capacitor/clipboard/android') 10 | 11 | include ':capacitor-filesystem' 12 | project(':capacitor-filesystem').projectDir = new File('../node_modules/@capacitor/filesystem/android') 13 | 14 | include ':capacitor-share' 15 | project(':capacitor-share').projectDir = new File('../node_modules/@capacitor/share/android') 16 | 17 | include ':capacitor-status-bar' 18 | project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacitor/status-bar/android') 19 | 20 | include ':capacitor-toast' 21 | project(':capacitor-toast').projectDir = new File('../node_modules/@capacitor/toast/android') 22 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | 19 | # AndroidX package structure to make it clearer which packages are bundled with the 20 | # Android operating system, and which are packaged with your app's APK 21 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 22 | android.useAndroidX=true 23 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip 4 | networkTimeout=10000 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 48 | echo. 49 | echo Please set the JAVA_HOME variable in your environment to match the 50 | echo location of your Java installation. 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 62 | echo. 63 | echo Please set the JAVA_HOME variable in your environment to match the 64 | echo location of your Java installation. 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | include ':capacitor-cordova-android-plugins' 3 | project(':capacitor-cordova-android-plugins').projectDir = new File('./capacitor-cordova-android-plugins/') 4 | 5 | apply from: 'capacitor.settings.gradle' -------------------------------------------------------------------------------- /android/variables.gradle: -------------------------------------------------------------------------------- 1 | ext { 2 | minSdkVersion = 22 3 | compileSdkVersion = 33 4 | targetSdkVersion = 33 5 | androidxActivityVersion = '1.7.0' 6 | androidxAppCompatVersion = '1.6.1' 7 | androidxCoordinatorLayoutVersion = '1.2.0' 8 | androidxCoreVersion = '1.10.0' 9 | androidxFragmentVersion = '1.5.6' 10 | coreSplashScreenVersion = '1.0.0' 11 | androidxWebkitVersion = '1.6.1' 12 | junitVersion = '4.13.2' 13 | androidxJunitVersion = '1.1.5' 14 | androidxEspressoCoreVersion = '3.5.1' 15 | cordovaAndroidVersion = '10.1.1' 16 | } -------------------------------------------------------------------------------- /capacitor.config.ts: -------------------------------------------------------------------------------- 1 | import { CapacitorConfig } from '@capacitor/cli'; 2 | 3 | const config: CapacitorConfig = { 4 | appId: 'com.yossthedev.karbonized', 5 | appName: 'karbonized', 6 | webDir: 'dist', 7 | bundledWebRuntime: false, 8 | }; 9 | 10 | export default config; 11 | -------------------------------------------------------------------------------- /dev-dist/registerSW.js: -------------------------------------------------------------------------------- 1 | if('serviceWorker' in navigator) navigator.serviceWorker.register('/dev-sw.js?dev-sw', { scope: '/', type: 'classic' }) -------------------------------------------------------------------------------- /dev-dist/sw.js: -------------------------------------------------------------------------------- 1 | if(!self.define){let e,t={};const i=(i,n)=>(i=new URL(i+".js",n).href,t[i]||new Promise((t=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=t,document.head.appendChild(e)}else e=i,importScripts(i),t()})).then((()=>{let e=t[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(n,r)=>{const o=e||("document"in self?document.currentScript.src:"")||location.href;if(t[o])return;let s={};const l=e=>i(e,o),u={module:{uri:o},exports:s,require:l};t[o]=Promise.all(n.map((e=>u[e]||l(e)))).then((e=>(r(...e),s)))}}define(["./workbox-3625d7b0"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"3ca0b8505b4bec776b69afdba2768812"},{revision:null,url:"index.html"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html"),{allowlist:[/^\/$/]}))})); 2 | -------------------------------------------------------------------------------- /dist-electron/main.js: -------------------------------------------------------------------------------- 1 | "use strict";const i=require("electron"),c=require("fs"),l=require("node:fs/promises"),t=require("path");function m(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const n in a)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(a,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>a[n]})}}return e.default=a,Object.freeze(e)}const r=m(l),d=async a=>{c.mkdirSync(t.join(i.app.getPath("appData"),"karbonized","extensions"),{recursive:!0}),a.reply("loading_extensions",!0);const e=t.join(i.app.getPath("appData"),"karbonized","extensions"),n=(await r.readdir(e)).filter(s=>s.endsWith(".kext")),o=[];for(const s of n){const p=JSON.parse(await r.readFile(t.join(e,s),"utf-8"));o.push(p),a.reply("extension_loaded",p)}await r.writeFile(t.join(i.app.getPath("appData"),"karbonized","extensions_data.json"),JSON.stringify(o)),a.reply("extensions_loaded",o),a.reply("loading_extensions",!1)};i.app.whenReady().then(()=>{const a=i.nativeImage.createFromPath(t.join(__dirname,process.platform==="win32"?"icon.ico":"icon.png")),e=new i.BrowserWindow({title:"Karbonized",icon:a,width:800,height:600,minHeight:600,minWidth:900,useContentSize:!0,frame:process.platform==="darwin",titleBarStyle:"hidden",webPreferences:{preload:t.join(__dirname,"preload.js"),sandbox:!1}});process.env.VITE_DEV_SERVER_URL||(i.app.applicationMenu=new i.Menu),e.maximize(),process.env.VITE_DEV_SERVER_URL?e.loadURL(process.env.VITE_DEV_SERVER_URL):e.loadFile("dist/index.html"),i.ipcMain.on("maximizeApp",n=>{e.isMaximized()?(e.unmaximize(),n.reply("maximizedStatus",e.isMaximized())):(e.maximize(),n.reply("maximizedStatus",e.isMaximized()))}),i.ipcMain.on("minimizeApp",()=>{e.minimize()}),i.ipcMain.on("closeApp",()=>{e.close()}),i.ipcMain.on("getAppData",async n=>{await(async()=>{if(c.existsSync(t.join(i.app.getPath("appData"),"karbonized","extensions_data.json"))){const s=JSON.parse(await r.readFile(t.join(i.app.getPath("appData"),"karbonized","extensions_data.json"),"utf-8"));n.reply("extensions_loaded",s)}else await d(n)})()}),i.ipcMain.on("reloadExtensions",async n=>{await d(n)})}); 2 | -------------------------------------------------------------------------------- /docs/plugin_system.md: -------------------------------------------------------------------------------- 1 | # 🔌 Plugins 2 | 3 | > ⚠️ This Functionality is Under Development 4 | 5 | ## Installing Plugins 6 | 7 | To install new Plugins copy the extension file *(.kext)* in the **Karbonized** folder in dependency of your operating system: 8 | 9 | * **Windows**: C:\Users\USER\AppData\Local\karbonized\extensions\ 10 | * **Linux**: /home/USER/.config/karbonized/extensions/ 11 | * **Mac**: /Users/USER/Library/Application Support/karbonized/extensions/ 12 | 13 | ## Creating new Plugins 14 | 15 | To create Plugins you only need to have a minimum knowledge of **Javascript** and **JSX**. So anyone can write new Plugins for **Kabonized** 16 | 17 | ### First, take a look at its Structure 18 | 19 | ``` plain 20 | my-plugin 21 | components 22 | - component1.jsx 23 | - component1.json 24 | - component1.png 25 | info.json 26 | ``` 27 | 28 | All the components you create must be in the **components** folder, no other name is allowed and the structure must be kept like this. 29 | 30 | The **info.json** stores the information of your new plugin its structure is as follow: 31 | 32 | ``` json 33 | { 34 | "name":"My New Plugin", 35 | "author":"@yossthedev", 36 | "description": "An Awesome Description", 37 | "version":"1.0.0" 38 | } 39 | 40 | ``` 41 | 42 | ### Creating New Components 43 | 44 | Start by creating a new .jsx files in the components folder and copy this structure, *all the component you create must have the same structure*, you can use everything you know about react, except Hooks, later we will see all the limitations. 45 | 46 | component1.jsx 47 | 48 | ``` jsx 49 | const Component = () => { 50 | return

This is Awesome

; 51 | }; 52 | 53 | render(); 54 | 55 | ``` 56 | 57 | component1.json 58 | 59 | ``` json 60 | { "name" : "component1"} 61 | ``` 62 | 63 | We also need to create a **JSON** file with the same name of the component which will include the properties that Karbonized needs to interact with it(for now only need the name of that component) and the image that will represent the component in the extensions section of **Karbonized** 64 | 65 | ### Packaging 66 | 67 | See [icon-pack-plugin-template](https://github.com/karbon-apps/icon-pack-extension-template) 68 | 69 | ### Limitations 70 | 71 | This function is still in **early development phase** and therefore contains some limitations when creating new Plugins: 72 | 73 | * External Libraries cannot be used 74 | * Component names must not contain "-" 75 | * The images representing the components can be .png or .svg 76 | -------------------------------------------------------------------------------- /electron-builder.json: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://www.electron.build/configuration/configuration 3 | */ 4 | { 5 | "appId": "com.yossthedev.karbonized", 6 | "publish": { 7 | "provider": "github", 8 | "protocol": "https", 9 | "releaseType": "release" 10 | }, 11 | "asar": true, 12 | "directories": { 13 | "output": "release/${version}" 14 | }, 15 | "files": ["dist", "dist-electron"], 16 | "mac": { 17 | "artifactName": "${productName}_${version}.${ext}", 18 | "target": ["dmg"], 19 | "icon": "./src-electron/assets/icon.icns" 20 | }, 21 | "win": { 22 | "artifactName": "${productName}_${version}.${ext}", 23 | "target": [ 24 | { 25 | "target": "nsis", 26 | "arch": ["x64"] 27 | } 28 | ], 29 | "icon": "./src-electron/assets/icon.ico" 30 | }, 31 | "linux": { 32 | "target": ["AppImage", "snap", "deb", "rpm", "pacman"] 33 | }, 34 | "nsis": { 35 | "oneClick": false, 36 | "perMachine": false, 37 | "allowToChangeInstallationDirectory": true, 38 | "deleteAppDataOnUninstall": false 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /electron/.gitignore: -------------------------------------------------------------------------------- 1 | # NPM renames .gitignore to .npmignore 2 | # In order to prevent that, we remove the initial "." 3 | # And the CLI then renames it 4 | app 5 | node_modules 6 | build 7 | dist 8 | logs 9 | -------------------------------------------------------------------------------- /electron/.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules -------------------------------------------------------------------------------- /electron/assets/appIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/electron/assets/appIcon.ico -------------------------------------------------------------------------------- /electron/assets/appIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/electron/assets/appIcon.png -------------------------------------------------------------------------------- /electron/assets/splash.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/electron/assets/splash.gif -------------------------------------------------------------------------------- /electron/assets/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/electron/assets/splash.png -------------------------------------------------------------------------------- /electron/capacitor.config.ts: -------------------------------------------------------------------------------- 1 | import { CapacitorConfig } from '@capacitor/cli'; 2 | 3 | const config: CapacitorConfig = { 4 | appId: 'com.yossthedev.karbonized', 5 | appName: 'Karbonized', 6 | webDir: 'dist', 7 | bundledWebRuntime: false, 8 | }; 9 | 10 | export default config; 11 | -------------------------------------------------------------------------------- /electron/electron-builder.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "appId": "com.yossthedev.karbonized", 3 | "directories": { 4 | "buildResources": "resources" 5 | }, 6 | "files": ["assets/**/*", "build/**/*", "capacitor.config.*", "app/**/*"], 7 | "publish": { 8 | "provider": "github" 9 | }, 10 | "nsis": { 11 | "allowElevation": true, 12 | "oneClick": false, 13 | "allowToChangeInstallationDirectory": true 14 | }, 15 | "win": { 16 | "target": "nsis", 17 | "icon": "assets/appIcon.ico" 18 | }, 19 | "mac": { 20 | "category": "your.app.category.type", 21 | "target": "dmg" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /electron/live-runner.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | /* eslint-disable @typescript-eslint/no-var-requires */ 3 | const cp = require('child_process'); 4 | const chokidar = require('chokidar'); 5 | const electron = require('electron'); 6 | 7 | let child = null; 8 | const npmCmd = process.platform === 'win32' ? 'npm.cmd' : 'npm'; 9 | const reloadWatcher = { 10 | debouncer: null, 11 | ready: false, 12 | watcher: null, 13 | restarting: false, 14 | }; 15 | 16 | ///* 17 | function runBuild() { 18 | return new Promise((resolve, _reject) => { 19 | let tempChild = cp.spawn(npmCmd, ['run', 'build']); 20 | tempChild.once('exit', () => { 21 | resolve(); 22 | }); 23 | tempChild.stdout.pipe(process.stdout); 24 | }); 25 | } 26 | //*/ 27 | 28 | async function spawnElectron() { 29 | if (child !== null) { 30 | child.stdin.pause(); 31 | child.kill(); 32 | child = null; 33 | await runBuild(); 34 | } 35 | child = cp.spawn(electron, ['--inspect=5858', './']); 36 | child.on('exit', () => { 37 | if (!reloadWatcher.restarting) { 38 | process.exit(0); 39 | } 40 | }); 41 | child.stdout.pipe(process.stdout); 42 | } 43 | 44 | function setupReloadWatcher() { 45 | reloadWatcher.watcher = chokidar 46 | .watch('./src/**/*', { 47 | ignored: /[/\\]\./, 48 | persistent: true, 49 | }) 50 | .on('ready', () => { 51 | reloadWatcher.ready = true; 52 | }) 53 | .on('all', (_event, _path) => { 54 | if (reloadWatcher.ready) { 55 | clearTimeout(reloadWatcher.debouncer); 56 | reloadWatcher.debouncer = setTimeout(async () => { 57 | console.log('Restarting'); 58 | reloadWatcher.restarting = true; 59 | await spawnElectron(); 60 | reloadWatcher.restarting = false; 61 | reloadWatcher.ready = false; 62 | clearTimeout(reloadWatcher.debouncer); 63 | reloadWatcher.debouncer = null; 64 | reloadWatcher.watcher = null; 65 | setupReloadWatcher(); 66 | }, 500); 67 | } 68 | }); 69 | } 70 | 71 | (async () => { 72 | await runBuild(); 73 | await spawnElectron(); 74 | setupReloadWatcher(); 75 | })(); 76 | -------------------------------------------------------------------------------- /electron/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Karbonized", 3 | "version": "1.0.0", 4 | "description": "Make awesome images of your screenshot or your code", 5 | "author": { 6 | "name": "Yoannis Sanchez", 7 | "email": "" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/yossthedev/karbonized" 12 | }, 13 | "license": "MIT", 14 | "main": "build/src/index.js", 15 | "scripts": { 16 | "build": "tsc && electron-rebuild", 17 | "electron:start-live": "node ./live-runner.js", 18 | "electron:start": "npm run build && electron --inspect=5858 ./", 19 | "electron:pack": "npm run build && electron-builder build --dir -c ./electron-builder.config.json", 20 | "electron:make": "npm run build && electron-builder build -c ./electron-builder.config.json -p always" 21 | }, 22 | "dependencies": { 23 | "@capacitor-community/electron": "^4.1.1", 24 | "chokidar": "~3.5.3", 25 | "electron-is-dev": "~2.0.0", 26 | "electron-serve": "~1.1.0", 27 | "electron-unhandled": "~4.0.1", 28 | "electron-updater": "~5.0.1", 29 | "electron-window-state": "~5.0.3" 30 | }, 31 | "devDependencies": { 32 | "electron": "^19.1.9", 33 | "electron-builder": "~22.14.13", 34 | "electron-rebuild": "^3.2.7", 35 | "typescript": "~4.3.5" 36 | }, 37 | "keywords": [ 38 | "capacitor", 39 | "electron" 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /electron/resources/electron-publisher-custom.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | /* eslint-disable @typescript-eslint/no-var-requires */ 3 | const electronPublish = require('electron-publish'); 4 | 5 | class Publisher extends electronPublish.Publisher { 6 | async upload(task) { 7 | console.log('electron-publisher-custom', task.file); 8 | } 9 | } 10 | module.exports = Publisher; 11 | -------------------------------------------------------------------------------- /electron/src/index.ts: -------------------------------------------------------------------------------- 1 | import type { CapacitorElectronConfig } from '@capacitor-community/electron'; 2 | import { 3 | getCapacitorElectronConfig, 4 | setupElectronDeepLinking, 5 | } from '@capacitor-community/electron'; 6 | import type { MenuItemConstructorOptions } from 'electron'; 7 | import { app, MenuItem } from 'electron'; 8 | import electronIsDev from 'electron-is-dev'; 9 | import unhandled from 'electron-unhandled'; 10 | import { autoUpdater } from 'electron-updater'; 11 | 12 | import { 13 | ElectronCapacitorApp, 14 | setupContentSecurityPolicy, 15 | setupReloadWatcher, 16 | } from './setup'; 17 | 18 | // Graceful handling of unhandled errors. 19 | unhandled(); 20 | 21 | // Define our menu templates (these are optional) 22 | /*const trayMenuTemplate: (MenuItemConstructorOptions | MenuItem)[] = [new MenuItem({ label: 'Quit App', role: 'quit' })]; 23 | const appMenuBarMenuTemplate: (MenuItemConstructorOptions | MenuItem)[] = [ 24 | { role: process.platform === 'darwin' ? 'appMenu' : 'fileMenu' }, 25 | { role: 'viewMenu' }, 26 | ];*/ 27 | 28 | // Get Config options from capacitor.config 29 | const capacitorFileConfig: CapacitorElectronConfig = 30 | getCapacitorElectronConfig(); 31 | 32 | // Initialize our app. You can pass menu templates into the app here. 33 | // const myCapacitorApp = new ElectronCapacitorApp(capacitorFileConfig); 34 | const myCapacitorApp = new ElectronCapacitorApp( 35 | capacitorFileConfig 36 | //trayMenuTemplate, 37 | //appMenuBarMenuTemplate 38 | ); 39 | 40 | // If deeplinking is enabled then we will set it up here. 41 | if (capacitorFileConfig.electron?.deepLinkingEnabled) { 42 | setupElectronDeepLinking(myCapacitorApp, { 43 | customProtocol: 44 | capacitorFileConfig.electron.deepLinkingCustomProtocol ?? 45 | 'mycapacitorapp', 46 | }); 47 | } 48 | 49 | // If we are in Dev mode, use the file watcher components. 50 | if (electronIsDev) { 51 | setupReloadWatcher(myCapacitorApp); 52 | } 53 | 54 | // Run Application 55 | (async () => { 56 | // Wait for electron app to be ready. 57 | await app.whenReady(); 58 | // Security - Set Content-Security-Policy based on whether or not we are in dev mode. 59 | setupContentSecurityPolicy(myCapacitorApp.getCustomURLScheme()); 60 | // Initialize our app, build windows, and load content. 61 | await myCapacitorApp.init(); 62 | // Check for updates if we are in a packaged app. 63 | autoUpdater.checkForUpdatesAndNotify(); 64 | })(); 65 | 66 | // Handle when all of our windows are close (platforms have their own expectations). 67 | app.on('window-all-closed', function () { 68 | // On OS X it is common for applications and their menu bar 69 | // to stay active until the user quits explicitly with Cmd + Q 70 | if (process.platform !== 'darwin') { 71 | app.quit(); 72 | } 73 | }); 74 | 75 | // When the dock icon is clicked. 76 | app.on('activate', async function () { 77 | // On OS X it's common to re-create a window in the app when the 78 | // dock icon is clicked and there are no other windows open. 79 | if (myCapacitorApp.getMainWindow().isDestroyed()) { 80 | await myCapacitorApp.init(); 81 | } 82 | }); 83 | 84 | // Place all ipc or other electron api calls and custom functionality under this line 85 | -------------------------------------------------------------------------------- /electron/src/preload.ts: -------------------------------------------------------------------------------- 1 | require('./rt/electron-rt'); 2 | ////////////////////////////// 3 | // User Defined Preload scripts below 4 | console.log('User Preload!'); 5 | -------------------------------------------------------------------------------- /electron/src/rt/electron-plugins.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | /* eslint-disable @typescript-eslint/no-var-requires */ 3 | module.exports = {}; 4 | -------------------------------------------------------------------------------- /electron/src/rt/electron-rt.ts: -------------------------------------------------------------------------------- 1 | import { randomBytes } from 'crypto'; 2 | import { ipcRenderer, contextBridge } from 'electron'; 3 | import { EventEmitter } from 'events'; 4 | 5 | //////////////////////////////////////////////////////// 6 | // eslint-disable-next-line @typescript-eslint/no-var-requires 7 | const plugins = require('./electron-plugins'); 8 | 9 | const randomId = (length = 5) => randomBytes(length).toString('hex'); 10 | 11 | const contextApi: { 12 | [plugin: string]: { [functionName: string]: () => Promise }; 13 | } = {}; 14 | 15 | Object.keys(plugins).forEach((pluginKey) => { 16 | Object.keys(plugins[pluginKey]) 17 | .filter((className) => className !== 'default') 18 | .forEach((classKey) => { 19 | const functionList = Object.getOwnPropertyNames(plugins[pluginKey][classKey].prototype).filter( 20 | (v) => v !== 'constructor' 21 | ); 22 | 23 | if (!contextApi[classKey]) { 24 | contextApi[classKey] = {}; 25 | } 26 | 27 | functionList.forEach((functionName) => { 28 | if (!contextApi[classKey][functionName]) { 29 | contextApi[classKey][functionName] = (...args) => ipcRenderer.invoke(`${classKey}-${functionName}`, ...args); 30 | } 31 | }); 32 | 33 | // Events 34 | if (plugins[pluginKey][classKey].prototype instanceof EventEmitter) { 35 | const listeners: { [key: string]: { type: string; listener: (...args: any[]) => void } } = {}; 36 | const listenersOfTypeExist = (type) => 37 | !!Object.values(listeners).find((listenerObj) => listenerObj.type === type); 38 | 39 | Object.assign(contextApi[classKey], { 40 | addListener(type: string, callback: (...args) => void) { 41 | const id = randomId(); 42 | 43 | // Deduplicate events 44 | if (!listenersOfTypeExist(type)) { 45 | ipcRenderer.send(`event-add-${classKey}`, type); 46 | } 47 | 48 | const eventHandler = (_, ...args) => callback(...args); 49 | 50 | ipcRenderer.addListener(`event-${classKey}-${type}`, eventHandler); 51 | listeners[id] = { type, listener: eventHandler }; 52 | 53 | return id; 54 | }, 55 | removeListener(id: string) { 56 | if (!listeners[id]) { 57 | throw new Error('Invalid id'); 58 | } 59 | 60 | const { type, listener } = listeners[id]; 61 | 62 | ipcRenderer.removeListener(`event-${classKey}-${type}`, listener); 63 | 64 | delete listeners[id]; 65 | 66 | if (!listenersOfTypeExist(type)) { 67 | ipcRenderer.send(`event-remove-${classKey}-${type}`); 68 | } 69 | }, 70 | removeAllListeners(type: string) { 71 | Object.entries(listeners).forEach(([id, listenerObj]) => { 72 | if (listenerObj.type === type) { 73 | ipcRenderer.removeListener(`event-${classKey}-${type}`, listenerObj.listener); 74 | delete listeners[id]; 75 | } 76 | }); 77 | 78 | ipcRenderer.send(`event-remove-${classKey}-${type}`); 79 | }, 80 | }); 81 | } 82 | }); 83 | }); 84 | 85 | contextBridge.exposeInMainWorld('CapacitorCustomPlatform', { 86 | name: 'electron', 87 | plugins: contextApi, 88 | }); 89 | //////////////////////////////////////////////////////// 90 | -------------------------------------------------------------------------------- /electron/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": true, 3 | "include": ["./src/**/*", "./capacitor.config.ts", "./capacitor.config.js"], 4 | "compilerOptions": { 5 | "outDir": "./build", 6 | "importHelpers": true, 7 | "target": "ES2017", 8 | "module": "CommonJS", 9 | "moduleResolution": "node", 10 | "esModuleInterop": true, 11 | "typeRoots": ["./node_modules/@types"], 12 | "allowJs": true, 13 | "rootDir": "." 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /img/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/img/banner.png -------------------------------------------------------------------------------- /img/screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/img/screen.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | Karbonized | Image Generator 13 | 14 | 15 | 16 | 20 | 21 | 22 | 23 | 24 | 25 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 39 | 40 | 41 | 42 | 47 | 48 | 49 | 50 |
51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /news/news.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "title": "Wallpapers!!! 🎉", 4 | "description": "New backgrounds for your designs", 5 | "img": "wallpapers.png" 6 | }, 7 | 8 | { 9 | "title": "Mockups, Mockups, and More Mockups", 10 | "description": "7 new devices for mockups, several improvements and new Editor features", 11 | "link": "https://github.com/yossTheDev/karbonized", 12 | "img": "mockups.png" 13 | } 14 | ] 15 | -------------------------------------------------------------------------------- /postcss.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | 'tailwindcss/nesting': {}, 4 | tailwindcss: {}, 5 | autoprefixer: {} 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /public/.well-known/assetlinks.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "relation": ["delegate_permission/common.handle_all_urls"], 3 | "target" : { "namespace": "android_app", "package_name": "com.yossthedev.karbonized.twa", 4 | "sha256_cert_fingerprints": ["D5:ED:EB:50:A9:CB:B4:76:4E:D2:1E:72:C5:CB:FD:02:2C:14:89:DB:76:C8:FB:CB:38:D5:1D:D7:08:F8:52:39"] } 5 | } 6 | ] -------------------------------------------------------------------------------- /public/assets/icons/icon-128.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/public/assets/icons/icon-128.webp -------------------------------------------------------------------------------- /public/assets/icons/icon-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/public/assets/icons/icon-128x128.png -------------------------------------------------------------------------------- /public/assets/icons/icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/public/assets/icons/icon-144x144.png -------------------------------------------------------------------------------- /public/assets/icons/icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/public/assets/icons/icon-152x152.png -------------------------------------------------------------------------------- /public/assets/icons/icon-192.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/public/assets/icons/icon-192.webp -------------------------------------------------------------------------------- /public/assets/icons/icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/public/assets/icons/icon-192x192.png -------------------------------------------------------------------------------- /public/assets/icons/icon-256.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/public/assets/icons/icon-256.webp -------------------------------------------------------------------------------- /public/assets/icons/icon-384x384.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/public/assets/icons/icon-384x384.png -------------------------------------------------------------------------------- /public/assets/icons/icon-48.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/public/assets/icons/icon-48.webp -------------------------------------------------------------------------------- /public/assets/icons/icon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/public/assets/icons/icon-48x48.png -------------------------------------------------------------------------------- /public/assets/icons/icon-512.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/public/assets/icons/icon-512.webp -------------------------------------------------------------------------------- /public/assets/icons/icon-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/public/assets/icons/icon-512x512.png -------------------------------------------------------------------------------- /public/assets/icons/icon-72.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/public/assets/icons/icon-72.webp -------------------------------------------------------------------------------- /public/assets/icons/icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/public/assets/icons/icon-72x72.png -------------------------------------------------------------------------------- /public/assets/icons/icon-96.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/public/assets/icons/icon-96.webp -------------------------------------------------------------------------------- /public/assets/icons/icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/public/assets/icons/icon-96x96.png -------------------------------------------------------------------------------- /public/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/public/image.png -------------------------------------------------------------------------------- /public/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src-electron/assets/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src-electron/assets/icon.icns -------------------------------------------------------------------------------- /src-electron/assets/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src-electron/assets/icon.ico -------------------------------------------------------------------------------- /src-electron/assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src-electron/assets/icon.png -------------------------------------------------------------------------------- /src-electron/main.ts: -------------------------------------------------------------------------------- 1 | import { app, BrowserWindow, ipcMain, Menu, nativeImage } from 'electron'; 2 | import { existsSync, mkdirSync } from 'fs'; 3 | import * as fs from 'node:fs/promises'; 4 | import { join } from 'path'; 5 | 6 | const loadExtensions = async (event) => { 7 | /* Create Extensions Folder */ 8 | mkdirSync(join(app.getPath('appData'), 'karbonized', 'extensions'), { 9 | recursive: true, 10 | }); 11 | 12 | event.reply('loading_extensions', true); 13 | 14 | const extensionsPath = join( 15 | app.getPath('appData'), 16 | 'karbonized', 17 | 'extensions', 18 | ); 19 | 20 | const extensions = (await fs.readdir(extensionsPath)).filter((item) => 21 | item.endsWith('.kext'), 22 | ); 23 | 24 | const loadedExtensions: Extension[] = []; 25 | 26 | for (const extension of extensions) { 27 | const newExtension = JSON.parse( 28 | await fs.readFile(join(extensionsPath, extension), 'utf-8'), 29 | ); 30 | 31 | loadedExtensions.push(newExtension); 32 | 33 | event.reply('extension_loaded', newExtension); 34 | } 35 | 36 | /* Write Extensions Data */ 37 | await fs.writeFile( 38 | join(app.getPath('appData'), 'karbonized', 'extensions_data.json'), 39 | JSON.stringify(loadedExtensions), 40 | ); 41 | 42 | event.reply('extensions_loaded', loadedExtensions); 43 | event.reply('loading_extensions', false); 44 | }; 45 | 46 | app.whenReady().then(() => { 47 | const icon = nativeImage.createFromPath( 48 | join(__dirname, process.platform === 'win32' ? 'icon.ico' : 'icon.png'), 49 | ); 50 | 51 | const win = new BrowserWindow({ 52 | title: 'Karbonized', 53 | icon: icon, 54 | width: 800, 55 | height: 600, 56 | minHeight: 600, 57 | minWidth: 900, 58 | useContentSize: true, 59 | frame: process.platform === 'darwin', 60 | titleBarStyle: 'hidden', 61 | 62 | webPreferences: { 63 | preload: join(__dirname, 'preload.js'), 64 | sandbox: false, 65 | }, 66 | }); 67 | 68 | if (!process.env.VITE_DEV_SERVER_URL) { 69 | app.applicationMenu = new Menu(); 70 | } 71 | 72 | win.maximize(); 73 | 74 | // You can use `process.env.VITE_DEV_SERVER_URL` when the vite command is called `serve` 75 | if (process.env.VITE_DEV_SERVER_URL) { 76 | win.loadURL(process.env.VITE_DEV_SERVER_URL); 77 | } else { 78 | // Load your file 79 | win.loadFile('dist/index.html'); 80 | } 81 | 82 | ipcMain.on('maximizeApp', (event) => { 83 | if (win.isMaximized()) { 84 | win.unmaximize(); 85 | event.reply('maximizedStatus', win.isMaximized()); 86 | } else { 87 | win.maximize(); 88 | event.reply('maximizedStatus', win.isMaximized()); 89 | } 90 | }); 91 | 92 | ipcMain.on('minimizeApp', () => { 93 | win.minimize(); 94 | }); 95 | 96 | ipcMain.on('closeApp', () => { 97 | win.close(); 98 | }); 99 | 100 | ipcMain.on('getAppData', async (event) => { 101 | const load = async () => { 102 | if ( 103 | existsSync( 104 | join(app.getPath('appData'), 'karbonized', 'extensions_data.json'), 105 | ) 106 | ) { 107 | const data = JSON.parse( 108 | await fs.readFile( 109 | join(app.getPath('appData'), 'karbonized', 'extensions_data.json'), 110 | 'utf-8', 111 | ), 112 | ); 113 | 114 | event.reply('extensions_loaded', data); 115 | } else { 116 | await loadExtensions(event); 117 | } 118 | }; 119 | 120 | await load(); 121 | }); 122 | 123 | ipcMain.on('reloadExtensions', async (event) => { 124 | await loadExtensions(event); 125 | }); 126 | }); 127 | 128 | interface Extension { 129 | info?: { 130 | name: string; 131 | author: string; 132 | description: string; 133 | version: string; 134 | }; 135 | logo: string; 136 | components: { properties?: {}; code?: string; image?: string }[]; 137 | } 138 | -------------------------------------------------------------------------------- /src-electron/preload.ts: -------------------------------------------------------------------------------- 1 | import { contextBridge, ipcRenderer, app, shell } from 'electron'; 2 | 3 | document.addEventListener('click', (event: any) => { 4 | if (event.target.tagName === 'A' && event.target.href.startsWith('http')) { 5 | event.preventDefault(); 6 | shell.openExternal(event.target.href); 7 | } 8 | }); 9 | 10 | window.addEventListener('DOMContentLoaded', () => {}); 11 | 12 | export type Channels = 'minimizeApp' | 'maximizeApp' | 'closeApp'; 13 | 14 | contextBridge.exposeInMainWorld('electron', { 15 | ipcRenderer: { 16 | sendMessage(channel: Channels, args: unknown[]) { 17 | ipcRenderer.send(channel, args); 18 | }, 19 | on( 20 | channel: string, 21 | listener: (event: Electron.IpcRendererEvent, ...args: any[]) => void, 22 | ) { 23 | ipcRenderer.on(channel, listener); 24 | }, 25 | 26 | once( 27 | channel: string, 28 | listener: (event: Electron.IpcRendererEvent, ...args: any[]) => void, 29 | ) { 30 | ipcRenderer.once(channel, listener); 31 | }, 32 | 33 | isLinux() { 34 | return process.platform === 'linux'; 35 | }, 36 | 37 | isWindow() { 38 | return process.platform === 'win32'; 39 | }, 40 | 41 | isMac() { 42 | return process.platform === 'darwin'; 43 | }, 44 | 45 | isLinuxOrWindows() { 46 | return process.platform === 'darwin' || process.platform === 'linux'; 47 | }, 48 | 49 | getAppData() { 50 | console.log(app.getPath('appData')); 51 | }, 52 | }, 53 | }); 54 | -------------------------------------------------------------------------------- /src-tauri/.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | /target/ 4 | -------------------------------------------------------------------------------- /src-tauri/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "app" 3 | version = "0.1.0" 4 | description = "A Tauri App" 5 | authors = ["you"] 6 | license = "" 7 | repository = "" 8 | default-run = "app" 9 | edition = "2021" 10 | rust-version = "1.60" 11 | 12 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 13 | 14 | [build-dependencies] 15 | tauri-build = { version = "1.3.0", features = [] } 16 | 17 | [dependencies] 18 | serde_json = "1.0" 19 | serde = { version = "1.0", features = ["derive"] } 20 | tauri = { version = "1.3.0", features = ["dialog-save", "fs-read-file", "fs-write-file", "os-all", "window-close", "window-hide", "window-maximize", "window-minimize", "window-show", "window-start-dragging", "window-unmaximize", "window-unminimize"] } 21 | 22 | [features] 23 | # this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled. 24 | # If you use cargo directly instead of tauri's cli you can use this feature flag to switch between tauri's `dev` and `build` modes. 25 | # DO NOT REMOVE!! 26 | custom-protocol = [ "tauri/custom-protocol" ] 27 | -------------------------------------------------------------------------------- /src-tauri/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | tauri_build::build() 3 | } 4 | -------------------------------------------------------------------------------- /src-tauri/icons/128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src-tauri/icons/128x128.png -------------------------------------------------------------------------------- /src-tauri/icons/128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src-tauri/icons/128x128@2x.png -------------------------------------------------------------------------------- /src-tauri/icons/32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src-tauri/icons/32x32.png -------------------------------------------------------------------------------- /src-tauri/icons/Square107x107Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src-tauri/icons/Square107x107Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square142x142Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src-tauri/icons/Square142x142Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square150x150Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src-tauri/icons/Square150x150Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square284x284Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src-tauri/icons/Square284x284Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square30x30Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src-tauri/icons/Square30x30Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square310x310Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src-tauri/icons/Square310x310Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square44x44Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src-tauri/icons/Square44x44Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square71x71Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src-tauri/icons/Square71x71Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square89x89Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src-tauri/icons/Square89x89Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src-tauri/icons/StoreLogo.png -------------------------------------------------------------------------------- /src-tauri/icons/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src-tauri/icons/icon.icns -------------------------------------------------------------------------------- /src-tauri/icons/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src-tauri/icons/icon.ico -------------------------------------------------------------------------------- /src-tauri/icons/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src-tauri/icons/icon.png -------------------------------------------------------------------------------- /src-tauri/src/main.rs: -------------------------------------------------------------------------------- 1 | // Prevents additional console window on Windows in release, DO NOT REMOVE!! 2 | #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] 3 | 4 | fn main() { 5 | tauri::Builder::default() 6 | .run(tauri::generate_context!()) 7 | .expect("error while running tauri application"); 8 | } 9 | -------------------------------------------------------------------------------- /src-tauri/tauri.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../node_modules/@tauri-apps/cli/schema.json", 3 | "build": { 4 | "beforeBuildCommand": "yarn build", 5 | "beforeDevCommand": "yarn dev", 6 | "devPath": "http://localhost:5173", 7 | "distDir": "../dist" 8 | }, 9 | "package": { 10 | "productName": "Karbonized", 11 | "version": "1.1.0" 12 | }, 13 | "tauri": { 14 | "allowlist": { 15 | "all": false, 16 | "os": { 17 | "all": true 18 | }, 19 | "dialog": { 20 | "all": false, 21 | "save": true 22 | }, 23 | "fs": { 24 | "all": false, 25 | "readFile": true, 26 | "writeFile": true 27 | }, 28 | "window": { 29 | "all": false, 30 | "close": true, 31 | "hide": true, 32 | "show": true, 33 | "maximize": true, 34 | "minimize": true, 35 | "unmaximize": true, 36 | "unminimize": true, 37 | "startDragging": true 38 | } 39 | }, 40 | "bundle": { 41 | "active": true, 42 | "category": "DeveloperTool", 43 | "copyright": "Yoannis Sánchez Soto © 2023", 44 | "deb": { 45 | "depends": [] 46 | }, 47 | "externalBin": [], 48 | "icon": [ 49 | "icons/32x32.png", 50 | "icons/128x128.png", 51 | "icons/128x128@2x.png", 52 | "icons/icon.icns", 53 | "icons/icon.ico" 54 | ], 55 | "identifier": "com.yossthedev.karbonized", 56 | "longDescription": "Awesome Image Generator for Code Snippets and Screenshots", 57 | "macOS": { 58 | "entitlements": null, 59 | "exceptionDomain": "", 60 | "frameworks": [], 61 | "providerShortName": null, 62 | "signingIdentity": null 63 | }, 64 | "resources": [], 65 | "shortDescription": "Awesome Image Generator", 66 | "targets": "all", 67 | "windows": { 68 | "certificateThumbprint": null, 69 | "digestAlgorithm": "sha256", 70 | "timestampUrl": "" 71 | } 72 | }, 73 | "security": { 74 | "csp": null 75 | }, 76 | "updater": { 77 | "active": false 78 | }, 79 | "windows": [ 80 | { 81 | "fullscreen": false, 82 | "height": 600, 83 | "resizable": true, 84 | "title": "Karbonized", 85 | "width": 800, 86 | "maximized": true, 87 | "minHeight": 600, 88 | "minWidth": 800, 89 | "decorations": false, 90 | "transparent": true 91 | } 92 | ] 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /src/App.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Poppins-Bold'; 3 | src: 4 | url('./fonts/Poppins-Bold.ttf') format('woff2'), 5 | url('./fonts/Poppins-Bold.ttf') format('woff'); 6 | font-weight: bold; 7 | font-style: bold; 8 | font-display: swap; 9 | } 10 | 11 | @font-face { 12 | font-family: 'Poppins-Regular'; 13 | src: 14 | url('./fonts/Poppins-Regular.ttf') format('woff2'), 15 | url('./fonts/Poppins-Regular.ttf') format('woff'); 16 | font-weight: bold; 17 | font-style: bold; 18 | font-display: swap; 19 | } 20 | 21 | @font-face { 22 | font-family: 'Borel-Regular'; 23 | src: 24 | url('./fonts/Borel-Regular.ttf') format('woff2'), 25 | url('./fonts/Borel-Regular.ttf') format('woff'); 26 | font-weight: bold; 27 | font-style: bold; 28 | font-display: swap; 29 | } 30 | 31 | .borel-font { 32 | font-family: 'Borel-Regular'; 33 | -webkit-font-smoothing: antialiased; 34 | -moz-osx-font-smoothing: grayscale; 35 | } 36 | 37 | .poppins-font-family { 38 | font-family: 'Poppins-Bold'; 39 | font-weight: bold; 40 | 41 | -webkit-font-smoothing: antialiased; 42 | -moz-osx-font-smoothing: grayscale; 43 | } 44 | 45 | .poppins-font-family-regular { 46 | font-family: 'Poppins-Regular'; 47 | font-weight: bold; 48 | 49 | -webkit-font-smoothing: antialiased; 50 | -moz-osx-font-smoothing: grayscale; 51 | } 52 | 53 | #root { 54 | font-family: 'Poppins-Regular'; 55 | } 56 | 57 | .draggable { 58 | -webkit-app-region: drag; 59 | } 60 | -------------------------------------------------------------------------------- /src/AppContext.tsx: -------------------------------------------------------------------------------- 1 | import { createContext } from 'react'; 2 | 3 | export const AppContext = createContext<{ 4 | viewerRef: any; 5 | showWizard: boolean; 6 | setShowWizard: Function; 7 | }>({ 8 | viewerRef: null, 9 | showWizard: true, 10 | setShowWizard: () => {}, 11 | }); 12 | -------------------------------------------------------------------------------- /src/assets/Arrow2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/assets/Line.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/assets/Oval.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/assets/Polygon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/assets/Rectangle.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/assets/Star.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/assets/Triangle.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/assets/arrow.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/assets/back.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/blank_template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/blank_template.png -------------------------------------------------------------------------------- /src/assets/browser_template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/browser_template.png -------------------------------------------------------------------------------- /src/assets/code_template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/code_template.png -------------------------------------------------------------------------------- /src/assets/device_mockups/galaxyS10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/device_mockups/galaxyS10.png -------------------------------------------------------------------------------- /src/assets/device_mockups/galaxyS10_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/device_mockups/galaxyS10_thumb.png -------------------------------------------------------------------------------- /src/assets/device_mockups/galaxyS20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/device_mockups/galaxyS20.png -------------------------------------------------------------------------------- /src/assets/device_mockups/galaxyS20_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/device_mockups/galaxyS20_thumb.png -------------------------------------------------------------------------------- /src/assets/device_mockups/galaxy_note10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/device_mockups/galaxy_note10.png -------------------------------------------------------------------------------- /src/assets/device_mockups/galaxy_note10_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/device_mockups/galaxy_note10_thumb.png -------------------------------------------------------------------------------- /src/assets/device_mockups/google_pixel4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/device_mockups/google_pixel4.png -------------------------------------------------------------------------------- /src/assets/device_mockups/google_pixel4_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/device_mockups/google_pixel4_thumb.png -------------------------------------------------------------------------------- /src/assets/device_mockups/google_pixel5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/device_mockups/google_pixel5.png -------------------------------------------------------------------------------- /src/assets/device_mockups/google_pixel5_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/device_mockups/google_pixel5_thumb.png -------------------------------------------------------------------------------- /src/assets/device_mockups/iphone14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/device_mockups/iphone14.png -------------------------------------------------------------------------------- /src/assets/device_mockups/iphone14_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/device_mockups/iphone14_thumb.png -------------------------------------------------------------------------------- /src/assets/device_mockups/iphone14pro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/device_mockups/iphone14pro.png -------------------------------------------------------------------------------- /src/assets/device_mockups/iphone14pro_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/device_mockups/iphone14pro_thumb.png -------------------------------------------------------------------------------- /src/assets/device_mockups/iphonex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/device_mockups/iphonex.png -------------------------------------------------------------------------------- /src/assets/device_mockups/iphonex_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/device_mockups/iphonex_thumb.png -------------------------------------------------------------------------------- /src/assets/example-user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/example-user.png -------------------------------------------------------------------------------- /src/assets/image-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/image-example.png -------------------------------------------------------------------------------- /src/assets/image_template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/image_template.png -------------------------------------------------------------------------------- /src/assets/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/assets/promotion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/promotion.png -------------------------------------------------------------------------------- /src/assets/promotion2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/promotion2.png -------------------------------------------------------------------------------- /src/assets/wallpapers/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/1.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/10.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/10_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/10_thumb.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/11.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/11_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/11_thumb.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/12.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/12_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/12_thumb.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/13.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/13_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/13_thumb.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/14.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/14_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/14_thumb.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/1_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/1_thumb.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/2.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/2_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/2_thumb.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/3.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/3_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/3_thumb.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/4.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/4_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/4_thumb.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/5.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/5_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/5_thumb.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/6.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/6_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/6_thumb.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/7.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/7_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/7_thumb.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/8.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/8_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/8_thumb.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/9.jpg -------------------------------------------------------------------------------- /src/assets/wallpapers/9_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/wallpapers/9_thumb.jpg -------------------------------------------------------------------------------- /src/assets/yoss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/assets/yoss.png -------------------------------------------------------------------------------- /src/components/Base/TabBar.tsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useRef } from 'react'; 2 | import { useStoreActions, useStoreState } from '../../stores/Hooks'; 3 | import { IconPlus, IconSquareRotated, IconX } from '@tabler/icons-react'; 4 | import { Scrollbars } from 'react-custom-scrollbars-2'; 5 | 6 | export const TabBar: React.FC = () => { 7 | const workspaces = useStoreState((state) => state.workspaces); 8 | 9 | const currentWorkspaceID = useStoreState((state) => state.currentWorkspaceID); 10 | 11 | const addWorkspace = useStoreActions((state) => state.addWorkspace); 12 | const deleteWorkspace = useStoreActions((state) => state.deleteWorkspace); 13 | const setCurrentWorkspace = useStoreActions( 14 | (state) => state.setCurrentWorkspace, 15 | ); 16 | 17 | const ref = useRef(null); 18 | 19 | useEffect(() => { 20 | ref.current?.scrollToRight(); 21 | }, [workspaces]); 22 | 23 | return ( 24 |
25 | ( 30 |
31 | )} 32 | onWheel={(event: any) => { 33 | const delta = Math.max( 34 | -1, 35 | Math.min( 36 | 1, 37 | (event.nativeEvent.wheelDelta as any) || 38 | -event.nativeEvent.detail, 39 | ), 40 | ); 41 | 42 | ref.current?.scrollLeft(ref.current.getScrollLeft() - delta * 20); 43 | event.preventDefault(); 44 | }} 45 | className='pointer-events-auto flex max-w-fit flex-auto flex-row gap-2 overflow-x-auto overflow-y-hidden' 46 | > 47 |
48 | {workspaces.map((item) => ( 49 | 76 | ))} 77 |
78 | 79 | 80 | 86 |
87 | ); 88 | }; 89 | 90 | export default TabBar; 91 | -------------------------------------------------------------------------------- /src/components/Base/TabsSelector.tsx: -------------------------------------------------------------------------------- 1 | import React, { ReactNode } from 'react'; 2 | 3 | interface Props { 4 | isActive: boolean; 5 | children: ReactNode; 6 | onClick: () => void; 7 | onDoubleClick?: () => void; 8 | } 9 | 10 | export const TabSelector: React.FC = ({ 11 | isActive, 12 | children, 13 | onClick, 14 | onDoubleClick, 15 | }) => { 16 | return ( 17 | 28 | ); 29 | }; 30 | -------------------------------------------------------------------------------- /src/components/Base/TitleBar.css: -------------------------------------------------------------------------------- 1 | .titlebar { 2 | -webkit-app-region: drag; 3 | } -------------------------------------------------------------------------------- /src/components/Blocks/AvatarBlock.tsx: -------------------------------------------------------------------------------- 1 | import { IconLetterT, IconPhoto } from '@tabler/icons-react'; 2 | import React, { useId, useState } from 'react'; 3 | import { FileInput } from 'react-daisyui'; 4 | import { CustomCollapse } from '../CustomControls/CustomCollapse'; 5 | import { ControlTemplate } from './ControlTemplate'; 6 | import example from '../../assets/example-user.png'; 7 | 8 | interface Props { 9 | id: string; 10 | } 11 | 12 | export const AvatarBlock: React.FC = ({ id }) => { 13 | /* Component States */ 14 | const [src, setSrc] = useState(example); 15 | 16 | return ( 17 | <> 18 | 30 | 34 | 35 |

Image

36 |
37 | } 38 | > 39 | {/* Source */} 40 |

Source

41 | { 44 | if (e.target.files && e.target.files.length > 0) { 45 | const reader = new FileReader(); 46 | reader.addEventListener('load', () => { 47 | setSrc(reader.result?.toString() || ''); 48 | }); 49 | reader.readAsDataURL(e.target.files[0]); 50 | } 51 | }} 52 | > 53 | 54 | 55 | } 56 | > 57 | 61 | 62 | 63 | ); 64 | }; 65 | export default AvatarBlock; 66 | -------------------------------------------------------------------------------- /src/components/Blocks/BadgeBlock.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { FileInput, Input } from 'react-daisyui'; 3 | import karbonized from '../../assets/karbonized.svg'; 4 | import { ColorPicker } from '../CustomControls/ColorPicker'; 5 | import { CustomCollapse } from '../CustomControls/CustomCollapse'; 6 | import { ControlTemplate } from './ControlTemplate'; 7 | import { useControlState } from '../../hooks/useControlState'; 8 | 9 | interface Props { 10 | id: string; 11 | } 12 | 13 | export const BadgeBlock: React.FC = ({ id }) => { 14 | /* Component States */ 15 | const [src, setSrc] = useControlState(karbonized, `${id}-src`); 16 | const [text, setText] = useControlState('@karbonized_app', `${id}-text`); 17 | const [color, setColor] = useControlState('#ffffff', `${id}-color`); 18 | 19 | return ( 20 | <> 21 | 32 | 36 |
37 |

Badge

38 | 39 | } 40 | > 41 | {/* Badge Color */} 42 | <> 43 | 49 | 50 | 51 | {/* Badge Text */} 52 | <> 53 |

Text

54 | 55 | setText(ev.target.value)} 58 | value={text} 59 | > 60 | 61 | 62 | {/* Image */} 63 | <> 64 |

Image

65 | { 68 | if (e.target.files && e.target.files.length > 0) { 69 | const reader = new FileReader(); 70 | reader.addEventListener('load', () => { 71 | setSrc(reader.result?.toString() || ''); 72 | }); 73 | reader.readAsDataURL(e.target.files[0]); 74 | } 75 | }} 76 | > 77 | 78 |
79 | 80 | } 81 | > 82 |
86 |
87 | 91 |

{text}

92 |
93 |
94 |
95 | 96 | ); 97 | }; 98 | 99 | export default BadgeBlock; 100 | -------------------------------------------------------------------------------- /src/components/Blocks/BlockLoader.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const BlockLoader: React.FC = () => { 4 | return ( 5 |
9 | ); 10 | }; 11 | -------------------------------------------------------------------------------- /src/components/Blocks/ControlHandler.tsx: -------------------------------------------------------------------------------- 1 | import React, { Suspense } from 'react'; 2 | import BadgeBlock from './BadgeBlock'; 3 | import { BlockLoader } from './BlockLoader'; 4 | import TweetBlock from './TweetBlock'; 5 | 6 | const CodeControl = React.lazy(() => import('./CodeBlock')); 7 | const FaIconBlock = React.lazy(() => import('./FaIconBlock')); 8 | const CustomBlock = React.lazy(() => import('./CustomBlock')); 9 | const TextControl = React.lazy(() => import('./TextBlock')); 10 | const QrControl = React.lazy(() => import('./QrBlock')); 11 | const PhoneBlock = React.lazy(() => import('./PhoneBlock')); 12 | const ImageBlock = React.lazy(() => import('./ImageBlock')); 13 | const AvatarBlock = React.lazy(() => import('./AvatarBlock')); 14 | const ShapeBlock = React.lazy(() => import('./ShapeBlock')); 15 | const WindowBlock = React.lazy(() => import('./WindowBlock')); 16 | 17 | interface Props { 18 | id: string; 19 | type: string; 20 | isVisible: boolean; 21 | } 22 | 23 | export const ControlHandler: React.FC = ({ type, id, isVisible }) => { 24 | // Store Actions 25 | switch (type) { 26 | case 'code': 27 | return ( 28 | }> 29 |
30 | 31 |
32 |
33 | ); 34 | case 'text': 35 | return ( 36 | 37 |
38 | 39 |
40 |
41 | ); 42 | case 'qr': 43 | return ( 44 | 45 |
46 | 47 |
48 |
49 | ); 50 | case 'image': 51 | return ( 52 | 53 |
54 | 55 |
56 |
57 | ); 58 | case 'window': 59 | return ( 60 | 61 |
62 | 63 |
64 |
65 | ); 66 | case 'avatar': 67 | return ( 68 | 69 |
70 | 71 |
72 |
73 | ); 74 | 75 | case 'shape': 76 | return ( 77 | 78 |
79 | 80 |
81 |
82 | ); 83 | case 'phone_mockup': 84 | return ( 85 | 86 |
87 | 88 |
89 |
90 | ); 91 | case 'icon': 92 | return ( 93 | }> 94 |
95 | 96 |
97 |
98 | ); 99 | 100 | case 'tweet': 101 | return ( 102 | }> 103 |
104 | 105 |
106 |
107 | ); 108 | 109 | case 'badge': 110 | return ( 111 | }> 112 |
113 | 114 |
115 |
116 | ); 117 | case 'custom': 118 | return ( 119 | }> 120 |
121 | 122 |
123 |
124 | ); 125 | default: 126 | return <>; 127 | } 128 | }; 129 | -------------------------------------------------------------------------------- /src/components/Blocks/CustomBlock.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Input } from 'react-daisyui'; 3 | import { ControlTemplate } from './ControlTemplate'; 4 | import { useControlState } from '../../hooks/useControlState'; 5 | import { LivePreview, LiveProvider } from 'react-live'; 6 | import { CustomCollapse } from '../CustomControls/CustomCollapse'; 7 | import { IconPalette } from '@tabler/icons-react'; 8 | import { ColorPicker } from '../CustomControls/ColorPicker'; 9 | 10 | interface Props { 11 | id: string; 12 | } 13 | 14 | export const CustomBlock: React.FC = ({ id }) => { 15 | const [code, setCode] = useControlState('', `${id}-code`); 16 | const [color, setColor] = useControlState('#f3f4f6', `${id}-fill_color`); 17 | const [bgcolor, setBgColor] = useControlState('#111a2600', `${id}-bg_color`); 18 | 19 | /* Component States */ 20 | const scope = { 21 | id, 22 | Input, 23 | }; 24 | 25 | return ( 26 | 27 | 37 | 41 | 42 |

Colors

43 | 44 | } 45 | > 46 | 53 | 54 | 61 |
62 | 63 | } 64 | > 65 | 70 |
71 |
72 | ); 73 | }; 74 | 75 | export default CustomBlock; 76 | -------------------------------------------------------------------------------- /src/components/Blocks/ImageBlock.tsx: -------------------------------------------------------------------------------- 1 | import { IconBorderStyle, IconPhoto } from '@tabler/icons-react'; 2 | import React, { useId, useState } from 'react'; 3 | import { FileInput, Range } from 'react-daisyui'; 4 | import { CustomCollapse } from '../CustomControls/CustomCollapse'; 5 | import { ControlTemplate } from './ControlTemplate'; 6 | import karbonized from '../../assets/logo.svg'; 7 | import { useControlState } from '../../hooks/useControlState'; 8 | 9 | interface Props { 10 | id: string; 11 | } 12 | 13 | export const ImageBlock: React.FC = ({ id }) => { 14 | /* Component States */ 15 | 16 | const [src, setSrc] = useControlState(karbonized, `${id}-src`); 17 | const [borderRadius, setBorderRadius] = useControlState( 18 | 3, 19 | `${id}-borderRadius`, 20 | ); 21 | 22 | return ( 23 | <> 24 | 36 | {/* Border Settings */} 37 | 40 | 41 |

Borders

42 | 43 | } 44 | > 45 |
46 |
47 |

Radius:

48 | 52 | setBorderRadius(ev.target.value as unknown as number) 53 | } 54 | value={borderRadius} 55 | max={'22'} 56 | > 57 |
58 |
59 |
60 | 61 | {/* Image Settings */} 62 | 66 | 67 |

Image

68 | 69 | } 70 | > 71 | {/* Source */} 72 |

Source

73 | { 76 | if (e.target.files && e.target.files.length > 0) { 77 | const reader = new FileReader(); 78 | reader.addEventListener('load', () => { 79 | setSrc(reader.result?.toString() || ''); 80 | }); 81 | reader.readAsDataURL(e.target.files[0]); 82 | } 83 | }} 84 | > 85 |
86 | 87 | } 88 | > 89 | 94 |
95 | 96 | ); 97 | }; 98 | export default ImageBlock; 99 | -------------------------------------------------------------------------------- /src/components/Blocks/LanguajeTabIcon.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | IconBrandCSharp, 3 | IconBrandCss3, 4 | IconBrandFlutter, 5 | IconBrandHtml5, 6 | IconBrandJavascript, 7 | IconBrandPython, 8 | IconBrandReact, 9 | IconFile, 10 | } from '@tabler/icons-react'; 11 | import React from 'react'; 12 | 13 | export const LanguajeTabIcon: React.FC<{ languaje: string }> = ({ 14 | languaje, 15 | }) => { 16 | switch (languaje) { 17 | case 'javascript': 18 | return ; 19 | case 'css': 20 | return ; 21 | case 'dart': 22 | return ; 23 | case 'xml': 24 | return ; 25 | case 'csharp': 26 | return ; 27 | case 'jsx': 28 | return ; 29 | case 'tsx': 30 | return ; 31 | case 'python': 32 | return ; 33 | 34 | default: 35 | return ; 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /src/components/Blocks/QrBlock.tsx: -------------------------------------------------------------------------------- 1 | import { IconPalette, IconQrcode } from '@tabler/icons-react'; 2 | import React, { useId, useState } from 'react'; 3 | import { Input } from 'react-daisyui'; 4 | import { CustomCollapse } from '../CustomControls/CustomCollapse'; 5 | import { ControlTemplate } from './ControlTemplate'; 6 | import { QRCodeSVG } from 'qrcode.react'; 7 | import { HexAlphaColorPicker, HexColorPicker } from 'react-colorful'; 8 | import { ColorPicker } from '../CustomControls/ColorPicker'; 9 | import { useControlState } from '../../hooks/useControlState'; 10 | 11 | interface Props { 12 | id: string; 13 | } 14 | 15 | export const QrControl: React.FC = ({ id }) => { 16 | /* Component States */ 17 | const [text, setText] = useControlState('karbonized', `${id}-text`); 18 | const [backgroundColor, setBackgroundColor] = useControlState( 19 | '#1e408400', 20 | `${id}-backgroundColor`, 21 | ); 22 | const [foregroundColor, setforegroundColor] = useControlState( 23 | '#090c12', 24 | `${id}-foregroundColor`, 25 | ); 26 | 27 | return ( 28 | <> 29 | 41 | {/* Colors Settings */} 42 | 45 | 46 |

Colors

47 | 48 | } 49 | > 50 | 57 | 58 | 65 |
66 | 67 | {/* QR Settings */} 68 | 72 | 73 |

QR Settings

74 | 75 | } 76 | > 77 |
78 |

Value

79 | setText(ev.target.value)} 82 | value={text} 83 | > 84 |
85 |
86 | 87 | } 88 | > 89 | 96 |
97 | 98 | ); 99 | }; 100 | 101 | export default QrControl; 102 | -------------------------------------------------------------------------------- /src/components/Blocks/ShapeHandler.tsx: -------------------------------------------------------------------------------- 1 | import { IconHeartFilled, IconHexagonFilled } from '@tabler/icons-react'; 2 | import React from 'react'; 3 | import { 4 | Arrow2Svg, 5 | Arrow3Svg, 6 | Arrow4Svg, 7 | Arrow5Svg, 8 | Arrow6Svg, 9 | ArrowSvg, 10 | LineSvg, 11 | OvalSvg, 12 | PoligonSvg, 13 | StarSvg, 14 | Trianglevg, 15 | } from '../Misc/Icons'; 16 | 17 | interface Props { 18 | type: string; 19 | color: string; 20 | } 21 | export const ShapeHandler: React.FC = ({ type, color }) => { 22 | // Store Actions 23 | switch (type) { 24 | case 'arrow': 25 | return ( 26 | 30 | ); 31 | 32 | case 'arrow2': 33 | return ( 34 | 38 | ); 39 | case 'arrow3': 40 | return ( 41 | 45 | ); 46 | case 'arrow4': 47 | return ( 48 | 52 | ); 53 | case 'arrow5': 54 | return ( 55 | 59 | ); 60 | 61 | case 'arrow6': 62 | return ( 63 | 67 | ); 68 | case 'line': 69 | return ( 70 | 74 | ); 75 | case 'poligon': 76 | return ( 77 | 81 | ); 82 | case 'rectangle': 83 | return ( 84 |
88 | ); 89 | case 'triangle': 90 | return ( 91 | 95 | ); 96 | case 'oval': 97 | return ( 98 | 102 | ); 103 | case 'star': 104 | return ( 105 | 109 | ); 110 | 111 | case 'heart': 112 | return ( 113 | 117 | ); 118 | 119 | case 'hexagon': 120 | return ( 121 | 125 | ); 126 | 127 | default: 128 | return <>; 129 | } 130 | }; 131 | -------------------------------------------------------------------------------- /src/components/Blocks/TweetBlock.css: -------------------------------------------------------------------------------- 1 | .react-tweet-theme { 2 | display: flex; 3 | flex: 1 1 auto; 4 | width: 100%; 5 | overflow: hidden; 6 | /* Base font styles */ 7 | color: var(--tweet-font-color); 8 | font-family: var(--tweet-font-family); 9 | font-weight: 400; 10 | box-sizing: border-box; 11 | border: var(--tweet-border); 12 | border-radius: 12px; 13 | margin: var(--tweet-container-margin); 14 | background-color: var(--tweet-bg-color); 15 | 16 | } -------------------------------------------------------------------------------- /src/components/Canvas.tsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useRef, useState } from 'react'; 2 | import { useStoreState } from '../stores/Hooks'; 3 | 4 | export const Canvas: React.FC = ({}) => { 5 | const [isDrawing, setIsDrawing] = useState(false); 6 | 7 | const canvasRef = useRef(null); 8 | const ctxRef = useRef(null); 9 | 10 | const canDraw = useStoreState((state) => state.isDrawing); 11 | const isErasing = useStoreState((state) => state.isErasing); 12 | 13 | const strokeColor = useStoreState((state) => state.strokeColor); 14 | const lineWidth = useStoreState((state) => state.lineWidth); 15 | const currentWorkspace = useStoreState((state) => state.currentWorkspace); 16 | 17 | const startDrawing = (e: any) => { 18 | if (ctxRef) { 19 | ctxRef.current?.beginPath(); 20 | ctxRef.current?.moveTo(e.nativeEvent.offsetX, e.nativeEvent.offsetY); 21 | 22 | setIsDrawing(true); 23 | } 24 | }; 25 | 26 | const endDrawing = () => { 27 | ctxRef.current.closePath(); 28 | setIsDrawing(false); 29 | }; 30 | 31 | const draw = (e: any) => { 32 | if (!isDrawing) { 33 | return; 34 | } 35 | 36 | ctxRef.current.lineTo(e.nativeEvent.offsetX, e.nativeEvent.offsetY); 37 | 38 | if (isErasing) { 39 | ctxRef.current.globalCompositeOperation = 'destination-out'; 40 | } else { 41 | ctxRef.current.globalCompositeOperation = 'source-over'; 42 | } 43 | 44 | ctxRef.current.stroke(); 45 | }; 46 | 47 | useEffect(() => { 48 | const canvas = canvasRef.current; 49 | const ctx = canvas?.getContext('2d'); 50 | 51 | if (ctx) { 52 | ctx.lineCap = 'round'; 53 | ctx.lineJoin = 'round'; 54 | //ctx.globalAlpha = 0.1; 55 | ctx.lineWidth = lineWidth; 56 | ctx.strokeStyle = strokeColor; 57 | ctxRef.current = ctx; 58 | } 59 | }, [lineWidth, strokeColor]); 60 | 61 | return ( 62 | <> 63 | 75 | 76 | ); 77 | }; 78 | -------------------------------------------------------------------------------- /src/components/CustomControls/ContextMenu.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | flip, 3 | offset, 4 | Placement, 5 | shift, 6 | useFloating, 7 | } from '@floating-ui/react-dom'; 8 | import { AnimatePresence, motion } from 'framer-motion'; 9 | import React, { ReactNode, useState } from 'react'; 10 | import { Portal } from 'react-portal'; 11 | 12 | interface Props { 13 | show?: boolean; 14 | position?: Placement; 15 | children: ReactNode; 16 | menu: ReactNode; 17 | showOnEnter?: boolean; 18 | } 19 | export const ContextMenu: React.FC = ({ 20 | children, 21 | position, 22 | menu, 23 | showOnEnter = false, 24 | }) => { 25 | const { x, y, reference, floating, strategy } = useFloating({ 26 | middleware: [offset(10), shift(), flip()], 27 | placement: position, 28 | }); 29 | const [show, setShow] = useState(false); 30 | 31 | return ( 32 | <> 33 |
setShow(false)} 36 | onMouseEnter={() => setShow(true)} 37 | ref={reference} 38 | > 39 | {children} 40 |
41 | 42 | 43 | {show && ( 44 | 45 | setShow(false)} 48 | initial={{ scale: 0.5, opacity: 0.94 }} 49 | animate={{ scale: 1, opacity: 1 }} 50 | exit={{ scale: 0, opacity: 0 }} 51 | className='z-50 flex w-52 flex-auto flex-col gap-2 rounded-2xl bg-base-100 p-2 shadow-2xl dark:text-gray-400' 52 | ref={floating} 53 | style={{ position: strategy, top: y ?? 0, left: x ?? 0 }} 54 | onMouseLeave={() => { 55 | setShow(false); 56 | }} 57 | > 58 | {menu} 59 | 60 | 61 | )} 62 | 63 | 64 | ); 65 | }; 66 | -------------------------------------------------------------------------------- /src/components/CustomControls/CustomCollapse.tsx: -------------------------------------------------------------------------------- 1 | import { IconChevronDown, IconChevronUp } from '@tabler/icons-react'; 2 | import { motion } from 'framer-motion'; 3 | import React, { ReactNode, useState } from 'react'; 4 | interface Props { 5 | isOpen?: boolean; 6 | menu?: ReactNode; 7 | children?: ReactNode; 8 | } 9 | 10 | export const CustomCollapse: React.FC = ({ 11 | children, 12 | menu, 13 | isOpen = false, 14 | }) => { 15 | const [open, setOpen] = useState(isOpen); 16 | 17 | return ( 18 |
19 | 42 | {open && ( 43 |
44 | {children} 45 |
46 | )} 47 |
48 | ); 49 | }; 50 | -------------------------------------------------------------------------------- /src/components/CustomControls/DropMenu.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | flip, 3 | offset, 4 | Placement, 5 | shift, 6 | useFloating, 7 | } from '@floating-ui/react-dom'; 8 | import React, { createContext, ReactNode, useContext, useState } from 'react'; 9 | import { Portal } from 'react-portal'; 10 | 11 | type Props = { 12 | id?: string; 13 | show?: boolean; 14 | position?: Placement; 15 | label: string; 16 | menu: ReactNode; 17 | showOnEnter?: boolean; 18 | }; 19 | 20 | const MenuContext = createContext({ 21 | isOpen: false, 22 | setIsOpen: (value: boolean) => {}, 23 | setIsInside: (value: boolean) => {}, 24 | }); 25 | 26 | export const DropMenu: React.FC = ({ id, position, label, menu }) => { 27 | const [show, setShow] = useState(false); 28 | const [isInside, setIsInside] = useState(false); 29 | 30 | const { x, y, reference, floating, strategy } = useFloating({ 31 | middleware: [offset(4), shift(), flip()], 32 | placement: 'bottom-start', 33 | }); 34 | 35 | return ( 36 | 39 | 58 | 59 | {show && ( 60 | 61 |
!isInside && setShow(false)} 65 | onMouseEnter={() => setIsInside(true)} 66 | onMouseLeave={() => setIsInside(false)} 67 | className={`poppins-font-family-regular z-30 68 | flex w-52 flex-auto flex-col gap-2 overflow-x-hidden rounded-xl border border-base-300 bg-base-200 px-1.5 py-2 text-base-content shadow-2xl`} 69 | ref={floating} 70 | style={{ position: strategy, top: y ?? 0, left: x ?? 0 }} 71 | > 72 | {menu} 73 |
74 |
75 | )} 76 |
77 | ); 78 | }; 79 | 80 | type MenuItemProps = { 81 | icon: ReactNode; 82 | label: string; 83 | shortcut?: string; 84 | click: () => void; 85 | }; 86 | 87 | export const MenuItem: React.FC = ({ 88 | icon, 89 | label, 90 | click, 91 | shortcut, 92 | }) => { 93 | const { setIsOpen, setIsInside } = useContext(MenuContext); 94 | 95 | return ( 96 | 109 | ); 110 | }; 111 | 112 | export const MenuSeparator: React.FC = () => { 113 | return
; 114 | }; 115 | -------------------------------------------------------------------------------- /src/components/CustomControls/NumberInput.tsx: -------------------------------------------------------------------------------- 1 | import { IconCaretDown, IconCaretUp } from '@tabler/icons-react'; 2 | import React, { useState } from 'react'; 3 | import { Input } from 'react-daisyui'; 4 | 5 | interface Props { 6 | number: number; 7 | onChange?: (number: number) => void; 8 | } 9 | 10 | export const NumberInput: React.FC = ({ 11 | number = 0, 12 | onChange = () => {}, 13 | }) => { 14 | return ( 15 |
16 | { 20 | onChange(parseInt(e.currentTarget.value)); 21 | }} 22 | value={number ? number : 0} 23 | > 24 | 25 |
26 |
27 | { 30 | onChange(number + 1); 31 | }} 32 | > 33 | { 36 | onChange(number - 1); 37 | }} 38 | > 39 |
40 |
41 |
42 | ); 43 | }; 44 | -------------------------------------------------------------------------------- /src/components/CustomControls/Tooltip.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | Placement, 3 | flip, 4 | offset, 5 | shift, 6 | useFloating, 7 | } from '@floating-ui/react-dom'; 8 | import React, { ReactNode, useEffect, useState } from 'react'; 9 | import { Portal } from 'react-portal'; 10 | import { useScreenDirection } from '../../hooks/useScreenDirection'; 11 | import { AnimatePresence, motion } from 'framer-motion'; 12 | 13 | interface Props { 14 | message?: string; 15 | className?: string; 16 | children: ReactNode; 17 | placement?: Placement; 18 | } 19 | 20 | export const Tooltip: React.FC = ({ 21 | children, 22 | message, 23 | className, 24 | placement = 'right', 25 | }) => { 26 | const isHorizontal = useScreenDirection(); 27 | const [showTooltip, setShowTooltip] = useState(false); 28 | const { x, y, reference, floating, strategy } = useFloating({ 29 | middleware: [offset(10), flip(), shift()], 30 | placement: placement, 31 | }); 32 | 33 | useEffect(() => { 34 | if (showTooltip) setTimeout(() => setShowTooltip(false), 1000); 35 | }, [showTooltip]); 36 | 37 | return ( 38 | <> 39 | <> 40 |
{ 42 | setShowTooltip(false); 43 | }} 44 | onMouseEnter={() => isHorizontal && setShowTooltip(true)} 45 | onContextMenu={() => { 46 | !isHorizontal && setShowTooltip(true); 47 | }} 48 | ref={reference} 49 | className={className} 50 | > 51 | {children} 52 |
53 | 54 | {/* Tooltip */} 55 | 56 | {showTooltip && ( 57 | 58 | 66 |
67 | {message} 68 |
69 |
70 |
71 | )} 72 |
73 | 74 | 75 | ); 76 | }; 77 | -------------------------------------------------------------------------------- /src/components/FaIcon.tsx: -------------------------------------------------------------------------------- 1 | import React, { createElement, useEffect, useState } from 'react'; 2 | import { IconType } from '../utils/FaIconList'; 3 | 4 | interface IconProps { 5 | icon: string; 6 | style?: React.CSSProperties; 7 | className?: string; 8 | } 9 | 10 | export const FaIcon: React.FC = ({ icon, style, className }) => { 11 | const [faIcon, setFaIcon] = useState(); 12 | 13 | useEffect(() => { 14 | const getIcon = async () => { 15 | const icons = await import('../utils/FaIconList'); 16 | 17 | function findIcon(): IconType { 18 | const iconSelected = icons.iconFaList.find((i) => i.label === icon); 19 | return iconSelected ? iconSelected : icons.iconFaList[0]; 20 | } 21 | 22 | setFaIcon(findIcon()); 23 | }; 24 | 25 | getIcon(); 26 | }, [icon]); 27 | return ( 28 | <> 29 | {faIcon && 30 | createElement(faIcon.icon, { className: className, style: style })} 31 | 32 | ); 33 | }; 34 | -------------------------------------------------------------------------------- /src/components/Misc/SvgBackgrounds/Backgrounds.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export interface Props { 4 | className?: string; 5 | style?: React.CSSProperties; 6 | color1?: string; 7 | color2?: string; 8 | } 9 | -------------------------------------------------------------------------------- /src/components/Misc/SvgBackgrounds/Circular.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Props } from './Backgrounds'; 3 | 4 | export const Circular: React.FC = ({ 5 | className, 6 | style, 7 | color1 = '#409ccf', 8 | color2 = '#136179', 9 | }) => { 10 | return ( 11 | 18 | 19 | 20 | 21 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | ); 43 | }; 44 | 45 | export default Circular; 46 | -------------------------------------------------------------------------------- /src/components/Misc/SvgBackgrounds/Flux.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Props } from './Backgrounds'; 3 | 4 | export const Flux: React.FC = ({ 5 | className, 6 | style, 7 | color1 = '#06080C', 8 | color2 = '#171717', 9 | }) => { 10 | return ( 11 | 18 | 19 | 27 | 28 | 29 | 30 | 40 | 52 | 62 | 72 | 73 | 74 | 80 | 81 | ); 82 | }; 83 | export default Flux; 84 | -------------------------------------------------------------------------------- /src/components/Misc/SvgBackgrounds/Neon.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Props } from './Backgrounds'; 3 | 4 | export const Neon: React.FC = ({ 5 | className, 6 | style, 7 | color1 = '#409ccf', 8 | color2 = '#136179', 9 | }) => { 10 | return ( 11 | 18 | 19 | 20 | 21 | 22 | 23 | 33 | 43 | 44 | 54 | 64 | 65 | 66 | 67 | 71 | 76 | 81 | 82 | 83 | 84 | ); 85 | }; 86 | export default Neon; 87 | -------------------------------------------------------------------------------- /src/components/Mobile/NavBarMobile.tsx: -------------------------------------------------------------------------------- 1 | import { IconBell, IconInfoCircle, IconMenu2 } from '@tabler/icons-react'; 2 | import React, { useState } from 'react'; 3 | import { Modal, Navbar } from 'react-daisyui'; 4 | import { Portal } from 'react-portal'; 5 | import NewsPanel from '../Panels/NewsPanel'; 6 | import AboutModal from '../Modals/AboutModal'; 7 | 8 | export const NavBarMobile: React.FC = () => { 9 | const [showNews, setShowNews] = useState(false); 10 | const [showAbout, setShowAbout] = useState(false); 11 | 12 | return ( 13 | <> 14 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 39 | 40 | 41 | 42 | {showNews && ( 43 | 44 | setShowNews(false)} 48 | > 49 | 50 | 51 | 52 | )} 53 | 54 | {showAbout && ( 55 | setShowAbout(false)} 57 | open={showAbout} 58 | > 59 | )} 60 | 61 | ); 62 | }; 63 | 64 | export default NavBarMobile; 65 | -------------------------------------------------------------------------------- /src/components/Mobile/NavBarMobileEditor.tsx: -------------------------------------------------------------------------------- 1 | import { IconMenu2 } from '@tabler/icons-react'; 2 | import React, { useState } from 'react'; 3 | import { Navbar } from 'react-daisyui'; 4 | 5 | const HomeButton = React.lazy(() => import('./SettingsButton')); 6 | 7 | export const NavBarMobile: React.FC = () => { 8 | const [showNews, setShowNews] = useState(false); 9 | 10 | return ( 11 | <> 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | ); 35 | }; 36 | -------------------------------------------------------------------------------- /src/components/Modals/AboutModal.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | IconBrandGithub, 3 | IconBrandTelegram, 4 | IconBrandTwitter, 5 | } from '@tabler/icons-react'; 6 | import React, { Ref } from 'react'; 7 | import { Button, Modal } from 'react-daisyui'; 8 | import karbonized from '../../assets/logo.svg'; 9 | interface Props { 10 | open: boolean; 11 | onClose?: Function; 12 | ref?: Ref; 13 | } 14 | 15 | export const AboutModal: React.FC = ({ open, onClose, ref }) => { 16 | return ( 17 | { 20 | onClose && onClose(); 21 | }} 22 | className='overflow-hidden' 23 | > 24 | 25 |

26 | Karbonized 27 |

28 |
29 | 30 | 31 |
32 | 36 |
37 | 38 | 41 |

42 | Image Generator for Code Snippets & Mockups 43 |

44 | 45 | 46 | Made by{' '} 47 | 52 | @yossthedev 53 | 54 | 55 | 56 |
57 | 58 |
59 | 60 | {/* Social Networks */} 61 | 92 |
93 | 94 | 95 | 101 | 102 |
103 | ); 104 | }; 105 | 106 | export default AboutModal; 107 | -------------------------------------------------------------------------------- /src/components/Modals/DonationsModal.tsx: -------------------------------------------------------------------------------- 1 | import { Clipboard } from '@capacitor/clipboard'; 2 | import { 3 | IconBrandGithub, 4 | IconBrandTelegram, 5 | IconBrandTwitter, 6 | IconCoinBitcoin, 7 | IconCurrencyDogecoin, 8 | } from '@tabler/icons-react'; 9 | import React from 'react'; 10 | import { Button, Modal } from 'react-daisyui'; 11 | import karbonized from '../../assets/karbonized.svg'; 12 | import qvapay from '../../assets/qvapay.svg'; 13 | interface Props { 14 | open: boolean; 15 | onClose?: Function; 16 | } 17 | 18 | export const DonationsModal: React.FC = ({ open, onClose }) => { 19 | return ( 20 | { 23 | onClose && onClose(); 24 | }} 25 | className='overflow-hidden' 26 | > 27 | 28 |

29 | Karbonized 30 |

31 |
32 | 33 | 34 |

35 | Support the Project. Make a Donation 😃 36 |

37 | 38 | {/* Donations*/} 39 |
40 |
{ 43 | //await Toast.show({ text: 'Copied!' }); 44 | await Clipboard.write({ 45 | string: 'bc1qwr6wltxvpvuqhx94lqjrdr090747yz9rw5mpec', 46 | }); 47 | 48 | alert('copied!'); 49 | }} 50 | > 51 |
52 | 53 |

54 | BTC 55 |

56 |
57 |
58 | 59 |
{ 61 | //await Toast.show({ text: 'Copied!' }); 62 | await Clipboard.write({ 63 | string: 'DFUAWcJLiqYKmZydxFsowdsEZio5ue9JYC', 64 | }); 65 | 66 | alert('copied!'); 67 | }} 68 | className='to flex w-24 flex-auto cursor-pointer select-none flex-row gap-1 rounded-3xl bg-gradient-to-br from-yellow-500 to-yellow-600 p-3 text-white hover:bg-gradient-to-bl ' 69 | > 70 |
71 | 72 |

73 | DOGE 74 |

75 |
76 |
77 | 78 | 82 |
83 | 87 |

88 | QVAPAY 89 |

90 |
91 |
92 |
93 |
94 | 95 | 96 | 102 | 103 |
104 | ); 105 | }; 106 | 107 | export default DonationsModal; 108 | -------------------------------------------------------------------------------- /src/components/Panels/HierarchyPanel.tsx: -------------------------------------------------------------------------------- 1 | import { List, arrayMove } from 'react-movable'; 2 | import { useStoreActions, useStoreState } from '../../stores/Hooks'; 3 | import { MenuItem } from './MenuItem'; 4 | 5 | export const HierarchyPanel = () => { 6 | /* App Store */ 7 | const currentWorkspace = useStoreState((state) => state.currentWorkspace); 8 | const visibleControls = useStoreState((state) => state.visibleControls); 9 | const setWorkspaceControls = useStoreActions( 10 | (state) => state.setWorkspaceControls, 11 | ); 12 | 13 | return ( 14 |
15 | {/* Controls */} 16 | {visibleControls.length > 0 ? ( 17 | <> 18 | 21 | 25 | setWorkspaceControls( 26 | arrayMove(visibleControls, oldIndex, newIndex), 27 | ) 28 | } 29 | renderList={({ children, props }) => ( 30 |
    34 | {children} 35 |
36 | )} 37 | renderItem={({ value, props, isDragged }) => ( 38 | 44 | )} 45 | /> 46 | 47 | ) : ( 48 |
49 |

50 | Start adding controls to the scene 51 |

52 |
53 | )} 54 |
55 | ); 56 | }; 57 | -------------------------------------------------------------------------------- /src/components/Panels/MenuItem.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | IconAppWindow, 3 | IconBrandTwitter, 4 | IconCircle, 5 | IconCode, 6 | IconDeviceMobile, 7 | IconEye, 8 | IconEyeClosed, 9 | IconLetterT, 10 | IconPhoto, 11 | IconPuzzle, 12 | IconQrcode, 13 | IconSticker, 14 | } from '@tabler/icons-react'; 15 | import React, { useEffect } from 'react'; 16 | import { useStoreActions, useStoreState } from '../../stores/Hooks'; 17 | 18 | export interface Item { 19 | id: string; 20 | type: string; 21 | name: string; 22 | isSelectable: boolean; 23 | isDeleted: boolean; 24 | isDragged: boolean; 25 | isVisible: boolean; 26 | props: any; 27 | } 28 | 29 | export const MenuItem: React.FC = ({ 30 | id, 31 | isVisible, 32 | isDragged, 33 | name, 34 | type, 35 | props, 36 | }) => { 37 | const controlID = useStoreState((state) => state.currentControlID); 38 | const setCurrentControlID = useStoreActions( 39 | (state) => state.setcurrentControlID, 40 | ); 41 | const setWorkspaceControls = useStoreActions( 42 | (state) => state.setWorkspaceControls, 43 | ); 44 | const currentWorkspace = useStoreState((state) => state.currentWorkspace); 45 | 46 | useEffect(() => { 47 | if (controlID === id && !isVisible) { 48 | setCurrentControlID(''); 49 | } 50 | }, [controlID, isVisible]); 51 | 52 | return ( 53 | <> 54 | 92 | 93 | ); 94 | }; 95 | 96 | export const MenuIcon: React.FC<{ type: string }> = ({ type }) => { 97 | // Store Actions 98 | switch (type) { 99 | case 'code': 100 | return ; 101 | case 'text': 102 | return ; 103 | case 'qr': 104 | return ; 105 | case 'image': 106 | return ; 107 | case 'window': 108 | return ; 109 | case 'avatar': 110 | return <>; 111 | 112 | case 'shape': 113 | return ; 114 | case 'phone_mockup': 115 | return ( 116 | 117 | ); 118 | case 'icon': 119 | return ; 120 | 121 | case 'tweet': 122 | return ( 123 | 124 | ); 125 | 126 | case 'badge': 127 | return ( 128 |
129 | ); 130 | 131 | case 'custom': 132 | return ; 133 | default: 134 | return <>; 135 | } 136 | }; 137 | -------------------------------------------------------------------------------- /src/components/Portal.tsx: -------------------------------------------------------------------------------- 1 | import React, { ReactNode, useEffect, useState } from 'react'; 2 | import { Portal } from 'react-portal'; 3 | 4 | export const CustomPortal: React.FC<{ id: string; children: ReactNode }> = ({ 5 | id, 6 | children, 7 | }) => { 8 | const [element, setElement] = useState(null); 9 | 10 | useEffect(() => { 11 | setElement(document.getElementById(id)); 12 | }, []); 13 | 14 | return <>{element && {children}}; 15 | }; 16 | -------------------------------------------------------------------------------- /src/fonts/Borel-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/fonts/Borel-Regular.ttf -------------------------------------------------------------------------------- /src/fonts/Poppins-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/fonts/Poppins-Bold.ttf -------------------------------------------------------------------------------- /src/fonts/Poppins-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yossTheDev/karbonized/89fc3b66e21a6078bf4586d3f2a95d6c1d2e75f6/src/fonts/Poppins-Regular.ttf -------------------------------------------------------------------------------- /src/hooks/useControlState.ts: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from 'react'; 2 | import { useStoreActions, useStoreState } from '../stores/Hooks'; 3 | import default_logo from '../assets/logo.svg'; 4 | 5 | export const useControlState = ( 6 | initialState: any, 7 | id: string, 8 | manual: boolean = false, 9 | ) => { 10 | const controlState = useStoreState((state) => state.controlState); 11 | const ControlProperties = useStoreState((state) => state.ControlProperties); 12 | const initialProperties = useStoreState((state) => state.initialProperties); 13 | const removeInitialProperty = useStoreActions( 14 | (state) => state.removeInitialProperty, 15 | ); 16 | const pastHistory = useStoreState((state) => state.pastHistory); 17 | const setControlState = useStoreActions((state) => state.setControlState); 18 | const addControlProperty = useStoreActions( 19 | (state) => state.addControlProperty, 20 | ); 21 | const setPastHistory = useStoreActions((state) => state.setPast); 22 | const setFutureHistory = useStoreActions((state) => state.setFuture); 23 | 24 | const hasInitialProperty = (id: string) => { 25 | for (const item of initialProperties) { 26 | if (item.id === id) return item.value; 27 | } 28 | return null; 29 | }; 30 | 31 | const [state, setState] = useState(initialState); 32 | 33 | /* Set Initial Properties */ 34 | useEffect(() => { 35 | const prop = hasInitialProperty(id); 36 | if (prop) { 37 | if ( 38 | id.endsWith('-src') && 39 | (prop === '/src/assets/logo.svg' || 40 | prop === '/src/assets/karbonized.svg') 41 | ) { 42 | setState(default_logo); 43 | } else { 44 | setState(prop); 45 | } 46 | 47 | removeInitialProperty(id); 48 | } 49 | }, [initialProperties]); 50 | 51 | /* Look at Current Controls Properties for Changes */ 52 | useEffect(() => { 53 | if (controlState?.id === id) { 54 | setState(controlState.value); 55 | } 56 | }, [controlState]); 57 | 58 | /* Save Control Property in Store */ 59 | useEffect(() => { 60 | addControlProperty({ id: id, value: state }); 61 | }, [state]); 62 | 63 | const set = (newState: any) => { 64 | if (!manual) { 65 | setPastHistory([...pastHistory, { id: id, value: state }]); 66 | setState(newState); 67 | setControlState({ id: id, value: newState }); 68 | 69 | /* Clean Future */ 70 | setFutureHistory([]); 71 | } 72 | }; 73 | 74 | return [state, set]; 75 | }; 76 | -------------------------------------------------------------------------------- /src/hooks/useKeyPress.ts: -------------------------------------------------------------------------------- 1 | /* Simple hook to manage Key Press */ 2 | import { useEffect, useState } from 'react'; 3 | 4 | export const useKeyPress = (keyToDown: string, func?: () => void) => { 5 | const [isPressed, setIsPressed] = useState(false); 6 | const [key, setKey] = useState(''); 7 | 8 | // Key Down Handler 9 | const downHandler = ({ key }: { key: string }) => { 10 | setKey(key); 11 | //console.log(key); 12 | if (key === keyToDown) { 13 | //func(); 14 | setIsPressed(true); 15 | } 16 | }; 17 | 18 | // Key Up Handler 19 | const upHandler = ({ key }: { key: string }) => { 20 | //console.log(key); 21 | setIsPressed(false); 22 | }; 23 | 24 | // Add event listeners 25 | useEffect(() => { 26 | window.addEventListener('keydown', downHandler); 27 | window.addEventListener('keyup', upHandler); 28 | 29 | // Remove event listeners 30 | return () => { 31 | window.removeEventListener('keydown', downHandler); 32 | window.removeEventListener('keyup', upHandler); 33 | }; 34 | }, []); 35 | 36 | useEffect(() => { 37 | if (key === keyToDown) func && func(); 38 | }, [key]); 39 | 40 | return isPressed; 41 | }; 42 | -------------------------------------------------------------------------------- /src/hooks/useScreenDirection.ts: -------------------------------------------------------------------------------- 1 | /* Simple hook to know if your app is running on a vertical or horizontal screen */ 2 | import { useEffect, useState } from 'react'; 3 | 4 | export const useScreenDirection = () => { 5 | // Initialize state with undefines Height and Width 6 | const [isHorizontal, setIsHorizontal] = useState( 7 | window.innerHeight < window.innerWidth ? true : false 8 | ); 9 | 10 | useEffect(() => { 11 | // Handler to call on Window Resize 12 | const handleResize = () => { 13 | // Set Window Size 14 | if (window.innerHeight < window.innerWidth) setIsHorizontal(true); 15 | }; 16 | 17 | // Add event listener 18 | window.addEventListener('resize', handleResize); 19 | 20 | handleResize(); 21 | 22 | //Remove event listener on Unmount 23 | return () => window.removeEventListener('resize', handleResize); 24 | }, []); 25 | 26 | return isHorizontal; 27 | }; 28 | -------------------------------------------------------------------------------- /src/hooks/useTauriPlatform.ts: -------------------------------------------------------------------------------- 1 | /* Simple hook to check if the app is running over Tauri Platfotm*/ 2 | import { useEffect, useState } from 'react'; 3 | import { platform } from '@tauri-apps/api/os'; 4 | 5 | export const useTauriPlatform = () => { 6 | const [isTauri, setIsTauri] = useState(false); 7 | 8 | useEffect(() => { 9 | const checkTauriPlatform = async () => { 10 | try { 11 | const platformName = await platform(); 12 | if (platformName.toString() !== '') setIsTauri(true); 13 | } catch { 14 | setIsTauri(false); 15 | } 16 | }; 17 | 18 | checkTauriPlatform(); 19 | }, []); 20 | 21 | return isTauri; 22 | }; 23 | -------------------------------------------------------------------------------- /src/hooks/useTheme.ts: -------------------------------------------------------------------------------- 1 | /* Simple hook to change app theme*/ 2 | import { useEffect, useState } from 'react'; 3 | import { Capacitor } from '@capacitor/core'; 4 | import { StatusBar, Style } from '@capacitor/status-bar'; 5 | 6 | export const useTheme = (): [string, () => void] => { 7 | const [appTheme, setAppTheme] = useState( 8 | localStorage.getItem('theme') || 'dark', 9 | ); 10 | 11 | const toggleTheme = () => { 12 | appTheme === 'light' ? setAppTheme('dark') : setAppTheme('light'); 13 | }; 14 | 15 | useEffect(() => { 16 | if (appTheme === 'dark') { 17 | document.documentElement.classList.add('dark'); 18 | document.querySelector('html')?.setAttribute('data-theme', 'dark'); 19 | 20 | if (Capacitor.isNativePlatform()) { 21 | StatusBar.setBackgroundColor({ color: '#242424' }); 22 | StatusBar.setStyle({ style: Style.Dark }); 23 | } 24 | } else { 25 | document.documentElement.classList.remove('dark'); 26 | document.querySelector('html')?.setAttribute('data-theme', 'light'); 27 | if (Capacitor.isNativePlatform()) { 28 | StatusBar.setBackgroundColor({ color: '#FFFFFF' }); 29 | StatusBar.setStyle({ style: Style.Light }); 30 | } 31 | } 32 | 33 | localStorage.setItem('theme', appTheme as string); 34 | }, [appTheme]); 35 | 36 | return [appTheme as string, toggleTheme]; 37 | }; 38 | -------------------------------------------------------------------------------- /src/hooks/useWindowsSize.ts: -------------------------------------------------------------------------------- 1 | /* Simple hook to get Window Size */ 2 | import { useEffect, useState } from 'react'; 3 | 4 | export const useWindowsSize = () => { 5 | // Initialize state with undefines Height and Width 6 | const [windowSize, setWindowSize] = useState<{ 7 | height: undefined | number; 8 | width: undefined | number; 9 | }>({ 10 | height: window.innerHeight, 11 | width: window.innerWidth, 12 | }); 13 | 14 | useEffect(() => { 15 | // Handler to call on Window Resize 16 | const handleResize = () => { 17 | // Set Window Size 18 | setWindowSize({ height: window.innerHeight, width: window.innerWidth }); 19 | console.log('resize'); 20 | }; 21 | 22 | // Add event listener 23 | window.addEventListener('resize', handleResize); 24 | 25 | handleResize(); 26 | 27 | //Remove event listener on Unmount 28 | return () => window.removeEventListener('resize', handleResize); 29 | }, []); 30 | 31 | return windowSize; 32 | }; 33 | -------------------------------------------------------------------------------- /src/input.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | -------------------------------------------------------------------------------- /src/main.tsx: -------------------------------------------------------------------------------- 1 | import { StoreProvider } from 'easy-peasy'; 2 | import React from 'react'; 3 | import ReactDOM from 'react-dom/client'; 4 | import App from './App'; 5 | import { AppStore } from './stores/AppStore'; 6 | import './input.css'; 7 | 8 | ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( 9 | 10 | 11 | 12 | 13 | , 14 | ); 15 | -------------------------------------------------------------------------------- /src/models/Extension.ts: -------------------------------------------------------------------------------- 1 | export interface Extension { 2 | logo: string; 3 | info: { 4 | name: string; 5 | author: string; 6 | description: string; 7 | version: string; 8 | }; 9 | 10 | components: { properties: Properties; code: string; image: string }[]; 11 | } 12 | 13 | interface Properties { 14 | name: string; 15 | } 16 | -------------------------------------------------------------------------------- /src/stores/Hooks.ts: -------------------------------------------------------------------------------- 1 | import { createTypedHooks } from 'easy-peasy'; 2 | import { AppStoreModel } from './AppStore'; 3 | 4 | const typedHooks = createTypedHooks(); 5 | 6 | export const useStoreActions = typedHooks.useStoreActions; 7 | export const useStoreDispatch = typedHooks.useStoreDispatch; 8 | export const useStoreState = typedHooks.useStoreState; 9 | -------------------------------------------------------------------------------- /src/utils.css: -------------------------------------------------------------------------------- 1 | @media (min-width: 768px) { 2 | ::-webkit-scrollbar { 3 | width: 5px; 4 | height: 5px; 5 | } 6 | ::-webkit-scrollbar-corner { 7 | background: rgba(0, 0, 0, 0); 8 | } 9 | ::-webkit-scrollbar-thumb { 10 | background-color: #9187872f; 11 | border-radius: 12px; 12 | border: 1px solid rgba(0, 0, 0, 0); 13 | background-clip: content-box; 14 | min-width: 5px; 15 | min-height: 5px; 16 | } 17 | ::-webkit-scrollbar-thumb:hover { 18 | background-color: #706a6a2f; 19 | } 20 | ::-webkit-scrollbar-track { 21 | background-color: rgba(0, 0, 0, 0); 22 | } 23 | } 24 | 25 | img { 26 | pointer-events: none; 27 | } 28 | 29 | p { 30 | cursor: default; 31 | } 32 | 33 | label { 34 | cursor: default; 35 | user-select: none; 36 | } 37 | -------------------------------------------------------------------------------- /src/utils/Base64Utils.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2011, Daniel Guerrero 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 12 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 13 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 14 | DISCLAIMED. IN NO EVENT SHALL DANIEL GUERRERO BE LIABLE FOR ANY 15 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 16 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 17 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 18 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 19 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 20 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 21 | */ 22 | 23 | /** 24 | * Uses the new array typed in javascript to binary base64 encode/decode 25 | * at the moment just decodes a binary base64 encoded 26 | * into either an ArrayBuffer (decodeArrayBuffer) 27 | * or into an Uint8Array (decode) 28 | * 29 | * References: 30 | * https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer 31 | * https://developer.mozilla.org/en/JavaScript_typed_arrays/Uint8Array 32 | */ 33 | 34 | export const Base64Binary = { 35 | _keyStr: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', 36 | 37 | /* will return a Uint8Array type */ 38 | decodeArrayBuffer: function (input: string | any[]) { 39 | var bytes = (input.length / 4) * 3; 40 | var ab = new ArrayBuffer(bytes); 41 | this.decode(input as unknown as any, ab); 42 | 43 | return ab; 44 | }, 45 | 46 | removePaddingChars: function (input: string) { 47 | var lkey = this._keyStr.indexOf(input.charAt(input.length - 1)); 48 | if (lkey == 64) { 49 | return input.substring(0, input.length - 1); 50 | } 51 | return input; 52 | }, 53 | 54 | decode: function (input: string, arrayBuffer?: ArrayBuffer) { 55 | //get last chars to see if are valid 56 | input = this.removePaddingChars(input); 57 | input = this.removePaddingChars(input); 58 | 59 | var bytes = parseInt(((input.length / 4) * 3) as unknown as string, 10); 60 | 61 | var uarray; 62 | var chr1, chr2, chr3; 63 | var enc1, enc2, enc3, enc4; 64 | var i = 0; 65 | var j = 0; 66 | 67 | if (arrayBuffer) uarray = new Uint8Array(arrayBuffer); 68 | else uarray = new Uint8Array(bytes); 69 | 70 | input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ''); 71 | 72 | for (i = 0; i < bytes; i += 3) { 73 | //get the 3 octects in 4 ascii chars 74 | enc1 = this._keyStr.indexOf(input.charAt(j++)); 75 | enc2 = this._keyStr.indexOf(input.charAt(j++)); 76 | enc3 = this._keyStr.indexOf(input.charAt(j++)); 77 | enc4 = this._keyStr.indexOf(input.charAt(j++)); 78 | 79 | chr1 = (enc1 << 2) | (enc2 >> 4); 80 | chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); 81 | chr3 = ((enc3 & 3) << 6) | enc4; 82 | 83 | uarray[i] = chr1; 84 | if (enc3 != 64) uarray[i + 1] = chr2; 85 | if (enc4 != 64) uarray[i + 2] = chr3; 86 | } 87 | 88 | return uarray; 89 | }, 90 | }; 91 | -------------------------------------------------------------------------------- /src/utils/Exporter.ts: -------------------------------------------------------------------------------- 1 | import { toJpeg, toPng, toSvg } from 'html-to-image'; 2 | import { isNative } from './isNative'; 3 | import { Base64Binary } from './Base64Utils'; 4 | import { save } from '@tauri-apps/api/dialog'; 5 | import { writeBinaryFile, writeTextFile } from '@tauri-apps/api/fs'; 6 | 7 | export enum export_format { 8 | 'png', 9 | 'svg', 10 | 'jpeg', 11 | } 12 | 13 | export const ExportImage = ( 14 | name: string, 15 | ref: HTMLElement | null, 16 | type: export_format, 17 | ) => { 18 | if (ref === null) { 19 | return; 20 | } 21 | 22 | switch (type) { 23 | case export_format.png: 24 | toPng(ref, { 25 | cacheBust: true, 26 | }) 27 | .then(async (dataUrl) => { 28 | const inNativePl = await isNative(); 29 | 30 | if (!inNativePl) { 31 | const link = document.createElement('a'); 32 | link.download = name + '.png'; 33 | link.href = dataUrl; 34 | link.click(); 35 | } else { 36 | try { 37 | const img = Base64Binary.decodeArrayBuffer( 38 | dataUrl.replace('data:image/png;base64,', ''), 39 | ); 40 | 41 | const filePath = await save({ 42 | defaultPath: name + '.png', 43 | filters: [ 44 | { 45 | name: 'Image', 46 | extensions: ['png', 'jpeg'], 47 | }, 48 | ], 49 | }); 50 | 51 | if (filePath) { 52 | await writeBinaryFile(filePath, img); 53 | } 54 | } catch (err) { 55 | console.log(err); 56 | } 57 | } 58 | }) 59 | .catch((err) => { 60 | console.log(err); 61 | }); 62 | break; 63 | 64 | case export_format.jpeg: 65 | toJpeg(ref, { 66 | cacheBust: true, 67 | }) 68 | .then(async (dataUrl) => { 69 | const inNativePl = await isNative(); 70 | 71 | if (!inNativePl) { 72 | const link = document.createElement('a'); 73 | link.download = name + '.jpeg'; 74 | link.href = dataUrl; 75 | link.click(); 76 | } else { 77 | try { 78 | const img = Base64Binary.decodeArrayBuffer( 79 | dataUrl.replace('data:image/jpeg;base64,', ''), 80 | ); 81 | 82 | const filePath = await save({ 83 | defaultPath: name + '.jpeg', 84 | filters: [ 85 | { 86 | name: 'Image', 87 | extensions: ['png', 'jpeg'], 88 | }, 89 | ], 90 | }); 91 | 92 | if (filePath) { 93 | await writeBinaryFile(filePath, img); 94 | } 95 | } catch (err) { 96 | console.log(err); 97 | } 98 | } 99 | }) 100 | .catch((err) => { 101 | console.log(err); 102 | }); 103 | break; 104 | 105 | case export_format.svg: 106 | toSvg(ref, { 107 | cacheBust: true, 108 | }) 109 | .then(async (dataUrl) => { 110 | const inNativePl = await isNative(); 111 | 112 | if (!inNativePl) { 113 | const link = document.createElement('a'); 114 | link.download = name + '.svg'; 115 | link.href = dataUrl; 116 | link.click(); 117 | } else { 118 | try { 119 | const img = Base64Binary.decodeArrayBuffer( 120 | dataUrl.replace('data:image/svg+xml;charset=utf-8,', ''), 121 | ); 122 | 123 | const filePath = await save({ 124 | defaultPath: name + '.svg', 125 | filters: [ 126 | { 127 | name: 'Image', 128 | extensions: ['png', 'jpeg', 'svg'], 129 | }, 130 | ], 131 | }); 132 | 133 | if (filePath) { 134 | await writeTextFile(filePath, dataUrl); 135 | } 136 | } catch (err) { 137 | console.log(err); 138 | } 139 | } 140 | }) 141 | .catch((err) => { 142 | console.log(err); 143 | }); 144 | break; 145 | } 146 | }; 147 | -------------------------------------------------------------------------------- /src/utils/PrismThemes.tsx: -------------------------------------------------------------------------------- 1 | import * as prismThemes from 'react-syntax-highlighter/dist/esm/styles/prism'; 2 | 3 | interface Style { 4 | label: string; 5 | theme: {}; 6 | } 7 | 8 | export const themes: Style[] = [ 9 | { label: 'a11yDark', theme: prismThemes.a11yDark }, 10 | { label: 'atomDark', theme: prismThemes.atomDark }, 11 | { 12 | label: 'base16AteliersulphurpoolLight', 13 | theme: prismThemes.base16AteliersulphurpoolLight, 14 | }, 15 | { label: 'cb', theme: prismThemes.cb }, 16 | { label: 'coldarkCold', theme: prismThemes.coldarkCold }, 17 | { label: 'coldarkDark', theme: prismThemes.coldarkDark }, 18 | { label: 'coy', theme: prismThemes.coy }, 19 | { label: 'darcula', theme: prismThemes.darcula }, 20 | { label: 'duotoneDark', theme: prismThemes.duotoneDark }, 21 | { label: 'duotoneEarth', theme: prismThemes.duotoneEarth }, 22 | { label: 'duotoneForest', theme: prismThemes.duotoneForest }, 23 | { label: 'duotoneLight', theme: prismThemes.duotoneLight }, 24 | { label: 'duotoneSea', theme: prismThemes.duotoneSea }, 25 | { label: 'duotoneSpace', theme: prismThemes.duotoneSpace }, 26 | { label: 'funky', theme: prismThemes.funky }, 27 | { label: 'ghcolors', theme: prismThemes.ghcolors }, 28 | { label: 'gruvboxDark', theme: prismThemes.gruvboxDark }, 29 | { label: 'gruvboxLight', theme: prismThemes.gruvboxLight }, 30 | { label: 'hopscotch', theme: prismThemes.hopscotch }, 31 | { label: 'materialDark', theme: prismThemes.materialDark }, 32 | { label: 'materialLight', theme: prismThemes.materialLight }, 33 | { label: 'materialOceanic', theme: prismThemes.materialOceanic }, 34 | { label: 'nord', theme: prismThemes.nord }, 35 | { label: 'okaidia', theme: prismThemes.okaidia }, 36 | { label: 'oneDark', theme: prismThemes.oneDark }, 37 | { label: 'oneLight', theme: prismThemes.oneLight }, 38 | { label: 'pojoaque', theme: prismThemes.pojoaque }, 39 | { label: 'prism', theme: prismThemes.prism }, 40 | { label: 'shadesOfPurple', theme: prismThemes.shadesOfPurple }, 41 | { label: 'solarizedlight', theme: prismThemes.solarizedlight }, 42 | { label: 'synthwave84', theme: prismThemes.synthwave84 }, 43 | { label: 'tomorrow', theme: prismThemes.tomorrow }, 44 | { label: 'twilight', theme: prismThemes.twilight }, 45 | { label: 'vs', theme: prismThemes.vs }, 46 | { label: 'vscDarkPlus', theme: prismThemes.vscDarkPlus }, 47 | { label: 'xonokai', theme: prismThemes.xonokai }, 48 | ]; 49 | -------------------------------------------------------------------------------- /src/utils/getRandom.ts: -------------------------------------------------------------------------------- 1 | export const getRandomNumber = () => { 2 | return Math.floor(Math.random() * 10000); 3 | }; 4 | -------------------------------------------------------------------------------- /src/utils/isElectron.ts: -------------------------------------------------------------------------------- 1 | export const isElectron = () => { 2 | // Renderer process 3 | if ( 4 | typeof window !== 'undefined' && 5 | typeof window.process === 'object' && 6 | (window.process as any).type === 'renderer' 7 | ) { 8 | return true; 9 | } 10 | 11 | // Main process 12 | if ( 13 | typeof process !== 'undefined' && 14 | typeof process.versions === 'object' && 15 | !!process.versions.electron 16 | ) { 17 | return true; 18 | } 19 | 20 | // Detect the user agent when the `nodeIntegration` option is set to true 21 | if ( 22 | typeof navigator === 'object' && 23 | typeof navigator.userAgent === 'string' && 24 | navigator.userAgent.indexOf('Electron') >= 0 25 | ) { 26 | return true; 27 | } 28 | 29 | return false; 30 | }; 31 | -------------------------------------------------------------------------------- /src/utils/isNative.ts: -------------------------------------------------------------------------------- 1 | import { platform } from '@tauri-apps/api/os'; 2 | 3 | export const isNative = async () => { 4 | try { 5 | const platformName = await platform(); 6 | if (platformName.toString() !== '') return true; 7 | return true; 8 | } catch { 9 | return false; 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /src/utils/secrets.ts: -------------------------------------------------------------------------------- 1 | export const PROJECT_KEY = 'sdfkf8524ß325-5235$74363/535&'; 2 | -------------------------------------------------------------------------------- /src/utils/wallpapers.ts: -------------------------------------------------------------------------------- 1 | import wallpaper1 from '../assets/wallpapers/1.jpg'; 2 | import wallpaper2 from '../assets/wallpapers/2.jpg'; 3 | import wallpaper3 from '../assets/wallpapers/3.jpg'; 4 | import wallpaper4 from '../assets/wallpapers/4.jpg'; 5 | import wallpaper5 from '../assets/wallpapers/5.jpg'; 6 | import wallpaper6 from '../assets/wallpapers/6.jpg'; 7 | import wallpaper7 from '../assets/wallpapers/7.jpg'; 8 | import wallpaper8 from '../assets/wallpapers/8.jpg'; 9 | import wallpaper9 from '../assets/wallpapers/9.jpg'; 10 | import wallpaper10 from '../assets/wallpapers/10.jpg'; 11 | import wallpaper11 from '../assets/wallpapers/11.jpg'; 12 | import wallpaper12 from '../assets/wallpapers/12.jpg'; 13 | import wallpaper13 from '../assets/wallpapers/13.jpg'; 14 | import wallpaper14 from '../assets/wallpapers/14.jpg'; 15 | 16 | import wallpaper1_thumb from '../assets/wallpapers/1_thumb.jpg'; 17 | import wallpaper2_thumb from '../assets/wallpapers/2_thumb.jpg'; 18 | import wallpaper3_thumb from '../assets/wallpapers/3_thumb.jpg'; 19 | import wallpaper4_thumb from '../assets/wallpapers/4_thumb.jpg'; 20 | import wallpaper5_thumb from '../assets/wallpapers/5_thumb.jpg'; 21 | import wallpaper6_thumb from '../assets/wallpapers/6_thumb.jpg'; 22 | import wallpaper7_thumb from '../assets/wallpapers/7_thumb.jpg'; 23 | import wallpaper8_thumb from '../assets/wallpapers/8_thumb.jpg'; 24 | import wallpaper9_thumb from '../assets/wallpapers/9_thumb.jpg'; 25 | import wallpaper10_thumb from '../assets/wallpapers/10_thumb.jpg'; 26 | import wallpaper11_thumb from '../assets/wallpapers/11_thumb.jpg'; 27 | import wallpaper12_thumb from '../assets/wallpapers/12_thumb.jpg'; 28 | import wallpaper13_thumb from '../assets/wallpapers/13_thumb.jpg'; 29 | import wallpaper14_thumb from '../assets/wallpapers/14_thumb.jpg'; 30 | 31 | export const Wallpapers = [ 32 | { id: 'wallpaper1', img: wallpaper1, thumb: wallpaper1_thumb }, 33 | { id: 'wallpaper2', img: wallpaper2, thumb: wallpaper2_thumb }, 34 | { id: 'wallpaper3', img: wallpaper3, thumb: wallpaper3_thumb }, 35 | { id: 'wallpaper4', img: wallpaper4, thumb: wallpaper4_thumb }, 36 | { id: 'wallpaper5', img: wallpaper5, thumb: wallpaper5_thumb }, 37 | { id: 'wallpaper6', img: wallpaper6, thumb: wallpaper6_thumb }, 38 | { id: 'wallpaper7', img: wallpaper7, thumb: wallpaper7_thumb }, 39 | { id: 'wallpaper8', img: wallpaper8, thumb: wallpaper8_thumb }, 40 | { id: 'wallpaper9', img: wallpaper9, thumb: wallpaper9_thumb }, 41 | { id: 'wallpaper10', img: wallpaper10, thumb: wallpaper10_thumb }, 42 | { id: 'wallpaper11', img: wallpaper11, thumb: wallpaper11_thumb }, 43 | { id: 'wallpaper12', img: wallpaper12, thumb: wallpaper12_thumb }, 44 | { id: 'wallpaper13', img: wallpaper13, thumb: wallpaper13_thumb }, 45 | { id: 'wallpaper14', img: wallpaper14, thumb: wallpaper14_thumb }, 46 | ]; 47 | 48 | export default Wallpapers; 49 | -------------------------------------------------------------------------------- /src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /tailwind.config.cjs: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | content: [ 4 | './src/**/*.{html,js,ts,jsx,tsx}', 5 | 'node_modules/daisyui/dist/**/*.js', 6 | 'node_modules/react-daisyui/dist/**/*.js', 7 | ], 8 | 9 | // enable dark mode via class strategy 10 | darkMode: 'class', 11 | 12 | plugins: [require('daisyui'), require('@tailwindcss/typography')], 13 | 14 | // daisyUI config (optional) 15 | daisyui: { 16 | // themes: true, 17 | themes: [ 18 | { 19 | light: { 20 | ...require('daisyui/src/theming/themes')['[data-theme=light]'], 21 | primary: '#f43f5e', 22 | neutral: '#eff0f0', 23 | }, 24 | 25 | dark: { 26 | primary: '#f43f5e', 27 | 28 | secondary: '#abfcc1', 29 | 30 | accent: '#0ea5e9', 31 | 32 | neutral: '#353535', 33 | 34 | 'base-100': '#232323', 35 | 'base-200': '#212121', 36 | 'base-300': '#161616', 37 | 38 | info: '#38a5dc', 39 | 40 | success: '#229187', 41 | 42 | warning: '#cf7507', 43 | 44 | error: '#fc4a27', 45 | }, 46 | }, 47 | ], 48 | styled: true, 49 | base: true, 50 | utils: true, 51 | logs: true, 52 | rtl: false, 53 | prefix: '', 54 | darkTheme: 'dark', 55 | }, 56 | }; 57 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "useDefineForClassFields": true, 5 | "lib": ["DOM", "DOM.Iterable", "ESNext"], 6 | "allowJs": false, 7 | "skipLibCheck": true, 8 | "esModuleInterop": false, 9 | "allowSyntheticDefaultImports": true, 10 | "strict": true, 11 | "forceConsistentCasingInFileNames": true, 12 | "module": "ESNext", 13 | "moduleResolution": "Node", 14 | "resolveJsonModule": true, 15 | "isolatedModules": true, 16 | "noEmit": true, 17 | "jsx": "react-jsx" 18 | }, 19 | "include": ["src"], 20 | "references": [{ "path": "./tsconfig.node.json" }] 21 | } 22 | -------------------------------------------------------------------------------- /tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "module": "ESNext", 5 | "moduleResolution": "Node", 6 | "allowSyntheticDefaultImports": true 7 | }, 8 | "include": ["vite.config.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import react from '@vitejs/plugin-react'; 3 | import { VitePWA } from 'vite-plugin-pwa'; 4 | 5 | // https://vitejs.dev/config/ 6 | export default defineConfig({ 7 | plugins: [ 8 | react(), 9 | VitePWA({ 10 | workbox: { 11 | globPatterns: ['**/*.{js,css,html,ico,png,svg,ttf}'], 12 | }, 13 | registerType: 'autoUpdate', 14 | includeAssets: ['fonts/*.ttf', 'images/*.png'], 15 | manifest: { 16 | name: 'Karbonized', 17 | display: 'standalone', 18 | description: 'Image Generator for Code Snippets & Mockups', 19 | theme_color: '#141414', 20 | background_color: '#141414', 21 | icons: [ 22 | { 23 | src: 'assets/icons/icon-72.webp', 24 | sizes: '72x72', 25 | type: 'image/png', 26 | purpose: 'maskable any', 27 | }, 28 | { 29 | src: 'assets/icons/icon-96.webp', 30 | sizes: '96x96', 31 | type: 'image/png', 32 | purpose: 'maskable any', 33 | }, 34 | { 35 | src: 'assets/icons/icon-128.webp', 36 | sizes: '128x128', 37 | type: 'image/png', 38 | purpose: 'maskable any', 39 | }, 40 | { 41 | src: 'assets/icons/icon-192.webp', 42 | sizes: '192x192', 43 | type: 'image/png', 44 | purpose: 'maskable any', 45 | }, 46 | { 47 | src: 'assets/icons/icon-256.webp', 48 | sizes: '256x256', 49 | type: 'image/png', 50 | purpose: 'maskable any', 51 | }, 52 | { 53 | src: 'assets/icons/icon-512.webp', 54 | sizes: '512x512', 55 | type: 'image/png', 56 | purpose: 'maskable any', 57 | }, 58 | ], 59 | categories: ['personalization', 'photo', 'productivity', 'utilities'], 60 | }, 61 | }), 62 | ], 63 | }); 64 | -------------------------------------------------------------------------------- /vite.electron.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import react from '@vitejs/plugin-react'; 3 | import electron from 'vite-plugin-electron'; 4 | 5 | // https://vitejs.dev/config/ 6 | export default defineConfig({ 7 | plugins: [ 8 | react(), 9 | electron({ 10 | entry: 'src-electron/main.ts', 11 | 12 | vite: { 13 | publicDir: 'src-electron/assets/', 14 | build: { 15 | rollupOptions: { 16 | input: { 17 | main: 'src-electron/main.ts', 18 | preload: 'src-electron/preload.ts', 19 | }, 20 | }, 21 | }, 22 | }, 23 | }), 24 | ], 25 | }); 26 | --------------------------------------------------------------------------------