1
0
Fork 0

Compare commits

..

No commits in common. "master" and "v2.0.1" have entirely different histories.

37 changed files with 149 additions and 682 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View file

@ -1,4 +1,3 @@
build/*.js
config/*.js
dist/*.js
src/tmp/*.js

2
.gitignore vendored
View file

@ -1,8 +1,6 @@
.DS_Store
src/tmp/
node_modules/
dist/
src/statics/spells.json
npm-debug.log
npm-debug.log.*
selenium-debug.log

24
LICENSE
View file

@ -1,24 +0,0 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org>

View file

@ -2,8 +2,6 @@
My Spells is an open source web-based application to elegantly view spells and save them to your local spellbook.
[![PlayStore](https://play.google.com/intl/en_us/badges/images/badge_new.png)](https://play.google.com/store/apps/details?id=io.cordova.myspells)
## License
Open Game License v1.0a Copyright 2000, Wizards of the Coast, Inc.
@ -23,16 +21,10 @@ App contains content from the SRD and is restricted and covered by the OGL. You
$ npm install
# serve with hot reload at localhost:8080
$ npm run dev_web
$ npm run dev
# build for production with minification
$ npm run build_web # or build_app
# build cordova (android, iOS potentially in future) release
$ npm run build_app_cordova
# sign apk with android studio or jarsigner
# install on device
$ adp install cordova/platforms/android/build/apk/<BUILT-FILE.apk>
$ npm run build
# lint code
$ npm run lint

View file

@ -1,53 +0,0 @@
'use strict'
const args = require('yargs').argv
const fs = require('fs')
const spells = require('../src/spells_original.json')
const hashCode = function (str) {
let hash = 0, i, chr
if (str.length === 0) return hash
for (i = 0; i < str.length; i++) {
chr = str.charCodeAt(i)
hash = ((hash << 5) - hash) + chr
hash |= 0
}
return hash
}
console.log('Processing spells...', args.web ? 'for web!' : 'for apps!')
let spellsWithIDs = spells.map(spell => {
spell.id = hashCode(spell.name).toString()
return spell
})
let indexedSpells = spellsWithIDs.map(spell => {
return {
id: spell.id,
name: spell.name,
classes: spell.classes,
level: spell.level.toLowerCase() === 'cantrip' ? 0 : parseInt(spell.level),
link: '/spell/' + spell.id,
}
})
let dirs = ['dist', 'dist/statics', 'src/tmp']
dirs.forEach(dir => {
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir)
}
})
fs.writeFileSync('./src/tmp/spells_index.js', `export default ${JSON.stringify(indexedSpells)};`)
if (args.web) {
fs.writeFileSync('./dist/statics/spells.json', JSON.stringify(spellsWithIDs));
fs.writeFileSync('./src/tmp/spells.js', `export default []; // Will fetch from web`)
}
else {
fs.writeFileSync('./src/tmp/spells.js', `export default ${JSON.stringify(spellsWithIDs)};`)
}
console.log('Processed spells')

View file

@ -2,5 +2,5 @@ var
shell = require('shelljs'),
path = require('path')
shell.rm('-rf', path.resolve(__dirname, '../dist ../src/tmp'))
shell.rm('-rf', path.resolve(__dirname, '../dist'))
console.log(' Cleaned build artifacts.\n')

View file

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>

View file

@ -1,3 +0,0 @@
<component name="CopyrightManager">
<settings default="" />
</component>

View file

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android" name="Android">
<configuration>
<option name="GEN_FOLDER_RELATIVE_PATH_APT" value="/../gen" />
<option name="GEN_FOLDER_RELATIVE_PATH_AIDL" value="/../gen" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/../../cordova/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/../../cordova/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/../../cordova/assets" />
<option name="LIBS_FOLDER_RELATIVE_PATH" value="/../../cordova/libs" />
<option name="PROGUARD_LOGS_FOLDER_RELATIVE_PATH" value="/../../cordova/proguard_logs" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" />
</content>
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

14
cordova/.idea/misc.xml generated
View file

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_3" default="false" assert-keyword="false" jdk-15="false" />
</project>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/cordova.iml" filepath="$PROJECT_DIR$/.idea/cordova.iml" />
</modules>
</component>
</project>

View file

@ -1,291 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="c5c4ced8-75d2-4b8c-a2ac-45d7a9743afa" name="Default" comment="" />
<ignored path="cordova.iws" />
<ignored path=".idea/workspace.xml" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FavoritesManager">
<favorites_list name="cordova" />
</component>
<component name="GenerateSignedApkSettings">
<option name="KEY_STORE_PATH" value="$USER_HOME$/android/keystore/sharpshark28-keystore.jks" />
<option name="KEY_ALIAS" value="key0" />
</component>
<component name="GradleLocalSettings">
<option name="externalProjectsViewState">
<projects_view />
</option>
</component>
<component name="ProjectFrameBounds">
<option name="y" value="23" />
<option name="width" value="1440" />
<option name="height" value="873" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectView">
<navigator currentView="AndroidView" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
<manualOrder />
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="PackagesPane" />
<pane id="Scope" />
<pane id="AndroidView">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="cordova" />
<option name="myItemType" value="com.android.tools.idea.navigator.nodes.AndroidViewProjectNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="ProjectPane" />
<pane id="Scratches" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="android.sdk.path" value="$USER_HOME$/Library/Android/sdk" />
<property name="settings.editor.selected.configurable" value="android.sdk-updates" />
<property name="settings.editor.splitter.proportion" value="0.2" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/platforms/android/build/outputs/apk/android-release-unsigned.apk" />
<property name="ExportedModule" value="cordova" />
<property name="ExportedApkPath" value="$PROJECT_DIR$/cordova.apk" />
<property name="AndroidRunProguardForReleaseBuild" value="false" />
<property name="project.structure.last.edited" value="Modules" />
<property name="project.structure.proportion" value="0.0" />
<property name="project.structure.side.proportion" value="0.0" />
</component>
<component name="RunManager">
<configuration default="true" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<method />
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method />
</configuration>
<configuration name="&lt;template&gt;" type="Applet" default="true" selected="false">
<option name="MAIN_CLASS_NAME" />
<option name="HTML_FILE_NAME" />
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<option name="VM_PARAMETERS" />
</configuration>
<configuration name="&lt;template&gt;" type="JUnit" default="true" selected="false">
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
</configuration>
<configuration name="&lt;template&gt;" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" default="true" selected="false">
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
</configuration>
</component>
<component name="ShelveChangesManager" show_recycled="false">
<option name="remove_strategy" value="false" />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="c5c4ced8-75d2-4b8c-a2ac-45d7a9743afa" name="Default" comment="" />
<created>1502571896668</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1502571896668</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="0" y="23" width="1440" height="873" extended-state="6" />
<editor active="false" />
<layout>
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Image Layers" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Build Variants" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Android Monitor" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Captures" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24964234" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24892704" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24964234" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Theme Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Android Model" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="Vcs.Log.UiProperties">
<option name="RECENTLY_FILTERED_USER_GROUPS">
<collection />
</option>
<option name="RECENTLY_FILTERED_BRANCH_GROUPS">
<collection />
</option>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
<watches-manager />
</component>
<component name="masterDetails">
<states>
<state key="ArtifactsStructureConfigurable.UI">
<settings>
<artifact-editor />
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="FacetStructureConfigurable.UI">
<settings>
<last-edited>Android</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="GlobalLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="JdkListConfigurable.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ModuleStructureConfigurable.UI">
<settings>
<last-edited>Android|cordova</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>

View file

@ -1,2 +0,0 @@
# OS X
.DS_Store

View file

@ -1,31 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.myspells" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>My Spells DnD5e</name>
<description>
My Spells is an open source web-based application to elegantly view spells and save them to your local spellbook.
</description>
<author email="joe@wroten.me" href="https://www.wroten.me/">
Joe Wroten
</author>
<content src="index.html" />
<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="android">
<icon density="ldpi" src="res/android/ldpi.png" />
<icon density="mdpi" src="res/android/mdpi.png" />
<icon density="hdpi" src="res/android/hdpi.png" />
<icon density="xhdpi" src="res/android/xhdpi.png" />
<icon density="xxhdpi" src="res/android/xxhdpi.png" />
<icon density="xxxhdpi" src="res/android/xxxhdpi.png" />
</platform>
<engine name="android" spec="^6.2.3" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.2" />
</widget>

View file

@ -1,23 +0,0 @@
<!--
#
# 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.

View file

@ -1,24 +0,0 @@
{
"name": "my_spells_app",
"displayName": "My Spells - Cordova",
"version": "1.0.0",
"description": "My Spells is an open source web-based application to elegantly view spells and save them to your local spellbook.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Joe Wroten <joe@wroten.me>",
"license": "ISC",
"dependencies": {
"cordova-android": "^6.2.3",
"cordova-plugin-whitelist": "^1.3.2"
},
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {}
},
"platforms": [
"android"
]
}
}

View file

@ -1,29 +0,0 @@
<!--
#
# 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.
#
-->
Note that these image resources are not copied into a project when a project
is created with the CLI. Although there are default image resources in a
newly-created project, those come from the platform-specific project template,
which can generally be found in the platform's `template` directory. Until
icon and splashscreen support is added to the CLI, these image resources
aren't used directly.
See https://issues.apache.org/jira/browse/CB-5145

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View file

@ -1 +0,0 @@
../dist

View file

@ -1,16 +1,13 @@
{
"name": "my_spells",
"version": "2.0.5",
"version": "2.0.1",
"description": "My Spells is an open source web-based application to elegantly view spells and save them to your local spellbook.",
"author": "Joe Wroten <joe@wroten.me>",
"license": "ISC",
"scripts": {
"clean": "node build/script.clean.js",
"dev_web": "node build/process_spells.js --web && node build/script.dev.js ",
"dev_app_cordova": "cd cordova && cordova run --device android",
"build_web": "node build/process_spells.js --web && node build/script.build.js",
"build_app": "node build/process_spells.js && node build/script.build.js",
"build_app_cordova": "cd cordova && cordova build --release",
"dev": "node build/script.dev.js",
"build": "node build/script.build.js",
"lint": "eslint --ext .js,.vue src"
},
"dependencies": {
@ -50,7 +47,6 @@
"extract-text-webpack-plugin": "^2.0.0-beta.4",
"file-loader": "^0.11.1",
"friendly-errors-webpack-plugin": "^1.1.3",
"fs": "0.0.1-security",
"html-webpack-plugin": "^2.8.1",
"http-proxy-middleware": "^0.17.0",
"json-loader": "^0.5.4",
@ -70,7 +66,6 @@
"webpack-dev-middleware": "^1.8.4",
"webpack-hot-middleware": "^2.17.0",
"webpack-merge": "^4.0.0",
"whatwg-fetch": "^2.0.3",
"yargs": "^8.0.2"
"whatwg-fetch": "^2.0.3"
}
}

View file

@ -25,7 +25,6 @@ import 'whatwg-fetch'
import { state, dispatch } from './store'
import Header from './components/Header'
import Footer from './components/Footer'
import bakedInSpells from './tmp/spells'
Vue.component('nav-header', Header)
Vue.component('nav-footer', Footer)
@ -51,18 +50,11 @@ function fetchFailure (reason) {
}
function fetchSpells () {
console.log('WOW DATA', bakedInSpells)
if (bakedInSpells.length) {
fetchSuccess(bakedInSpells)
Loading.hide()
}
else {
fetch('./statics/spells.json')
.then(response => response.json())
.then(fetchSuccess)
.catch(fetchFailure)
.then(() => { Loading.hide() })
}
fetch('./statics/dnd5e.json')
.then(response => response.json())
.then(fetchSuccess)
.catch(fetchFailure)
.then(() => { Loading.hide() })
}
export default {
@ -71,10 +63,14 @@ export default {
},
mounted () {
if (LocalStorage.has('chosen')) {
dispatch({type: 'LOAD_LOCAL_CHOSEN'})
dispatch({
type: 'LOAD_LOCAL_CHOSEN'
})
}
if (!this.state.spells.loaded) {
Loading.show()
fetchSpells()
}
}

View file

@ -24,13 +24,13 @@
>{{state.chosen.length}}</span>
</q-tab>
<q-tab
hidden
hidden="true"
route="/spell"
>
Spell
</q-tab>
<q-tab
hidden
hidden="true"
route="/about"
>
About
@ -52,6 +52,4 @@ export default {
<style scoped lang="stylus">
footer .q-tabs
width: 100%
.pointing-left:before
transform: translateX(-50%) translateY(-50%) rotate(225deg)
</style>

View file

@ -1,8 +1,8 @@
<template>
<main>
<spell-list
v-if="state.indexedSpells.length"
:spells="state.indexedSpells"
v-if="state.spells.data.length"
:spells="state.spells.data"
></spell-list>
<page-empty
v-else

View file

@ -8,7 +8,7 @@
v-else
title="You haven't chosen any spells"
>
Try <span class="text-pink"><i>bookmark</i> Bookmarking</span> spells from the
Try <i>bookmark</i> bookmarking spells from the
<router-link to="/">all spells page</router-link> to add to your spellbook.
</page-empty>
</main>
@ -34,8 +34,8 @@ export default {
}
return this.state.chosen.map(chosen => {
return this.state.indexedSpells.find(spell => {
return spell.id === chosen
return this.state.spells.data.find(spell => {
return spell.name === chosen
})
})
}

View file

@ -1,12 +1,21 @@
<template>
<div class="page-spell">
<button
v-go-back=" '/' "
<router-link
tag="button"
to="/"
class="page-back-small primary shadow-1"
>
<i>arrow_back</i>
Back
</button>
</router-link>
<router-link
tag="button"
to="/"
class="page-back-big primary circular big shadow-2"
>
<i>arrow_back</i>
</router-link>
<div class="card bg-white">
<div class="card-title bg-pink text-white">
@ -75,7 +84,6 @@
</template>
<script>
import { Loading } from 'quasar'
import { dispatch, state } from '../store'
import { capitalize } from '../utils'
import Marked from 'marked'
@ -85,21 +93,14 @@ export default {
return { state }
},
mounted () {
let scrollingPageElement = document.getElementsByClassName('layout-view')[0]
scrollingPageElement.scrollTop = 0
if (this.state.spells.loaded === false) {
Loading.show()
}
this.state.lastSpell = this.spell.id
state.lastSpell = this.state.spell.data.name
},
computed: {
checked () {
return this.state.chosen.indexOf(this.spell.id) >= 0
return this.state.chosen.indexOf(this.spell.name) >= 0
},
spell () {
return this.state.spells.data.find(spell => spell.id === this.$route.params.id)
return this.state.spells.data.find(spell => spell.name === this.$route.params.name)
},
level () {
return this.spell.level.toLowerCase() === 'cantrip' ? 'C' : this.spell.level
@ -125,7 +126,7 @@ export default {
type: 'CHANGE_CHOSEN',
data: {
want,
id: this.spell.id
name: this.spell.name
}
})
}
@ -163,4 +164,17 @@ export default {
.bookmark
font-size: 1.25em
line-height: 1em
@media screen and (min-height: 800px)
.card
position: relative
top: 50%
transform: translateY(-50%)
.page-back-big
display: block
position: absolute
top: 1rem
left: 1rem
z-index: 1
.page-back-small
display: none
</style>

View file

@ -1,30 +1,32 @@
<template>
<div v-bind:class="{'checked': checked}">
<div class="item-primary">
{{spell.level}}
{{level}}
</div>
<div class="item-content has-secondary">
<router-link :to="spell.link">
<span class="spell-link-alignment">
<span class="spell-name">
{{spell.name}}
</span>
<br />
<span class="spell-classes">
{{classes}}
</span>
</span>
</router-link>
<div class="item-content has-secondary" v-on:click="openSpell">
<div>
{{spell.name}}
</div>
<div>
{{classes}}
</div>
</div>
<div class="item-secondary" v-on:click="toggle">
<div class="item-secondary">
<i
class="float-left text-pink bookmark checked"
class="float-left text-pink"
v-if="checked"
v-on:click="checked = false"
>bookmark</i>
<i
class="float-left text-grey-7 bookmark"
class="float-left text-grey-5"
v-else
v-on:click="checked = true"
>bookmark_border</i>
<q-checkbox
class="float-right pink"
v-model="checked"
@input="toggle"
></q-checkbox>
</div>
</div>
</template>
@ -35,6 +37,9 @@ import { capitalize } from '../utils'
export default {
computed: {
level () {
return this.spell.level.toLowerCase() === 'cantrip' ? '0' : this.spell.level.charAt(0)
},
school () {
return capitalize(this.spell.school)
},
@ -42,7 +47,7 @@ export default {
return this.spell.classes.map(cla => capitalize(cla)).join(', ')
},
checked () {
return this.state.chosen.indexOf(this.spell.id) >= 0
return this.state.chosen.indexOf(this.spell.name) >= 0
}
},
data () {
@ -52,12 +57,15 @@ export default {
'spell'
],
methods: {
toggle () {
openSpell (event) {
this.$router.push('/spell/' + this.spell.name)
},
toggle (want) {
dispatch({
type: 'CHANGE_CHOSEN',
data: {
want: !this.checked,
id: this.spell.id
want,
name: this.spell.name
}
})
}
@ -66,33 +74,6 @@ export default {
</script>
<style scoped lang="stylus">
.spell-classes
color: rgba(0, 0, 0, .54)
.item.two-lines > .item-content
height: 100%
padding: 0
a
color: black
display: table
height: 100%
width: 100%
.spell-link-alignment
display: table-cell
vertical-align: middle
.item-secondary
width: 50px
height: 50px
margin: 0
padding: 12px
.bookmark
transition: transform .25s ease
&:hover,
&:target
.bookmark
transform: scale(1.5)
.bookmark:not(.checked)
color: yellow !important
&:active
.bookmark:not(.checked)
color: deeppink !important
</style>

View file

@ -1,25 +1,26 @@
<template>
<div class="spell-list-container">
<nav-filter></nav-filter>
<section
class="spell-list list striped no-border"
id="spell_list"
>
<section class="spell-list list striped no-border" id="spell_list">
<label
is="spell-item"
class="item two-lines item-link"
v-for="spell in filteredSpells"
:key="spell.id"
:ref="spell.id"
v-for="spell in pagedSpells"
:spell="spell"
>
</label>
<q-pagination
class="text-center"
v-model="state.page"
:max="numPages"
></q-pagination>
</section>
</div>
</template>
<script>
import Vue from 'vue'
import { Utils } from 'quasar'
import Query from 'json-query-chain'
import Filter from './Filter'
import SpellItem from './Spellitem'
@ -30,23 +31,43 @@ Vue.component('spell-item', SpellItem)
export default {
data () {
return { state }
return {
state,
perPage: 0
}
},
props: [ 'spells' ],
props: [
'spells'
],
mounted () {
if (this.state.lastSpell) {
let lastSpellPosition = this.$refs[this.state.lastSpell][0].$el.offsetTop
let scrollingPageElement = document.getElementsByClassName('layout-view')[0]
scrollingPageElement.scrollTop = lastSpellPosition
this.$nextTick(() => {
window.addEventListener('resize', this.newPerPage)
})
this.calculateNewPage()
},
methods: {
newPerPage: Utils.debounce(function () {
this.calculateNewPage()
}, 100),
calculateNewPage () {
let fontSize = 14
this.perPage = Math.floor(window.innerHeight / (fontSize * 5)) - 4
}
},
computed: {
numPages () {
return Math.ceil(this.filteredSpells.length / this.perPage)
},
filteredSpells () {
let spells = this.spells
return new Query(spells)
return new Query(this.spells)
.search('name', this.state.search)
.sort(this.state.sortBy)
.results
},
pagedSpells () {
return new Query(this.filteredSpells)
.paginate(this.state.page, this.perPage)
.results
}
}
}

View file

@ -23,7 +23,7 @@ export default new VueRouter({
routes: [
{ path: '/', component: load('Index') }, // Default
{ path: '/my', component: load('Myspells') },
{ path: '/spell/:id', component: load('Spell') },
{ path: '/spell/:name', component: load('Spell') },
{ path: '/about', component: load('About') },
{ path: '*', component: load('Error404') } // Not found
]

View file

@ -6178,7 +6178,7 @@
"description": "Objects come to life at your command. Choose up to ten nonmagical objects within range that are not being worn or carried. Medium targets count as two objects, Large targets count as four objects, Huge targets count as eight objects. You can't animate any object larger than Huge. Each target animates and becomes a creature under your control until the spell ends or until reduced to 0 hit points.\n\nAs a bonus action, you can mentally command any creature you made with this spell if the creature is within 500 feet of you (if you control multiple creatures, you can command any or all of them at the same time, issuing the same command to each one). You decide what action the creature will take and where it will move during its next turn, or you can issue a general command, such as to guard a particular chamber or corridor. If you issue no commands, the creature only defends itself against hostile creatures. Once given an order, the creature continues to follow it until its task is complete.\n\n| Size | HP | AC | Attack | Str | Dex |\n\n| Tiny | 20 | 18 | +8 to hit, 1d4+4 damage | 4 | 18 |\n\n| Small | 25 | 16 | +6 to hit, 1d8+2 damage | 6 | 14 |\n\n| Medium | 40 | 13 | +5 to hit, 2d6+1 damage | 10 | 12 |\n\n| Large | 50 | 10 | +6 to hit, 2d10+2 damage | 14 | 10 |\n\n| Huge | 80 | 10 | +8 to hit, 2d12+2 damage | 18 | 6 |\n\nAn animated object is a construct with AC, hit points, attacks, Strength, and Dexterity determined by its size. Its Constitution is 10 and its Intelligence and Wisdom are 3, and its Charisma is 1. Its speed is 30 feet; if the object lacks legs or other appendages it can use for locomotion, it instead has a flying speed of 30 feet and can hover. If the object is securely attached to a surface or a larger object, such as a chain bolted to a wall, its speed is 0. It has blindsight with a radius of 30 feet and is blind beyond that distance. When the animated object drops to 0 hit points, it reverts to its original object form, and any remaining damage carries over to its original object form.\n\nIf you command an object to attack, it can make a single melee attack against a creature within 5 feet of it. It makes a slam attack with an attack bonus and bludgeoning damage determined by its size. The DM might rule that a specific object inflicts slashing or piercing damage based on its form.",
"duration": "Concentration, up to 1 minute",
"higher_levels": "If you cast this spell using a spell slot of 6th level or higher, you can animate two additional objects for each slot level above 5th.",
"level": "5",
"level": "animated",
"name": "Animate Objects",
"range": "120 feet",
"ritual": false,
@ -6202,7 +6202,7 @@
"somatic": true,
"verbal": true
},
"description": "A shimmering barrier extends out from you in a 10-foot radius and moves with you, remaining centered on you and hedging out creatures other than undead and constructs. The barrier lasts for the duration.\n\nThe barrier prevents an affected creature from passing or reaching through. An affected creature can cast spells or make attacks with ranged or reach weapons through the barrier.\n\nIf you move so an affected creature is forced to pass through the barrier, the spell ends.",
"description": "A shimmering barrier extends out from you in a 10-foot-radius and moves with you, remaining centered on you and hedging out creatures other than undead and constructs. The barrier lasts for the duration.\n\nThe barrier prevents an affected creature from passing or reaching through. An affected creature can cast spells or make attacks with ranged or reach weapons through the barrier.\n\nIf you move so an affected creature is forced to pass through the barrier, the spell ends.",
"duration": "Concentration, up to 1 hour",
"level": "5",
"name": "Antilife Shell",
@ -6211,7 +6211,7 @@
"school": "abjuration",
"tags": [
"druid",
"level5"
"level6"
],
"type": "5th-level abjuration"
},
@ -6243,6 +6243,30 @@
],
"type": "6th-level conjuration"
},
{
"casting_time": "1 action",
"classes": [
"druid"
],
"components": {
"material": false,
"raw": "V, S",
"somatic": true,
"verbal": true
},
"description": "A shimmering barrier extends out from you in a 10-foot radius and moves with you, remaining centered on you and hedging out creatures other than undead and constructs. The barrier lasts for the duration.\n\nThe barrier prevents an affected creature from passing or reaching through. An affected creature can cast spells or make attacks with ranged or reach weapons through the barrier.\n\nIf you move so that an affected creature is forced to pass through the barrier, the spell ends.",
"duration": "Concentration, up to 1 hour",
"level": "5",
"name": "Antilife Shell",
"range": "Self (10-foot radius)",
"ritual": false,
"school": "abjuration",
"tags": [
"druid",
"level5"
],
"type": "5th-level abjuration"
},
{
"casting_time": "8 hours",
"classes": [

View file

@ -1,8 +1,6 @@
import { LocalStorage } from 'quasar'
import indexedSpells from './tmp/spells_index'
export let state = {
indexedSpells,
spells: {
loaded: false,
data: []
@ -11,7 +9,7 @@ export let state = {
search: '',
sortBy: 'name',
previousSortBy: 'name',
lastSpell: ''
page: 1
}
export function dispatch (action) {
@ -28,10 +26,10 @@ export function dispatch (action) {
break
case 'CHANGE_CHOSEN':
if (action.data.want) {
state.chosen.push(action.data.id)
state.chosen.push(action.data.name)
}
else {
let index = state.chosen.indexOf(action.data.id)
let index = state.chosen.indexOf(action.data.name)
if (index >= 0) state.chosen.splice(index, 1)
}

View file

@ -1 +1 @@
export const capitalize = str => str.charAt(0).toUpperCase() + str.slice(1)
export let capitalize = str => str.charAt(0).toUpperCase() + str.slice(1)