Compare commits

...

3 Commits

Author SHA1 Message Date
Sean McArde b9740f9239 fixed spacing issues and counter check edge case 2020-05-28 22:07:40 -07:00
Sean McArdle b844810d44 More tweaks. Trying to add cordova build. 2020-02-20 20:02:35 -08:00
Sean McArdle e5e72ca645 UI Tweaks 2020-02-19 00:29:37 -08:00
11 changed files with 1893 additions and 60 deletions

5
.gitignore vendored
View File

@ -11,3 +11,8 @@ yarn-error.log*
*.ntvs*
*.njsproj
*.sln
# Cordova
/src-cordova/platforms
/src-cordova/plugins
/public/cordova.js

View File

@ -1,14 +1,27 @@
{
"name": "vue-counter",
"version": "1.0.0",
"private": true,
"description": "Simple tally application.",
"author": "sean@mcardletech.com",
"private": true,
"scripts": {
"dev": "node build/dev-server.js",
"start": "node build/dev-server.js",
"build": "node build/build.js",
"lint": "eslint --ext .js,.vue src"
"lint": "eslint --ext .js,.vue src",
"cordova-build-android": "cross-env CORDOVA_PLATFORM=android vue-cli-service cordova-build-android",
"cordova-build-browser": "cross-env CORDOVA_PLATFORM=browser vue-cli-service cordova-build-browser",
"cordova-build-ios": "cross-env CORDOVA_PLATFORM=ios vue-cli-service cordova-build-ios",
"cordova-build-only-www-android": "cross-env CORDOVA_PLATFORM=android vue-cli-service cordova-build-only-www-android",
"cordova-build-only-www-browser": "cross-env CORDOVA_PLATFORM=browser vue-cli-service cordova-build-only-www-browser",
"cordova-build-only-www-ios": "cross-env CORDOVA_PLATFORM=ios vue-cli-service cordova-build-only-www-ios",
"cordova-build-only-www-osx": "cross-env CORDOVA_PLATFORM=osx vue-cli-service cordova-build-only-www-osx",
"cordova-build-osx": "cross-env CORDOVA_PLATFORM=osx vue-cli-service cordova-build-osx",
"cordova-prepare": "vue-cli-service cordova-prepare",
"cordova-serve-android": "cross-env CORDOVA_PLATFORM=android vue-cli-service cordova-serve-android",
"cordova-serve-browser": "cross-env CORDOVA_PLATFORM=browser vue-cli-service cordova-serve-browser",
"cordova-serve-ios": "cross-env CORDOVA_PLATFORM=ios vue-cli-service cordova-serve-ios",
"cordova-serve-osx": "cross-env CORDOVA_PLATFORM=osx vue-cli-service cordova-serve-osx",
"dev": "node build/dev-server.js",
"start": "node build/dev-server.js"
},
"dependencies": {
"vue": "^2.5.2",
@ -53,6 +66,7 @@
"sw-precache-webpack-plugin": "^0.11.4",
"uglify-es": "^3.1.3",
"url-loader": "^0.6.2",
"vue-cli-plugin-cordova": "~2.4.0",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.3",
"vue-template-compiler": "^2.5.2",
@ -62,13 +76,13 @@
"webpack-hot-middleware": "^2.19.1",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 4.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
],
"engines": {
"node": ">= 4.0.0",
"npm": ">= 3.0.0"
}
}

28
src-cordova/config.xml Normal file
View File

@ -0,0 +1,28 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.mcardle.count" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Rep Count</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="dev@cordova.apache.org" href="http://cordova.io">
Apache Cordova Team
</author>
<!-- this hook will point your config.xml to the DevServer on Serve -->
<hook type="after_prepare" src="../node_modules/vue-cli-plugin-cordova/serve-config-hook.js" />
<content src="index.html" />
<plugin name="cordova-plugin-whitelist" spec="1" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
</widget>

View File

@ -0,0 +1,23 @@
<!--
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
-->
# Cordova Hooks
Cordova Hooks represent special scripts which could be added by application and plugin developers or even by your own build system to customize cordova commands. See Hooks Guide for more details: http://cordova.apache.org/docs/en/edge/guide_appdev_hooks_index.md.html#Hooks%20Guide.

