Giter Club home page Giter Club logo

codeimage's Introduction

Hi there πŸ‘‹

I'm Riccardo, a software developer based in Cagliari, Italy.

About me

  • At work, I'm currently working with TypeScript, Angular and Java Spring Boot.
  • I 🩷 TypeScript and it's type system.
  • I'm a Solid.js enthusiast.
  • When I'm free I usually contribute to open source in my own and someone else projects. Sometimes I take part in competitions 😊
  • I'm particularly interested in web animations and building editor-like web applications.

πŸ’» Top Repositories

CodeImage card Solid-codemirror card

πŸš€ Stats

πŸ† Awards

codeimage's People

Contributors

alexandercerutti avatar apollo79 avatar arstnei0 avatar endbug avatar github-actions[bot] avatar hackpirodev avatar jrafael91 avatar kalmarv avatar kriskw1999 avatar max-programming avatar riccardoperra avatar sarjuhansaliya avatar simran88 avatar tglide avatar vikki123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

codeimage's Issues

πŸš€ - Changelog and release automation

Planning:

Main will host beta.codeimage.dev
Release branches will host the new codeimage.dev

To deploy in production:

  • Add a workflow dispatch
  • Set git repo, use peter-evans/create-pull-request@v3 to create a new pull request for branch release/${{ steps.run-release.outputs.new_version }}

πŸš€ - Ui kit design tokens improvements

  • Adjust vanilla-extract duplicate styling in components
  • Provide better abstraction for base components to avoid style code duplication
  • Improve sprinkles and base component API
  • Provide better accessibility (see lighthouse)

πŸš€ - Moonlight Theme

This task consist of creating a new theme for CodeImage editor using CodeMirror API.

https://github.com/atomiks/moonlight-vscode-theme


Instructions for contributions

NOTE If your intention is to only develop a new theme, you don't need to use docker or install everything. You will work only on @codeimage/highlight package

  • Move to packages/highlight. You will see a How to create a new theme section in the README.md file .
  • Run the pnpm generate:theme script and put the moonlight theme name
  • Open the theme playground with pnpm dev (from the highlight package) or pnpm dev --filter=@codeimage/highlight (from the root folder)

For further help you can ask for help in the comments below

πŸš€ - Code beautify

Code beautifier could not be available for all language. Must investigate to discover which tool can be used.

For html/js/css/ts there is prettier plugin

🐞- Link sharing

Already done in main/dev branch. Must investigate on WebShare API errors on iOS due to async task and font loading

OSS

  • create pr template
  • improve ci workflow
  • add contributing.md and code line-guides
  • Update README.md

πŸ€– - Investigate for presets

Presets are premade templates that user can create without any restriction. Presets will be built-in in the application providing settings adapted for Social media

πŸš€ - Shortcut hint toolbar

Commands:
F: focus text editor
Esc: unfocus text editor
B: toggle background
D: toggle dark mode
L: select programming language
Ctrl+S: export (check if should open dialog or export directly)
Ctrl+Shift+Ccopy link with share api
? open shortcut

🐞 - Broken code mirror cursor and line numbers on scaled content

Added to fix mobile editor cursor and gutter when scaling the content, should be removed since it is an experimental property.

Edit:
After an investigation, it seems that there is a browser issue with "getBoundingClientRects"that returns inconsistent values when the parent node has the transform scale property.

This could be fixed wrapping the scaled content into an iframe. This could be a possible implementation that doesn't cover these issues:

  • Stylesheet are not fully loaded. When switching a theme that uses @emotion/css the stylesheet must be loaded into the iframe.
  • Iframe position must be changered.
  • Frame handler size could be fixed

Possible implementation: create a new app package that handle only his style and the editor content

// IFrame.tsx

type IFrameProps = JSX.IntrinsicElements['iframe'] & {};

export function IFrame(props: IFrameProps): JSX.Element {
  const [ref, setRef] = createSignal<HTMLIFrameElement>();
  const [mountNode, setMountNode] = createSignal<HTMLElement>();
  const [height, setHeight] = createSignal(0);
  const [width, setWidth] = createSignal(0);

  createEffect(
    on(ref, frame => {
      if (!frame || !frame.contentWindow) return;
      const currentHead = window.document.head;
      frame.contentDocument!.head.innerHTML = currentHead.innerHTML;
      setMountNode(() => frame.contentWindow?.document.body);

      setTimeout(() => {
        const scrollHeight = ref()?.contentWindow?.document.body.scrollHeight;
        const scrollWidth = ref()?.contentWindow?.document.body.scrollWidth;
        setHeight(scrollHeight ?? 0);
        setWidth(scrollWidth ?? 0);
      });
    }),
  );

  return (
    <iframe {...props} ref={setRef} width={width()} height={height()}>
      <Show when={mountNode()}>
        {node => <Portal mount={node}>{props.children}</Portal>}
      </Show>
    </iframe>
  );
}
// FrameHandler.tsx

export function FrameHandler(
  props: PropsWithChildren<FrameHandlerProps>,
): JSXElement {
  const [internalRef, setInternalRef] = createSignal<HTMLDivElement>();
  const [canvasScale, setCanvasScale] = createSignal(1);
  const ratio = 0.1;

  createEffect(
    on([internalRef], ([frame]) => {
      setTimeout(() => {
        const scale = getScaleByRatio(
          // TODO: should be a ref (?)
          frame?.parentElement,
          frame,
          1 + ratio,
        );
        props.onScaleChange(scale);
        setCanvasScale(scale);
      });
    }),
  );

  return (
    <Box class={styles.wrapper}>
      <div
        class={styles.handler}
        style={assignInlineVars({
          [styles.frameHandlerVars.scale]: canvasScale().toString(),
        })}
        ref={createRef<'div'>(props, e => {
          setInternalRef(() => e);
        })}
      >
        <div use:exportExclude={true} class={styles.squaredBackgroundOverlay} />

        <IFrame>{props.children}</IFrame>
      </div>
    </Box>
  );
}

πŸš€ - Monokai Pro Theme

Color scheme https://monokai.pro/

This task consist of creating a new theme for CodeImage editor using CodeMirror API.


Instructions for contributions

NOTE If your intention is to only develop a new theme, you don't need to use docker or install everything. You will work only on @codeimage/highlight package

  • Move to packages/highlight. You will see a How to create a new theme section in the README.md file .
  • Run the pnpm generate:theme script and put the monokaiPro theme name
  • Open the theme playground with pnpm dev (from the highlight package) or pnpm dev --filter=@codeimage/highlight (from the root folder)

For further help you can ask for help in the comments below

πŸš€ - Mobile lite view

Due to accessibility and issues related to frame scaling (#42) when opening the mobile version of the app there could be used a button that change the canvas view to a lite modality.

In the lite modality (<=749 width) only the Editor will be viewed, then the preview could be accessed clicking another action (or with the export button)

πŸš€ - Mobile native inputs

Components like select, range, color must be native in mobile phones due to ux accessibility. In desktop modality there will be a custom component

Theme API improvements

Currently creating new themes is β€œhard”, it’s a lot of copy paste and there isn’t a right api contract that all themes uses.

With this new Theme API, all themes must follow the same interface (palette, highlight color api) and extends the same default theme.

Export action improvements

In desktop/mobile view, export button is only exporting the image, but no information about the extension or sizing are displayed. A dialog where these options will be settled could be useful

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.