Skip to content

Commit

Permalink
Merge pull request #16 from Bubobubobubobubo/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Bubobubobubobubo authored Aug 27, 2023
2 parents 2d58734 + 57d5ae6 commit 728d7c2
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 93 deletions.
75 changes: 24 additions & 51 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,22 @@

</a>
<nav class="py-2 flex flex-wrap items-center text-base absolute right-0">
<a title="Play button" id="play-button-1" class="hover:bg-gray-800 px-2 py-2 rounded-lg">
<a title="Play button (Ctrl+P)" id="play-button-1" class="hover:bg-gray-800 px-2 py-2 rounded-lg">
<svg class="w-8 h-8" fill="currentColor" viewBox="0 0 14 16">
<path d="M0 .984v14.032a1 1 0 0 0 1.506.845l12.006-7.016a.974.974 0 0 0 0-1.69L1.506.139A1 1 0 0 0 0 .984Z"/>
</svg>
</a>
<a title="Pause button" id="pause-button-1" class="mr-2 hover:text-gray-900 hover:bg-gray-800 px-2 py-2 rounded-lg">
<a title="Pause button (Ctrl+S)" id="pause-button-1" class="mr-2 hover:text-gray-900 hover:bg-gray-800 px-2 py-2 rounded-lg">
<svg class="fill-orange-300 w-8 h-8 text-gray-800 text-white" fill="currentColor" viewBox="0 0 20 20">
<path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9 13a1 1 0 0 1-2 0V7a1 1 0 0 1 2 0v6Zm4 0a1 1 0 0 1-2 0V7a1 1 0 0 1 2 0v6Z"/>
</svg>
</a>
<a title="Stop button" id="stop-button-1" class="mr-2 hover:text-gray-900 hover:bg-gray-800 px-2 py-2 rounded-lg">
<a title="Stop button (Ctrl+R)" id="stop-button-1" class="mr-2 hover:text-gray-900 hover:bg-gray-800 px-2 py-2 rounded-lg">
<svg class="w-8 h-8 text-gray-800 text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 12 16">
<path d="M10.819.4a1.974 1.974 0 0 0-2.147.33l-6.5 5.773A2.014 2.014 0 0 0 2 6.7V1a1 1 0 0 0-2 0v14a1 1 0 1 0 2 0V9.3c.055.068.114.133.177.194l6.5 5.773a1.982 1.982 0 0 0 2.147.33A1.977 1.977 0 0 0 12 13.773V2.227A1.977 1.977 0 0 0 10.819.4Z"/>
</svg>
</a>
<a title="Eval button" id="eval-button-1" class="mr-2 hover:text-gray-900 hover:bg-gray-800 px-2 py-2 rounded-lg">
<a title="Eval button (Ctrl+Enter)" id="eval-button-1" class="mr-2 hover:text-gray-900 hover:bg-gray-800 px-2 py-2 rounded-lg">
<svg class="w-8 h-8 text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 18 20">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 1v5h-5M2 19v-5h5m10-4a8 8 0 0 1-14.947 3.97M1 10a8 8 0 0 1 14.947-3.97"/>
</svg>
Expand All @@ -79,7 +79,7 @@
<path d="M7.958 19.393a7.7 7.7 0 0 1-6.715-3.439c-2.868-4.832 0-9.376.944-10.654l.091-.122a3.286 3.286 0 0 0 .765-3.288A1 1 0 0 1 4.6.8c.133.1.313.212.525.347A10.451 10.451 0 0 1 10.6 9.3c.5-1.06.772-2.213.8-3.385a1 1 0 0 1 1.592-.758c1.636 1.205 4.638 6.081 2.019 10.441a8.177 8.177 0 0 1-7.053 3.795Z"/>
</svg>
</a>
<a title="Open Documentation" id="doc-button-1" class="mr-2 hover:text-gray-900 hover:bg-gray-800 px-2 py-2 rounded-lg">
<a title="Open Documentation (Ctrl+D)" id="doc-button-1" class="mr-2 hover:text-gray-900 hover:bg-gray-800 px-2 py-2 rounded-lg">
<svg class="w-8 h-8 text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 18">
<path d="M9 1.334C7.06.594 1.646-.84.293.653a1.158 1.158 0 0 0-.293.77v13.973c0 .193.046.383.134.55.088.167.214.306.366.403a.932.932 0 0 0 .5.147c.176 0 .348-.05.5-.147 1.059-.32 6.265.851 7.5 1.65V1.334ZM19.707.653C18.353-.84 12.94.593 11 1.333V18c1.234-.799 6.436-1.968 7.5-1.65a.931.931 0 0 0 .5.147.931.931 0 0 0 .5-.148c.152-.096.279-.235.366-.403.088-.167.134-.357.134-.55V1.423a1.158 1.158 0 0 0-.293-.77Z"/>
</svg>
Expand Down Expand Up @@ -127,7 +127,9 @@ <h2 class="font-semibold dark:text-gray-400">More</h2>
<div id="app">
<!-- This modal is used for switching between buffers -->
<div id="modal-buffers" class="invisible bg-neutral-900 bg-opacity-50 flex justify-center items-center absolute top-0 right-0 bottom-0 left-0">
<div id="start-button" class="px-16 py-14 rounded-md text-center">
<div id="start-button" class="px-16 pt-4 pb-4 rounded-md text-center bg-white">
<p class="text-semibold text-2xl pb-4">Known universes</p>
<p id="existing-universes" class="text-xl"></p>
<div id="disclaimer" class="pb-4">
<form>
<label for="search" class="mb-2 text-sm font-medium text-gray-900 sr-only text-white">Search</label>
Expand All @@ -137,8 +139,8 @@ <h2 class="font-semibold dark:text-gray-400">More</h2>
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"/>
</svg>
</div>
<input minlength="2" type="text" id="buffer-search" class="block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 outline-0 rounded-lg bg-neutral-900 bg-neutral-900 text-white" placeholder="Buffer..." required>
<button disabled class="text-black absolute right-2.5 bottom-2.5 bg-white hover:bg-white focus:outline-none font-medium rounded-lg text-sm px-4 py-2">Go</button>
<input name="universe" minlength="2" autocomplete="off" type="text" id="buffer-search" class="block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-800 outline-0 rounded-lg bg-gray-800 text-white" placeholder="Buffer..." required>
<button id="load-universe-button" class="text-black absolute right-2.5 bottom-2.5 bg-white hover:bg-white focus:outline-none font-medium rounded-lg text-sm px-4 py-2">Go</button>
</div>
</form>
</div>
Expand Down Expand Up @@ -199,7 +201,7 @@ <h5 class="mb-2 lg:text-2xl text-xl font-bold tracking-tight text-white">Discord
<div id="modal-container" class="motion-safe:animate-pulse flex min-h-screen flex flex-col">
<div id="modal" class="bg-neutral-900 bg-opacity-50 flex justify-center items-center absolute top-0 right-0 bottom-0 left-0">
<div id="start-button" class="bg-white px-2 py-2 lg:px-12 lg:py-12 rounded-md text-center">
<h1 class="text-xl mb-4 font-bold text-white rounded bg-gray-800 py-4 mb-6">Topos Prototype</h1>
<h1 class="text-xl mb-4 font-bold text-white rounded bg-gray-800 py-4 mb-6">Topos Alpha v0.1</h1>
<div class="flex ml-0 lg:flex-row landscape:space-y-0 portrait:space-y-2 lg:space-y-4 lg:space-y-0 portrait:flex-col landscape:flex-row lg:flex-col w-auto min-w-screen px-0 lg:space-x-8 landscape:space-x-2">
<a href="https://github.com/Bubobubobubobubo/Topos" class="block max-w-sm lg:p-6 border border-gray-200 rounded-lg shadow bg-gray-800 border-gray-700 hover:bg-gray-700">
<h5 class="sm:pt-2 mb-2 lg:text-2xl text-xl font-bold tracking-tight text-white">GitHub</h5>
Expand All @@ -224,7 +226,7 @@ <h5 class="sm:pt-2 mb-2 lg:text-2xl text-xl font-bold tracking-tight text-white"
dark:border-neutral-700 border-none"
>
<nav class="flex flex-col space-y-6">
<a title="Local Scripts" id="local-button" class="pl-2 p-1.5 text-gray-700 focus:outline-nones transition-colors duration-200 rounded-lg dark:text-gray-200 hover:bg-gray-800">
<a title="Local Scripts (Ctrl + L)" id="local-button" class="pl-2 p-1.5 text-gray-700 focus:outline-nones transition-colors duration-200 rounded-lg dark:text-gray-200 hover:bg-gray-800">
<!--
<p class="grid font-mono font-semibold text-4xl content-center justify-center">L</p>
-->
Expand All @@ -233,7 +235,7 @@ <h5 class="sm:pt-2 mb-2 lg:text-2xl text-xl font-bold tracking-tight text-white"
</svg>
</a>

