comp calendar

This commit is contained in:
Sendou
2019-07-26 20:28:28 +03:00
parent dbab8493a7
commit 3ccb237520
17 changed files with 140 additions and 59 deletions

View File

@@ -1,13 +1,13 @@
{
"files": {
"main.js": "/static/js/main.df8995ab.chunk.js",
"main.js.map": "/static/js/main.df8995ab.chunk.js.map",
"main.js": "/static/js/main.da201f04.chunk.js",
"main.js.map": "/static/js/main.da201f04.chunk.js.map",
"runtime~main.js": "/static/js/runtime~main.a8a9905a.js",
"runtime~main.js.map": "/static/js/runtime~main.a8a9905a.js.map",
"static/js/2.42f6cc1f.chunk.js": "/static/js/2.42f6cc1f.chunk.js",
"static/js/2.42f6cc1f.chunk.js.map": "/static/js/2.42f6cc1f.chunk.js.map",
"static/js/2.262c534a.chunk.js": "/static/js/2.262c534a.chunk.js",
"static/js/2.262c534a.chunk.js.map": "/static/js/2.262c534a.chunk.js.map",
"index.html": "/index.html",
"precache-manifest.6888341309774d9ceb58689973f32497.js": "/precache-manifest.6888341309774d9ceb58689973f32497.js",
"precache-manifest.1247c056ccf6a3a04c55d6b1bbd6f3d9.js": "/precache-manifest.1247c056ccf6a3a04c55d6b1bbd6f3d9.js",
"service-worker.js": "/service-worker.js",
"static/media/academy-sz.png": "/static/media/academy-sz.d3862485.png",
"static/media/ancho-v_games.png": "/static/media/ancho-v_games.07d5d0f6.png",

View File

@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="stylesheet" href="//cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="/manifest.json"/><title>sendou.ink</title></head><body style="background-color:#f2f7fd"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(l){function e(e){for(var r,t,n=e[0],o=e[1],u=e[2],f=0,i=[];f<n.length;f++)t=n[f],p[t]&&i.push(p[t][0]),p[t]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(l[r]=o[r]);for(s&&s(e);i.length;)i.shift()();return c.push.apply(c,u||[]),a()}function a(){for(var e,r=0;r<c.length;r++){for(var t=c[r],n=!0,o=1;o<t.length;o++){var u=t[o];0!==p[u]&&(n=!1)}n&&(c.splice(r--,1),e=f(f.s=t[0]))}return e}var t={},p={1:0},c=[];function f(e){if(t[e])return t[e].exports;var r=t[e]={i:e,l:!1,exports:{}};return l[e].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.m=l,f.c=t,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(r,e){if(1&e&&(r=f(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var n in r)f.d(t,n,function(e){return r[e]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="/";var r=window.webpackJsonp=window.webpackJsonp||[],n=r.push.bind(r);r.push=e,r=r.slice();for(var o=0;o<r.length;o++)e(r[o]);var s=n;a()}([])</script><script src="/static/js/2.42f6cc1f.chunk.js"></script><script src="/static/js/main.df8995ab.chunk.js"></script></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="stylesheet" href="//cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="/manifest.json"/><title>sendou.ink</title></head><body style="background-color:#f2f7fd"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(l){function e(e){for(var r,t,n=e[0],o=e[1],u=e[2],f=0,i=[];f<n.length;f++)t=n[f],p[t]&&i.push(p[t][0]),p[t]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(l[r]=o[r]);for(s&&s(e);i.length;)i.shift()();return c.push.apply(c,u||[]),a()}function a(){for(var e,r=0;r<c.length;r++){for(var t=c[r],n=!0,o=1;o<t.length;o++){var u=t[o];0!==p[u]&&(n=!1)}n&&(c.splice(r--,1),e=f(f.s=t[0]))}return e}var t={},p={1:0},c=[];function f(e){if(t[e])return t[e].exports;var r=t[e]={i:e,l:!1,exports:{}};return l[e].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.m=l,f.c=t,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(r,e){if(1&e&&(r=f(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var n in r)f.d(t,n,function(e){return r[e]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="/";var r=window.webpackJsonp=window.webpackJsonp||[],n=r.push.bind(r);r.push=e,r=r.slice();for(var o=0;o<r.length;o++)e(r[o]);var s=n;a()}([])</script><script src="/static/js/2.262c534a.chunk.js"></script><script src="/static/js/main.da201f04.chunk.js"></script></body></html>

View File

@@ -1,15 +1,15 @@
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "54cd558bfc8f3641d31b17cd0082108a",
"revision": "789e973d9a9b022b35726832f147e276",
"url": "/index.html"
},
{
"revision": "19f9bfc566373c285736",
"url": "/static/js/2.42f6cc1f.chunk.js"
"revision": "400597823d2046153b33",
"url": "/static/js/2.262c534a.chunk.js"
},
{
"revision": "18c04211b278cbf2f4d9",
"url": "/static/js/main.df8995ab.chunk.js"
"revision": "8341c5826954f2c5f202",
"url": "/static/js/main.da201f04.chunk.js"
},
{
"revision": "42ac5946195a7306e2a5",

View File

@@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.0/workbox-sw.js");
importScripts(
"/precache-manifest.6888341309774d9ceb58689973f32497.js"
"/precache-manifest.1247c056ccf6a3a04c55d6b1bbd6f3d9.js"
);
self.addEventListener('message', (event) => {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -7772,6 +7772,11 @@
"verror": "1.10.0"
}
},
"jstz": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/jstz/-/jstz-2.1.1.tgz",
"integrity": "sha512-8hfl5RD6P7rEeIbzStBz3h4f+BQHfq/ABtoU6gXKQv5OcZhnmrIpG7e1pYaZ8hS9e0mp+bxUj08fnDUbKctYyA=="
},
"jsx-ast-utils": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.1.0.tgz",
@@ -7943,9 +7948,9 @@
}
},
"lodash": {
"version": "4.17.11",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
"integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg=="
"version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A=="
},
"lodash._reinterpolate": {
"version": "3.0.0",
@@ -8284,9 +8289,9 @@
}
},
"mixin-deep": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz",
"integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==",
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz",
"integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==",
"requires": {
"for-in": "^1.0.2",
"is-extendable": "^1.0.1"
@@ -11149,9 +11154,9 @@
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
},
"set-value": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz",
"integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz",
"integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==",
"requires": {
"extend-shallow": "^2.0.1",
"is-extendable": "^0.1.1",
@@ -12176,35 +12181,14 @@
}
},
"union-value": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz",
"integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
"integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==",
"requires": {
"arr-union": "^3.1.0",
"get-value": "^2.0.6",
"is-extendable": "^0.1.1",
"set-value": "^0.4.3"
},
"dependencies": {
"extend-shallow": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
"integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
"requires": {
"is-extendable": "^0.1.0"
}
},
"set-value": {
"version": "0.4.3",
"resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz",
"integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=",
"requires": {
"extend-shallow": "^2.0.1",
"is-extendable": "^0.1.1",
"is-plain-object": "^2.0.1",
"to-object-path": "^0.3.0"
}
}
"set-value": "^2.0.1"
}
},
"uniq": {

View File

@@ -7,6 +7,7 @@
"apollo-link": "^1.2.12",
"apollo-link-context": "^1.0.18",
"graphql": "^14.4.2",
"jstz": "^2.1.1",
"react": "^16.8.6",
"react-apollo": "^2.5.8",
"react-apollo-hooks": "^0.4.5",

6
react-ui/src/App.js vendored
View File

@@ -19,6 +19,7 @@ import UserPage from './components/SoloLadder/UserPage'
import HomePage from './components/Misc/HomePage'
import BuildSearch from './components/SoloLadder/BuildSearch'
import Admin from './components/Misc/Admin'
import Calendar from './components/Tools/Calendar'
const App = () => {
const [menuSelection, setMenuSelection] = useState('home')
@@ -68,6 +69,11 @@ const App = () => {
setMenuSelection={setMenuSelection}
/>
} />
<Route exact path="/calendar" render={() =>
<Calendar
setMenuSelection={setMenuSelection}
/>
} />
<Route path="/404" render={() => <NotFound />} />
<Route path="/admin" render={() => <Admin />} />
<Route path="*" render={() => <NotFound />} />

View File

@@ -111,6 +111,11 @@ const MainMenu = withRouter(({ history, menuSelection, setMenuSelection }) => {
/>
</Dropdown.Menu>
</Dropdown>
<Menu.Item
name='calendar'
active={menuSelection === 'calendar'}
onClick={() => { history.push('/calendar') }}
/>
<Menu.Item
name='links'
active={menuSelection === 'links'}

View File

@@ -0,0 +1,45 @@
import React, { useState, useEffect, useRef } from 'react'
import { Button, Segment } from 'semantic-ui-react'
import jstz from 'jstz'
import useWindowDimensions from '../hooks/useWindowDimensions'
const Calendar = ({ setMenuSelection }) => {
const [showCode, setShowCode] = useState(false)
const { containerWidth } = useWindowDimensions()
const calenderDiv = useRef(null)
const iFrameHTML = `<iframe title="calendar" src="https://calendar.google.com/calendar/embed?height=600&amp;wkst=2&amp;bgcolor=%23ffffff&amp;src=NDNnYnJlamkxbnQyZTY1dWJuZzdvYWkxZGtAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&amp;color=%23E67C73&amp;showTitle=0&amp;showNav=1&amp;showDate=1&amp;showPrint=0&amp;showCalendars=0&amp;ctz=${jstz.determine().name()}" style=border-width: 0 width=${containerWidth} height="1000" frameBorder="0" scrolling="no"></iframe>`
useEffect(() => {
setMenuSelection('calendar')
document.title = 'Competitive Calendar - sendou.ink'
console.log('calenderDiv', calenderDiv.current)
calenderDiv.current.innerHTML = iFrameHTML
}, [setMenuSelection, iFrameHTML])
return (
<div>
<h1>Competitive Splatoon Calendar</h1>
<div>
<Button onClick={() => setShowCode(!showCode)}>Show emoji code</Button>
{showCode
&&
<Segment raised compact>
<h4>
💰 - Has prizes<br/>
🎭 - Unconventional ruleset<br/>
🔒 - Limited registration<br/>
🎲 - Solo registration available
</h4>
</Segment>}
</div>
<div style={{"paddingTop": "15px"}} ref={calenderDiv}></div>
<div style={{"paddingTop": "10px"}}>
You can add the calendar to your personal Google Calendar by pressing the plus button above. If you are using other kind of calendar program you can try <a href="https://calendar.google.com/calendar/ical/43gbreji1nt2e65ubng7oai1dk%40group.calendar.google.com/public/basic.ics">this link</a> instead.
</div>
</div>
)
}
export default Calendar

View File

@@ -70,6 +70,13 @@ const MapPlanner = ({ setMenuSelection }) => {
const [uploadError, setUploadError] = useState(null)
const [controlledValue, setControlledValue] = useState(defaultValue)
useEffect(() => {
if (!sketch) return
sketch.setBackgroundFromDataUrl(bg)
setMenuSelection('plans')
document.title = 'Planner - sendou.ink'
}, [sketch, setMenuSelection, bg])
const tools = [
{ key: 1, text: 'Pencil', value: Tools.Pencil, icon: 'pencil' },
{ key: 2, text: 'Line', value: Tools.Line, icon: 'window minimize outline' },
@@ -185,13 +192,6 @@ const MapPlanner = ({ setMenuSelection }) => {
sketch.setBackgroundFromDataUrl(value)
}
useEffect(() => {
if (!sketch) return
setMenuSelection('plans')
document.title = 'Planner - sendou.ink'
sketch.setBackgroundFromDataUrl(reef)
}, [sketch, setMenuSelection])
return (
<div>
<h1>Make your plans!</h1>

View File

@@ -0,0 +1,40 @@
//https://stackoverflow.com/a/36862446
import { useState, useEffect } from 'react';
const getContainerWidth = (width) => {
if (width < 768) {
return width - 45
} else if (width < 992) {
return 723
} else if (width < 1200) {
return 933
}
return 1127
}
function getWindowDimensions() {
const { innerWidth: width, innerHeight: height } = window;
const containerWidth = getContainerWidth(width)
return {
width,
height,
containerWidth
};
}
export default function useWindowDimensions() {
const [windowDimensions, setWindowDimensions] = useState(getWindowDimensions());
useEffect(() => {
function handleResize() {
setWindowDimensions(getWindowDimensions());
}
window.addEventListener('resize', handleResize);
return () => window.removeEventListener('resize', handleResize);
}, []);
return windowDimensions;
}