├── .github
└── FUNDING.yml
├── .gitignore
├── LICENSE
├── README.md
├── altro
├── logo per sito electronJS.svg
├── screenshot - icona sulla dash.JPG
├── screenshot-credits.png
└── screenshot.JPG
└── vue-calc
├── .babelrc
├── .electron-vue
├── build.js
├── dev-client.js
├── dev-runner.js
├── webpack.main.config.js
├── webpack.renderer.config.js
└── webpack.web.config.js
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── .travis.yml
├── LICENSE
├── README.md
├── appveyor.yml
├── build
└── icons
│ ├── 1024x1024.png
│ ├── 128x128.png
│ ├── 16x16.png
│ ├── 24x24.png
│ ├── 256x256.png
│ ├── 32x32.png
│ ├── 48x48.png
│ ├── 512x512.png
│ ├── 64x64.png
│ ├── 96x96.png
│ ├── icon.icns
│ ├── icon.ico
│ └── icon.svg
├── linkUtili.md
├── package-lock.json
├── package.json
├── src
├── index.ejs
├── main
│ ├── index.dev.js
│ └── index.js
└── renderer
│ ├── App.vue
│ ├── assets
│ ├── .gitkeep
│ ├── fonts
│ │ ├── font-mina
│ │ │ ├── Mina-Bold.woff
│ │ │ ├── Mina-Regular.woff
│ │ │ └── fontMina.css
│ │ ├── font-roboto
│ │ │ ├── Roboto-Black.woff
│ │ │ ├── Roboto-BlackItalic.woff
│ │ │ ├── Roboto-Bold.woff
│ │ │ ├── Roboto-BoldItalic.woff
│ │ │ ├── Roboto-Italic.woff
│ │ │ ├── Roboto-Light.woff
│ │ │ ├── Roboto-LightItalic.woff
│ │ │ ├── Roboto-Medium.woff
│ │ │ ├── Roboto-MediumItalic.woff
│ │ │ ├── Roboto-Regular.woff
│ │ │ ├── Roboto-Thin.woff
│ │ │ ├── Roboto-ThinItalic.woff
│ │ │ └── fontRoboto.css
│ │ └── icons-material-icons
│ │ │ ├── materialIcons.css
│ │ │ └── materialIcons.woff2
│ └── icons
│ │ ├── 1024x1024.png
│ │ ├── 128x128.png
│ │ ├── 16x16.png
│ │ ├── 24x24.png
│ │ ├── 256x256.png
│ │ ├── 32x32.png
│ │ ├── 48x48.png
│ │ ├── 512x512.png
│ │ ├── 64x64.png
│ │ ├── 96x96.png
│ │ ├── icon.icns
│ │ ├── icon.ico
│ │ └── icon.svg
│ ├── components
│ ├── CalcDisplay
│ │ ├── CalcDisplayInputText.vue
│ │ ├── CalcDisplayOperazione.vue
│ │ └── CalcDisplayResult.vue
│ ├── CalcInput
│ │ └── CalcStandardInput.vue
│ ├── CalcStandardView.vue
│ ├── InfosView.vue
│ ├── SettingsView.vue
│ └── UIview
│ │ ├── Footer.vue
│ │ └── ToolbarENavigation.vue
│ ├── local
│ └── index.js
│ ├── main.js
│ ├── router
│ └── index.js
│ └── store
│ ├── index.js
│ └── modules
│ ├── calcInput.js
│ ├── calculus.js
│ ├── impostazioni.js
│ └── index.js
└── static
├── .gitkeep
├── 1024x1024.png
├── 128x128.png
├── 16x16.png
├── 24x24.png
├── 256x256.png
├── 32x32.png
├── 48x48.png
├── 512x512.png
├── 64x64.png
├── 96x96.png
├── icon.icns
├── icon.ico
└── icon.svg
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: [el3um4s]
4 | patreon: el3um4s
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom: ["https://www.paypal.me/el3um4s"]
13 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | dist/electron/*
3 | dist/web/*
4 | build/*
5 | !build/icons
6 | node_modules/
7 | npm-debug.log
8 | npm-debug.log.*
9 | thumbs.db
10 | !.gitkeep
11 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Samuele de Tomasi
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Vue Calc
2 |
3 | > A Simple VueJS's Calculator built with ElectronJS
4 |
5 | **Last Releases** [link](https://github.com/el3um4s/vue-calc/releases)
6 | - [Portable Windows 32bit](https://github.com/el3um4s/vue-calc/releases/download/v0.18.04.15/vue-calc-32bit.exe)
7 | - [Portable Windows 64bit](https://github.com/el3um4s/vue-calc/releases/download/v0.18.04.15/vue-calc-64bit.exe)
8 | - [Linux (.appimage 32bit)](https://github.com/el3um4s/vue-calc/releases/download/v0.18.04.15/vue-calc-i386.AppImage)
9 | - [Linux (.appimage 64bit)](https://github.com/el3um4s/vue-calc/releases/download/v0.18.04.15/vue-calc-x86_64.AppImage)
10 |
11 | 
12 |
13 | **Version** 0.18.04.06
14 |
15 | **License** MIT © 2017-2018 - Samuele de Tomasi
16 |
17 | **GitHub** [el3um4s/vue-calc](https://github.com/el3um4s/vue-calc/)
18 |
19 | **Created with:**
20 | - Vue.js
21 | - Vuetify
22 | - Electron-vue
23 | - decimal.js
24 | - Google Font Roboto
25 | - Google Font Mina
26 | - vue-shortkey
27 | - electron-store
28 |
29 | **Icons** created by [Arslan Şahìn](https://twitter.com/arslansahin)
30 |
31 | **Note about Calculator Logic:** It should be noted that there are two main schools of thought on calculator input logic: immediate execution logic and formula logic. Formula logic observes order of operation precedence, immediate execution does not. **Vue Calc utilizes immediate execution logic**.
32 |
33 | Either is acceptable, but please note that depending on which you choose, your calculator may yield different results than ours for certain equations (see below example)
34 |
35 | `3 + 5 x 6 - 2 / 4 =`
36 | * Immediate Execution Logic: 11.5
37 | * Formula/Expression Logic: 32.5
38 |
--------------------------------------------------------------------------------
/altro/logo per sito electronJS.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
191 |
--------------------------------------------------------------------------------
/altro/screenshot - icona sulla dash.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/altro/screenshot - icona sulla dash.JPG
--------------------------------------------------------------------------------
/altro/screenshot-credits.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/altro/screenshot-credits.png
--------------------------------------------------------------------------------
/altro/screenshot.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/altro/screenshot.JPG
--------------------------------------------------------------------------------
/vue-calc/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "comments": false,
3 | "env": {
4 | "main": {
5 | "presets": [
6 | ["env", {
7 | "targets": { "node": 7 }
8 | }],
9 | "stage-0"
10 | ]
11 | },
12 | "renderer": {
13 | "presets": [
14 | ["env", {
15 | "modules": false
16 | }],
17 | "stage-0"
18 | ]
19 | },
20 | "web": {
21 | "presets": [
22 | ["env", {
23 | "modules": false
24 | }],
25 | "stage-0"
26 | ]
27 | }
28 | },
29 | "plugins": ["transform-runtime"]
30 | }
31 |
--------------------------------------------------------------------------------
/vue-calc/.electron-vue/build.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | process.env.NODE_ENV = 'production'
4 |
5 | const { say } = require('cfonts')
6 | const chalk = require('chalk')
7 | const del = require('del')
8 | const { spawn } = require('child_process')
9 | const webpack = require('webpack')
10 | const Multispinner = require('multispinner')
11 |
12 |
13 | const mainConfig = require('./webpack.main.config')
14 | const rendererConfig = require('./webpack.renderer.config')
15 | const webConfig = require('./webpack.web.config')
16 |
17 | const doneLog = chalk.bgGreen.white(' DONE ') + ' '
18 | const errorLog = chalk.bgRed.white(' ERROR ') + ' '
19 | const okayLog = chalk.bgBlue.white(' OKAY ') + ' '
20 | const isCI = process.env.CI || false
21 |
22 | if (process.env.BUILD_TARGET === 'clean') clean()
23 | else if (process.env.BUILD_TARGET === 'web') web()
24 | else build()
25 |
26 | function clean () {
27 | del.sync(['build/*', '!build/icons', '!build/icons/icon.*'])
28 | console.log(`\n${doneLog}\n`)
29 | process.exit()
30 | }
31 |
32 | function build () {
33 | greeting()
34 |
35 | del.sync(['dist/electron/*', '!.gitkeep'])
36 |
37 | const tasks = ['main', 'renderer']
38 | const m = new Multispinner(tasks, {
39 | preText: 'building',
40 | postText: 'process'
41 | })
42 |
43 | let results = ''
44 |
45 | m.on('success', () => {
46 | process.stdout.write('\x1B[2J\x1B[0f')
47 | console.log(`\n\n${results}`)
48 | console.log(`${okayLog}take it away ${chalk.yellow('`electron-builder`')}\n`)
49 | process.exit()
50 | })
51 |
52 | pack(mainConfig).then(result => {
53 | results += result + '\n\n'
54 | m.success('main')
55 | }).catch(err => {
56 | m.error('main')
57 | console.log(`\n ${errorLog}failed to build main process`)
58 | console.error(`\n${err}\n`)
59 | process.exit(1)
60 | })
61 |
62 | pack(rendererConfig).then(result => {
63 | results += result + '\n\n'
64 | m.success('renderer')
65 | }).catch(err => {
66 | m.error('renderer')
67 | console.log(`\n ${errorLog}failed to build renderer process`)
68 | console.error(`\n${err}\n`)
69 | process.exit(1)
70 | })
71 | }
72 |
73 | function pack (config) {
74 | return new Promise((resolve, reject) => {
75 | webpack(config, (err, stats) => {
76 | if (err) reject(err.stack || err)
77 | else if (stats.hasErrors()) {
78 | let err = ''
79 |
80 | stats.toString({
81 | chunks: false,
82 | colors: true
83 | })
84 | .split(/\r?\n/)
85 | .forEach(line => {
86 | err += ` ${line}\n`
87 | })
88 |
89 | reject(err)
90 | } else {
91 | resolve(stats.toString({
92 | chunks: false,
93 | colors: true
94 | }))
95 | }
96 | })
97 | })
98 | }
99 |
100 | function web () {
101 | del.sync(['dist/web/*', '!.gitkeep'])
102 | webpack(webConfig, (err, stats) => {
103 | if (err || stats.hasErrors()) console.log(err)
104 |
105 | console.log(stats.toString({
106 | chunks: false,
107 | colors: true
108 | }))
109 |
110 | process.exit()
111 | })
112 | }
113 |
114 | function greeting () {
115 | const cols = process.stdout.columns
116 | let text = ''
117 |
118 | if (cols > 85) text = 'lets-build'
119 | else if (cols > 60) text = 'lets-|build'
120 | else text = false
121 |
122 | if (text && !isCI) {
123 | say(text, {
124 | colors: ['yellow'],
125 | font: 'simple3d',
126 | space: false
127 | })
128 | } else console.log(chalk.yellow.bold('\n lets-build'))
129 | console.log()
130 | }
131 |
--------------------------------------------------------------------------------
/vue-calc/.electron-vue/dev-client.js:
--------------------------------------------------------------------------------
1 | const hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
2 |
3 | hotClient.subscribe(event => {
4 | /**
5 | * Reload browser when HTMLWebpackPlugin emits a new index.html
6 | *
7 | * Currently disabled until jantimon/html-webpack-plugin#680 is resolved.
8 | * https://github.com/SimulatedGREG/electron-vue/issues/437
9 | * https://github.com/jantimon/html-webpack-plugin/issues/680
10 | */
11 | // if (event.action === 'reload') {
12 | // window.location.reload()
13 | // }
14 |
15 | /**
16 | * Notify `mainWindow` when `main` process is compiling,
17 | * giving notice for an expected reload of the `electron` process
18 | */
19 | if (event.action === 'compiling') {
20 | document.body.innerHTML += `
21 |
34 |
35 |
36 | Compiling Main Process...
37 |
38 | `
39 | }
40 | })
41 |
--------------------------------------------------------------------------------
/vue-calc/.electron-vue/dev-runner.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | const chalk = require('chalk')
4 | const electron = require('electron')
5 | const path = require('path')
6 | const { say } = require('cfonts')
7 | const { spawn } = require('child_process')
8 | const webpack = require('webpack')
9 | const WebpackDevServer = require('webpack-dev-server')
10 | const webpackHotMiddleware = require('webpack-hot-middleware')
11 |
12 | const mainConfig = require('./webpack.main.config')
13 | const rendererConfig = require('./webpack.renderer.config')
14 |
15 | let electronProcess = null
16 | let manualRestart = false
17 | let hotMiddleware
18 |
19 | function logStats (proc, data) {
20 | let log = ''
21 |
22 | log += chalk.yellow.bold(`┏ ${proc} Process ${new Array((19 - proc.length) + 1).join('-')}`)
23 | log += '\n\n'
24 |
25 | if (typeof data === 'object') {
26 | data.toString({
27 | colors: true,
28 | chunks: false
29 | }).split(/\r?\n/).forEach(line => {
30 | log += ' ' + line + '\n'
31 | })
32 | } else {
33 | log += ` ${data}\n`
34 | }
35 |
36 | log += '\n' + chalk.yellow.bold(`┗ ${new Array(28 + 1).join('-')}`) + '\n'
37 |
38 | console.log(log)
39 | }
40 |
41 | function startRenderer () {
42 | return new Promise((resolve, reject) => {
43 | rendererConfig.entry.renderer = [path.join(__dirname, 'dev-client')].concat(rendererConfig.entry.renderer)
44 |
45 | const compiler = webpack(rendererConfig)
46 | hotMiddleware = webpackHotMiddleware(compiler, {
47 | log: false,
48 | heartbeat: 2500
49 | })
50 |
51 | compiler.plugin('compilation', compilation => {
52 | compilation.plugin('html-webpack-plugin-after-emit', (data, cb) => {
53 | hotMiddleware.publish({ action: 'reload' })
54 | cb()
55 | })
56 | })
57 |
58 | compiler.plugin('done', stats => {
59 | logStats('Renderer', stats)
60 | })
61 |
62 | const server = new WebpackDevServer(
63 | compiler,
64 | {
65 | contentBase: path.join(__dirname, '../'),
66 | quiet: true,
67 | before (app, ctx) {
68 | app.use(hotMiddleware)
69 | ctx.middleware.waitUntilValid(() => {
70 | resolve()
71 | })
72 | }
73 | }
74 | )
75 |
76 | server.listen(9080)
77 | })
78 | }
79 |
80 | function startMain () {
81 | return new Promise((resolve, reject) => {
82 | mainConfig.entry.main = [path.join(__dirname, '../src/main/index.dev.js')].concat(mainConfig.entry.main)
83 |
84 | const compiler = webpack(mainConfig)
85 |
86 | compiler.plugin('watch-run', (compilation, done) => {
87 | logStats('Main', chalk.white.bold('compiling...'))
88 | hotMiddleware.publish({ action: 'compiling' })
89 | done()
90 | })
91 |
92 | compiler.watch({}, (err, stats) => {
93 | if (err) {
94 | console.log(err)
95 | return
96 | }
97 |
98 | logStats('Main', stats)
99 |
100 | if (electronProcess && electronProcess.kill) {
101 | manualRestart = true
102 | process.kill(electronProcess.pid)
103 | electronProcess = null
104 | startElectron()
105 |
106 | setTimeout(() => {
107 | manualRestart = false
108 | }, 5000)
109 | }
110 |
111 | resolve()
112 | })
113 | })
114 | }
115 |
116 | function startElectron () {
117 | electronProcess = spawn(electron, ['--inspect=5858', path.join(__dirname, '../dist/electron/main.js')])
118 |
119 | electronProcess.stdout.on('data', data => {
120 | electronLog(data, 'blue')
121 | })
122 | electronProcess.stderr.on('data', data => {
123 | electronLog(data, 'red')
124 | })
125 |
126 | electronProcess.on('close', () => {
127 | if (!manualRestart) process.exit()
128 | })
129 | }
130 |
131 | function electronLog (data, color) {
132 | let log = ''
133 | data = data.toString().split(/\r?\n/)
134 | data.forEach(line => {
135 | log += ` ${line}\n`
136 | })
137 | if (/[0-9A-z]+/.test(log)) {
138 | console.log(
139 | chalk[color].bold('┏ Electron -------------------') +
140 | '\n\n' +
141 | log +
142 | chalk[color].bold('┗ ----------------------------') +
143 | '\n'
144 | )
145 | }
146 | }
147 |
148 | function greeting () {
149 | const cols = process.stdout.columns
150 | let text = ''
151 |
152 | if (cols > 104) text = 'electron-vue'
153 | else if (cols > 76) text = 'electron-|vue'
154 | else text = false
155 |
156 | if (text) {
157 | say(text, {
158 | colors: ['yellow'],
159 | font: 'simple3d',
160 | space: false
161 | })
162 | } else console.log(chalk.yellow.bold('\n electron-vue'))
163 | console.log(chalk.blue(' getting ready...') + '\n')
164 | }
165 |
166 | function init () {
167 | greeting()
168 |
169 | Promise.all([startRenderer(), startMain()])
170 | .then(() => {
171 | startElectron()
172 | })
173 | .catch(err => {
174 | console.error(err)
175 | })
176 | }
177 |
178 | init()
179 |
--------------------------------------------------------------------------------
/vue-calc/.electron-vue/webpack.main.config.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | process.env.BABEL_ENV = 'main'
4 |
5 | const path = require('path')
6 | const { dependencies } = require('../package.json')
7 | const webpack = require('webpack')
8 |
9 | const BabiliWebpackPlugin = require('babili-webpack-plugin')
10 |
11 | let mainConfig = {
12 | entry: {
13 | main: path.join(__dirname, '../src/main/index.js')
14 | },
15 | externals: [
16 | ...Object.keys(dependencies || {})
17 | ],
18 | module: {
19 | rules: [
20 | {
21 | test: /\.(js)$/,
22 | enforce: 'pre',
23 | exclude: /node_modules/,
24 | use: {
25 | loader: 'eslint-loader',
26 | options: {
27 | formatter: require('eslint-friendly-formatter')
28 | }
29 | }
30 | },
31 | {
32 | test: /\.js$/,
33 | use: 'babel-loader',
34 | exclude: /node_modules/
35 | },
36 | {
37 | test: /\.node$/,
38 | use: 'node-loader'
39 | }
40 | ]
41 | },
42 | node: {
43 | __dirname: process.env.NODE_ENV !== 'production',
44 | __filename: process.env.NODE_ENV !== 'production'
45 | },
46 | output: {
47 | filename: '[name].js',
48 | libraryTarget: 'commonjs2',
49 | path: path.join(__dirname, '../dist/electron')
50 | },
51 | plugins: [
52 | new webpack.NoEmitOnErrorsPlugin()
53 | ],
54 | resolve: {
55 | extensions: ['.js', '.json', '.node']
56 | },
57 | target: 'electron-main'
58 | }
59 |
60 | /**
61 | * Adjust mainConfig for development settings
62 | */
63 | if (process.env.NODE_ENV !== 'production') {
64 | mainConfig.plugins.push(
65 | new webpack.DefinePlugin({
66 | '__static': `"${path.join(__dirname, '../static').replace(/\\/g, '\\\\')}"`
67 | })
68 | )
69 | }
70 |
71 | /**
72 | * Adjust mainConfig for production settings
73 | */
74 | if (process.env.NODE_ENV === 'production') {
75 | mainConfig.plugins.push(
76 | new BabiliWebpackPlugin(),
77 | new webpack.DefinePlugin({
78 | 'process.env.NODE_ENV': '"production"'
79 | })
80 | )
81 | }
82 |
83 | module.exports = mainConfig
84 |
--------------------------------------------------------------------------------
/vue-calc/.electron-vue/webpack.renderer.config.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | process.env.BABEL_ENV = 'renderer'
4 |
5 | const path = require('path')
6 | const { dependencies } = require('../package.json')
7 | const webpack = require('webpack')
8 |
9 | const BabiliWebpackPlugin = require('babili-webpack-plugin')
10 | const CopyWebpackPlugin = require('copy-webpack-plugin')
11 | const ExtractTextPlugin = require('extract-text-webpack-plugin')
12 | const HtmlWebpackPlugin = require('html-webpack-plugin')
13 |
14 | /**
15 | * List of node_modules to include in webpack bundle
16 | *
17 | * Required for specific packages like Vue UI libraries
18 | * that provide pure *.vue files that need compiling
19 | * https://simulatedgreg.gitbooks.io/electron-vue/content/en/webpack-configurations.html#white-listing-externals
20 | */
21 | let whiteListedModules = ['vue']
22 |
23 | let rendererConfig = {
24 | devtool: '#cheap-module-eval-source-map',
25 | entry: {
26 | renderer: path.join(__dirname, '../src/renderer/main.js')
27 | },
28 | externals: [
29 | ...Object.keys(dependencies || {}).filter(d => !whiteListedModules.includes(d))
30 | ],
31 | module: {
32 | rules: [
33 | {
34 | test: /\.(js|vue)$/,
35 | enforce: 'pre',
36 | exclude: /node_modules/,
37 | use: {
38 | loader: 'eslint-loader',
39 | options: {
40 | formatter: require('eslint-friendly-formatter')
41 | }
42 | }
43 | },
44 | {
45 | test: /\.css$/,
46 | use: ExtractTextPlugin.extract({
47 | fallback: 'style-loader',
48 | use: 'css-loader'
49 | })
50 | },
51 | {
52 | test: /\.html$/,
53 | use: 'vue-html-loader'
54 | },
55 | {
56 | test: /\.js$/,
57 | use: 'babel-loader',
58 | exclude: /node_modules/
59 | },
60 | {
61 | test: /\.node$/,
62 | use: 'node-loader'
63 | },
64 | {
65 | test: /\.vue$/,
66 | use: {
67 | loader: 'vue-loader',
68 | options: {
69 | extractCSS: process.env.NODE_ENV === 'production',
70 | loaders: {
71 | sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax=1',
72 | scss: 'vue-style-loader!css-loader!sass-loader'
73 | }
74 | }
75 | }
76 | },
77 | {
78 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
79 | use: {
80 | loader: 'url-loader',
81 | query: {
82 | limit: 10000,
83 | name: 'imgs/[name]--[folder].[ext]'
84 | }
85 | }
86 | },
87 | {
88 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
89 | loader: 'url-loader',
90 | options: {
91 | limit: 10000,
92 | name: 'media/[name]--[folder].[ext]'
93 | }
94 | },
95 | {
96 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
97 | use: {
98 | loader: 'url-loader',
99 | query: {
100 | limit: 10000,
101 | name: 'fonts/[name]--[folder].[ext]'
102 | }
103 | }
104 | }
105 | ]
106 | },
107 | node: {
108 | __dirname: process.env.NODE_ENV !== 'production',
109 | __filename: process.env.NODE_ENV !== 'production'
110 | },
111 | plugins: [
112 | new ExtractTextPlugin('styles.css'),
113 | new HtmlWebpackPlugin({
114 | filename: 'index.html',
115 | template: path.resolve(__dirname, '../src/index.ejs'),
116 | minify: {
117 | collapseWhitespace: true,
118 | removeAttributeQuotes: true,
119 | removeComments: true
120 | },
121 | nodeModules: process.env.NODE_ENV !== 'production'
122 | ? path.resolve(__dirname, '../node_modules')
123 | : false
124 | }),
125 | new webpack.HotModuleReplacementPlugin(),
126 | new webpack.NoEmitOnErrorsPlugin()
127 | ],
128 | output: {
129 | filename: '[name].js',
130 | libraryTarget: 'commonjs2',
131 | path: path.join(__dirname, '../dist/electron')
132 | },
133 | resolve: {
134 | alias: {
135 | '@': path.join(__dirname, '../src/renderer'),
136 | 'vue$': 'vue/dist/vue.esm.js'
137 | },
138 | extensions: ['.js', '.vue', '.json', '.css', '.node']
139 | },
140 | target: 'electron-renderer'
141 | }
142 |
143 | /**
144 | * Adjust rendererConfig for development settings
145 | */
146 | if (process.env.NODE_ENV !== 'production') {
147 | rendererConfig.plugins.push(
148 | new webpack.DefinePlugin({
149 | '__static': `"${path.join(__dirname, '../static').replace(/\\/g, '\\\\')}"`
150 | })
151 | )
152 | }
153 |
154 | /**
155 | * Adjust rendererConfig for production settings
156 | */
157 | if (process.env.NODE_ENV === 'production') {
158 | rendererConfig.devtool = ''
159 |
160 | rendererConfig.plugins.push(
161 | new BabiliWebpackPlugin(),
162 | new CopyWebpackPlugin([
163 | {
164 | from: path.join(__dirname, '../static'),
165 | to: path.join(__dirname, '../dist/electron/static'),
166 | ignore: ['.*']
167 | }
168 | ]),
169 | new webpack.DefinePlugin({
170 | 'process.env.NODE_ENV': '"production"'
171 | }),
172 | new webpack.LoaderOptionsPlugin({
173 | minimize: true
174 | })
175 | )
176 | }
177 |
178 | module.exports = rendererConfig
179 |
--------------------------------------------------------------------------------
/vue-calc/.electron-vue/webpack.web.config.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | process.env.BABEL_ENV = 'web'
4 |
5 | const path = require('path')
6 | const webpack = require('webpack')
7 |
8 | const BabiliWebpackPlugin = require('babili-webpack-plugin')
9 | const CopyWebpackPlugin = require('copy-webpack-plugin')
10 | const ExtractTextPlugin = require('extract-text-webpack-plugin')
11 | const HtmlWebpackPlugin = require('html-webpack-plugin')
12 |
13 | let webConfig = {
14 | devtool: '#cheap-module-eval-source-map',
15 | entry: {
16 | web: path.join(__dirname, '../src/renderer/main.js')
17 | },
18 | module: {
19 | rules: [
20 | {
21 | test: /\.(js|vue)$/,
22 | enforce: 'pre',
23 | exclude: /node_modules/,
24 | use: {
25 | loader: 'eslint-loader',
26 | options: {
27 | formatter: require('eslint-friendly-formatter')
28 | }
29 | }
30 | },
31 | {
32 | test: /\.css$/,
33 | use: ExtractTextPlugin.extract({
34 | fallback: 'style-loader',
35 | use: 'css-loader'
36 | })
37 | },
38 | {
39 | test: /\.html$/,
40 | use: 'vue-html-loader'
41 | },
42 | {
43 | test: /\.js$/,
44 | use: 'babel-loader',
45 | include: [ path.resolve(__dirname, '../src/renderer') ],
46 | exclude: /node_modules/
47 | },
48 | {
49 | test: /\.vue$/,
50 | use: {
51 | loader: 'vue-loader',
52 | options: {
53 | extractCSS: true,
54 | loaders: {
55 | sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax=1',
56 | scss: 'vue-style-loader!css-loader!sass-loader'
57 | }
58 | }
59 | }
60 | },
61 | {
62 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
63 | use: {
64 | loader: 'url-loader',
65 | query: {
66 | limit: 10000,
67 | name: 'imgs/[name].[ext]'
68 | }
69 | }
70 | },
71 | {
72 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
73 | use: {
74 | loader: 'url-loader',
75 | query: {
76 | limit: 10000,
77 | name: 'fonts/[name].[ext]'
78 | }
79 | }
80 | }
81 | ]
82 | },
83 | plugins: [
84 | new ExtractTextPlugin('styles.css'),
85 | new HtmlWebpackPlugin({
86 | filename: 'index.html',
87 | template: path.resolve(__dirname, '../src/index.ejs'),
88 | minify: {
89 | collapseWhitespace: true,
90 | removeAttributeQuotes: true,
91 | removeComments: true
92 | },
93 | nodeModules: false
94 | }),
95 | new webpack.DefinePlugin({
96 | 'process.env.IS_WEB': 'true'
97 | }),
98 | new webpack.HotModuleReplacementPlugin(),
99 | new webpack.NoEmitOnErrorsPlugin()
100 | ],
101 | output: {
102 | filename: '[name].js',
103 | path: path.join(__dirname, '../dist/web')
104 | },
105 | resolve: {
106 | alias: {
107 | '@': path.join(__dirname, '../src/renderer'),
108 | 'vue$': 'vue/dist/vue.esm.js'
109 | },
110 | extensions: ['.js', '.vue', '.json', '.css']
111 | },
112 | target: 'web'
113 | }
114 |
115 | /**
116 | * Adjust webConfig for production settings
117 | */
118 | if (process.env.NODE_ENV === 'production') {
119 | webConfig.devtool = ''
120 |
121 | webConfig.plugins.push(
122 | new BabiliWebpackPlugin(),
123 | new CopyWebpackPlugin([
124 | {
125 | from: path.join(__dirname, '../static'),
126 | to: path.join(__dirname, '../dist/web/static'),
127 | ignore: ['.*']
128 | }
129 | ]),
130 | new webpack.DefinePlugin({
131 | 'process.env.NODE_ENV': '"production"'
132 | }),
133 | new webpack.LoaderOptionsPlugin({
134 | minimize: true
135 | })
136 | )
137 | }
138 |
139 | module.exports = webConfig
140 |
--------------------------------------------------------------------------------
/vue-calc/.eslintignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/.eslintignore
--------------------------------------------------------------------------------
/vue-calc/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | parser: 'babel-eslint',
4 | parserOptions: {
5 | sourceType: 'module'
6 | },
7 | env: {
8 | browser: true,
9 | node: true
10 | },
11 | extends: 'standard',
12 | globals: {
13 | __static: true
14 | },
15 | plugins: [
16 | 'html'
17 | ],
18 | 'rules': {
19 | // allow paren-less arrow functions
20 | 'arrow-parens': 0,
21 | // allow async-await
22 | 'generator-star-spacing': 0,
23 | // allow debugger during development
24 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/vue-calc/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | dist/electron/*
3 | dist/web/*
4 | build/*
5 | !build/icons
6 | node_modules/
7 | npm-debug.log
8 | npm-debug.log.*
9 | thumbs.db
10 | !.gitkeep
11 |
--------------------------------------------------------------------------------
/vue-calc/.travis.yml:
--------------------------------------------------------------------------------
1 | osx_image: xcode8.3
2 | sudo: required
3 | dist: trusty
4 | language: c
5 | matrix:
6 | include:
7 | - os: osx
8 | - os: linux
9 | env: CC=clang CXX=clang++ npm_config_clang=1
10 | compiler: clang
11 | cache:
12 | directories:
13 | - node_modules
14 | - "$HOME/.electron"
15 | - "$HOME/.cache"
16 | addons:
17 | apt:
18 | packages:
19 | - libgnome-keyring-dev
20 | - icnsutils
21 | before_install:
22 | - mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v1.2.1/git-lfs-$([
23 | "$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-1.2.1.tar.gz
24 | | tar -xz -C /tmp/git-lfs --strip-components 1 && /tmp/git-lfs/git-lfs pull
25 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install --no-install-recommends -y icnsutils graphicsmagick xz-utils; fi
26 | install:
27 | - nvm install 7
28 | - curl -o- -L https://yarnpkg.com/install.sh | bash
29 | - source ~/.bashrc
30 | - npm install -g xvfb-maybe
31 | - yarn
32 | script:
33 | - yarn run build
34 | branches:
35 | only:
36 | - master
37 |
--------------------------------------------------------------------------------
/vue-calc/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Samuele de Tomasi
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/vue-calc/README.md:
--------------------------------------------------------------------------------
1 | # vue-calc
2 |
3 | > An electron-vue project
4 |
5 | #### Build Setup
6 |
7 | ``` bash
8 | # install dependencies
9 | npm install
10 |
11 | # serve with hot reload at localhost:9080
12 | npm run dev
13 |
14 | # build electron application for production
15 | npm run build
16 |
17 |
18 | # lint all JS/Vue component files in `src/`
19 | npm run lint
20 |
21 | ```
22 |
23 | ---
24 |
25 | This project was generated with [electron-vue](https://github.com/SimulatedGREG/electron-vue) using [vue-cli](https://github.com/vuejs/vue-cli). Documentation about the original structure can be found [here](https://simulatedgreg.gitbooks.io/electron-vue/content/index.html).
26 |
--------------------------------------------------------------------------------
/vue-calc/appveyor.yml:
--------------------------------------------------------------------------------
1 | version: 0.1.{build}
2 |
3 | branches:
4 | only:
5 | - master
6 |
7 | image: Visual Studio 2017
8 | platform:
9 | - x64
10 |
11 | cache:
12 | - node_modules
13 | - '%APPDATA%\npm-cache'
14 | - '%USERPROFILE%\.electron'
15 | - '%USERPROFILE%\AppData\Local\Yarn\cache'
16 |
17 | init:
18 | - git config --global core.autocrlf input
19 |
20 | install:
21 | - ps: Install-Product node 8 x64
22 | - choco install yarn --ignore-dependencies
23 | - git reset --hard HEAD
24 | - yarn
25 | - node --version
26 |
27 | build_script:
28 | - yarn build
29 |
30 | test: off
31 |
--------------------------------------------------------------------------------
/vue-calc/build/icons/1024x1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/build/icons/1024x1024.png
--------------------------------------------------------------------------------
/vue-calc/build/icons/128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/build/icons/128x128.png
--------------------------------------------------------------------------------
/vue-calc/build/icons/16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/build/icons/16x16.png
--------------------------------------------------------------------------------
/vue-calc/build/icons/24x24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/build/icons/24x24.png
--------------------------------------------------------------------------------
/vue-calc/build/icons/256x256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/build/icons/256x256.png
--------------------------------------------------------------------------------
/vue-calc/build/icons/32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/build/icons/32x32.png
--------------------------------------------------------------------------------
/vue-calc/build/icons/48x48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/build/icons/48x48.png
--------------------------------------------------------------------------------
/vue-calc/build/icons/512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/build/icons/512x512.png
--------------------------------------------------------------------------------
/vue-calc/build/icons/64x64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/build/icons/64x64.png
--------------------------------------------------------------------------------
/vue-calc/build/icons/96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/build/icons/96x96.png
--------------------------------------------------------------------------------
/vue-calc/build/icons/icon.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/build/icons/icon.icns
--------------------------------------------------------------------------------
/vue-calc/build/icons/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/build/icons/icon.ico
--------------------------------------------------------------------------------
/vue-calc/build/icons/icon.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
191 |
--------------------------------------------------------------------------------
/vue-calc/linkUtili.md:
--------------------------------------------------------------------------------
1 | - [electron-vue](https://github.com/SimulatedGREG/electron-vue)
2 | - [guida electron-vue](https://simulatedgreg.gitbooks.io/electron-vue/content/en/)
3 | - [Vuetify: Material Design
4 | Component Framework](https://vuetifyjs.com/en/)
5 | - [electron-vue + vuetify](https://github.com/vuetifyjs/electron)
6 |
--------------------------------------------------------------------------------
/vue-calc/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vue-calc",
3 | "version": "0.18.05.07",
4 | "author": "el3um4s ",
5 | "description": "A Simple VueJS's Calculator built with ElectronJS",
6 | "repository": "https://github.com/el3um4s/vue-calc",
7 | "license": "MIT",
8 | "main": "./dist/electron/main.js",
9 | "scripts": {
10 | "start": "node .electron-vue/dev-runner.js",
11 | "build": "node .electron-vue/build.js && electron-builder",
12 | "build:dir": "node .electron-vue/build.js && electron-builder --dir",
13 | "build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js",
14 | "build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js",
15 | "dist": "build",
16 | "dist:32win": "build --win --ia32 ",
17 | "dist:64win": "build --win --x64",
18 | "dist:32deb": "build --linux --ia32",
19 | "dist:64deb": "build --linux --x64",
20 | "dev": "node .electron-vue/dev-runner.js",
21 | "lint": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter src",
22 | "lint:fix": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter --fix src",
23 | "pack": "npm run pack:main && npm run pack:renderer",
24 | "pack:main": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js",
25 | "pack:renderer": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js",
26 | "postinstall": "npm run lint:fix"
27 | },
28 | "build": {
29 | "productName": "vue-calc",
30 | "appId": "com.stranianelli.vue-calc",
31 | "directories": {
32 | "output": "build"
33 | },
34 | "files": [
35 | "dist/electron/**/*"
36 | ],
37 | "dmg": {
38 | "contents": [
39 | {
40 | "x": 410,
41 | "y": 150,
42 | "type": "link",
43 | "path": "/Applications"
44 | },
45 | {
46 | "x": 130,
47 | "y": 150,
48 | "type": "file"
49 | }
50 | ]
51 | },
52 | "mac": {
53 | "icon": "build/icons/icon.icns"
54 | },
55 | "win": {
56 | "target": "portable",
57 | "icon": "build/icons/icon.ico"
58 | },
59 | "linux": {
60 | "icon": "build/icons"
61 | }
62 | },
63 | "dependencies": {
64 | "axios": "^0.21.1",
65 | "decimal.js": "^9.0.1",
66 | "electron-store": "^1.3.0",
67 | "mdi": "^2.2.43",
68 | "npm": "^6.14.6",
69 | "vue": "^2.5.16",
70 | "vue-electron": "^1.0.6",
71 | "vue-inter": "^3.0.0",
72 | "vue-router": "^2.5.3",
73 | "vue-shortkey": "^3.1.4",
74 | "vuetify": "1.0.0",
75 | "vuex": "^2.3.1"
76 | },
77 | "devDependencies": {
78 | "babel-core": "^6.26.3",
79 | "babel-eslint": "^7.2.3",
80 | "babel-loader": "^7.1.1",
81 | "babel-plugin-transform-runtime": "^6.23.0",
82 | "babel-preset-env": "^1.6.0",
83 | "babel-preset-stage-0": "^6.24.1",
84 | "babel-register": "^6.24.1",
85 | "babili-webpack-plugin": "^0.1.2",
86 | "cfonts": "^1.2.0",
87 | "chalk": "^2.4.1",
88 | "copy-webpack-plugin": "^4.5.1",
89 | "cross-env": "^5.1.4",
90 | "css-loader": "^0.28.11",
91 | "del": "^3.0.0",
92 | "devtron": "^1.4.0",
93 | "electron": "^1.8.6",
94 | "electron-builder": "^19.19.1",
95 | "electron-debug": "^1.4.0",
96 | "electron-devtools-installer": "^2.2.4",
97 | "eslint": "^4.19.1",
98 | "eslint-config-standard": "^10.2.1",
99 | "eslint-friendly-formatter": "^3.0.0",
100 | "eslint-loader": "^1.9.0",
101 | "eslint-plugin-html": "^3.1.1",
102 | "eslint-plugin-import": "^2.11.0",
103 | "eslint-plugin-node": "^5.1.1",
104 | "eslint-plugin-promise": "^3.7.0",
105 | "eslint-plugin-standard": "^3.1.0",
106 | "extract-text-webpack-plugin": "^3.0.0",
107 | "file-loader": "^0.11.2",
108 | "html-webpack-plugin": "^2.30.1",
109 | "multispinner": "^0.2.1",
110 | "node-loader": "^0.6.0",
111 | "style-loader": "^0.18.2",
112 | "stylus": "^0.54.5",
113 | "stylus-loader": "^3.0.1",
114 | "url-loader": "^0.5.9",
115 | "vue-html-loader": "^1.2.4",
116 | "vue-loader": "^13.0.5",
117 | "vue-style-loader": "^3.0.1",
118 | "vue-template-compiler": "^2.5.16",
119 | "webpack": "^3.5.2",
120 | "webpack-dev-server": "^3.1.11",
121 | "webpack-hot-middleware": "^2.22.1"
122 | }
123 | }
124 |
--------------------------------------------------------------------------------
/vue-calc/src/index.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Vue Calc
6 | <% if (htmlWebpackPlugin.options.nodeModules) { %>
7 |
8 |
11 | <% } %>
12 |
13 |
14 |
15 |
16 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/vue-calc/src/main/index.dev.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is used specifically and only for development. It installs
3 | * `electron-debug` & `vue-devtools`. There shouldn't be any need to
4 | * modify this file, but it can be used to extend your development
5 | * environment.
6 | */
7 |
8 | /* eslint-disable */
9 |
10 | // Set environment for development
11 | process.env.NODE_ENV = 'development'
12 |
13 | // Install `electron-debug` with `devtron`
14 | require('electron-debug')({ showDevTools: true })
15 |
16 | // Install `vue-devtools`
17 | require('electron').app.on('ready', () => {
18 | let installExtension = require('electron-devtools-installer')
19 | installExtension.default(installExtension.VUEJS_DEVTOOLS)
20 | .then(() => {})
21 | .catch(err => {
22 | console.log('Unable to install `vue-devtools`: \n', err)
23 | })
24 | })
25 |
26 | // Require `main` process to boot app
27 | require('./index')
28 |
--------------------------------------------------------------------------------
/vue-calc/src/main/index.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | import { app, BrowserWindow } from 'electron'
4 | // const path = require('path')
5 |
6 | const Impostazioni = require('electron-store')
7 | const impostazioni = new Impostazioni({
8 | defaults: {
9 | windowBounds: { width: 340, height: 550 },
10 | settings: { temaDark: true, formatNumber: 'zzz', decimalPlaces: 5, linguaApp: 'zzz' },
11 | sistema: { lang: 'zzz' }
12 | }
13 | })
14 |
15 | /**
16 | * Set `__static` path to static files in production
17 | * https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html
18 | */
19 | if (process.env.NODE_ENV !== 'development') {
20 | global.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\')
21 | }
22 |
23 | let mainWindow
24 | const winURL = process.env.NODE_ENV === 'development'
25 | ? `http://localhost:9080`
26 | : `file://${__dirname}/index.html`
27 |
28 | function createWindow () {
29 | /**
30 | * Initial window options
31 | */
32 | let { width, height } = impostazioni.get('windowBounds')
33 |
34 | mainWindow = new BrowserWindow({
35 | height: height,
36 | width: width,
37 | minHeight: 550,
38 | // useContentSize: true,
39 | minWidth: 340,
40 | // icon: path.join(__static, '64x64.png'),
41 | frame: false
42 | })
43 |
44 | mainWindow.loadURL(winURL)
45 |
46 | mainWindow.on('closed', () => {
47 | mainWindow = null
48 | })
49 |
50 | mainWindow.on('resize', () => {
51 | let { width, height } = mainWindow.getBounds()
52 | impostazioni.set('windowBounds', { width, height })
53 | })
54 | }
55 |
56 | app.on('ready', () => {
57 | const langLocale = app.getLocale()
58 | const linguaAppLocale = langLocale === 'it' | langLocale === 'it-IT' | langLocale === 'it-CH' ? 'Italiano' : 'English'
59 | if (impostazioni.get('settings.formatNumber') === 'zzz') { impostazioni.set('settings.formatNumber', langLocale) }
60 | if (impostazioni.get('settings.linguaApp') === 'zzz') { impostazioni.set('settings.linguaApp', linguaAppLocale) }
61 | if (impostazioni.get('sistema.lang') === 'zzz') { impostazioni.set('sistema.lang', langLocale) }
62 |
63 | createWindow()
64 | })
65 |
66 | app.on('window-all-closed', () => {
67 | if (process.platform !== 'darwin') {
68 | app.quit()
69 | }
70 | })
71 |
72 | app.on('activate', () => {
73 | if (mainWindow === null) {
74 | createWindow()
75 | }
76 | })
77 |
78 | /**
79 | * Auto Updater
80 | *
81 | * Uncomment the following code below and install `electron-updater` to
82 | * support auto updating. Code Signing with a valid certificate is required.
83 | * https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-electron-builder.html#auto-updating
84 | */
85 |
86 | // import { autoUpdater } from 'electron-updater'
87 |
88 | // autoUpdater.on('update-downloaded', () => {
89 | // autoUpdater.quitAndInstall()
90 | // })
91 | //
92 | // app.on('ready', () => {
93 | // if (process.env.NODE_ENV === 'production') autoUpdater.checkForUpdates()
94 | // })
95 |
--------------------------------------------------------------------------------
/vue-calc/src/renderer/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
55 |
56 |
65 |
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/.gitkeep
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/fonts/font-mina/Mina-Bold.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/fonts/font-mina/Mina-Bold.woff
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/fonts/font-mina/Mina-Regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/fonts/font-mina/Mina-Regular.woff
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/fonts/font-mina/fontMina.css:
--------------------------------------------------------------------------------
1 | /* bengali */
2 | @font-face {
3 | font-family: 'Mina';
4 | font-style: normal;
5 | font-weight: 400;
6 | src: local('Mina'), local('Mina-Regular'), url(Mina-Regular.woff) format('woff');
7 | unicode-range: U+0964-0965, U+0981-09FB, U+200C-200D, U+20B9, U+25CC;
8 | }
9 | /* latin-ext */
10 | @font-face {
11 | font-family: 'Mina';
12 | font-style: normal;
13 | font-weight: 400;
14 | src: local('Mina'), local('Mina-Regular'), url(Mina-Regular.woff) format('woff');
15 | unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
16 | }
17 | /* latin */
18 | @font-face {
19 | font-family: 'Mina';
20 | font-style: normal;
21 | font-weight: 400;
22 | src: local('Mina'), local('Mina-Regular'), url(Mina-Regular.woff) format('woff');
23 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
24 | }
25 | /* bengali */
26 | @font-face {
27 | font-family: 'Mina';
28 | font-style: normal;
29 | font-weight: 700;
30 | src: local('Mina Bold'), local('Mina-Bold'), url(Mina-Regular.woff) format('woff');
31 | unicode-range: U+0964-0965, U+0981-09FB, U+200C-200D, U+20B9, U+25CC;
32 | }
33 | /* latin-ext */
34 | @font-face {
35 | font-family: 'Mina';
36 | font-style: normal;
37 | font-weight: 700;
38 | src: local('Mina Bold'), local('Mina-Bold'), url(Mina-Bold.woff) format('woff');
39 | unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
40 | }
41 | /* latin */
42 | @font-face {
43 | font-family: 'Mina';
44 | font-style: normal;
45 | font-weight: 700;
46 | src: local('Mina Bold'), local('Mina-Bold'), url(Mina-Bold.woff) format('woff');
47 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
48 | }
49 |
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-Black.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-Black.woff
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-BlackItalic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-BlackItalic.woff
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-Bold.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-Bold.woff
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-BoldItalic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-BoldItalic.woff
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-Italic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-Italic.woff
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-Light.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-Light.woff
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-LightItalic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-LightItalic.woff
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-Medium.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-Medium.woff
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-MediumItalic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-MediumItalic.woff
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-Regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-Regular.woff
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-Thin.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-Thin.woff
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-ThinItalic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/fonts/font-roboto/Roboto-ThinItalic.woff
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/fonts/font-roboto/fontRoboto.css:
--------------------------------------------------------------------------------
1 | /* cyrillic-ext */
2 | @font-face {
3 | font-family: 'Roboto';
4 | font-style: normal;
5 | font-weight: 300;
6 | src: local('Roboto Light'), local('Roboto-Light'), url(Roboto-Light.woff) format('woff');
7 | unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
8 | }
9 | /* cyrillic */
10 | @font-face {
11 | font-family: 'Roboto';
12 | font-style: normal;
13 | font-weight: 300;
14 | src: local('Roboto Light'), local('Roboto-Light'), url(Roboto-Light.woff) format('woff');
15 | unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
16 | }
17 | /* greek-ext */
18 | @font-face {
19 | font-family: 'Roboto';
20 | font-style: normal;
21 | font-weight: 300;
22 | src: local('Roboto Light'), local('Roboto-Light'), url(Roboto-Light.woff) format('woff');
23 | unicode-range: U+1F00-1FFF;
24 | }
25 | /* greek */
26 | @font-face {
27 | font-family: 'Roboto';
28 | font-style: normal;
29 | font-weight: 300;
30 | src: local('Roboto Light'), local('Roboto-Light'), url(Roboto-Light.woff) format('woff');
31 | unicode-range: U+0370-03FF;
32 | }
33 | /* vietnamese */
34 | @font-face {
35 | font-family: 'Roboto';
36 | font-style: normal;
37 | font-weight: 300;
38 | src: local('Roboto Light'), local('Roboto-Light'), url(Roboto-Light.woff) format('woff');
39 | unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
40 | }
41 | /* latin-ext */
42 | @font-face {
43 | font-family: 'Roboto';
44 | font-style: normal;
45 | font-weight: 300;
46 | src: local('Roboto Light'), local('Roboto-Light'), url(Roboto-Light.woff) format('woff');
47 | unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
48 | }
49 | /* latin */
50 | @font-face {
51 | font-family: 'Roboto';
52 | font-style: normal;
53 | font-weight: 300;
54 | src: local('Roboto Light'), local('Roboto-Light'), url(Roboto-Light.woff) format('woff');
55 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
56 | }
57 | /* cyrillic-ext */
58 | @font-face {
59 | font-family: 'Roboto';
60 | font-style: normal;
61 | font-weight: 400;
62 | src: local('Roboto'), local('Roboto-Regular'), url(Roboto-Regular.woff) format('woff');
63 | unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
64 | }
65 | /* cyrillic */
66 | @font-face {
67 | font-family: 'Roboto';
68 | font-style: normal;
69 | font-weight: 400;
70 | src: local('Roboto'), local('Roboto-Regular'), url(Roboto-Regular.woff) format('woff');
71 | unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
72 | }
73 | /* greek-ext */
74 | @font-face {
75 | font-family: 'Roboto';
76 | font-style: normal;
77 | font-weight: 400;
78 | src: local('Roboto'), local('Roboto-Regular'), url(Roboto-Regular.woff) format('woff');
79 | unicode-range: U+1F00-1FFF;
80 | }
81 | /* greek */
82 | @font-face {
83 | font-family: 'Roboto';
84 | font-style: normal;
85 | font-weight: 400;
86 | src: local('Roboto'), local('Roboto-Regular'), url(Roboto-Regular.woff) format('woff');
87 | unicode-range: U+0370-03FF;
88 | }
89 | /* vietnamese */
90 | @font-face {
91 | font-family: 'Roboto';
92 | font-style: normal;
93 | font-weight: 400;
94 | src: local('Roboto'), local('Roboto-Regular'), url(Roboto-Regular.woff) format('woff');
95 | unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
96 | }
97 | /* latin-ext */
98 | @font-face {
99 | font-family: 'Roboto';
100 | font-style: normal;
101 | font-weight: 400;
102 | src: local('Roboto'), local('Roboto-Regular'), url(Roboto-Regular.woff) format('woff');
103 | unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
104 | }
105 | /* latin */
106 | @font-face {
107 | font-family: 'Roboto';
108 | font-style: normal;
109 | font-weight: 400;
110 | src: local('Roboto'), local('Roboto-Regular'), url(Roboto-Regular.woff) format('woff');
111 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
112 | }
113 | /* cyrillic-ext */
114 | @font-face {
115 | font-family: 'Roboto';
116 | font-style: normal;
117 | font-weight: 500;
118 | src: local('Roboto Medium'), local('Roboto-Medium'), url(Roboto-Medium.woff) format('woff');
119 | unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
120 | }
121 | /* cyrillic */
122 | @font-face {
123 | font-family: 'Roboto';
124 | font-style: normal;
125 | font-weight: 500;
126 | src: local('Roboto Medium'), local('Roboto-Medium'), url(Roboto-Medium.woff) format('woff');
127 | unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
128 | }
129 | /* greek-ext */
130 | @font-face {
131 | font-family: 'Roboto';
132 | font-style: normal;
133 | font-weight: 500;
134 | src: local('Roboto Medium'), local('Roboto-Medium'), url(Roboto-Medium.woff) format('woff');
135 | unicode-range: U+1F00-1FFF;
136 | }
137 | /* greek */
138 | @font-face {
139 | font-family: 'Roboto';
140 | font-style: normal;
141 | font-weight: 500;
142 | src: local('Roboto Medium'), local('Roboto-Medium'), url(Roboto-Medium.woff) format('woff');
143 | unicode-range: U+0370-03FF;
144 | }
145 | /* vietnamese */
146 | @font-face {
147 | font-family: 'Roboto';
148 | font-style: normal;
149 | font-weight: 500;
150 | src: local('Roboto Medium'), local('Roboto-Medium'), url(Roboto-Medium.woff) format('woff');
151 | unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
152 | }
153 | /* latin-ext */
154 | @font-face {
155 | font-family: 'Roboto';
156 | font-style: normal;
157 | font-weight: 500;
158 | src: local('Roboto Medium'), local('Roboto-Medium'), url(Roboto-Medium.woff) format('woff');
159 | unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
160 | }
161 | /* latin */
162 | @font-face {
163 | font-family: 'Roboto';
164 | font-style: normal;
165 | font-weight: 500;
166 | src: local('Roboto Medium'), local('Roboto-Medium'), url(Roboto-Medium.woff) format('woff');
167 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
168 | }
169 | /* cyrillic-ext */
170 | @font-face {
171 | font-family: 'Roboto';
172 | font-style: normal;
173 | font-weight: 700;
174 | src: local('Roboto Bold'), local('Roboto-Bold'), url(Roboto-Bold.woff) format('woff');
175 | unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
176 | }
177 | /* cyrillic */
178 | @font-face {
179 | font-family: 'Roboto';
180 | font-style: normal;
181 | font-weight: 700;
182 | src: local('Roboto Bold'), local('Roboto-Bold'), url(Roboto-Bold.woff) format('woff');
183 | unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
184 | }
185 | /* greek-ext */
186 | @font-face {
187 | font-family: 'Roboto';
188 | font-style: normal;
189 | font-weight: 700;
190 | src: local('Roboto Bold'), local('Roboto-Bold'), url(Roboto-Bold.woff) format('woff');
191 | unicode-range: U+1F00-1FFF;
192 | }
193 | /* greek */
194 | @font-face {
195 | font-family: 'Roboto';
196 | font-style: normal;
197 | font-weight: 700;
198 | src: local('Roboto Bold'), local('Roboto-Bold'), url(Roboto-Bold.woff) format('woff');
199 | unicode-range: U+0370-03FF;
200 | }
201 | /* vietnamese */
202 | @font-face {
203 | font-family: 'Roboto';
204 | font-style: normal;
205 | font-weight: 700;
206 | src: local('Roboto Bold'), local('Roboto-Bold'), url(Roboto-Bold.woff) format('woff');
207 | unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
208 | }
209 | /* latin-ext */
210 | @font-face {
211 | font-family: 'Roboto';
212 | font-style: normal;
213 | font-weight: 700;
214 | src: local('Roboto Bold'), local('Roboto-Bold'), url(Roboto-Bold.woff) format('woff');
215 | unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
216 | }
217 | /* latin */
218 | @font-face {
219 | font-family: 'Roboto';
220 | font-style: normal;
221 | font-weight: 700;
222 | src: local('Roboto Bold'), local('Roboto-Bold'), url(Roboto-Bold.woff) format('woff');
223 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
224 | }
225 |
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/fonts/icons-material-icons/materialIcons.css:
--------------------------------------------------------------------------------
1 | /* fallback */
2 | @font-face {
3 | font-family: 'Material Icons';
4 | font-style: normal;
5 | font-weight: 400;
6 | src: url(materialIcons.woff2) format('woff2');
7 | }
8 |
9 | .material-icons {
10 | font-family: 'Material Icons';
11 | font-weight: normal;
12 | font-style: normal;
13 | font-size: 24px;
14 | line-height: 1;
15 | letter-spacing: normal;
16 | text-transform: none;
17 | display: inline-block;
18 | white-space: nowrap;
19 | word-wrap: normal;
20 | direction: ltr;
21 | -webkit-font-feature-settings: 'liga';
22 | -webkit-font-smoothing: antialiased;
23 | }
24 |
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/fonts/icons-material-icons/materialIcons.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/fonts/icons-material-icons/materialIcons.woff2
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/icons/1024x1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/icons/1024x1024.png
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/icons/128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/icons/128x128.png
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/icons/16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/icons/16x16.png
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/icons/24x24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/icons/24x24.png
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/icons/256x256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/icons/256x256.png
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/icons/32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/icons/32x32.png
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/icons/48x48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/icons/48x48.png
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/icons/512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/icons/512x512.png
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/icons/64x64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/icons/64x64.png
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/icons/96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/icons/96x96.png
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/icons/icon.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/icons/icon.icns
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/icons/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/src/renderer/assets/icons/icon.ico
--------------------------------------------------------------------------------
/vue-calc/src/renderer/assets/icons/icon.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
191 |
--------------------------------------------------------------------------------
/vue-calc/src/renderer/components/CalcDisplay/CalcDisplayInputText.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{ getInputText }}
5 | {{ item }}
6 |
7 |
8 |
9 |
10 |
26 |
27 |
41 |
--------------------------------------------------------------------------------
/vue-calc/src/renderer/components/CalcDisplay/CalcDisplayOperazione.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
22 |
23 |
30 |
--------------------------------------------------------------------------------
/vue-calc/src/renderer/components/CalcDisplay/CalcDisplayResult.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{ getRisultato }}
5 |
6 |
7 |
8 |
19 |
20 |
31 |
--------------------------------------------------------------------------------
/vue-calc/src/renderer/components/CalcInput/CalcStandardInput.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{ riga.icon }}
9 | {{ riga.label }}
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
33 |
34 |
49 |
--------------------------------------------------------------------------------
/vue-calc/src/renderer/components/CalcStandardView.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
24 |
25 |
31 |
--------------------------------------------------------------------------------
/vue-calc/src/renderer/components/InfosView.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Vue Calc
6 |
7 | A Simple VueJS's Calculator
8 |
9 | Version {{ versionNumber }}
10 |
11 | License MIT © {{ new Date().getFullYear() }} - Samuele de Tomasi
12 |
13 |
14 |
15 |
16 | GitHub: el3um4s/vue-calc
17 |
18 |
19 |
20 |
21 | Created with:
22 |
23 |
Vue.js
24 | Vuetify
25 | Electron-vue
26 | decimal.js
27 | Google Font Roboto
28 | Google Font Mina
29 | vue-shortkey
30 | electron-store
31 |
32 |
33 |
34 |
35 |
36 | Icon: created by Arslan Şahìn
37 |
38 |
39 |
40 |
41 |
42 |
62 |
63 |
75 |
--------------------------------------------------------------------------------
/vue-calc/src/renderer/components/SettingsView.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
16 |
17 |
18 |
19 |
23 |
24 |
32 |
33 |
34 |
35 |
36 |
40 |
41 |
47 |
48 |
49 |
50 |
54 |
55 |
61 |
62 |
63 |
64 |
65 |
131 |
132 |
134 |
--------------------------------------------------------------------------------
/vue-calc/src/renderer/components/UIview/Footer.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | v.{{ versionNumber }}
4 |
5 | © {{ new Date().getFullYear() }}
6 |
7 |
8 |
9 |
22 |
23 |
25 |
--------------------------------------------------------------------------------
/vue-calc/src/renderer/components/UIview/ToolbarENavigation.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Vue Calc
6 |
7 |
8 | mdi-window-minimize
9 |
10 |
11 | mdi-window-close
12 |
13 |
14 |
15 |
16 |
17 | {{ item.header }}
18 |
19 |
20 |
21 | {{ item.icon }}
22 |
23 |
24 |
25 |
29 |
30 | {{ item.subtitle }}
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
83 |
84 |
100 |
--------------------------------------------------------------------------------
/vue-calc/src/renderer/local/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Inter from 'vue-inter'
3 |
4 | Vue.use(Inter)
5 |
6 | export default new Inter({
7 | locale: 'Italiano',
8 | messages: {
9 | English: {
10 | toolbar: {
11 | standard: 'Standard',
12 | impostazioni: 'Settings',
13 | informazioni: 'Info'
14 | },
15 | impostazioni: {
16 | formato: 'Format',
17 | posizioniDecimali: 'Decimal Places',
18 | tema: 'Theme',
19 | lingua: 'Language'
20 | }
21 | }
22 | }
23 | })
24 |
--------------------------------------------------------------------------------
/vue-calc/src/renderer/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import axios from 'axios'
3 | import Vuetify from 'vuetify'
4 |
5 | import 'vuetify/dist/vuetify.css'
6 | import 'mdi/css/materialdesignicons.min.css'
7 |
8 | import App from './App'
9 | import router from './router'
10 | import store from './store'
11 | import inter from './local' // per gestire le traduzioni
12 |
13 | Vue.use(Vuetify)
14 | Vue.use(require('vue-shortkey'))
15 |
16 | if (!process.env.IS_WEB) Vue.use(require('vue-electron'))
17 | Vue.http = Vue.prototype.$http = axios
18 | Vue.config.productionTip = false
19 |
20 | /* eslint-disable no-new */
21 | new Vue({
22 | inter,
23 | components: { App },
24 | router,
25 | store,
26 | template: ''
27 | }).$mount('#app')
28 |
--------------------------------------------------------------------------------
/vue-calc/src/renderer/router/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Router from 'vue-router'
3 |
4 | Vue.use(Router)
5 |
6 | export default new Router({
7 | routes: [
8 | {
9 | path: '/',
10 | redirect: '/simple'
11 | },
12 | {
13 | path: '/simple',
14 | name: 'simple',
15 | component: require('@/components/CalcStandardView').default
16 | },
17 | {
18 | path: '*',
19 | redirect: '/simple'
20 | },
21 | {
22 | path: '/settings',
23 | name: 'settings',
24 | component: require('@/components/SettingsView').default
25 | },
26 | {
27 | path: '/informazioni',
28 | name: 'informazioni',
29 | component: require('@/components/InfosView').default
30 | }
31 | ]
32 | })
33 |
--------------------------------------------------------------------------------
/vue-calc/src/renderer/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Vuex from 'vuex'
3 |
4 | import modules from './modules'
5 |
6 | Vue.use(Vuex)
7 |
8 | export default new Vuex.Store({
9 | modules,
10 | strict: process.env.NODE_ENV !== 'production'
11 | })
12 |
--------------------------------------------------------------------------------
/vue-calc/src/renderer/store/modules/calcInput.js:
--------------------------------------------------------------------------------
1 | const NUMBER = 'NUMBER'
2 | const OPERAZIONEBASE = 'OPERAZIONEBASE'
3 | const PUNTODECIMALE = 'PUNTODECIMALE'
4 | const TOGGLESEGNO = 'TOGGLESEGNO'
5 | const CLEAR = 'CLEAR'
6 | const EQUAL = 'EQUAL'
7 | const PERCENTUALE = 'PERCENTUALE'
8 | // const ELIMINAULTIMOCARATTERE = 'ELIMINAULTIMOCARATTERE'
9 | const ELIMINATUTTO = 'ELIMINATUTTO'
10 |
11 | class Btn {
12 | constructor (obj) {
13 | this.key = obj.key // per creare un id univoco nel DOM
14 | this.label = obj.label // il testo da mostrare nella tastiera della calcolatrice
15 | this.icon = obj.icon // l'eventuale iconda della tastiera
16 | this.value = obj.value // il valore assegnato al pulsante della tastiera
17 | if (obj.symbol) { // il testo/simbolo da usare nel display delle operazioni
18 | this.symbol = obj.symbol
19 | } else {
20 | this.symbol = obj.label
21 | }
22 | this.type = obj.type // il tipo di pulsante (number, operator, clear, equal, modificatore)
23 | this.conParteDecimale = false
24 | this.numeroNegativo = false
25 | this.shortkey = obj.shortkey
26 | }
27 | }
28 |
29 | const BTN_0 = new Btn({key: 'N0', label: '0', value: '0', type: NUMBER, shortkey: '0'})
30 | const BTN_1 = new Btn({key: 'N1', label: '1', value: '1', type: NUMBER, shortkey: '1'})
31 | const BTN_2 = new Btn({key: 'N2', label: '2', value: '2', type: NUMBER, shortkey: '2'})
32 | const BTN_3 = new Btn({key: 'N3', label: '3', value: '3', type: NUMBER, shortkey: '3'})
33 | const BTN_4 = new Btn({key: 'N4', label: '4', value: '4', type: NUMBER, shortkey: '4'})
34 | const BTN_5 = new Btn({key: 'N5', label: '5', value: '5', type: NUMBER, shortkey: '5'})
35 | const BTN_6 = new Btn({key: 'N6', label: '6', value: '6', type: NUMBER, shortkey: '6'})
36 | const BTN_7 = new Btn({key: 'N7', label: '7', value: '7', type: NUMBER, shortkey: '7'})
37 | const BTN_8 = new Btn({key: 'N8', label: '8', value: '8', type: NUMBER, shortkey: '8'})
38 | const BTN_9 = new Btn({key: 'N9', label: '9', value: '9', type: NUMBER, shortkey: '9'})
39 |
40 | const BTN_DIVIDE = new Btn({key: 'DIVIDE', label: '÷', icon: 'mdi-division', value: 'div', type: OPERAZIONEBASE, shortkey: '/'})
41 | const BTN_MOLT = new Btn({key: 'MOLT', label: '*', icon: 'mdi-multiplication', value: 'mul', type: OPERAZIONEBASE, shortkey: '*'})
42 | const BTN_MINUS = new Btn({key: 'MINUS', label: '-', value: 'sub', type: OPERAZIONEBASE, shortkey: '-'})
43 | const BTN_PLUS = new Btn({key: 'PLUS', label: '+', icon: 'mdi-plus', value: 'add', type: OPERAZIONEBASE, shortkey: '+'})
44 |
45 | const BTN_OP_PERC = new Btn({key: 'OP_PERC', label: '%', icon: 'mdi-percent', value: 'PERCENTUALE', type: PERCENTUALE, shortkey: '%'})
46 |
47 | const BTN_POINT = new Btn({key: 'POINT', label: '.', value: 'PUNTODECIMALE', type: PUNTODECIMALE, shortkey: '.'})
48 | const BTN_SIGN = new Btn({key: 'SIGN', label: '±', value: 'TOGGLESEGNO', type: TOGGLESEGNO, shortkey: 'tab'})
49 |
50 | const BTN_RESULT = new Btn({key: 'RESULT', label: '=', icon: 'mdi-equal', value: 'RISULTATO', type: EQUAL, shortkey: 'enter'})
51 |
52 | // const BTN_OP_C = new Btn({key: 'OP_C', label: 'C', value: 'CANCELLA', type: CLEAR})
53 | // const BTN_OP_DEL = new Btn({key: 'OP_DEL', label: '<-', icon: 'mdi-backspace', value: 'ELIMINAULTIMOCARATTERE', symbol: 'D', type: ELIMINAULTIMOCARATTERE})
54 | const BTN_OP_CE = new Btn({key: 'OP_CE', label: 'CE', value: 'ELIMINATUTTO', type: ELIMINATUTTO, shortkey: 'del'})
55 | const BTN_OP_DEL = new Btn({key: 'OP_DEL', label: '<-', icon: 'mdi-backspace', value: 'CANCELLA', symbol: 'D', type: CLEAR})
56 |
57 | const state = {
58 | calcStandard: [
59 | [BTN_OP_CE, BTN_OP_DEL, BTN_OP_PERC, BTN_DIVIDE],
60 | [BTN_7, BTN_8, BTN_9, BTN_MOLT],
61 | [BTN_4, BTN_5, BTN_6, BTN_MINUS],
62 | [BTN_1, BTN_2, BTN_3, BTN_PLUS],
63 | [BTN_SIGN, BTN_0, BTN_POINT, BTN_RESULT]
64 | ]
65 | }
66 |
67 | const getters = {
68 | listButtons (state) {
69 | return state.calcStandard
70 | }
71 | }
72 |
73 | export default {
74 | namespaced: true,
75 | state,
76 | getters
77 | }
78 |
--------------------------------------------------------------------------------
/vue-calc/src/renderer/store/modules/calculus.js:
--------------------------------------------------------------------------------
1 |
2 | import { Decimal } from 'decimal.js'
3 |
4 | const NUMBER = 'NUMBER'
5 | const OPERAZIONEBASE = 'OPERAZIONEBASE'
6 | const PUNTODECIMALE = 'PUNTODECIMALE'
7 | const TOGGLESEGNO = 'TOGGLESEGNO'
8 | const EQUAL = 'EQUAL'
9 | const PERCENTUALE = 'PERCENTUALE'
10 | const CLEAR = 'CLEAR'
11 | const ELIMINATUTTO = 'ELIMINATUTTO'
12 |
13 | function puntoDecimale () {
14 | const numIn = parseFloat(1 / 2)
15 | const strx = numIn.toLocaleString(state.formatNumber)
16 | return strx.substr(1, 1)
17 | }
18 |
19 | function aggiungiInputAInputDec (obj) {
20 | state.inputDec.push(obj)
21 | }
22 |
23 | function sostituisciUltimoInput (obj) {
24 | state.inputDec.pop()
25 | state.inputDec.push(obj)
26 | }
27 |
28 | function eliminaUltimoInput () {
29 | if (state.inputDec.length > 0) {
30 | state.inputDec.pop()
31 | }
32 | }
33 |
34 | function eliminatTutto () {
35 | state.inputDec = []
36 | state.listOperationDec = []
37 | }
38 |
39 | class Input {
40 | constructor (obj) {
41 | this.symbol = obj.symbol
42 | this.value = obj.value
43 | this.type = obj.type
44 | this.conParteDecimale = obj.conParteDecimale
45 | this.numeroNegativo = obj.numeroNegativo
46 | }
47 |
48 | isNumber (obj) {
49 | return this.type === NUMBER
50 | }
51 |
52 | isPuntoDecimale (obj) {
53 | return this.type === PUNTODECIMALE
54 | }
55 |
56 | isSegnoNegativo (obj) {
57 | return this.type === TOGGLESEGNO
58 | }
59 |
60 | isOperazioneBase (obj) {
61 | return this.type === OPERAZIONEBASE
62 | }
63 |
64 | isSegnoUguale (obj) {
65 | return this.type === EQUAL
66 | }
67 |
68 | isSegnoPercentuale (obj) {
69 | return this.type === PERCENTUALE
70 | }
71 |
72 | isEliminaUltimoInput (obj) {
73 | return this.type === CLEAR
74 | }
75 |
76 | isEliminaTutto (obj) {
77 | return this.type === ELIMINATUTTO
78 | }
79 |
80 | static unisciNumero (x, y) {
81 | const z = new Input({
82 | symbol: x.symbol + y.symbol,
83 | value: x.value + y.value,
84 | type: x.type,
85 | conParteDecimale: x.conParteDecimale,
86 | numeroNegativo: x.numeroNegativo
87 | })
88 | return z
89 | }
90 |
91 | static aggiungiPuntoDecimale (x) {
92 | const z = new Input({
93 | symbol: x.conParteDecimale ? x.symbol : x.symbol + puntoDecimale(),
94 | value: x.conParteDecimale ? x.value : x.value + '.',
95 | type: x.type,
96 | conParteDecimale: true,
97 | numeroNegativo: x.numeroNegativo
98 | })
99 | return z
100 | }
101 |
102 | static toogleSegnoNumero (x) {
103 | const z = new Input({
104 | symbol: x.numeroNegativo ? x.symbol.substring(1) : '-' + x.symbol,
105 | value: x.numeroNegativo ? x.value.substring(1) : '-' + x.value,
106 | type: x.type,
107 | conParteDecimale: x.conParteDecimale,
108 | numeroNegativo: !x.numeroNegativo
109 | })
110 | return z
111 | }
112 |
113 | static dividiPerCento (x) {
114 | // per dividere per cento sposto il punto decimale di due posizioni verso sinistra
115 | const {symbol, value, type, conParteDecimale, numeroNegativo} = x
116 | let numeroCifre = numeroNegativo ? value.length - 1 : value.length
117 | numeroCifre = conParteDecimale ? value.length - 1 : value.length
118 | let newValue = numeroNegativo ? value.substring(1) : value
119 | let newSymbol = numeroNegativo ? symbol.substring(1) : symbol
120 |
121 | // va gestito il caso di numero senza decimale
122 | let positionPuntoDecimale = value.lastIndexOf('.')
123 | newValue = newValue.substring(0, positionPuntoDecimale) + newValue.substring(positionPuntoDecimale + 1)
124 | newSymbol = newSymbol.substring(0, positionPuntoDecimale) + newSymbol.substring(positionPuntoDecimale + 1)
125 |
126 | // controlla quante cifre ci sono prima del punto decimale
127 | // se non c'è il punto decimale
128 | positionPuntoDecimale = positionPuntoDecimale === -1 ? numeroCifre : positionPuntoDecimale
129 |
130 | switch (positionPuntoDecimale) {
131 | case 1:
132 | newValue = '0.0' + newValue
133 | newSymbol = '0' + puntoDecimale() + '0' + newSymbol
134 | break
135 | case 2:
136 | newValue = '0.' + newValue
137 | newSymbol = '0' + puntoDecimale() + newSymbol
138 | break
139 | default:
140 | newValue = newValue.substring(0, positionPuntoDecimale - 2) + '.' + newValue.substring(positionPuntoDecimale - 2)
141 | newSymbol = newSymbol.substring(0, positionPuntoDecimale - 2) + puntoDecimale() + newSymbol.substring(positionPuntoDecimale - 2)
142 | }
143 |
144 | const z = new Input({
145 | symbol: numeroNegativo ? '-' + newSymbol : newSymbol,
146 | value: numeroNegativo ? '-' + newValue : newValue,
147 | type: type,
148 | conParteDecimale: true,
149 | numeroNegativo: numeroNegativo
150 | })
151 | return z
152 | }
153 |
154 | static restituisciNumeroDecimal (x, conParteDecimale = false, numeroNegativo = false) {
155 | const z = new Input({
156 | symbol: x.toString(),
157 | value: x.toString(),
158 | type: NUMBER,
159 | conParteDecimale: conParteDecimale,
160 | numeroNegativo: numeroNegativo
161 | })
162 | return z
163 | }
164 | }
165 |
166 | // FUNZIONE CHE CALCOLA IL RISULTATO DELL'OPERAZIONE
167 | function calcolaRisultato () {
168 | const listaInput = state.inputDec
169 | let decimal = new Decimal(0)
170 | // se non ci sono operazioni o numeri inseriti allora non occorre fare nulla
171 | if (listaInput.length === 0) return decimal
172 | // se invece ci sono operazioni o numeri inseriti allora inizio a fare i conti
173 | for (let i = 0; i < listaInput.length; i++) {
174 | if (i === 0 && listaInput[i].isNumber()) {
175 | decimal = new Decimal(listaInput[i].value)
176 | } else if (i < listaInput.length - 1) {
177 | if (listaInput[i].isOperazioneBase()) {
178 | decimal = decimal[listaInput[i].value](new Decimal(listaInput[i + 1].value))
179 | i += 1
180 | }
181 | }
182 | }
183 | return decimal
184 | }
185 | // FINE DELLA FUNZIONE CHE CALCOLA IL RISULTATO DELL'OPERAZIONE
186 |
187 | // trasforma il decimale con il risultato in una stringa con il numero nel formato
188 | // locale impostato in state.formatNumber e con tante cifre decimali quante impostate
189 | // su state.decimalPlaces
190 | function formatoRisultato (x) {
191 | if (x.isNaN()) {
192 | return 'NaN'
193 | }
194 | const y = x.truncated()
195 | const z = x.minus(y)
196 | if (x.equals(y)) {
197 | return y.toNumber().toLocaleString(state.formatNumber)
198 | } else {
199 | if (z > 0) {
200 | return y.toNumber().toLocaleString(state.formatNumber, {minimumFractionDigits: 0}) + puntoDecimale() + z.toString().substring(2, state.decimalPlaces + 2)
201 | } else {
202 | const parteIntera = y.toNumber().toLocaleString(state.formatNumber, {minimumFractionDigits: 0})
203 | const parteDecimale = z.toString().substring(3, state.decimalPlaces + 2)
204 | const segno = parteIntera === '0' ? '-' : ''
205 | return segno + parteIntera + puntoDecimale() + parteDecimale
206 | }
207 | }
208 | }
209 |
210 | function formatoInput (x) {
211 | const xTemp = new Decimal(x.value)
212 | const y = xTemp.truncated()
213 | const xStringParteIntera = y.toNumber().toLocaleString(state.formatNumber, {minimumFractionDigits: 0})
214 | // const xStringSegno = x.numeroNegativo ? '-' : ''
215 | const xStringParteDecimale = x.conParteDecimale ? puntoDecimale() + x.value.substring(x.value.lastIndexOf('.') + 1) : ''
216 | return xStringParteIntera + xStringParteDecimale
217 | // return xStringSegno + xStringParteIntera + xStringParteDecimale
218 | }
219 |
220 | // STATE (VUEX)
221 | const state = {
222 | formatNumber: 'it-IT',
223 | inputDec: [],
224 | resultDec: new Decimal(0), // il risultato dell'operazione
225 | inputText: '',
226 | listOperationDec: [],
227 | decimalPlaces: 5 // il numero di cifre mostrate dal display
228 | }
229 | // FINE STATE (VUEX)
230 |
231 | // GETTERS
232 | const getters = {
233 | getRisultatoDec () {
234 | return formatoRisultato(state.resultDec)
235 | },
236 | getInputTextDec () {
237 | const inputText = state.inputDec.map(function (item) {
238 | if (item.type === NUMBER) {
239 | // return item.symbol
240 | return formatoInput(item)
241 | }
242 | return item.symbol
243 | })
244 | return inputText.join(' ')
245 | },
246 | getListOperationDec () {
247 | return state.listOperationDec
248 | },
249 | getFormatoNumero () {
250 | return state.formatNumber
251 | },
252 | getPosizioniDecimali () {
253 | return state.decimalPlaces
254 | }
255 | }
256 | // FINE GETTERS
257 |
258 | const mutations = {
259 | cambiaFormatoNumero (state, payload) {
260 | state.formatNumber = payload
261 | },
262 | cambiaNumeroDecimali (state, payload) {
263 | state.decimalPlaces = Number(payload)
264 | },
265 | addInput (state, payload) {
266 | const datoNuovo = new Input(payload)
267 |
268 | // calcolo la lunghezza di state.inputDec per capire se è il primo
269 | // dato inserito o se ce ne sono altri prima
270 | // inoltre uso il numero per ricavarmi i valori già inseriti
271 | const indiceNuovoDato = state.inputDec.length
272 | const thereIsDatoPrecedente = indiceNuovoDato > 0
273 | const datoPrecedente = thereIsDatoPrecedente ? state.inputDec[indiceNuovoDato - 1] : 0
274 |
275 | // se non c'è nessun inserimento allora inserisci un nuovo valore in inputDec
276 | if (!thereIsDatoPrecedente) {
277 | // il nuovo dato è un numero: aggiungilo
278 | if (datoNuovo.isNumber()) {
279 | aggiungiInputAInputDec(datoNuovo)
280 | }
281 | // il nuovo dato è il punto decimale: aggiungi uno zero e imposta il punto decimale
282 | if (datoNuovo.isPuntoDecimale()) {
283 | const datoTemp = Input.aggiungiPuntoDecimale(Input.restituisciNumeroDecimal(0))
284 | aggiungiInputAInputDec(datoTemp)
285 | }
286 | } else { // se invece c'è un dato già inserito valuta il da farsi
287 | // se il datoPrecedente è un NUMBER
288 | if (datoPrecedente.isNumber()) {
289 | // se il nuovo dato è un numero, aggiungo la cifra al numero datoPrecedente
290 | if (datoNuovo.isNumber()) {
291 | const datoTemp = Input.unisciNumero(datoPrecedente, datoNuovo)
292 | sostituisciUltimoInput(datoTemp)
293 | }
294 | // se il nuovo dato è il punto decimale aggiungo la parte decimale
295 | if (datoNuovo.isPuntoDecimale()) {
296 | const datoTemp = Input.aggiungiPuntoDecimale(datoPrecedente)
297 | sostituisciUltimoInput(datoTemp)
298 | }
299 | // se il nuovo dato è un'operazione di base aggiungo un nuovo elemento a inputDec
300 | if (datoNuovo.isOperazioneBase()) {
301 | aggiungiInputAInputDec(datoNuovo)
302 | }
303 | // se il nuovo dato è il segno di ± allora inverto il segno del numero
304 | if (datoNuovo.isSegnoNegativo()) {
305 | const datoTemp = Input.toogleSegnoNumero(datoPrecedente)
306 | sostituisciUltimoInput(datoTemp)
307 | }
308 | // se il nuovo dato è il segno percenuale allora divido il numero per 100
309 | // e lo moltiplico per il numero inserito in precedenza
310 | if (datoNuovo.isSegnoPercentuale()) {
311 | if (indiceNuovoDato === 1) {
312 | const datoTemp = Input.dividiPerCento(datoPrecedente)
313 | sostituisciUltimoInput(datoTemp)
314 | } else {
315 | const datoPrecedenteX2 = state.inputDec[indiceNuovoDato - 3]
316 | const datoPrecedenteX2UnoPerCento = Input.dividiPerCento(datoPrecedenteX2)
317 | const datoPrecedenteX2UnoPerCentoDecimal = new Decimal(datoPrecedenteX2UnoPerCento.value)
318 | const datoPrecedenteDecimal = new Decimal(datoPrecedente.value)
319 | const datoTemp = datoPrecedenteDecimal.mul(datoPrecedenteX2UnoPerCentoDecimal)
320 | const datoTemp2 = Input.restituisciNumeroDecimal(datoTemp, true, datoPrecedenteX2.numeroNegativo)
321 | sostituisciUltimoInput(datoTemp2)
322 | }
323 | }
324 | }
325 | // se il datoPrecedente è un OPERAZIONEBASE
326 | if (datoPrecedente.isOperazioneBase()) {
327 | // se il nuovo dato è un numero aggiungo un nuovo elemento a inputDec
328 | if (datoNuovo.isNumber()) {
329 | aggiungiInputAInputDec(datoNuovo)
330 | }
331 | // se il nuovo dato è il punto decimale aggiungo un numero e poi aggiungo la parte decimale
332 | if (datoNuovo.isPuntoDecimale()) {
333 | const datoTemp = Input.aggiungiPuntoDecimale(Input.restituisciNumeroDecimal(0))
334 | aggiungiInputAInputDec(datoTemp)
335 | }
336 | // se il nuovo dato è una nuova operazione base allora sostituisco la precedente operazione base
337 | if (datoNuovo.isOperazioneBase()) {
338 | sostituisciUltimoInput(datoNuovo)
339 | }
340 | }
341 | }
342 |
343 | if (datoNuovo.isEliminaUltimoInput()) {
344 | eliminaUltimoInput()
345 | }
346 |
347 | if (datoNuovo.isEliminaTutto()) {
348 | eliminatTutto()
349 | }
350 |
351 | // CALOLA IL RISULTATO
352 | state.resultDec = calcolaRisultato()
353 |
354 | // se il nuovo dato è il segno = allora chiudi l'operazione
355 | if (datoNuovo.isSegnoUguale() && thereIsDatoPrecedente) {
356 | if (datoPrecedente.isOperazioneBase()) {
357 | eliminaUltimoInput()
358 | }
359 | aggiungiInputAInputDec(datoNuovo)
360 | state.listOperationDec.unshift(getters.getInputTextDec() + ' ' + formatoRisultato(state.resultDec))
361 | state.inputDec = []
362 | state.resultDec = calcolaRisultato()
363 | }
364 | }
365 | }
366 |
367 | export default {
368 | namespaced: true,
369 | state,
370 | getters,
371 | mutations
372 | }
373 |
--------------------------------------------------------------------------------
/vue-calc/src/renderer/store/modules/impostazioni.js:
--------------------------------------------------------------------------------
1 | const state = {
2 | dark: false,
3 | version: '0.18.04.15',
4 | linguaApp: 'English',
5 | linguaSistema: 'en'
6 | }
7 |
8 | const getters = {
9 | versionNumber (state) {
10 | return state.version
11 | },
12 | darkTheme (state) {
13 | return state.dark
14 | },
15 | linguaApp (state) {
16 | return state.linguaApp
17 | },
18 | linguaSistema (state) {
19 | return state.linguaSistema
20 | }
21 | }
22 |
23 | const mutations = {
24 | cambiaTema (state, payload) {
25 | state.dark = payload
26 | },
27 | cambiaLingua (state, payload) {
28 | state.linguaApp = payload
29 | },
30 | cambiaLinguaSistema (state, payload) {
31 | state.linguaSistema = payload
32 | }
33 | }
34 |
35 | export default {
36 | namespaced: true,
37 | state,
38 | getters,
39 | mutations
40 | }
41 |
--------------------------------------------------------------------------------
/vue-calc/src/renderer/store/modules/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * The file enables `@/store/index.js` to import all vuex modules
3 | * in a one-shot manner. There should not be any reason to edit this file.
4 | */
5 |
6 | const files = require.context('.', false, /\.js$/)
7 | const modules = {}
8 |
9 | files.keys().forEach(key => {
10 | if (key === './index.js') return
11 | modules[key.replace(/(\.\/|\.js)/g, '')] = files(key).default
12 | })
13 |
14 | export default modules
15 |
--------------------------------------------------------------------------------
/vue-calc/static/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/static/.gitkeep
--------------------------------------------------------------------------------
/vue-calc/static/1024x1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/static/1024x1024.png
--------------------------------------------------------------------------------
/vue-calc/static/128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/static/128x128.png
--------------------------------------------------------------------------------
/vue-calc/static/16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/static/16x16.png
--------------------------------------------------------------------------------
/vue-calc/static/24x24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/static/24x24.png
--------------------------------------------------------------------------------
/vue-calc/static/256x256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/static/256x256.png
--------------------------------------------------------------------------------
/vue-calc/static/32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/static/32x32.png
--------------------------------------------------------------------------------
/vue-calc/static/48x48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/static/48x48.png
--------------------------------------------------------------------------------
/vue-calc/static/512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/static/512x512.png
--------------------------------------------------------------------------------
/vue-calc/static/64x64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/static/64x64.png
--------------------------------------------------------------------------------
/vue-calc/static/96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/static/96x96.png
--------------------------------------------------------------------------------
/vue-calc/static/icon.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/static/icon.icns
--------------------------------------------------------------------------------
/vue-calc/static/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/el3um4s/vue-calc/5aaa75ad9372a1e86379b2732b8327b51acb1630/vue-calc/static/icon.ico
--------------------------------------------------------------------------------
/vue-calc/static/icon.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
191 |
--------------------------------------------------------------------------------