<a title="Global Script" id="global-button" class="pl-2 p-1.5 text-gray-700 focus:outline-nones transition-colors duration-200 rounded-lg dark:text-gray-200 hover:bg-gray-800">
<a title="Global Script (Ctrl + G)" id="global-button" class="pl-2 p-1.5 text-gray-700 focus:outline-nones transition-colors duration-200 rounded-lg dark:text-gray-200 hover:bg-gray-800">
<!--
<p class="grid font-mono font-semibold text-4xl content-center justify-center">G</p>
-->
Expand All @@ -242,7 +244,7 @@ <h5 class="sm:pt-2 mb-2 lg:text-2xl text-xl font-bold tracking-tight text-white"
</svg>
</a>

<a title="Initialisation Script" id="init-button" class="pl-2 p-1.5 text-gray-700 focus:outline-nones transition-colors duration-200 rounded-lg dark:text-gray-200 bg-gray-800">
<a title="Initialisation Script (Ctrl + I)" id="init-button" class="pl-2 p-1.5 text-gray-700 focus:outline-nones transition-colors duration-200 rounded-lg dark:text-gray-200 bg-gray-800">
<!--
<p class="grid font-mono font-semibold text-4xl content-center justify-center">I</p>
-->
Expand All @@ -251,41 +253,12 @@ <h5 class="sm:pt-2 mb-2 lg:text-2xl text-xl font-bold tracking-tight text-white"
</svg>
</a>

