+ Added structure and spell-card component
This commit is contained in:
20
.gitignore
vendored
20
.gitignore
vendored
@@ -1 +1,21 @@
|
|||||||
|
.DS_Store
|
||||||
node_modules
|
node_modules
|
||||||
|
/dist
|
||||||
|
|
||||||
|
# local env files
|
||||||
|
.env.local
|
||||||
|
.env.*.local
|
||||||
|
|
||||||
|
# Log files
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw?
|
||||||
|
|||||||
5
babel.config.js
Normal file
5
babel.config.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
module.exports = {
|
||||||
|
presets: [
|
||||||
|
'@vue/cli-plugin-babel/preset'
|
||||||
|
],
|
||||||
|
}
|
||||||
12554
package-lock.json
generated
Normal file
12554
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
62
package.json
Normal file
62
package.json
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
{
|
||||||
|
"name": "spellsaurus",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "A dictionnary of arcane spells from a homebrew tabletop RPG.",
|
||||||
|
"keywords": [
|
||||||
|
"rpg",
|
||||||
|
"dev",
|
||||||
|
"spells",
|
||||||
|
"roleplay",
|
||||||
|
"website",
|
||||||
|
"database"
|
||||||
|
],
|
||||||
|
"author": "AlexisNP",
|
||||||
|
"license": "ISC",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/AlexisNP/spellsaurus/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/AlexisNP/spellsaurus#readme",
|
||||||
|
"private": true,
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/AlexisNP/spellsaurus.git"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"serve": "vue-cli-service serve",
|
||||||
|
"build": "vue-cli-service build",
|
||||||
|
"lint": "vue-cli-service lint"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"core-js": "^3.6.4",
|
||||||
|
"vue": "^2.6.11"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@vue/cli-plugin-babel": "~4.2.0",
|
||||||
|
"@vue/cli-plugin-eslint": "~4.2.0",
|
||||||
|
"@vue/cli-service": "~4.2.0",
|
||||||
|
"babel-eslint": "^10.0.3",
|
||||||
|
"eslint": "^6.7.2",
|
||||||
|
"eslint-plugin-vue": "^6.1.2",
|
||||||
|
"node-sass": "^4.13.1",
|
||||||
|
"sass-loader": "^8.0.2",
|
||||||
|
"vue-template-compiler": "^2.6.11"
|
||||||
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"root": true,
|
||||||
|
"env": {
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"extends": [
|
||||||
|
"plugin:vue/essential",
|
||||||
|
"eslint:recommended"
|
||||||
|
],
|
||||||
|
"parserOptions": {
|
||||||
|
"parser": "babel-eslint"
|
||||||
|
},
|
||||||
|
"rules": {}
|
||||||
|
},
|
||||||
|
"browserslist": [
|
||||||
|
"> 1%",
|
||||||
|
"last 2 versions"
|
||||||
|
]
|
||||||
|
}
|
||||||
BIN
public/favicon.ico
Normal file
BIN
public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
17
public/index.html
Normal file
17
public/index.html
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
|
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||||
|
<title>Spellsaurus</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<noscript>
|
||||||
|
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||||
|
</noscript>
|
||||||
|
<div id="app"></div>
|
||||||
|
<!-- built files will be auto injected -->
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
38
src/app.vue
Normal file
38
src/app.vue
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<template>
|
||||||
|
<div id="app">
|
||||||
|
|
||||||
|
<spellcard
|
||||||
|
v-bind:name="'Soleil Pourri'"
|
||||||
|
v-bind:description="[`Le lanceur projette un petit astre vert jusqu’à 20m autour de lui. L’astre brûle l’air environnant, nécrosant rapidement les formes de vies dans un rayon de 100m.`, `Toutes les créatures dans la portée de l’astre (sauf le lanceur) doivent réussir un jet de CON avec un malus de -30. Si elles échouent, elles subissent 3D20 dégâts radiants et 2D20 dégâts nécrotiques. Elles perdent également 1D10 PV max.`]"
|
||||||
|
v-bind:schools="['Lumomancie', 'Nécromancie']"
|
||||||
|
v-bind:level="'30'"
|
||||||
|
v-bind:charge="'2'"
|
||||||
|
v-bind:ingredients="[`Volonté`, `Geste`]"
|
||||||
|
v-bind:cost="'-90'"
|
||||||
|
v-bind:variables="[{name: 'x', description: 'lol'}]"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import spellcard from './components/spell-card.vue'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'app',
|
||||||
|
components: {
|
||||||
|
spellcard
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
|
||||||
|
#app {
|
||||||
|
font-family: Avenir, Helvetica, Arial, sans-serif;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
margin-top: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
BIN
src/assets/images/logo.png
Normal file
BIN
src/assets/images/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
0
src/assets/scss/_fonts.scss
Normal file
0
src/assets/scss/_fonts.scss
Normal file
46
src/assets/scss/_global.scss
Normal file
46
src/assets/scss/_global.scss
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
@import '_variables';
|
||||||
|
@import '_mixins';
|
||||||
|
@import '_fonts';
|
||||||
|
|
||||||
|
// RESETS
|
||||||
|
html {
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: $font-size-root;
|
||||||
|
-ms-overflow-style: scrollbar;
|
||||||
|
height: 100%;
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
|
line-height: 1.15;
|
||||||
|
color: $dark-gray;
|
||||||
|
-ms-text-size-adjust: 100%;
|
||||||
|
-webkit-text-size-adjust: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
html *,
|
||||||
|
html *::before,
|
||||||
|
html *::after {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@at-root {
|
||||||
|
@-ms-viewport { width: device-width; }
|
||||||
|
}
|
||||||
|
|
||||||
|
var {
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
// BUTTONS
|
||||||
|
|
||||||
|
// MISC.
|
||||||
|
hr {
|
||||||
|
border: none;
|
||||||
|
border-top-style: solid;
|
||||||
|
border-top-width: 1px;
|
||||||
|
border-top-color: rgba($black, .25);
|
||||||
|
}
|
||||||
0
src/assets/scss/_mixins.scss
Normal file
0
src/assets/scss/_mixins.scss
Normal file
16
src/assets/scss/_variables.scss
Normal file
16
src/assets/scss/_variables.scss
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
// COLOURS
|
||||||
|
$white: #FFF;
|
||||||
|
$black: #000;
|
||||||
|
|
||||||
|
$dark-gray: #222;
|
||||||
|
|
||||||
|
$dark-blue: #2c3e50;
|
||||||
|
$card-border-inner: #f5ebd8;
|
||||||
|
|
||||||
|
// FONT FAMILY
|
||||||
|
$font-family: 'Overpass', sans-serif;
|
||||||
|
|
||||||
|
$font-size-root: 15px !default;
|
||||||
|
$font-size-base: 1.2rem !default;
|
||||||
|
$line-height-base: 1.3 !default;
|
||||||
198
src/components/spell-card.vue
Normal file
198
src/components/spell-card.vue
Normal file
@@ -0,0 +1,198 @@
|
|||||||
|
<template>
|
||||||
|
<article class="spell-card">
|
||||||
|
<div class="content">
|
||||||
|
<header>
|
||||||
|
<h3>{{ name }}</h3>
|
||||||
|
</header>
|
||||||
|
<section class="casting-header">
|
||||||
|
<div class="casting-infos">
|
||||||
|
<div class="type">
|
||||||
|
<div class="level">
|
||||||
|
<div class="label">
|
||||||
|
<span>LV.</span>
|
||||||
|
<br>
|
||||||
|
<span>MIN</span>
|
||||||
|
</div>
|
||||||
|
<var>{{ level }}</var>
|
||||||
|
</div>
|
||||||
|
<ul class="schools">
|
||||||
|
<li v-for="school of schools" :key="school">
|
||||||
|
{{ school }}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="cost">
|
||||||
|
<span class="label">Malus</span>
|
||||||
|
<var>{{ cost }}</var>
|
||||||
|
</div>
|
||||||
|
<div class="charge">
|
||||||
|
<span class="label">Charge</span>
|
||||||
|
<var>{{ charge }}</var>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="casting-ingredients">
|
||||||
|
<p class="title">Nécessite</p>
|
||||||
|
<p class="content">
|
||||||
|
<span v-for="ingredient of ingredients" :key="ingredient">
|
||||||
|
<span>{{ ingredient }} </span>
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<hr>
|
||||||
|
<section class="spell-description">
|
||||||
|
<p v-for="line of description" :key="line">
|
||||||
|
{{ line }}
|
||||||
|
</p>
|
||||||
|
</section>
|
||||||
|
<hr>
|
||||||
|
<footer v-if="variables">
|
||||||
|
<div class="label">Variables</div>
|
||||||
|
<div class="variables">
|
||||||
|
<div v-for="variable in variables" :key="variable" class="xyz">
|
||||||
|
<span>{{ variable.name }}</span>
|
||||||
|
<var>{{ variable.description }}</var>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "spell-card",
|
||||||
|
props: {
|
||||||
|
name: String,
|
||||||
|
description: Array,
|
||||||
|
level: String,
|
||||||
|
schools: Array,
|
||||||
|
ingredients: Array,
|
||||||
|
charge: String,
|
||||||
|
cost: String,
|
||||||
|
variables: Array,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
|
||||||
|
|
||||||
|
.spell-card {
|
||||||
|
max-width: 35rem;
|
||||||
|
padding: .5rem;
|
||||||
|
margin: .5rem auto .5rem;
|
||||||
|
background: $card-border-inner;
|
||||||
|
border: solid 1px rgba($dark-blue, .5);
|
||||||
|
border-radius: .5rem;
|
||||||
|
box-shadow: .0 .0 .75rem rgba($dark-blue, .25);
|
||||||
|
|
||||||
|
> .content {
|
||||||
|
max-width: 35rem;
|
||||||
|
height: 100%;
|
||||||
|
padding: .75rem;
|
||||||
|
background: $white;
|
||||||
|
|
||||||
|
header {
|
||||||
|
h3 {
|
||||||
|
padding: .5rem;
|
||||||
|
text-align: center;
|
||||||
|
color: $white;
|
||||||
|
text-transform: uppercase;
|
||||||
|
background: $black;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.casting-header {
|
||||||
|
display: flex;
|
||||||
|
> * {
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.casting-infos {
|
||||||
|
margin: .75rem 0;
|
||||||
|
padding-right: .75rem;
|
||||||
|
border-right: 1px solid rgba($black, .25);
|
||||||
|
.type {
|
||||||
|
margin-bottom: .5rem;
|
||||||
|
display: flex;
|
||||||
|
> * {
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
.level {
|
||||||
|
.label {
|
||||||
|
margin-right: .25rem;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
var {
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 2.3em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.cost, .charge {
|
||||||
|
font-size: 0.9rem;
|
||||||
|
> * {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.label {
|
||||||
|
display: inline-block;
|
||||||
|
width: 30%;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
var {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.casting-ingredients {
|
||||||
|
margin: .75rem 0;
|
||||||
|
padding-left: .75rem;
|
||||||
|
.title {
|
||||||
|
margin-bottom: .25rem;
|
||||||
|
font-size: .9rem;
|
||||||
|
font-weight: bold;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
.content {
|
||||||
|
font-size: .85rem;
|
||||||
|
text-align: justify;
|
||||||
|
text-align-last: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.spell-description {
|
||||||
|
padding: .75rem 0;
|
||||||
|
font-size: .85rem;
|
||||||
|
p {
|
||||||
|
&:not(:last-of-type) {
|
||||||
|
margin-bottom: .5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
footer {
|
||||||
|
padding: .75rem 0 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.label {
|
||||||
|
margin-right: 1rem;
|
||||||
|
}
|
||||||
|
.variables {
|
||||||
|
.xyz {
|
||||||
|
span {
|
||||||
|
font-size: 1.1rem;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-right: 1rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
8
src/main.js
Normal file
8
src/main.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import App from './app.vue'
|
||||||
|
|
||||||
|
Vue.config.productionTip = false
|
||||||
|
|
||||||
|
new Vue({
|
||||||
|
render: h => h(App),
|
||||||
|
}).$mount('#app')
|
||||||
14
vue.config.js
Normal file
14
vue.config.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
module.exports = {
|
||||||
|
css: {
|
||||||
|
loaderOptions: {
|
||||||
|
sass: {
|
||||||
|
prependData: `
|
||||||
|
@import "@/assets/scss/_global.scss";
|
||||||
|
@import "@/assets/scss/_variables.scss";
|
||||||
|
@import "@/assets/scss/_mixins.scss";
|
||||||
|
@import "@/assets/scss/_fonts.scss";
|
||||||
|
`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user