moved images to s3 and added terraform scripts

This commit is contained in:
2020-08-08 19:27:32 +09:00
parent d0a8424731
commit 94a9d18c02
90 changed files with 859 additions and 55 deletions

View File

@@ -2,7 +2,7 @@ mkdir build
cd main-web/client
npm run build
cd ../../
mv main-web/client/client build/
mv main-web/client/client build
cd tools/janken
npm run build
cd ../../
@@ -10,6 +10,6 @@ mv tools/janken/tool build
cd main-web/server
npm run build
cd ../../
mv main-web/server/build server/
mv main-web/server/build build/server
tar czf build.tar.gz build/
rm -rf build/

View File

@@ -38,7 +38,7 @@
{
"type": "shell",
"inline": [
"sudo yum update",
"sudo yum -y update",
"sudo yum -y install unzip",
"sudo yum -y install nano",
"sudo yum -y install dos2unix",

View File

@@ -3,4 +3,5 @@
aws s3 cp s3://catherine-fc-infra/build.tar.gz .
tar zxf build.tar.gz
rm build.tar.gz
node build/server/index.js
cd build
node server/index.js

View File

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

View File

@@ -0,0 +1,8 @@
terraform {
backend "s3" {
bucket = "catherine-fc-infra"
key = "catherine-fc-ec2/terraform.tfstate"
region = "ap-northeast-1"
encrypt = true
}
}

View File

@@ -0,0 +1,12 @@
module "catherine-fc" {
source = "../../modules/catherine-fc/main"
vpc_id = var.vpc_id[terraform.workspace]
internal_subnet_ids = var.internal_subnet_ids[terraform.workspace]
tags = var.tags
asg_tags = var.asg_tags
basename = "catherine-fc"
asg_caps = var.asg_caps["catherine-fc"]
ec2_instance_type = "t2.micro"
key_name = var.key_name[terraform.workspace]
asg_arn = module.catherine-fc.asg_arn
}

View File

@@ -0,0 +1,3 @@
output "asg_arn" {
value = module.catherine-fc.asg_arn
}

View File

@@ -0,0 +1,4 @@
provider "aws" {
region = "ap-northeast-1"
version = "~> 2.0"
}

View File

@@ -0,0 +1,46 @@
variable "tags" {
type = map(string)
default = {
PROJECT = "CATHERINE_FC"
}
}
variable "asg_tags" {
type = list(object({key=string, value=string, propagate_at_launch=bool}))
default = [
{
key = "PROJECT",
value = "CATHERINE_FC",
propagate_at_launch = true
}
]
}
variable "asg_caps" {
type = map(map(number))
default = {
"catherine-fc" = {
min = 1
max = 1
desired = 1
}
}
}
variable "vpc_id" {
type = map(string)
default = {
prod = "vpc-c54553a2"
}
}
variable "internal_subnet_ids" {
type = map(list(string))
default = {
prod = [ "subnet-0d0fdf45", "subnet-4dcecc16", "subnet-4dcecc16" ]
}
}
variable "key_name" {
type = map(string)
default = {
prod = "catherine-fc"
}
}

View File

@@ -0,0 +1,36 @@
resource "aws_autoscaling_group" "es_asg" {
name = "${var.basename}-${terraform.workspace}"
availability_zones = ["ap-northeast-1a", "ap-northeast-1c", "ap-northeast-1d"]
vpc_zone_identifier = var.internal_subnet_ids
desired_capacity = var.asg_caps.desired
max_size = var.asg_caps.max
min_size = var.asg_caps.min
launch_configuration = aws_launch_configuration.catherine_fc_conf.name
tags = concat(var.asg_tags, [
{
key = "STAGE_ENVIRONMENT",
value = "${terraform.workspace}",
propagate_at_launch = true
},
{
key = "Name",
value = "${var.basename}-${terraform.workspace}",
propagate_at_launch = true
}
])
enabled_metrics = [
"GroupMinSize",
"GroupMaxSize",
"GroupDesiredCapacity",
"GroupInServiceInstances",
"GroupPendingInstances",
"GroupTerminatingInstances",
"GroupStandbyInstances",
"GroupTotalInstances"
]
}

View File

@@ -0,0 +1,12 @@
data "aws_caller_identity" "self" { }
data "aws_ami" "catherine_fc_ami" {
most_recent = true
filter {
name = "name"
values = [ "catherine-fc" ]
}
owners = [ "353699021357" ]
}

View File

@@ -0,0 +1,97 @@
resource "aws_iam_instance_profile" "catherine_fc_profile" {
name_prefix = "${var.basename}-"
role = aws_iam_role.instance.name
}
resource "aws_iam_role" "instance" {
name = "${var.basename}-${terraform.workspace}"
path = "/"
assume_role_policy = <<EOF1
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Effect": "Allow"
}
]
}
EOF1
tags = var.tags
}
resource "aws_iam_role_policy" "catherine_fc_autoscaling" {
name = "catherine_fc_autoscaling_policy"
role = aws_iam_role.instance.id
policy = <<EOF2
{
"Statement": [
{
"Action": [
"autoscaling:UpdateAutoScalingGroup"
],
"Effect": "Allow",
"Resource": [
"${var.asg_arn}"
]
}
],
"Version": "2012-10-17"
}
EOF2
}
resource "aws_iam_role_policy" "catherine_fc_ec2" {
name = "catherine_fc_ec2_policy"
role = aws_iam_role.instance.id
policy = <<EOF4
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"ec2:DescribeInstances",
"ec2:DescribeTags"
],
"Effect": "Allow",
"Resource": [
"*"
]
}
]
}
EOF4
}
resource "aws_iam_role_policy" "catherine_fc_s3" {
name = "catherine_fc_s3_policy"
role = aws_iam_role.instance.id
policy = <<EOF5
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:GetObjectAcl",
"s3:GetObject",
"s3:ListBucket"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::catherine-fc-*"
]
}
]
}
EOF5
}
resource "aws_iam_role_policy_attachment" "GOV_ssm_basic" {
role = aws_iam_role.instance.id
policy_arn = "arn:aws:iam::${data.aws_caller_identity.self.account_id}:policy/GOV_ssm_basic"
}

