mirror of
https://github.com/tauri-apps/board-voter.git
synced 2026-01-31 00:55:20 +01:00
Initial commit
This commit is contained in:
4
.gitattributes
vendored
Normal file
4
.gitattributes
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.ico filter=lfs diff=lfs merge=lfs -text
|
||||
*.jpg filter=lfs diff=lfs merge=lfs -text
|
||||
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
||||
23
.gitignore
vendored
Normal file
23
.gitignore
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
# Nuxt dev/build outputs
|
||||
.output
|
||||
.nuxt
|
||||
.nitro
|
||||
.cache
|
||||
dist
|
||||
|
||||
# Node dependencies
|
||||
node_modules
|
||||
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
|
||||
# Misc
|
||||
.DS_Store
|
||||
.fleet
|
||||
.idea
|
||||
|
||||
# Local env files
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
63
README.md
Normal file
63
README.md
Normal file
@@ -0,0 +1,63 @@
|
||||
# Nuxt 3 Minimal Starter
|
||||
|
||||
Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
|
||||
|
||||
## Setup
|
||||
|
||||
Make sure to install the dependencies:
|
||||
|
||||
```bash
|
||||
# npm
|
||||
npm install
|
||||
|
||||
# pnpm
|
||||
pnpm install
|
||||
|
||||
# yarn
|
||||
yarn install
|
||||
```
|
||||
|
||||
## Development Server
|
||||
|
||||
Start the development server on `http://localhost:3000`:
|
||||
|
||||
```bash
|
||||
# npm
|
||||
npm run dev
|
||||
|
||||
# pnpm
|
||||
pnpm run dev
|
||||
|
||||
# yarn
|
||||
yarn dev
|
||||
```
|
||||
|
||||
## Production
|
||||
|
||||
Build the application for production:
|
||||
|
||||
```bash
|
||||
# npm
|
||||
npm run build
|
||||
|
||||
# pnpm
|
||||
pnpm run build
|
||||
|
||||
# yarn
|
||||
yarn build
|
||||
```
|
||||
|
||||
Locally preview production build:
|
||||
|
||||
```bash
|
||||
# npm
|
||||
npm run preview
|
||||
|
||||
# pnpm
|
||||
pnpm run preview
|
||||
|
||||
# yarn
|
||||
yarn preview
|
||||
```
|
||||
|
||||
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
|
||||
7
nuxt.config.ts
Normal file
7
nuxt.config.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||
export default defineNuxtConfig({
|
||||
ssr: false,
|
||||
srcDir: 'src',
|
||||
telemetry: false,
|
||||
devtools: { enabled: false }
|
||||
})
|
||||
20
package.json
Normal file
20
package.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "nuxt-app",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "nuxt build",
|
||||
"dev": "nuxt dev",
|
||||
"generate": "nuxt generate",
|
||||
"preview": "nuxt preview",
|
||||
"postinstall": "nuxt prepare"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nuxt/devtools": "latest",
|
||||
"@types/node": "^18",
|
||||
"nuxt": "^3.6.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/cli": "^1.4.0",
|
||||
"vuedraggable": "^4.1.0"
|
||||
}
|
||||
}
|
||||
6701
pnpm-lock.yaml
generated
Normal file
6701
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
3
src-tauri/.gitignore
vendored
Normal file
3
src-tauri/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Generated by Cargo
|
||||
# will have compiled files and executables
|
||||
/target/
|
||||
4572
src-tauri/Cargo.lock
generated
Normal file
4572
src-tauri/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
26
src-tauri/Cargo.toml
Normal file
26
src-tauri/Cargo.toml
Normal file
@@ -0,0 +1,26 @@
|
||||
[package]
|
||||
name = "app"
|
||||
version = "0.1.0"
|
||||
description = "A Tauri App"
|
||||
authors = ["you"]
|
||||
license = ""
|
||||
repository = ""
|
||||
default-run = "app"
|
||||
edition = "2021"
|
||||
rust-version = "1.60"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "1.4.0", features = [] }
|
||||
|
||||
[dependencies]
|
||||
serde_json = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
tauri = { version = "1.4.0", features = ["api-all"] }
|
||||
|
||||
[features]
|
||||
# this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled.
|
||||
# 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.
|
||||
# DO NOT REMOVE!!
|
||||
custom-protocol = [ "tauri/custom-protocol" ]
|
||||
3
src-tauri/build.rs
Normal file
3
src-tauri/build.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
tauri_build::build()
|
||||
}
|
||||
3
src-tauri/icons/128x128.png
Normal file
3
src-tauri/icons/128x128.png
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:eeebf55d8ffe07348786b9057af253e3ca08c56b6a8f8893826381430e3c0b7b
|
||||
size 11059
|
||||
3
src-tauri/icons/128x128@2x.png
Normal file
3
src-tauri/icons/128x128@2x.png
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2998b41d0c9278b08e8b3874e094920034fe983a46053c9d62764225f58ab7b0
|
||||
size 23137
|
||||
3
src-tauri/icons/32x32.png
Normal file
3
src-tauri/icons/32x32.png
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:aaa96d0c53b756b77c7f46aeb72290f42256c786c69be68f6bcdeb9c7492a48e
|
||||
size 2225
|
||||
3
src-tauri/icons/Square107x107Logo.png
Normal file
3
src-tauri/icons/Square107x107Logo.png
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:33446a858d982a529554e562114673f8b15620588137cf0bf6c56a7441c78cd7
|
||||
size 9202
|
||||
3
src-tauri/icons/Square142x142Logo.png
Normal file
3
src-tauri/icons/Square142x142Logo.png
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:633d6dba504faa844b309e01272386e4523cddd4a3639c77c0eb5d2ce3eac752
|
||||
size 12530
|
||||
3
src-tauri/icons/Square150x150Logo.png
Normal file
3
src-tauri/icons/Square150x150Logo.png
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d90061ad71e6f5882b759d80cf58cc16aa5021fa29ba4b2614adea982a4d7ee5
|
||||
size 13032
|
||||
3
src-tauri/icons/Square284x284Logo.png
Normal file
3
src-tauri/icons/Square284x284Logo.png
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5feaa4f18f404843551756dd2791d7654ef471b6b007767ae40f60c7aebcad5b
|
||||
size 25943
|
||||
3
src-tauri/icons/Square30x30Logo.png
Normal file
3
src-tauri/icons/Square30x30Logo.png
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:68bc1b585f5685e0922f14b1ca7eb2d618213c684c89e759c6a5eb8578c3fe8d
|
||||
size 2078
|
||||
3
src-tauri/icons/Square310x310Logo.png
Normal file
3
src-tauri/icons/Square310x310Logo.png
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5df8d779ab57c63ee06ed237b94c3c0954711e88117dccfa72b2aec5d83b0d80
|
||||
size 28507
|
||||
3
src-tauri/icons/Square44x44Logo.png
Normal file
3
src-tauri/icons/Square44x44Logo.png
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c46208286b1ea1b4841b714972f3cb0a8abc6d3bfa71a29238f7b4d62f511f89
|
||||
size 3419
|
||||
3
src-tauri/icons/Square71x71Logo.png
Normal file
3
src-tauri/icons/Square71x71Logo.png
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:cb0ea93cbd13509d32c6bc06da71687e73d673d166fde91b23061771abe16b86
|
||||
size 6027
|
||||
3
src-tauri/icons/Square89x89Logo.png
Normal file
3
src-tauri/icons/Square89x89Logo.png
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2208da1d741a20e902a59d7c39a5e58af74ec823db13113bf8ac6f555fa25bca
|
||||
size 7551
|
||||
3
src-tauri/icons/StoreLogo.png
Normal file
3
src-tauri/icons/StoreLogo.png
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9f84d0ce09df51bac0a4855042b3e49b190cc2b9761cd5eab61ebec5cd343820
|
||||
size 3971
|
||||
BIN
src-tauri/icons/icon.icns
Normal file
BIN
src-tauri/icons/icon.icns
Normal file
Binary file not shown.
3
src-tauri/icons/icon.ico
Normal file
3
src-tauri/icons/icon.ico
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e38ca88e1d5490f3dcbc3c3fa525f7fcb7b80fff3cb2f3a4eb1b2d018c0915c1
|
||||
size 37710
|
||||
3
src-tauri/icons/icon.png
Normal file
3
src-tauri/icons/icon.png
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6413bfe9d546e5225fc9256a0ecec48df3a1272ea4bdc91c15b8e000222a95d3
|
||||
size 49979
|
||||
13
src-tauri/src/main.rs
Normal file
13
src-tauri/src/main.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
|
||||
fn main() {
|
||||
tauri::Builder::default()
|
||||
.on_window_event(|e| {
|
||||
if let tauri::WindowEvent::Resized(_) = e.event() {
|
||||
std::thread::sleep(std::time::Duration::from_nanos(1));
|
||||
}
|
||||
})
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
68
src-tauri/tauri.conf.json
Normal file
68
src-tauri/tauri.conf.json
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
|
||||
"build": {
|
||||
"beforeBuildCommand": "pnpm generate",
|
||||
"beforeDevCommand": "pnpm dev",
|
||||
"devPath": "http://localhost:3000",
|
||||
"distDir": "../dist"
|
||||
},
|
||||
"package": {
|
||||
"productName": "board-voter",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"tauri": {
|
||||
"allowlist": {
|
||||
"all": true
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"category": "DeveloperTool",
|
||||
"copyright": "",
|
||||
"deb": {
|
||||
"depends": []
|
||||
},
|
||||
"externalBin": [],
|
||||
"icon": [
|
||||
"icons/32x32.png",
|
||||
"icons/128x128.png",
|
||||
"icons/128x128@2x.png",
|
||||
"icons/icon.icns",
|
||||
"icons/icon.ico"
|
||||
],
|
||||
"identifier": "com.tauri.board-voter",
|
||||
"longDescription": "",
|
||||
"macOS": {
|
||||
"entitlements": null,
|
||||
"exceptionDomain": "",
|
||||
"frameworks": [],
|
||||
"providerShortName": null,
|
||||
"signingIdentity": null
|
||||
},
|
||||
"resources": [],
|
||||
"shortDescription": "",
|
||||
"targets": "all",
|
||||
"windows": {
|
||||
"certificateThumbprint": null,
|
||||
"digestAlgorithm": "sha256",
|
||||
"timestampUrl": ""
|
||||
}
|
||||
},
|
||||
"security": {
|
||||
"csp": null
|
||||
},
|
||||
"updater": {
|
||||
"active": false
|
||||
},
|
||||
"windows": [
|
||||
{
|
||||
"fullscreen": false,
|
||||
"height": 600,
|
||||
"resizable": true,
|
||||
"title": "Board Voter",
|
||||
"transparent": true,
|
||||
"width": 800,
|
||||
"fileDropEnabled": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
5
src/app.vue
Normal file
5
src/app.vue
Normal file
@@ -0,0 +1,5 @@
|
||||
<template>
|
||||
<div @contextmenu.prevent>
|
||||
<NuxtLayout></NuxtLayout>
|
||||
</div>
|
||||
</template>
|
||||
3
src/layouts/default.vue
Normal file
3
src/layouts/default.vue
Normal file
@@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<NuxtPage></NuxtPage>
|
||||
</template>
|
||||
148
src/pages/index.vue
Normal file
148
src/pages/index.vue
Normal file
@@ -0,0 +1,148 @@
|
||||
<template>
|
||||
<div class="col">
|
||||
<div class="col center">
|
||||
<a class="submit-button"
|
||||
:href="mailto + '?subject=' + mailtoSubject + '&body=' + mailtoBody + '%0D%0A%0D%0AVoted Yes%0D%0A' + list1.map(val => val.name).join('%0D%0A') + '%0D%0A%0D%0AVoted No%0D%0A' + list2.map(val => val.name).join('%0D%0A')">Submit</a>
|
||||
</div>
|
||||
<div class="col center">
|
||||
<h3>Yes</h3>
|
||||
<p>These are people you are voting yes for. The higher they are in the list the more you want to see them voted
|
||||
in.</p>
|
||||
<draggable class="list-group" :list="list1" group="people" @change="log" itemKey="name">
|
||||
<template #item="{ element, index }">
|
||||
<div draggable="true" class="list-group-item">{{ element.name }} {{ index }}</div>
|
||||
</template>
|
||||
</draggable>
|
||||
</div>
|
||||
|
||||
<div class="col center">
|
||||
<h3>No</h3>
|
||||
<p>These are people you are voting no for.</p>
|
||||
<draggable class="list-group" :list="list2" group="people" @change="log" itemKey="name">
|
||||
<template #item="{ element, index }">
|
||||
<div draggable="true" class="list-group-item">{{ element.name }} {{ index }}</div>
|
||||
</template>
|
||||
</draggable>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
mailto: 'mailto:board@tauri.app',
|
||||
mailtoSubject: 'I am voting!'.replace(' ', '%20'),
|
||||
mailtoBody: 'Thank you for voting!'.replace(' ', '%20'),
|
||||
list1: [
|
||||
{ name: "John", id: 1 },
|
||||
{ name: "Joao", id: 2 },
|
||||
{ name: "Jean", id: 3 },
|
||||
{ name: "Gerard", id: 4 }
|
||||
],
|
||||
list2: [
|
||||
{ name: "Juan", id: 5 },
|
||||
{ name: "Edgard", id: 6 },
|
||||
{ name: "Johnson", id: 7 }
|
||||
]
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
add: function () {
|
||||
this.list.push({ name: "Juan" });
|
||||
},
|
||||
replace: function () {
|
||||
this.list = [{ name: "Edgard" }];
|
||||
},
|
||||
clone: function (el) {
|
||||
return {
|
||||
name: el.name + " cloned"
|
||||
};
|
||||
},
|
||||
log: function (evt) {
|
||||
window.console.log(evt);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
:root {
|
||||
font-family: 'Courier New', Courier, monospace;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
background: #242526;
|
||||
color: #fff;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.col {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
flex-grow: 1;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.submit-button {
|
||||
display: block;
|
||||
width: 5cm;
|
||||
background: #333;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
height: 1cm;
|
||||
text-align: center;
|
||||
line-height: 1cm;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 0 2px 0 #000;
|
||||
}
|
||||
|
||||
.submit-button:hover {
|
||||
background: #444;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.submit-button:active {
|
||||
background: #111;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.list-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
width: 50%;
|
||||
flex-grow: 1;
|
||||
min-height: 1cm;
|
||||
}
|
||||
|
||||
.list-group-item {
|
||||
position: relative;
|
||||
display: block;
|
||||
padding: 10px 15px;
|
||||
margin-bottom: -1px;
|
||||
background-color: #242526;
|
||||
border: 1px solid #ddd;
|
||||
width: 100%;
|
||||
flex-grow: 1;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 0 2px 1px #000;
|
||||
margin: 4px;
|
||||
cursor: move;
|
||||
}
|
||||
</style>
|
||||
5
src/plugins/vuedraggable.ts
Normal file
5
src/plugins/vuedraggable.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import draggable from 'vuedraggable';
|
||||
|
||||
export default defineNuxtPlugin((nuxtApp) => {
|
||||
nuxtApp.vueApp.component('draggable', draggable)
|
||||
})
|
||||
3
src/public/favicon.ico
Normal file
3
src/public/favicon.ico
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1057b17aec08a7191d134000203947f195a8aa7c84c39f1164cee8d01279762a
|
||||
size 4286
|
||||
4
tsconfig.json
Normal file
4
tsconfig.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
// https://nuxt.com/docs/guide/concepts/typescript
|
||||
"extends": "./.nuxt/tsconfig.json"
|
||||
}
|
||||
Reference in New Issue
Block a user