<a title="Project notes" id="note-button" class="pl-2 p-1.5 text-gray-700 focus:outline-nones transition-colors duration-200 rounded-lg dark:text-gray-200 hover:bg-gray-800">
<a title="Project notes (Ctrl + N)" id="note-button" class="pl-2 p-1.5 text-gray-700 focus:outline-nones transition-colors duration-200 rounded-lg dark:text-gray-200 hover:bg-gray-800">
<svg class="w-8 h-8 text-white" fill="currentColor" viewBox="0 0 16 20">
<path d="M16 14V2a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2v15a3 3 0 0 0 3 3h12a1 1 0 0 0 0-2h-1v-2a2 2 0 0 0 2-2ZM4 2h2v12H4V2Zm8 16H3a1 1 0 0 1 0-2h9v2Z"/>
</svg>
</a>

<!-- Other buttons -->

<!--
<a title="Play button" id="play-button-2" class="pl-2 p-1.5 text-gray-700 focus:outline-nones transition-colors duration-200 rounded-lg dark:text-gray-200 hover:bg-gray-800 sm:landscape:hidden">
<svg class="w-8 h-8 text-white block xl:hidden" fill="currentColor" viewBox="0 0 14 16">
<path d="M0 .984v14.032a1 1 0 0 0 1.506.845l12.006-7.016a.974.974 0 0 0 0-1.69L1.506.139A1 1 0 0 0 0 .984Z"/>
</svg>
</a>
<a title="Pause button" id="pause-button-2" class="pl-2 p-1.5 text-gray-700 focus:outline-nones transition-colors duration-200 rounded-lg dark:text-gray-200 hover:bg-gray-800 sm:landscape:hidden">
<svg class="fill-orange-300 w-8 h-8 block xl:hidden" fill="currentColor" viewBox="0 0 20 20">
<path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9 13a1 1 0 0 1-2 0V7a1 1 0 0 1 2 0v6Zm4 0a1 1 0 0 1-2 0V7a1 1 0 0 1 2 0v6Z"/>
</svg>
</a>
<a title="Stop button" id="stop-button-2" class="pl-2 p-1.5 text-gray-700 focus:outline-nones transition-colors duration-200 rounded-lg dark:text-gray-200 hover:bg-gray-800 sm:landscape:hidden">
<svg class="w-8 h-8 text-gray-800 dark:text-white block xl:hidden" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 12 16">
<path d="M10.819.4a1.974 1.974 0 0 0-2.147.33l-6.5 5.773A2.014 2.014 0 0 0 2 6.7V1a1 1 0 0 0-2 0v14a1 1 0 1 0 2 0V9.3c.055.068.114.133.177.194l6.5 5.773a1.982 1.982 0 0 0 2.147.33A1.977 1.977 0 0 0 12 13.773V2.227A1.977 1.977 0 0 0 10.819.4Z"/>
</svg>
</a>
<a title="Clear button" id="clear-button-2" class="hidden lg:block pl-2 p-1.5 text-gray-700 focus:outline-nones transition-colors duration-200 rounded-lg text-white hover:bg-gray-800">
<svg class="w-8 h-8 text-white block xl:hidden" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 17 20">
<path d="M7.958 19.393a7.7 7.7 0 0 1-6.715-3.439c-2.868-4.832 0-9.376.944-10.654l.091-.122a3.286 3.286 0 0 0 .765-3.288A1 1 0 0 1 4.6.8c.133.1.313.212.525.347A10.451 10.451 0 0 1 10.6 9.3c.5-1.06.772-2.213.8-3.385a1 1 0 0 1 1.592-.758c1.636 1.205 4.638 6.081 2.019 10.441a8.177 8.177 0 0 1-7.053 3.795Z"/>
</svg>
</a>
-->