View File

@@ -0,0 +1,20 @@
resource "aws_launch_configuration" "catherine_fc_conf" {
name_prefix = "catherine-fc-conf-"
image_id = data.aws_ami.catherine_fc_ami.id
instance_type = var.ec2_instance_type
iam_instance_profile = aws_iam_instance_profile.catherine_fc_profile.name
security_groups = [
aws_security_group.catherine_fc_ec2_sg.id
]
user_data = <<-EOF
#!/bin/bash
yum -y update
EOF
root_block_device {
volume_type = "gp2"
volume_size = 16
}
associate_public_ip_address = false
key_name = var.key_name
}

View File

@@ -0,0 +1,23 @@
resource "aws_lb" "catherine_fc_load_balancer" {
name = "catherine-fc-lb"
internal = false
load_balancer_type = "application"
security_groups = [aws_security_group.catherine_fc_lb_sg]
subnets = [var.internal_subnet_ids]
enable_deletion_protection = true
tags = var.tags
}
resource "aws_lb_listener" "front_end" {
load_balancer_arn = aws_lb.front_end.arn
port = "443"
protocol = "HTTPS"
ssl_policy = "ELBSecurityPolicy-TLS-1-2-Ext-2018-06"
certificate_arn = "arn:aws:acm:ap-northeast-1:353699021357:certificate/df8e9911-1f45-4e3f-90cb-4c34f3ed3e50"
default_action {
type = "forward"
target_group_arn = aws_lb_target_group.target_group_web.arn
}
}

View File

@@ -0,0 +1,4 @@
output "asg_arn" {
value = aws_autoscaling_group.es_asg.arn
}

View File

