Work on responsive and add loading animation

This commit is contained in:
Valentin Kaelin 2019-04-04 22:29:37 +02:00
parent c26b7a2191
commit 2a12c38ab2
13 changed files with 2612 additions and 124 deletions

View file

@ -11072,6 +11072,12 @@
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.0.2.tgz", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.0.2.tgz",
"integrity": "sha512-opKtsxjp9eOcFWdp6xLQPLmRGgfM932Tl56U9chYTnoWqKxQ8M20N7AkdEbM5beUh6wICoFGYugAX9vQjyJLFg==" "integrity": "sha512-opKtsxjp9eOcFWdp6xLQPLmRGgfM932Tl56U9chYTnoWqKxQ8M20N7AkdEbM5beUh6wICoFGYugAX9vQjyJLFg=="
}, },
"vue-spinner": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/vue-spinner/-/vue-spinner-1.0.3.tgz",
"integrity": "sha512-Phh6QC/Bh80ZE/0SH9ADw4irbRGwFK6VZsTksPHpPm16xga2OXwNC2nI7SEPnndUZP+Lgu1wu+pbH6i6+5siBQ==",
"dev": true
},
"vue-style-loader": { "vue-style-loader": {
"version": "4.1.2", "version": "4.1.2",
"resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.2.tgz", "resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.2.tgz",

View file

@ -25,6 +25,7 @@
"purgecss": "^1.1.0", "purgecss": "^1.1.0",
"tailwindcss": "^1.0.0-beta.3", "tailwindcss": "^1.0.0-beta.3",
"vue-awesome": "^3.5.1", "vue-awesome": "^3.5.1",
"vue-spinner": "^1.0.3",
"vue-template-compiler": "^2.5.21" "vue-template-compiler": "^2.5.21"
} }
} }

View file

@ -13,17 +13,20 @@ module.exports = {
plugins: [ plugins: [
postcssImport, postcssImport,
tailwindcss('./tailwind.config.js'), tailwindcss('./tailwind.config.js'),
purgecss({
content: ['./src/**/*.vue'],
whitelist: ['html', 'body'],
extractors: [
{
extractor: TailwindExtractor,
extensions: ['html', 'js', 'vue'] // --- !!! purgecss not working !!! ---
}
] // purgecss({
}), // content: ['./src/**/*.vue'],
// whitelist: ['html', 'body'],
// extractors: [
// {
// extractor: TailwindExtractor,
// extensions: ['html', 'js', 'vue']
// }
// ]
// }),
autoprefixer autoprefixer
] ]
} }

View file

@ -16,6 +16,8 @@
#app { #app {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
min-height: 100vh;
} }
</style> </style>

View file