<a title="Open settings" id="settings-button" class="lg:block sm:hidden p-2 text-gray-200 ml-1 absolute bottom-2 focus:outline-nones transition-colors duration-200 rounded-lg text-gray-200 bg-gray-800">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 011.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 01-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.397.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 01-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.505-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.107-1.204l-.527-.738a1.125 1.125 0 01.12-1.45l.773-.773a1.125 1.125 0 011.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894z" />
Expand All @@ -298,31 +271,31 @@ <h5 class="sm:pt-2 mb-2 lg:text-2xl text-xl font-bold tracking-tight text-white"
<div class="min-w-screen flex grow flex-col">
<ul id="local-script-tabs" class="text-xl flex text-sm font-medium text-center text-white bg-neutral-900 space-x-2 lg:space-x-8">
<li class="pl-5">
<a title="Local Script 1" id="tab-1" class="bg-orange-300 inline-block px-4 py-1 text-white hover:bg-gray-800">1</a>
<a title="Local Script 1 (F1)" id="tab-1" class="bg-orange-300 inline-block px-4 py-1 text-white hover:bg-gray-800">1</a>
</li>
<li class="">
<a title="Local Script 2" id="tab-2" class="inline-block px-4 py-1 hover:bg-gray-800">2</a>
<a title="Local Script 2 (F2)" id="tab-2" class="inline-block px-4 py-1 hover:bg-gray-800">2</a>
</li>
<li class="">
<a title="Local Script 3" id="tab-3" class="inline-block px-4 py-1 hover:bg-gray-800">3</a>
<a title="Local Script 3 (F3)" id="tab-3" class="inline-block px-4 py-1 hover:bg-gray-800">3</a>
</li>
<li class="">
<a title="Local Script 4" id="tab-4" class="inline-block px-4 py-1 hover:bg-gray-800">4</a>
<a title="Local Script 4 (F4)" id="tab-4" class="inline-block px-4 py-1 hover:bg-gray-800">4</a>
</li>
<li class="">
<a title="Local Script 5" id="tab-5" class="inline-block px-4 py-1 hover:bg-gray-800">5</a>
<a title="Local Script 5 (F5)" id="tab-5" class="inline-block px-4 py-1 hover:bg-gray-800">5</a>
</li>
<li class="">
<a title="Local Script 6" id="tab-6" class="inline-block px-4 py-1 hover:bg-gray-800">6</a>
<a title="Local Script 6 (F6)" id="tab-6" class="inline-block px-4 py-1 hover:bg-gray-800">6</a>
</li>
<li class="">
<a title="Local Script 7" id="tab-7" class="inline-block px-4 py-1 hover:bg-gray-800">7</a>
<a title="Local Script 7 (F7)" id="tab-7" class="inline-block px-4 py-1 hover:bg-gray-800">7</a>
</li>
<li class="">
<a title="Local Script 8" id="tab-8" class="inline-block px-4 py-1 hover:bg-gray-800">8</a>
<a title="Local Script 8 (F8)" id="tab-8" class="inline-block px-4 py-1 hover:bg-gray-800">8</a>
</li>
<li class="">
<a title="Local Script 9" id="tab-9" class="inline-block px-4 py-1 hover:bg-gray-800">9</a>
<a title="Local Script 9 (F9)" id="tab-9" class="inline-block px-4 py-1 hover:bg-gray-800">9</a>
</li>

</ul>
Expand Down
10 changes: 10 additions & 0 deletions src/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ export class UserAPI {

constructor(public app: Editor) {}

_loadUniverseFromInterface = (universe: string) => {
this.app.loadUniverse(universe as string);
this.app.openBuffersModal();
}

_deleteUniverseFromInterface = (universe: string) => {
delete this.app.universes[universe];
this.app.openBuffersModal();
}

_playDocExample = (code?: string) => {
this.play();
console.log("Executing documentation example: " + this.app.selectedExample);
Expand Down
Loading

0 comments on commit 728d7c2

Please sign in to comment.