@@ -0,0 +1,55 @@
resource "aws_security_group" "catherine_fc_asg_sg" {
description = "catherine fc security group"
vpc_id = var.vpc_id
tags = var.tags
}
resource "aws_security_group_rule" "catherine_fc_asg_sg_ingress" {
description = "lb security group"
type = "ingress"
from_port = 8080
to_port = 8080
protocol = "tcp"
cidr_blocks = [ "0.0.0.0/0" ]
security_group_id = aws_security_group.catherine_fc_asg_sg.id
}
resource "aws_security_group_rule" "catherine_fc_asg_sg_allow_egress" {
description = "allow all"
type = "egress"
protocol = "all"
from_port = 0
to_port = 65535
cidr_blocks = [ "0.0.0.0/0" ]
security_group_id = aws_security_group.catherine_fc_asg_sg.id
}
resource "aws_security_group" "catherine_fc_lb_sg" {
description = "catherine fc security group for load balancer"
vpc_id = var.vpc_id
tags = var.tags
}
resource "aws_security_group_rule" "catherine_fc_alb_sg_ingress" {
description = "alb security group"
type = "ingress"
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = [ "0.0.0.0/0" ]
security_group_id = aws_security_group.catherine_fc_lb_sg.id
}
resource "aws_security_group_rule" "catherine_fc_asg_sg_allow_egress" {
description = "allow all"
type = "egress"
protocol = "all"
from_port = 0
to_port = 65535
cidr_blocks = [ "0.0.0.0/0" ]
security_group_id = aws_security_group.catherine_fc_lb_sg.id
}

View File

@@ -0,0 +1,6 @@
resource "aws_lb_target_group" "target_group_web" {
name = "catherine-fc-tg"
port = 8080
protocol = "HTTP"
vpc_id = aws_vpc.main.id
}

View File