@ -1,60 +1,83 @@
<template> <template>
<li class="match" :class="data.result ? 'win' : 'lose'"> <li class="match bg-white shadow text-sm md:text-base" :class="data.result ? 'win' : 'lose'">
<div class="content-container">
<div class="first">
<img :src="`https://cdn.valentinkaelin.ch/riot/champions/${data.champ}.png`" class="champion-icon" alt="example design">
<span class="level">{{ data.level }}</span> <div class="match-container">
<div class="summonerSpells"> <!-- Responsive -->
<img class="spell-icon" src="https://cdn.valentinkaelin.ch/riot/spells/SummonerFlash.png" alt="Flash"> <div class="flex justify-between lg:hidden text-sm text-gray-800 px-2 border-gray-300 border-b">
<img class="spell-icon" src="https://cdn.valentinkaelin.ch/riot/spells/SummonerDot.png" alt="Ignite"> <div class="flex">
<div class="gamemode mr-1">{{ data.gamemode }}</div>
<span></span>
<div class="date ml-1">Il y a {{ data.date }}</div>
</div>
<div>
<div class="date">{{ data.time }}</div>
</div> </div>
<span class="champion-name">{{ data.champ }}</span>
</div> </div>
<div class="second"> <div class="flex-container">
<div class="first col w-1/3 lg:w-1/4">
<div class="icon-and-sums flex flex-col sm:flex-row">
<div class="relative">
<img :src="`https://cdn.valentinkaelin.ch/riot/champions/${data.champ}.png`" class="champion-icon mb-2px sm:mb-0 sm:mr-2px" alt="example design">
<span class="level absolute bottom-0 left-0 text-white font-bold">{{ data.level }}</span>
</div>
<div class="summonerSpells flex flex-row sm:flex-col">
<img class="spell-icon mr-2px sm:mr-0 sm:mb-2px" :src="data.firstSum" alt="Ignite">
<img class="spell-icon" :src="data.secondSum" alt="Ignite">
</div>
</div>
<span class="champion-name hidden sm:block">{{ data.champ }}</span>
</div>
<div class="second col hidden lg:block lg:w-1/4">
<div class="map">{{ data.map }}</div> <div class="map">{{ data.map }}</div>
<div class="gamemode">{{ data.gamemode }}</div> <div class="gamemode">{{ data.gamemode }}</div>
</div> </div>
<div class="third"> <div class="third col w-1/2 lg:w-1/4 flex-wrap md:flex-no-wrap">
<div <div
v-for="(item, index) in data.items" :key="index" v-for="(item, index) in data.items" :key="index"
:style="{background: getItemLink(item)}" class="item" :style="{background: item}" class="item"
> >
</div> </div>
</div> </div>
<div class="fourth"> <div class="fourth w-1/6 lg:w-1/4 flex-col items-center justify-center sm:flex-row sm:justify-around">
<div class="score">{{ data.kills }}/{{ data.deaths }}/{{ data.assists }}</div> <div class="score mb-2 sm:mb-0 font-bold">{{ data.kills }}/{{ data.deaths }}/{{ data.assists }}</div>
<div class="gold-farm"> <div class="gold-farm text-center">
<div class="gold">{{ data.gold }}</div> <div class="gold flex items-center justify-center mb-2 sm:mb-0">
<div class="farm">{{ data.minions }}</div> {{ data.gold }}
<v-icon name="coins" class="h-3 ml-1 text-blue-800" />
</div> </div>
<div class="duration-date"> <div class="farm flex items-center justify-center">
{{ data.minions }}
<v-icon name="skull-crossbones" class="h-3 ml-1 text-blue-800" />
</div>
</div>
<div class="duration-date hidden lg:block">
<div class="duration">{{ data.time }}</div> <div class="duration">{{ data.time }}</div>
<div class="date">{{ data.date }}</div> <div class="date">{{ data.date }}</div>
</div> </div>
</div> </div>
</div> </div>
</div>
</li> </li>
</template> </template>
<script> <script>
import itemsJSON from '@/data/item.json'
export default { export default {
props: { props: {
data: Object data: Object
}, },
methods: { methods: {
getItemLink(id) { tinyItem(link) {
if(id !== 0) { return link.replace('item', 'tiny_item')
const itemImage = itemsJSON.data[id].image;
return `url('https://cdn.valentinkaelin.ch/riot/${itemImage.sprite}') -${itemImage.x}px -${itemImage.y}px`;
}
return "url('https://cdn.valentinkaelin.ch/riot/items/0.png') 0% 0% / cover";
} }
} }
} }
@ -63,48 +86,41 @@ export default {
<style scoped> <style scoped>
.match { .match {
background: #fff; /* padding: 10px 0; */
padding: 10px 0;
border-bottom: 1px solid #dae1e7; border-bottom: 1px solid #dae1e7;
margin: 16px 0;
} }
.match .content-container { .match .flex-container {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
padding: 16px; padding: 16px 8px;
} }
.match.win .content-container { .match.win .match-container {
border-left: 10px solid #51d88a; border-left: 10px solid #48BB78;
} }
.match.lose .content-container { .match.lose .match-container {
border-left: 10px solid #ef5753; border-left: 10px solid #F56565;
}
.match .col {
/* flex: 1 0 0; */
} }
/* First col */ /* First col */
.match .first { .match .first {
position: relative;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
flex: 1 0 0; /* flex: 1 0 0; */
} }
.champion-icon { .champion-icon {
width: 48px; width: 48px;
height: 48px; height: 48px;
display: block; display: block;
margin: 0 2px 0 0;
}
.match .level {
position: absolute;
bottom: 0;
left: 0;
color: #fff;
font-weight: bold;
} }
.match .summonerSpells { .match .summonerSpells {
@ -117,19 +133,15 @@ export default {
display: block; display: block;
} }
.match .spell-icon:first-child {
margin: 0 0 2px 0;
}
/* Second col */ /* Second col */
.match .second { .match .second {
flex: 1 0 0; /* flex: 1 0 0; */
text-align: left; text-align: left;
} }
/* Third col */ /* Third col */
.match .third { .match .third {
flex: 1 0 0; /* flex: 1 0 0; */
display: flex; display: flex;
} }
@ -141,9 +153,8 @@ export default {
/* Fourth col */ /* Fourth col */
.match .fourth { .match .fourth {
flex: 1 0 0; /* flex: 1 0 0; */
display: flex; display: flex;
justify-content: space-around;
align-items: center; align-items: center;
} }
</style> </style>

File diff suppressed because it is too large Load diff

View file

@ -46,10 +46,14 @@ export function getRankImg(soloQStats) {
if (!soloQStats) { if (!soloQStats) {
return 'https://cdn.valentinkaelin.ch/riot/tier-icons/provisional.png'; return 'https://cdn.valentinkaelin.ch/riot/tier-icons/provisional.png';
} }
return 'https://cdn.valentinkaelin.ch/riot/tier-icons/Emblem_' + capitalize(soloQStats.tier.toLowerCase()) + '.png';
}
if (soloQStats.tier != 'MASTER' && soloQStats.tier != 'CHALLENGER') {
return 'https://cdn.valentinkaelin.ch/riot/tier-icons/' + soloQStats.tier.toLowerCase() + '_' + soloQStats.rank.toLowerCase() + '.png'; /**
} else { * Capitalize first letter of params string
return 'https://cdn.valentinkaelin.ch/riot/tier-icons/' + soloQStats.tier.toLowerCase() + '.png'; * @param string : string to capitalize
} */
function capitalize(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
} }

View file

@ -1,6 +1,7 @@
import Vue from 'vue' import Vue from 'vue'
import axios from 'axios' import axios from 'axios'
import VueAxios from 'vue-axios' import VueAxios from 'vue-axios'
import DotLoader from 'vue-spinner/src/DotLoader.vue'
import '@/assets/css/tailwind.css' import '@/assets/css/tailwind.css'
import 'vue-awesome/icons' import 'vue-awesome/icons'
@ -12,6 +13,7 @@ import Icon from 'vue-awesome/components/Icon'
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.use(VueAxios, axios) Vue.use(VueAxios, axios)
Vue.component('v-icon', Icon) Vue.component('v-icon', Icon)
Vue.component('dot-loader', DotLoader);
new Vue({ new Vue({

View file

@ -1,24 +1,9 @@
import Vue from 'vue' import Vue from 'vue'
import Router from 'vue-router' import Router from 'vue-router'
import Home from '@/views/Home.vue' import Home from '@/views/Home.vue'
import Summoner from '@/views/Summoner.vue' import Summoner from '@/views/Summoner.vue'
//import Cats from './views/Cats.vue'
//import Dogs from './views/Dogs.vue'
//import Pet from './views/Pet.vue'
Vue.use(Router) Vue.use(Router)
export default new Router({ export default new Router({
@ -35,20 +20,5 @@ export default new Router({
name: 'summoner', name: 'summoner',
component: Summoner component: Summoner
} }
/*{
path: '/cats',
name: 'cats',
component: Cats
},
{
path: '/dogs',
name: 'dogs',
component: Dogs
},
{
path: '/pets/:species/:id',
name: 'pet',
component: Pet
}*/
] ]
}) })

View file

@ -2,16 +2,18 @@
<div> <div>
<button class="debug" @click="this.resetLocalStorage"></button> <button class="debug" @click="this.resetLocalStorage"></button>
<div class="search"> <div class="search mb-4">
<div class="container mx-auto"> <div class="container mx-auto">
<form @submit.prevent="redirect" class="flex items-center"> <form @submit.prevent="redirect" class="flex items-center">
<input type="text" placeholder="Entre un pseudo" class="bg-gray-300 p-2 rounded-l outline-none focus:bg-gray-400" v-model="search"> <input type="text" placeholder="Entre un pseudo" class="bg-gray-300 p-2 rounded-l outline-none focus:bg-gray-400" v-model="search">
<button class="bg-teal-500 p-2 text-white rounded-r hover:bg-teal-400" type="submit">Rechercher</button> <button class="bg-teal-500 p-2 text-white rounded-r hover:bg-teal-400" type="submit" :disabled="loading">Rechercher</button>
<button <button
v-if="summonerFound" v-if="summonerFound"
id="refresh" id="refresh"
class="block bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 px-4 border border-gray-400 rounded shadow ml-2" class="block bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 px-4 border border-gray-400 rounded shadow ml-2"
:disabled="loading"
@click="apiCall"
> >
<v-icon name="sync"/> <v-icon name="sync"/>
</button> </button>
@ -19,9 +21,9 @@
</div> </div>
</div> </div>
<template v-if="summonerFound"> <template v-if="summonerFound && !loading">
<div class="container mx-auto pb-16"> <div class="container mx-auto pb-16">
<div class="player shadow-md" v-if="localInfos.name"> <div class="player bg-blue-100" v-if="localInfos.name">
<div class="player__pp" :style="{background: `url(https://cdn.valentinkaelin.ch/riot/profileicon/${localInfos.profileIconId}.png) center/cover`}"></div> <div class="player__pp" :style="{background: `url(https://cdn.valentinkaelin.ch/riot/profileicon/${localInfos.profileIconId}.png) center/cover`}"></div>
<h1 class="player__name">{{ localInfos.name }}</h1> <h1 class="player__name">{{ localInfos.name }}</h1>
<h3 class="player__level">{{ localInfos.level }}</h3> <h3 class="player__level">{{ localInfos.level }}</h3>
@ -42,6 +44,11 @@
</div> </div>
</div> </div>
</template> </template>
<template v-else-if="loading">
<div class="flex items-center justify-center bg-white max-w-xs mx-auto p-5 rounded-lg shadow-xl">
<dot-loader :loading="loading"></dot-loader>
</div>
</template>
<template v-else> <template v-else>
<p>Le joueur est introuvable.</p> <p>Le joueur est introuvable.</p>
</template> </template>
@ -50,6 +57,8 @@
</template> </template>
<script> <script>
import itemsJSON from '@/data/item.json'
import summonersJSON from '@/data/summoner.json'
import Match from '@/components/Match.vue'; import Match from '@/components/Match.vue';
import { championsId, maps, gameModes } from "@/data/data.js"; import { championsId, maps, gameModes } from "@/data/data.js";
import { timeDifference, secToTime, getRankImg } from "@/helpers/functions.js"; import { timeDifference, secToTime, getRankImg } from "@/helpers/functions.js";
@ -63,16 +72,18 @@ export default {
localInfos: {}, localInfos: {},
nameChosen: this.$route.params.name, nameChosen: this.$route.params.name,
search: '', search: '',
summonerFound: true summonerFound: true,
loading: false
}; };
}, },
methods: { methods: {
apiCall() { apiCall() {
const summoner = this.$route.params.name; const summoner = this.$route.params.name;
this.loading = true;
this.axios({ this.axios({
method: "POST", method: "POST",
//url: "https://vue.valentinkaelin.ch/api", url: "https://vue.valentinkaelin.ch/api",
url: "http://localhost:5000/api", //url: "http://localhost:5000/api",
headers: { headers: {
"Content-Type": "application/json" "Content-Type": "application/json"
}, },
@ -81,6 +92,7 @@ export default {
} }
}) })
.then(response => { .then(response => {
this.loading = false;
return response.data; return response.data;
}) })
.then(jsonData => { .then(jsonData => {
@ -93,6 +105,7 @@ export default {
} }
}) })
.catch(err => { .catch(err => {
this.loading = false;
console.log(err); console.log(err);
}); });
}, },
@ -106,8 +119,8 @@ export default {
} }
}, },
createObject(JSONData) { createObject(JSONData) {
//console.log('--- ALL INFOS ---') console.log('--- ALL INFOS ---')
//console.log(JSONData); console.log(JSONData);
const userStats = JSONData[0]; const userStats = JSONData[0];
const rankedStats = JSONData[1]; const rankedStats = JSONData[1];
@ -149,12 +162,15 @@ export default {
const items = []; const items = [];
for (let i = 0; i < 6; i++) { for (let i = 0; i < 6; i++) {
const currentItem = 'item' + i; const currentItem = 'item' + i;
items.push(currentMatch.participants[participantId - 1].stats[currentItem]); items.push(this.getItemLink(currentMatch.participants[participantId - 1].stats[currentItem]));
} }
const gold = (currentMatch.participants[participantId - 1].stats.goldEarned / 1000).toFixed(1) + 'k'; const gold = (currentMatch.participants[participantId - 1].stats.goldEarned / 1000).toFixed(1) + 'k';
const minions = currentMatch.participants[participantId - 1].stats.totalMinionsKilled + currentMatch.participants[participantId - 1].stats.neutralMinionsKilled; const minions = currentMatch.participants[participantId - 1].stats.totalMinionsKilled + currentMatch.participants[participantId - 1].stats.neutralMinionsKilled;
const firstSum = currentMatch.participants[participantId - 1].spell1Id;
const secondSum = currentMatch.participants[participantId - 1].spell2Id;
matchesInfos.push({ matchesInfos.push({
result: win, result: win,
map: map, map: map,
@ -169,7 +185,9 @@ export default {
level: level, level: level,
items: items, items: items,
gold: gold, gold: gold,
minions: minions minions: minions,
firstSum: this.getSummonerLink(firstSum),
secondSum: this.getSummonerLink(secondSum)
}); });
} }
console.log(matchesInfos); console.log(matchesInfos);
@ -193,6 +211,20 @@ export default {
localStorage[this.nameChosen] = JSON.stringify(this.localInfos); localStorage[this.nameChosen] = JSON.stringify(this.localInfos);
}, },
getItemLink(id) {
if(id === 0) {
return "url('https://cdn.valentinkaelin.ch/riot/items/0.png') 0% 0% / cover";
}
const itemImage = itemsJSON.data[id].image;
return `url('https://cdn.valentinkaelin.ch/riot/${itemImage.sprite}') -${itemImage.x}px -${itemImage.y}px`;
},
getSummonerLink(id) {
for(var prop in summonersJSON.data) {
if(summonersJSON.data[prop].key == id) {
return `https://cdn.valentinkaelin.ch/riot/spells/${summonersJSON.data[prop].id}.png`;
}
}
},
redirect() { redirect() {
this.$router.push("/summoner/" + this.search) this.$router.push("/summoner/" + this.search)
}, },
@ -245,7 +277,7 @@ export default {
margin: 16px auto 0; margin: 16px auto 0;
border: 1px solid #ebebeb; border: 1px solid #ebebeb;
padding: 16px; padding: 16px;
background: #fff; /* background: #fff; */
} }
.player__pp { .player__pp {

View file

@ -1,11 +1,447 @@
module.exports = { module.exports = {
prefix: '',
important: false,
separator: ':',
theme: { theme: {
// Some useful comment colors: {
transparent: 'transparent',
black: '#000',
white: '#fff',
gray: {
100: '#f7fafc',
200: '#edf2f7',
300: '#e2e8f0',
400: '#cbd5e0',
500: '#a0aec0',
600: '#718096',
700: '#4a5568',
800: '#2d3748',
900: '#1a202c',
},
red: {
100: '#fff5f5',
200: '#fed7d7',
300: '#feb2b2',
400: '#fc8181',
500: '#f56565',
600: '#e53e3e',
700: '#c53030',
800: '#9b2c2c',
900: '#742a2a',
},
orange: {
100: '#fffaf0',
200: '#feebc8',
300: '#fbd38d',
400: '#f6ad55',
500: '#ed8936',
600: '#dd6b20',
700: '#c05621',
800: '#9c4221',
900: '#7b341e',
},
yellow: {
100: '#fffff0',
200: '#fefcbf',
300: '#faf089',
400: '#f6e05e',
500: '#ecc94b',
600: '#d69e2e',
700: '#b7791f',
800: '#975a16',
900: '#744210',
},
green: {
100: '#f0fff4',
200: '#c6f6d5',
300: '#9ae6b4',
400: '#68d391',
500: '#48bb78',
600: '#38a169',
700: '#2f855a',
800: '#276749',
900: '#22543d',
},
teal: {
100: '#e6fffa',
200: '#b2f5ea',
300: '#81e6d9',
400: '#4fd1c5',
500: '#38b2ac',
600: '#319795',
700: '#2c7a7b',
800: '#285e61',
900: '#234e52',
},
blue: {
100: '#ebf8ff',
200: '#bee3f8',
300: '#90cdf4',
400: '#63b3ed',
500: '#4299e1',
600: '#3182ce',
700: '#2b6cb0',
800: '#2c5282',
900: '#2a4365',
},
indigo: {
100: '#ebf4ff',
200: '#c3dafe',
300: '#a3bffa',
400: '#7f9cf5',
500: '#667eea',
600: '#5a67d8',
700: '#4c51bf',
800: '#434190',
900: '#3c366b',
},
purple: {
100: '#faf5ff',
200: '#e9d8fd',
300: '#d6bcfa',
400: '#b794f4',
500: '#9f7aea',
600: '#805ad5',
700: '#6b46c1',
800: '#553c9a',
900: '#44337a',
},
pink: {
100: '#fff5f7',
200: '#fed7e2',
300: '#fbb6ce',
400: '#f687b3',
500: '#ed64a6',
600: '#d53f8c',
700: '#b83280',
800: '#97266d',
900: '#702459',
},
},
spacing: {
px: '1px',
'2px': '2px',
'0': '0',
'1': '0.25rem',
'2': '0.5rem',
'3': '0.75rem',
'4': '1rem',
'5': '1.25rem',
'6': '1.5rem',
'8': '2rem',
'10': '2.5rem',
'12': '3rem',
'16': '4rem',
'20': '5rem',
'24': '6rem',
'32': '8rem',
'40': '10rem',
'48': '12rem',
'56': '14rem',
'64': '16rem',
},
screens: {
sm: '640px',
md: '768px',
lg: '1024px',
xl: '1280px',
},
fontFamily: {
sans: [
'-apple-system',
'BlinkMacSystemFont',
'"Segoe UI"',
'Roboto',
'"Helvetica Neue"',
'Arial',
'"Noto Sans"',
'sans-serif',
'"Apple Color Emoji"',
'"Segoe UI Emoji"',
'"Segoe UI Symbol"',
'"Noto Color Emoji"',
],
serif: ['Georgia', 'Cambria', '"Times New Roman"', 'Times', 'serif'],
mono: [
'Menlo',
'Monaco',
'Consolas',
'"Liberation Mono"',
'"Courier New"',
'monospace',
],
},
fontSize: {
xs: '.75rem',
sm: '.875rem',
base: '1rem',
lg: '1.125rem',
xl: '1.25rem',
'2xl': '1.5rem',
'3xl': '1.875rem',
'4xl': '2.25rem',
'5xl': '3rem',
'6xl': '4rem',
},
fontWeight: {
hairline: 100,
thin: 200,
light: 300,
normal: 400,
medium: 500,
semibold: 600,
bold: 700,
extrabold: 800,
black: 900,
},
lineHeight: {
none: 1,
tight: 1.25,
snug: 1.375,
normal: 1.5,
relaxed: 1.625,
loose: 2,
},
letterSpacing: {
tighter: '-.05em',
tight: '-.025em',
normal: '0',
wide: '.025em',
wider: '.05em',
widest: '.1em',
},
textColor: theme => theme('colors'),
backgroundColor: theme => theme('colors'),
backgroundPosition: {
bottom: 'bottom',
center: 'center',
left: 'left',
'left-bottom': 'left bottom',
'left-top': 'left top',
right: 'right',
'right-bottom': 'right bottom',
'right-top': 'right top',
top: 'top',
},
backgroundSize: {
auto: 'auto',
cover: 'cover',
contain: 'contain',
},
borderWidth: {
default: '1px',
'0': '0',
'2': '2px',
'4': '4px',
'8': '8px',
},
borderColor: theme => ({
...theme('colors'),
default: theme('colors.gray.300', 'currentColor'),
}),
borderRadius: {
none: '0',
sm: '.125rem',
default: '.25rem',
lg: '.5rem',
full: '9999px',
},
cursor: {
auto: 'auto',
default: 'default',
pointer: 'pointer',
wait: 'wait',
move: 'move',
'not-allowed': 'not-allowed',
},
width: theme => ({
auto: 'auto',
...theme('spacing'),
'1/2': '50%',
'1/3': '33.33333%',
'2/3': '66.66667%',
'1/4': '25%',
'3/4': '75%',
'1/5': '20%',
'2/5': '40%',
'3/5': '60%',
'4/5': '80%',
'1/6': '16.66667%',
'5/6': '83.33333%',
full: '100%',
screen: '100vw',
}),
height: theme => ({
auto: 'auto',
...theme('spacing'),
full: '100%',
screen: '100vh',
}),
minWidth: {
'0': '0',
full: '100%',
},
minHeight: {
'0': '0',
full: '100%',
screen: '100vh',
},
maxWidth: {
xs: '20rem',
sm: '24rem',
md: '28rem',
lg: '32rem',
xl: '36rem',
'2xl': '42rem',
'3xl': '48rem',
'4xl': '56rem',
'5xl': '64rem',
'6xl': '72rem',
full: '100%',
},
maxHeight: {
full: '100%',
screen: '100vh',
},
padding: theme => theme('spacing'),
margin: theme => ({ auto: 'auto', ...theme('spacing') }),
negativeMargin: theme => theme('spacing'),
objectPosition: {
bottom: 'bottom',
center: 'center',
left: 'left',
'left-bottom': 'left bottom',
'left-top': 'left top',
right: 'right',
'right-bottom': 'right bottom',
'right-top': 'right top',
top: 'top',
},
boxShadow: {
default: '0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px 0 rgba(0, 0, 0, .06)',
md: '0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06)',
lg: '0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05)',
xl: '0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .04)',
'2xl': '0 25px 50px -12px rgba(0, 0, 0, .25)',
inner: 'inset 0 2px 4px 0 rgba(0,0,0,0.06)',
outline: '0 0 0 3px rgba(66,153,225,0.5)',
none: 'none',
},
zIndex: {
auto: 'auto',
'0': 0,
'10': 10,
'20': 20,
'30': 30,
'40': 40,
'50': 50,
},
opacity: {
'0': '0',
'25': '.25',
'50': '.5',
'75': '.75',
'100': '1',
},
fill: {
current: 'currentColor',
},
stroke: {
current: 'currentColor',
},
flex: {
'1': '1 1 0%',
auto: '1 1 auto',
initial: '0 1 auto',
none: 'none',
},
flexGrow: {
'0': 0,
default: 1,
},
flexShrink: {
'0': 0,
default: 1,
},
listStyleType: {
none: 'none',
disc: 'disc',
decimal: 'decimal',
},
inset: {
'0': 0,
auto: 'auto',
},
container: {}
}, },
variants: { variants: {
// Some useful comment appearance: ['responsive'],
backgroundAttachment: ['responsive'],
backgroundColor: ['responsive', 'hover', 'focus'],
backgroundPosition: ['responsive'],
backgroundRepeat: ['responsive'],
backgroundSize: ['responsive'],
borderCollapse: [],
borderColor: ['responsive', 'hover', 'focus'],
borderRadius: ['responsive'],
borderStyle: ['responsive'],
borderWidth: ['responsive'],
cursor: ['responsive'],
display: ['responsive'],
flexDirection: ['responsive'],
flexWrap: ['responsive'],
alignItems: ['responsive'],
alignSelf: ['responsive'],
justifyContent: ['responsive'],
alignContent: ['responsive'],
flex: ['responsive'],
flexGrow: ['responsive'],
flexShrink: ['responsive'],
float: ['responsive'],
fontFamily: ['responsive'],
fontWeight: ['responsive', 'hover', 'focus'],
height: ['responsive'],
lineHeight: ['responsive'],
listStylePosition: ['responsive'],
listStyleType: ['responsive'],
margin: ['responsive'],
maxHeight: ['responsive'],
maxWidth: ['responsive'],
minHeight: ['responsive'],
minWidth: ['responsive'],
negativeMargin: ['responsive'],
objectFit: ['responsive'],
objectPosition: ['responsive'],
opacity: ['responsive'],
outline: ['focus'],
overflow: ['responsive'],
padding: ['responsive'],
pointerEvents: ['responsive'],
position: ['responsive'],
inset: ['responsive'],
resize: ['responsive'],
boxShadow: ['responsive', 'hover', 'focus'],
fill: [],
stroke: [],
tableLayout: ['responsive'],
textAlign: ['responsive'],
textColor: ['responsive', 'hover', 'focus'],
fontSize: ['responsive'],
fontStyle: ['responsive'],
textTransform: ['responsive'],
textDecoration: ['responsive', 'hover', 'focus'],
fontSmoothing: ['responsive'],
letterSpacing: ['responsive'],
userSelect: ['responsive'],
verticalAlign: ['responsive'],
visibility: ['responsive'],
whitespace: ['responsive'],
wordBreak: ['responsive'],
width: ['responsive'],
zIndex: ['responsive'],
}, },
plugins: [ corePlugins: {},
// Some useful comment plugins: [],
]
} }

2
server/.gitignore vendored
View file

@ -1,3 +1,3 @@
/node_modules /node_modules
/Patch9.5 /DDragon
.env .env

View file

@ -20,11 +20,11 @@ let finalJSON = [];
app.set('port', (process.env.PORT || 5000)) app.set('port', (process.env.PORT || 5000))
/* DEV */ /* DEV */
var cors = require('cors'); //var cors = require('cors');
app.use(cors({origin: '*'})); //app.use(cors({origin: '*'}));
/* PRODUCTION */ /* PRODUCTION */
/*const staticFileMiddleware = express.static(path.join(__dirname + '/dist')); const staticFileMiddleware = express.static(path.join(__dirname + '/dist'));
app.use(staticFileMiddleware); app.use(staticFileMiddleware);
app.use(history({ app.use(history({
disableDotRule: true, disableDotRule: true,
@ -34,7 +34,7 @@ app.use(staticFileMiddleware);
app.get('/', function (req, res) { app.get('/', function (req, res) {
res.render(path.join(__dirname + '/dist/index.html')); res.render(path.join(__dirname + '/dist/index.html'));
});*/ });
/* To retrieve data of post request */ /* To retrieve data of post request */
app.use(bodyParser.json()); // to support JSON-encoded bodies app.use(bodyParser.json()); // to support JSON-encoded bodies