initial commit

This commit is contained in:
2022-08-14 13:27:41 -07:00
commit b30e8bcea1
38 changed files with 6919 additions and 0 deletions

14
src/App.svelte Normal file
View File

@@ -0,0 +1,14 @@
<script>
import { emit, listen } from '@tauri-apps/api/event';
import Home from './views/Home.svelte';
import Approve from './views/Approve.svelte';
// listen('credentials-request', (event) => {
// const passphrase = prompt('Please enter your passphrase:');
// emit('passphrase-entered', passphrase);
// });
let activeComponent = Approve;
</script>
<svelte:component this={activeComponent} />

24
src/lib/queue.js Normal file
View File

@@ -0,0 +1,24 @@
export default function() {
return {
items: [],
resolvers: []
put(item) {
this.items.push(item);
if (resolvers.length > 0) {
resolvers.shift().resolve();
}
},
async get() {
if (this.items.length === 0) {
await new Promise((resolve, reject) => {
this.resolvers.push(resolve);
})
}
return this.items.shift();
},
}
}

8
src/main.js Normal file
View File

@@ -0,0 +1,8 @@
import './style.css';
import App from './App.svelte';
const app = new App({
target: document.getElementById('app')
})
export default app;

3
src/style.css Normal file
View File

@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

22
src/views/Approve.svelte Normal file
View File

@@ -0,0 +1,22 @@
<script>
import { createEventDispatcher } from 'svelte';
import check_circle from '../assets/check-circle.svg?raw';
import x_circle from '../assets/x-circle.svg?raw';
const dispatch = createEventDispatcher();
</script>
<h2 class="text-3xl text-gray-200">An application would like to access your AWS credentials.</h2>
<button on:click={() => dispatch('response', 'approved')}>
<svg class="w-32 stroke-green-500" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1">
<path stroke-linecap="round" stroke-linejoin="round" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
</button>
<button on:click={() => dispatch('response', 'denied')}>
<svg class="w-32 stroke-red-600" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1">
<path stroke-linecap="round" stroke-linejoin="round" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
</button>

1
src/views/Home.svelte Normal file
View File

@@ -0,0 +1 @@
<h1 class="text-4xl text-gray-300">Creddy</h1>