@@ -0,0 +1,9 @@
variable "vpc_id" {}
variable "internal_subnet_ids" {}
variable "tags" {}
variable "asg_tags" {}
variable "asg_caps" {}
variable "basename" {}
variable "ec2_instance_type" {}
variable "key_name" {}
variable "asg_arn" {}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 455 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 461 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 457 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 448 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 454 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 702 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 748 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -3,7 +3,7 @@
src: url('./static/font/indieflower.ttf') format('truetype'); }
.header {
background-image: url('./static/img/bgbg.png');
background-image: url('https://static.catherine-fc.com/media/bgbg.png');
background-repeat: none;
width: 100%;
height: 460px;
@@ -16,7 +16,7 @@
margin: auto;
width: 235px;
height: 99px;
background-image: url('./static/img/buynow.png');
background-image: url('https://static.catherine-fc.com/media/buynow.png');
z-index: 1;
&> a {
display:block;
@@ -33,7 +33,7 @@
left: 0;
right: 0;
margin: auto;
background-image: url('./static/img/bgimage.png');
background-image: url('https://static.catherine-fc.com/media/bgimage.png');
background-repeat: none;
width: 1366px;
height: 401px;
@@ -41,7 +41,7 @@
transition: background-image 0.5s ease-in-out;
&:hover {
transition: background-image 0.5s ease-in-out;
background-image: url('./static/img/bgimagenight.png');
background-image: url('https://static.catherine-fc.com/media/bgimagenight.png');
}
}
.logoHeader {
@@ -52,7 +52,7 @@
margin: auto;
width: 577px;
height: 401px;
background-image: url('./static/img/cat_fb_logo.png');
background-image: url('https://static.catherine-fc.com/media/cat_fb_logo.png');
background-repeat: none;
z-index: 1;
}
@@ -65,7 +65,7 @@
margin: auto;
width: 415px;
height: 64px;
background-image: url('./static/img/faito_crab.png');
background-image: url('https://static.catherine-fc.com/media/faito_crab.png');
background-repeat: none;
z-index: 1;
}
@@ -77,7 +77,7 @@
display: flex;
flex-direction: column;
width: 100%;
background-image: url('./static/img/background.png');
background-image: url('https://static.catherine-fc.com/media/background.png');
background-repeat: none;
color: white;
min-height: 100vh;
@@ -108,7 +108,7 @@
float: right;
width: 113px;
height: 70px;
background-image: url('./static/img/twitch.png');
background-image: url('https://static.catherine-fc.com/media/twitch.png');
background-size: 142px 70px;
margin: 0 20px;
background-repeat: none;
@@ -122,7 +122,7 @@
.twitchHome {
width: 113px;
height: 70px;
background-image: url('./static/img/twitch.png');
background-image: url('https://static.catherine-fc.com/media/twitch.png');
background-size: 142px 70px;
margin: auto;
background-repeat: none;
@@ -138,7 +138,7 @@
width: 70px;
height: 70px;
margin: 0 20px;
background-image: url('./static/img/twitter.png');
background-image: url('https://static.catherine-fc.com/media/twitter.png');
background-size: contain;
&> a {
display:block;
@@ -151,7 +151,7 @@
width: 100px;
height: 70px;
margin: 0 20px;
background-image: url('./static/img/youtube.png');
background-image: url('https://static.catherine-fc.com/media/youtube.png');
background-size: contain;
&> a {
display:block;
@@ -255,7 +255,7 @@
height: 314px;
margin: 20px auto;
padding: 30px;
background-image: url('./static/img/playerbg.png');
background-image: url('https://static.catherine-fc.com/media/playerbg.png');
background-repeat: none;
font-family: 'M PLUS Rounded 1c';
&:nth-child(odd) {
@@ -309,43 +309,43 @@
}
.character-blue_cap {
@include characterImage('./static/img/00_bluecap_1204.png');
@include characterImage('https://static.catherine-fc.com/media/00_bluecap_1204.png');
}
.character-red_cap {
@include characterImage('./static/img/00_redcap_1204.png');
@include characterImage('https://static.catherine-fc.com/media/00_redcap_1204.png');
}
.character-vincent_shirt {
@include characterImage('./static/img/01_vincent_1204.png');
@include characterImage('https://static.catherine-fc.com/media/01_vincent_1204.png');
}
.character-vincent_sheep {
@include characterImage('./static/img/01_sheep_vincent_1204.png');
@include characterImage('https://static.catherine-fc.com/media/01_sheep_vincent_1204.png');
}
.character-katherine {
@include characterImage('./static/img/02_katherine_1204.png');
@include characterImage('https://static.catherine-fc.com/media/02_katherine_1204.png');
}
.character-catherine {
@include characterImage('./static/img/03_catherine_1204.png');
@include characterImage('https://static.catherine-fc.com/media/03_catherine_1204.png');
}
.character-rin {
@include characterImage('./static/img/04_rin_1204.png');
@include characterImage('https://static.catherine-fc.com/media/04_rin_1204.png');
}
.character-orlando {
@include characterImage('./static/img/05_orlando_1204.png');
@include characterImage('https://static.catherine-fc.com/media/05_orlando_1204.png');
}
.character-johny {
@include characterImage('./static/img/06_jonny_1204.png');
@include characterImage('https://static.catherine-fc.com/media/06_jonny_1204.png');
}
.character-tobby {
@include characterImage('./static/img/07_tobby_1204.png');
@include characterImage('https://static.catherine-fc.com/media/07_tobby_1204.png');
}
.character-erica {
@include characterImage('./static/img/08_erika_1204.png');
@include characterImage('https://static.catherine-fc.com/media/08_erika_1204.png');
}
.character-master {
@include characterImage('./static/img/09_master_1204.png');
@include characterImage('https://static.catherine-fc.com/media/09_master_1204.png');
}
.character-joker {
@include characterImage('./static/img/13_joker_1204.png');
@include characterImage('https://static.catherine-fc.com/media/13_joker_1204.png');
}
.titlePlayer {
@@ -368,7 +368,7 @@
height: 800px;
margin: 20px auto;
padding: 50px;
background-image: url('./static/img/playerbg.png');
background-image: url('https://static.catherine-fc.com/media/playerbg.png');
background-repeat: none;
background-size: 980px 800px;
font-family: 'M PLUS Rounded 1c';
@@ -382,7 +382,7 @@
margin-top: 70px;
bottom: 0;
left: 0;
background-image: url('./static/img/title_sheep.png');
background-image: url('https://static.catherine-fc.com/media/title_sheep.png');
background-repeat: none;
}
.guideBody {
@@ -401,7 +401,7 @@
width: 128px;
height: 128px;
margin: 20px;
background-image: url('./static/img/letterbox.png');
background-image: url('https://static.catherine-fc.com/media/letterbox.png');
background-size: 128px 128px;
background-repeat: none;
& > a {
@@ -415,7 +415,7 @@
width: 128px;
height: 128px;
margin: 20px auto;
background-image: url('./static/img/letterbox.png');
background-image: url('https://static.catherine-fc.com/media/letterbox.png');
background-size: 128px 128px;
background-repeat: none;
& > a {
@@ -436,7 +436,7 @@
width: 400px;
height: 340px;
margin: auto;
background-image: url('./static/img/chalice.png');
background-image: url('https://static.catherine-fc.com/media/chalice.png');
background-size: contain;
background-repeat: none;
}
@@ -444,7 +444,7 @@
width: 900px;
height: 606px;
margin: auto;
background-image: url('./static/img/players.png');
background-image: url('https://static.catherine-fc.com/media/players.png');
background-size: contain;
background-repeat: none;
}
@@ -452,7 +452,7 @@
width: 567px;
height: 485px;
margin: auto;
background-image: url('./static/img/scoreboard.png');
background-image: url('https://static.catherine-fc.com/media/scoreboard.png');
background-size: contain;
background-repeat: none;
}
@@ -460,7 +460,7 @@
width: 808px;
height: 119px;
margin: auto;
background-image: url('./static/img/straysheepcup0.png');
background-image: url('https://static.catherine-fc.com/media/straysheepcup0.png');
background-size: contain;
background-repeat: none;
}
@@ -468,7 +468,7 @@
width: 900px;
height: 637px;
margin: auto;
background-image: url('./static/img/rule.png');
background-image: url('https://static.catherine-fc.com/media/rule.png');
background-size: contain;
background-repeat: none;
}
@@ -482,7 +482,7 @@
width: 899px;
height: 696px;
margin: auto;
background-image: url('./static/img/0801.png');
background-image: url('https://static.catherine-fc.com/media/0801.png');
background-size: contain;
background-repeat: none;
}
@@ -491,7 +491,7 @@
width: 900px;
height: 710px;
margin: auto;
background-image: url('./static/img/0802.png');
background-image: url('https://static.catherine-fc.com/media/0802.png');
background-size: contain;
background-repeat: none;
}
@@ -499,7 +499,7 @@
width: 900px;
height: 710px;
margin: auto;
background-image: url('./static/img/0808.png');
background-image: url('https://static.catherine-fc.com/media/0808.png');
background-size: contain;
background-repeat: none;
}
@@ -507,7 +507,7 @@
width: 900px;
height: 696px;
margin: auto;
background-image: url('./static/img/0809.png');
background-image: url('https://static.catherine-fc.com/media/0809.png');
background-size: contain;
background-repeat: none;
}
@@ -515,7 +515,7 @@
width: 900px;
height: 696px;
margin: auto;
background-image: url('./static/img/0815.png');
background-image: url('https://static.catherine-fc.com/media/0815.png');
background-size: contain;
background-repeat: none;
}

