Skip to content

Commit

Permalink
Merge pull request #2 from robalb/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
robalb authored Oct 18, 2024
2 parents e64a206 + b9cd2b4 commit f480fa7
Show file tree
Hide file tree
Showing 9 changed files with 944 additions and 235 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/deploy_github_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# The GITHUB_TOKEN provided by the runner defaults to read-only permissions.
# Remember to add write permissions in `Settings -> Action -> General -> Workflow permissions`

# TODO: use the official github pages workflow.
# We are currently pushing build artifacts to a branch, which is stupid.
# https://github.com/actions/upload-pages-artifact
name: Update GitHub Pages
on:
push:
Expand Down
19 changes: 11 additions & 8 deletions emscripten_blink/field_notes/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,21 @@
-[x] complete the disassembler todos: proper BEM, proper c defines (#ifdef HTML)
-[x] add a good ui for the controls
-[x] first release with github pages
- service worker. Understand: is github pages good enough for caching?
can i solve eventual caching issues with service workers?
- CI/CD pipeline. pushes to master should trigger a merge and then a checkout into github_pages. then trigger a build. the contents of /build should be copied into /docs, and pushed.
-[x] CI/CD pipeline. pushes to master should trigger a merge and then a checkout into github_pages. then trigger a build. the contents of /build should be copied into /docs, and pushed.
- test CI/CD pipeline that directly publishes to github pages without storing the artifacts in a branch. -> https://github.com/actions/upload-pages-artifact
- mobile layout


service worker:
https://web.dev/articles/service-worker-lifecycle

https://flatassembler.net/docs.php?article=manual#2.4

https://web.dev/articles/building/an-adaptive-favicon

### backlog
- service worker. Understand: is github pages good enough for caching?
can i solve eventual caching issues with service workers?
https://web.dev/articles/service-worker-lifecycle
- adaptive favicon https://web.dev/articles/building/an-adaptive-favicon
even better:
<link rel="icon" href="" media="(prefers-color-scheme: dark)" type="image/png">
<link rel="icon" href="" media="(prefers-color-scheme: dark)" type="image/svg+xml">
- completely remove the concept of snippets. make every state reachable by
url. snippets will just be url that set the asm and the correct compiler
- add html syntax highlight to c disass.
Expand All @@ -48,3 +50,4 @@ https://web.dev/articles/building/an-adaptive-favicon



https://flatassembler.net/docs.php?article=manual#2.4
6 changes: 4 additions & 2 deletions svelte_blinkenweb/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@

<meta property="og:title" content="X86-64 playground" />
<meta property="og:description" content="An online x86-64 Assembly playground. Run, learn, and debug Assembly code directly from your browser" />
<meta property="og:image" content="/card.jpg" />
<meta property="og:image" content="https://x64.halb.it/card.jpg" />
<meta content="1762" property="og:image:width">
<meta content="1068" property="og:image:height">
<meta property="og:url" content="https://x64.halb.it/" />
<meta property="twitter:card" content="/card.jpg" />
<meta property="twitter:card" content="https://x64.halb.it/card.jpg" />
<meta property="og:site_name" content="X86-64 playground" />
<meta property="twitter:image:alt" content="X86-64 playground" />
</head>
Expand Down
142 changes: 14 additions & 128 deletions svelte_blinkenweb/src/App.svelte
Original file line number Diff line number Diff line change
@@ -1,135 +1,21 @@
<script lang="ts">
import './styles/style.css';
import { PaneGroup, Pane, PaneResizer } from "paneforge";
// import ThemeDebug from './components/ThemeDebug.svelte';
import Hexdump from './components/Hexdump.svelte';
import Editor from './components/Editor.svelte';
import Registers from './components/Registers.svelte';
import Disassembler from './components/Disassembler.svelte';
import Terminal from './components/Terminal.svelte';
import Controls from './components/Controls.svelte';
import DesktopLayout from './DesktopLayout.svelte';
import MobileLayout from './MobileLayout.svelte';
</script>


<PaneGroup direction="horizontal" class="pf__panegroup pf__panegroup--horizontal">

<Pane defaultSize={25} class="pf__pane pf__pane--h100">
<div class="pane">
<Controls/>
<!-- <div class="pane__bar"> -->
<!-- <p>Editor</p> -->
<!-- </div> -->
<div class="pane__content">
<Editor />
</div>
</div>
</Pane>
let innerWidth = 0;
let breakpoints = {
mobile: 640
}
<!-- <Pane defaultSize={25} class="pf__pane"> -->
<!-- <PaneGroup direction="vertical" class="pf__panegroup pf__panegroup--vertical"> -->
<!-- <Pane defaultSize={25} class="pf__pane"> -->
<!-- <div class="pane"> -->
<!-- <div class="pane__content"> -->
<!-- <Controls/> -->
<!-- </div> -->
<!-- </div> -->
<!-- </Pane> -->
<!-- <PaneResizer class="pf__resizer pf__resizer--horizontal" /> -->
<!-- <Pane defaultSize={75} class="pf__pane"> -->
<!-- <div class="pane"> -->
<!-- <div class="pane__bar"> -->
<!-- <p>Code editor</p> -->
<!-- <select> -->
<!-- </div> -->
<!-- <div class="pane__content"> -->
<!-- <Editor /> -->
<!-- </div> -->
<!-- </div> -->
<!-- </Pane> -->
<!-- </PaneGroup> -->
<!-- </Pane> -->

<PaneResizer class="pf__resizer pf__resizer--vertical" />
<Pane defaultSize={30} class="pf__pane pf__pane--h100">
<div class="pane">
<div class="pane__bar">
<p>Disassembly</p>
</div>
<div class="pane__content">
<Disassembler />
</div>
</div>
</Pane>

<PaneResizer class="pf__resizer pf__resizer--vertical" />
<Pane defaultSize={15} class="pf__pane pf__pane--h100">
<PaneGroup direction="vertical" class="pf__panegroup pf__panegroup--vertical">
<Pane defaultSize={50} class="pf__pane">
<div class="pane">
<div class="pane__bar">
<p>Registers</p>
</div>
<div class="pane__content">
<Registers />
</div>
</div>
</Pane>
<PaneResizer class="pf__resizer pf__resizer--horizontal" />
<Pane defaultSize={50} class="pf__pane">
<div class="pane">
<div class="pane__bar">
<p>Terminal</p>
</div>
<div class="pane__content">
<Terminal/>
</div>
</div>
</Pane>
</PaneGroup>
</Pane>
<PaneResizer class="pf__resizer pf__resizer--vertical" />
<Pane defaultSize={25} class="pf__pane pf__pane--h100">
<div class="pane">
<div class="pane__bar">
<p>Stack memory</p>
</div>
<div class="pane__content">
<Hexdump />
</div>
</div>
</Pane>
</PaneGroup>

<style>
.pane{
display: flex;
justify-content: center;
flex-direction:column;
align-items: stretch;
height: 100%;
/* border: 1px solid var(--theme-panel-border); */
}
.pane__bar{
height: 2rem;
flex-shrink: 0;
</script>

padding-left: 1rem;
background-color: var(--theme-panel-controls-bg);
border-bottom: 1px solid var(--theme-panel-border);
width: 100%;
display: flex;
}
.pane__bar p{
font-size: 1.1rem;
margin: 0;
}
<!-- attach an action to the browser window -->
<svelte:window bind:innerWidth />

.pane__content{
overflow: auto;
height: 100%;
/*this is cool the first time you see it, then super annoying */
/* scroll-behavior: smooth; */
}
{#if innerWidth <= breakpoints.mobile}
<MobileLayout/>
{:else}
<DesktopLayout/>
{/if}

</style>
108 changes: 108 additions & 0 deletions svelte_blinkenweb/src/DesktopLayout.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<script lang="ts">
import { PaneGroup, Pane, PaneResizer } from "paneforge";
import Hexdump from './components/Hexdump.svelte';
import Editor from './components/Editor.svelte';
import Registers from './components/Registers.svelte';
import Disassembler from './components/Disassembler.svelte';
import Terminal from './components/Terminal.svelte';
import Controls from './components/Controls.svelte';
</script>


<PaneGroup direction="horizontal" class="pf__panegroup pf__panegroup--horizontal">

<Pane defaultSize={25} class="pf__pane pf__pane--h100">
<div class="pane">

<Controls mobile={false} showEditor={true}/>
<div class="pane__content">
<Editor />
</div>
</div>
</Pane>

<PaneResizer class="pf__resizer pf__resizer--vertical" />
<Pane defaultSize={30} class="pf__pane pf__pane--h100">
<div class="pane">
<div class="pane__bar">
<p>Disassembly</p>
</div>
<div class="pane__content">
<Disassembler />
</div>
</div>
</Pane>

<PaneResizer class="pf__resizer pf__resizer--vertical" />
<Pane defaultSize={15} class="pf__pane pf__pane--h100">
<PaneGroup direction="vertical" class="pf__panegroup pf__panegroup--vertical">
<Pane defaultSize={50} class="pf__pane">
<div class="pane">
<div class="pane__bar">
<p>Registers</p>
</div>
<div class="pane__content">
<Registers />
</div>
</div>
</Pane>
<PaneResizer class="pf__resizer pf__resizer--horizontal" />
<Pane defaultSize={50} class="pf__pane">
<div class="pane">
<div class="pane__bar">
<p>Terminal</p>
</div>
<div class="pane__content">
<Terminal/>
</div>
</div>
</Pane>
</PaneGroup>
</Pane>
<PaneResizer class="pf__resizer pf__resizer--vertical" />
<Pane defaultSize={25} class="pf__pane pf__pane--h100">
<div class="pane">
<div class="pane__bar">
<p>Stack memory</p>
</div>
<div class="pane__content">
<Hexdump />
</div>
</div>
</Pane>
</PaneGroup>

<style>
.pane{
display: flex;
justify-content: center;
flex-direction:column;
align-items: stretch;
height: 100%;
/* border: 1px solid var(--theme-panel-border); */
}
.pane__bar{
height: 2rem;
flex-shrink: 0;
padding-left: 1rem;
background-color: var(--theme-panel-controls-bg);
border-bottom: 1px solid var(--theme-panel-border);
width: 100%;
display: flex;
}
.pane__bar p{
font-size: 1.1rem;
margin: 0;
}
.pane__content{
overflow: auto;
height: 100%;
/*this is cool the first time you see it, then super annoying */
/* scroll-behavior: smooth; */
}
</style>

Loading

0 comments on commit f480fa7

Please sign in to comment.