1186
src-cordova/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

31
src-cordova/package.json Normal file
View File

@ -0,0 +1,31 @@
{
"name": "com.mcardle.count",
"displayName": "Rep Count",
"version": "1.0.0",
"description": "A sample Apache Cordova application that responds to the deviceready event.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"ecosystem:cordova"
],
"author": "Apache Cordova Team",
"license": "Apache-2.0",
"dependencies": {
"cordova-browser": "^6.0.0",
"cordova-ios": "^5.1.1"
},
"devDependencies": {
"cordova-plugin-whitelist": "^1.3.4"
},
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {}
},
"platforms": [
"ios",
"browser"
]
}
}

3
src-cordova/www/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*
*/
!.gitignore

View File

@ -1,6 +1,6 @@
<template>
<div id="app">
<header>
<header id="header">
<span>Counter</span>
</header>
<main>
@ -16,9 +16,6 @@ export default {
</script>
<style>
body {
margin: 0;
}
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
@ -26,12 +23,14 @@ body {
-moz-osx-font-smoothing: grayscale;
height:100%;
width:100%;
margin: 0;
color: #2c3e50;
}
main {
text-align: center;
margin-top: 40px;
height: calc( 100% - 56px );
/* margin-top: 40px; */
}
header {
@ -53,7 +52,7 @@ header span {
padding-top: 16px;
}
html, body, main, counter {
html, body, counter {
margin: 0;
height: 100%;
}

View File

@ -2,7 +2,7 @@
<div class="counter">
<div class="count-top">
<label class="upper-label" for="limit" @click="reset">Limit</label>
<input class="upper-input" name="limit" type="number" v-model="countBound" placeholder="10"/>
<input class="upper-input" name="limit" type="number" pattern="[0-9]*" v-model="countBound" placeholder="10"/>
</div>
<div @click="bumpCount" :style="countStyle" class="count-bottom">
<div class="value">{{ countCurrent }}</div>
@ -35,6 +35,13 @@ export default {
this.countCurrent = this.countCurrent + 1
}
this.checkLimit()
},
reset () {
this.countCurrent = 0
this.limitReached = false
},
checkLimit () {
this.limitReached = (this.countCurrent >= this.countBound)
if (this.limitReached) {
@ -43,11 +50,10 @@ export default {
} else {
this.countStyle.backgroundColor = '#179e63'
}
},
reset () {
this.countCurrent = 0;
this.limitReached = false;
}
},
watch: {
countBound: function () { this.checkLimit() }
}
}
</script>
@ -56,35 +62,39 @@ export default {
<style>
.counter {
margin: 0;
width: 100%;
height: 100%;
margin: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
.count-top {
width:100%;
min-height:20%;
height: 2em;
font-size: 3em;
display: flex;
flex-direction: row;
justify-content: flex-start;
vertical-align: bottom;
}
.upper-label {
flex: 0 0 auto;
vertical-align: text-bottom;
vertical-align: middle;
align-self: flex-end;
margin-bottom: 0.55em;
margin: auto;
padding-right: 10px;
}
.upper-input {
font-size: 1em;
width: 3em;
width: 2em;
flex: 1 1 auto;
margin: 0.2em;
margin: auto;
vertical-align: text-bottom;
}
.count-bottom {
width:100%;
min-height:70%;
height:100%;
display: flex;
justify-content: center;
align-items: center;
@ -94,28 +104,12 @@ export default {
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
margin: auto;
}
.value {
font-family: -apple-system-tall-body, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
flex: 0 0 auto;
flex: auto;
font-size: 10em;
}
h1, h2 {
font-weight: normal;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #35495E;
}
</style>

6
vue.config.js Normal file
View File

@ -0,0 +1,6 @@
module.exports = {
publicPath: '',
pluginOptions: {
cordovaPath: 'src-cordova'
}
}

568
yarn.lock

File diff suppressed because it is too large Load Diff