23
tools/discord-commentator/.gitignore vendored Normal file
View File

@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*

View File

@@ -0,0 +1,44 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.<br />
You will also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).

View File

@@ -0,0 +1,39 @@
{
"name": "discord-commentator",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"@types/jest": "^24.9.1",
"@types/node": "^12.12.54",
"@types/react": "^16.9.44",
"@types/react-dom": "^16.9.8",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.1",
"typescript": "^3.7.5"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

View File

@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:

View File

@@ -0,0 +1,38 @@
.App {
text-align: center;
}
.App-logo {
height: 40vmin;
pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

View File

@@ -0,0 +1,9 @@
import React from 'react';
import { render } from '@testing-library/react';
import App from './App';
test('renders learn react link', () => {
const { getByText } = render(<App />);
const linkElement = getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});

View File

@@ -0,0 +1,26 @@
import React from 'react';
import logo from './logo.svg';
import './App.css';
function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.tsx</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
);
}
export default App;

View File

@@ -0,0 +1,13 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}

View File

@@ -0,0 +1,17 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();

View File

@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
<g fill="#61DAFB">
<path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/>
<circle cx="420.9" cy="296.5" r="45.7"/>
<path d="M520.5 78.1z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -0,0 +1 @@
/// <reference types="react-scripts" />

View File

@@ -0,0 +1,149 @@
// This optional code is used to register a service worker.
// register() is not called by default.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on subsequent visits to a page, after all the
// existing tabs open on the page have been closed, since previously cached
// resources are updated in the background.
// To learn more about the benefits of this model and instructions on how to
// opt-in, read https://bit.ly/CRA-PWA
const isLocalhost = Boolean(
window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.0/8 are considered localhost for IPv4.
window.location.hostname.match(
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
)
);
type Config = {
onSuccess?: (registration: ServiceWorkerRegistration) => void;
onUpdate?: (registration: ServiceWorkerRegistration) => void;
};
export function register(config?: Config) {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
// The URL constructor is available in all browsers that support SW.
const publicUrl = new URL(
process.env.PUBLIC_URL,
window.location.href
);
if (publicUrl.origin !== window.location.origin) {
// Our service worker won't work if PUBLIC_URL is on a different origin
// from what our page is served on. This might happen if a CDN is used to
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
return;
}
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
if (isLocalhost) {
// This is running on localhost. Let's check if a service worker still exists or not.
checkValidServiceWorker(swUrl, config);
// Add some additional logging to localhost, pointing developers to the
// service worker/PWA documentation.
navigator.serviceWorker.ready.then(() => {
console.log(
'This web app is being served cache-first by a service ' +
'worker. To learn more, visit https://bit.ly/CRA-PWA'
);
});
} else {
// Is not localhost. Just register service worker
registerValidSW(swUrl, config);
}
});
}
}
function registerValidSW(swUrl: string, config?: Config) {
navigator.serviceWorker
.register(swUrl)
.then(registration => {
registration.onupdatefound = () => {
const installingWorker = registration.installing;
if (installingWorker == null) {
return;
}
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the updated precached content has been fetched,
// but the previous service worker will still serve the older
// content until all client tabs are closed.
console.log(
'New content is available and will be used when all ' +
'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
);
// Execute callback
if (config && config.onUpdate) {
config.onUpdate(registration);
}
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.');
// Execute callback
if (config && config.onSuccess) {
config.onSuccess(registration);
}
}
}
};
};
})
.catch(error => {
console.error('Error during service worker registration:', error);
});
}
function checkValidServiceWorker(swUrl: string, config?: Config) {
// Check if the service worker can be found. If it can't reload the page.
fetch(swUrl, {
headers: { 'Service-Worker': 'script' }
})
.then(response => {
// Ensure service worker exists, and that we really are getting a JS file.
const contentType = response.headers.get('content-type');
if (
response.status === 404 ||
(contentType != null && contentType.indexOf('javascript') === -1)
) {
// No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready.then(registration => {
registration.unregister().then(() => {
window.location.reload();
});
});
} else {
// Service worker found. Proceed as normal.
registerValidSW(swUrl, config);
}
})
.catch(() => {
console.log(
'No internet connection found. App is running in offline mode.'
);
});
}
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready
.then(registration => {
registration.unregister();
})
.catch(error => {
console.error(error.message);
});
}
}

View File

@@ -0,0 +1,5 @@
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom/extend-expect';

View File

@@ -0,0 +1,25 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react"
},
"include": [
"src"
]
}

View File

@@ -1,7 +1,7 @@
.App {
height: 100vh;
width: 100vw;
background-image: url('./straysheep.png') ;
background-image: url('https://static.catherine-fc.com/tool/straysheep.png') ;
background-size: cover;
background-repeat: none;
}

View File

@@ -42,35 +42,35 @@
}
.cementery {
@include stageImage('../../static/img/01.png');
@include stageImage('https://static.catherine-fc.com/tool/01.png');
}
.prison {
@include stageImage('../../static/img/02.png');
@include stageImage('https://static.catherine-fc.com/tool/02.png');
}
.torture {
@include stageImage('../../static/img/03.png');
@include stageImage('https://static.catherine-fc.com/tool/03.png');
}
.inquisition {
@include stageImage('../../static/img/04.png');
@include stageImage('https://static.catherine-fc.com/tool/04.png');
}
.quadrangle {
@include stageImage('../../static/img/05.png');
@include stageImage('https://static.catherine-fc.com/tool/05.png');
}
.clock {
@include stageImage('../../static/img/06.png');
@include stageImage('https://static.catherine-fc.com/tool/06.png');
}
.spiral {
@include stageImage('../../static/img/07.png');
@include stageImage('https://static.catherine-fc.com/tool/07.png');
}
.cathedral {
@include stageImage('../../static/img/08.png');
@include stageImage('https://static.catherine-fc.com/tool/08.png');
}
.empireo {
@include stageImage('../../static/img/09.png');
@include stageImage('https://static.catherine-fc.com/tool/09.png');
}
.close {
@include stageImage('../../static/img/10.png');
@include stageImage('https://static.catherine-fc.com/tool/10.png');
}
.arrange {
@include stageImage('../../static/img/11.png');
@include stageImage('https://static.catherine-fc.com/tool/11.png');
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 858 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 995 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 MiB