Compare commits
47 Commits
master
...
image-extr
| Author | SHA1 | Date | |
|---|---|---|---|
| 147e2563d1 | |||
| 48e15e459b | |||
| 7322be7381 | |||
| 56c20da7ac | |||
| 69aa61a03b | |||
| 463d20999f | |||
| a399ca0e2b | |||
| 838441d25e | |||
| abd8789bea | |||
| eb7d5c75d0 | |||
| c29c601dea | |||
| d60857ec62 | |||
| 45db9a4af8 | |||
| ab9cdebaca | |||
| 6326de12f1 | |||
| 5728f34b3b | |||
| 2ac3a940fa | |||
| 541a6cdd59 | |||
| c1184fd330 | |||
| e7c61e2d86 | |||
| 3529ff23aa | |||
| a36673de41 | |||
| 159f676164 | |||
| 58015eeba4 | |||
| 266ef004f3 | |||
| c1f2761893 | |||
| 441cc92a28 | |||
| 7df0ed18f7 | |||
| 848551e00a | |||
| 8a40e52604 | |||
| 28ac00600d | |||
| a7ab986062 | |||
| 232dae3377 | |||
| 4573814d91 | |||
| dba90cd1ce | |||
| 31015e8b31 | |||
| 268cc5f32c | |||
| 1c915634b4 | |||
| 2633818cfd | |||
| f372b6dce1 | |||
| cef0509bf9 | |||
| 48d45312b7 | |||
| 92f26420ff | |||
| 385766ab31 | |||
| b47358949f | |||
| 4b1c59ed24 | |||
| 3c480f9b63 |
8
.gitignore
vendored
@@ -21,3 +21,11 @@ pnpm-debug.log*
|
|||||||
*.njsproj
|
*.njsproj
|
||||||
*.sln
|
*.sln
|
||||||
*.sw?
|
*.sw?
|
||||||
|
|
||||||
|
# Custom
|
||||||
|
src/assets/deck_of_cards
|
||||||
|
src/assets/avatars
|
||||||
|
.image-extraction/images
|
||||||
|
|
||||||
|
# terraform
|
||||||
|
*.terraform
|
||||||
|
|||||||
140
.image-extraction/.gitignore
vendored
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
# Byte-compiled / optimized / DLL files
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*$py.class
|
||||||
|
|
||||||
|
# C extensions
|
||||||
|
*.so
|
||||||
|
|
||||||
|
# Distribution / packaging
|
||||||
|
.Python
|
||||||
|
build/
|
||||||
|
develop-eggs/
|
||||||
|
dist/
|
||||||
|
downloads/
|
||||||
|
eggs/
|
||||||
|
.eggs/
|
||||||
|
lib/
|
||||||
|
lib64/
|
||||||
|
parts/
|
||||||
|
sdist/
|
||||||
|
var/
|
||||||
|
wheels/
|
||||||
|
share/python-wheels/
|
||||||
|
*.egg-info/
|
||||||
|
.installed.cfg
|
||||||
|
*.egg
|
||||||
|
MANIFEST
|
||||||
|
|
||||||
|
# PyInstaller
|
||||||
|
# Usually these files are written by a python script from a template
|
||||||
|
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||||
|
*.manifest
|
||||||
|
*.spec
|
||||||
|
|
||||||
|
# Installer logs
|
||||||
|
pip-log.txt
|
||||||
|
pip-delete-this-directory.txt
|
||||||
|
|
||||||
|
# Unit test / coverage reports
|
||||||
|
htmlcov/
|
||||||
|
.tox/
|
||||||
|
.nox/
|
||||||
|
.coverage
|
||||||
|
.coverage.*
|
||||||
|
.cache
|
||||||
|
nosetests.xml
|
||||||
|
coverage.xml
|
||||||
|
*.cover
|
||||||
|
*.py,cover
|
||||||
|
.hypothesis/
|
||||||
|
.pytest_cache/
|
||||||
|
cover/
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
*.mo
|
||||||
|
*.pot
|
||||||
|
|
||||||
|
# Django stuff:
|
||||||
|
*.log
|
||||||
|
local_settings.py
|
||||||
|
db.sqlite3
|
||||||
|
db.sqlite3-journal
|
||||||
|
|
||||||
|
# Flask stuff:
|
||||||
|
instance/
|
||||||
|
.webassets-cache
|
||||||
|
|
||||||
|
# Scrapy stuff:
|
||||||
|
.scrapy
|
||||||
|
|
||||||
|
# Sphinx documentation
|
||||||
|
docs/_build/
|
||||||
|
|
||||||
|
# PyBuilder
|
||||||
|
.pybuilder/
|
||||||
|
target/
|
||||||
|
|
||||||
|
# Jupyter Notebook
|
||||||
|
.ipynb_checkpoints
|
||||||
|
|
||||||
|
# IPython
|
||||||
|
profile_default/
|
||||||
|
ipython_config.py
|
||||||
|
|
||||||
|
# pyenv
|
||||||
|
# For a library or package, you might want to ignore these files since the code is
|
||||||
|
# intended to run in multiple environments; otherwise, check them in:
|
||||||
|
# .python-version
|
||||||
|
|
||||||
|
# pipenv
|
||||||
|
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
||||||
|
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
||||||
|
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
||||||
|
# install all needed dependencies.
|
||||||
|
#Pipfile.lock
|
||||||
|
|
||||||
|
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
||||||
|
__pypackages__/
|
||||||
|
|
||||||
|
# Celery stuff
|
||||||
|
celerybeat-schedule
|
||||||
|
celerybeat.pid
|
||||||
|
|
||||||
|
# SageMath parsed files
|
||||||
|
*.sage.py
|
||||||
|
|
||||||
|
# Environments
|
||||||
|
.env
|
||||||
|
.venv
|
||||||
|
env/
|
||||||
|
venv/
|
||||||
|
ENV/
|
||||||
|
env.bak/
|
||||||
|
venv.bak/
|
||||||
|
|
||||||
|
# Spyder project settings
|
||||||
|
.spyderproject
|
||||||
|
.spyproject
|
||||||
|
|
||||||
|
# Rope project settings
|
||||||
|
.ropeproject
|
||||||
|
|
||||||
|
# mkdocs documentation
|
||||||
|
/site
|
||||||
|
|
||||||
|
# mypy
|
||||||
|
.mypy_cache/
|
||||||
|
.dmypy.json
|
||||||
|
dmypy.json
|
||||||
|
|
||||||
|
# Pyre type checker
|
||||||
|
.pyre/
|
||||||
|
|
||||||
|
# pytype static type analyzer
|
||||||
|
.pytype/
|
||||||
|
|
||||||
|
# Cython debug symbols
|
||||||
|
cython_debug/
|
||||||
|
|
||||||
|
|
||||||
0
.image-extraction/__init__.py
Normal file
41
.image-extraction/add_new_shikigami.md
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
# Adding new Shikigami
|
||||||
|
|
||||||
|
Remove all current images:
|
||||||
|
|
||||||
|
`fd -e png -x rm {}**`
|
||||||
|
|
||||||
|
After convert, copy to the character folder in assets:
|
||||||
|
|
||||||
|
`fd -e png hououka -x mv {} /Users/dtomlinson/git-repos/web-dev/onmyoji-deck-builder/src/assets/cards/hououka`
|
||||||
|
|
||||||
|
Print all cards (excluding char and avatar):
|
||||||
|
|
||||||
|
`fd -E '*char*' -E '*avatar*'`
|
||||||
|
|
||||||
|
Blank JSON template:
|
||||||
|
|
||||||
|
- Paste template in
|
||||||
|
- Fill in with new char name
|
||||||
|
- Fill in filenames
|
||||||
|
- Copy `cards`
|
||||||
|
- Select all items in `cards`
|
||||||
|
- New line and paste to duplicate
|
||||||
|
- Update GUID
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"name": "Hououka",
|
||||||
|
"character_card": "hououka/hououka-char.png",
|
||||||
|
"cards": [
|
||||||
|
{ "id": "d6fc26b2", "name": "", "url": "" },
|
||||||
|
{ "id": "1217f957", "name": "", "url": "" },
|
||||||
|
{ "id": "a507638d", "name": "", "url": "" },
|
||||||
|
{ "id": "a3e876ec", "name": "", "url": "" },
|
||||||
|
{ "id": "8fa65d84", "name": "", "url": "" },
|
||||||
|
{ "id": "914c6cbb", "name": "", "url": "" },
|
||||||
|
{ "id": "f1f8ce7d", "name": "", "url": "" },
|
||||||
|
{ "id": "1d30d350", "name": "", "url": "" },
|
||||||
|
],
|
||||||
|
"avatar": "hououka/hououka-avatar.png"
|
||||||
|
}
|
||||||
|
```
|
||||||
52
.image-extraction/extract_all.py
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
import glob
|
||||||
|
|
||||||
|
import extract_combat
|
||||||
|
import extract_spell
|
||||||
|
import extract_form
|
||||||
|
|
||||||
|
SHIKIGAMI_NAME = "umibozu"
|
||||||
|
|
||||||
|
|
||||||
|
def main(shikigami_name: str):
|
||||||
|
# combat cards
|
||||||
|
for image in glob.glob(
|
||||||
|
"/Users/dtomlinson/git-repos/web-dev/onmyoji-deck-builder/."
|
||||||
|
"image-extraction/images/combat/*.*"
|
||||||
|
):
|
||||||
|
print(image)
|
||||||
|
extract_combat.extract_image(
|
||||||
|
image,
|
||||||
|
"/Users/dtomlinson/git-repos/web-dev/onmyoji-deck-builder/."
|
||||||
|
"image-extraction/images/combat/out",
|
||||||
|
shikigami_name,
|
||||||
|
)
|
||||||
|
|
||||||
|
# spell cards
|
||||||
|
for image in glob.glob(
|
||||||
|
"/Users/dtomlinson/git-repos/web-dev/onmyoji-deck-builder/."
|
||||||
|
"image-extraction/images/spells/*.*"
|
||||||
|
):
|
||||||
|
print(image)
|
||||||
|
extract_spell.extract_image(
|
||||||
|
image,
|
||||||
|
"/Users/dtomlinson/git-repos/web-dev/onmyoji-deck-builder/."
|
||||||
|
"image-extraction/images/spells/out",
|
||||||
|
shikigami_name,
|
||||||
|
)
|
||||||
|
|
||||||
|
# form cards
|
||||||
|
for image in glob.glob(
|
||||||
|
"/Users/dtomlinson/git-repos/web-dev/onmyoji-deck-builder/."
|
||||||
|
"image-extraction/images/forms/*.*"
|
||||||
|
):
|
||||||
|
print(image)
|
||||||
|
extract_form.extract_image(
|
||||||
|
image,
|
||||||
|
"/Users/dtomlinson/git-repos/web-dev/onmyoji-deck-builder/."
|
||||||
|
"image-extraction/images/forms/out",
|
||||||
|
shikigami_name,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main(SHIKIGAMI_NAME)
|
||||||
85
.image-extraction/extract_character.py
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
import glob
|
||||||
|
|
||||||
|
import numpy
|
||||||
|
from PIL import Image, ImageDraw
|
||||||
|
|
||||||
|
|
||||||
|
def extract_image(filename: str, output_path: str) -> None:
|
||||||
|
"""
|
||||||
|
Extract a character card from a screenshot from a device. Screenshot for each card
|
||||||
|
taken from the Shikigami page. Image will be resized and the card extracted.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
filename (str): Full path to the input image.
|
||||||
|
output_path (str): Full path to the directory where the image should be saved.
|
||||||
|
"""
|
||||||
|
# Open the image, add alpha channel for transparency
|
||||||
|
initial_image = Image.open(filename).convert("RGBA")
|
||||||
|
|
||||||
|
# Check for size
|
||||||
|
if initial_image.size[0] != 1304:
|
||||||
|
basewidth = 1304
|
||||||
|
wpercent = basewidth / float(initial_image.size[0])
|
||||||
|
hsize = int((float(initial_image.size[1]) * float(wpercent)))
|
||||||
|
initial_image = initial_image.resize((basewidth, hsize), Image.ANTIALIAS)
|
||||||
|
# initial_image.save(f"{output_path}/{filename.split('/')[-1]}")
|
||||||
|
# raise SystemExit
|
||||||
|
|
||||||
|
# Convert to numpy array
|
||||||
|
initial_image_array = numpy.asarray(initial_image)
|
||||||
|
|
||||||
|
# Create mask polygon using points of the card border
|
||||||
|
mask_polygon = [
|
||||||
|
(768, 97),
|
||||||
|
(768, 512),
|
||||||
|
(534, 512),
|
||||||
|
(534, 97),
|
||||||
|
(559, 79),
|
||||||
|
(580, 70),
|
||||||
|
(604, 63),
|
||||||
|
(631, 58),
|
||||||
|
(651, 58),
|
||||||
|
(652, 58),
|
||||||
|
(671, 58),
|
||||||
|
(698, 63),
|
||||||
|
(722, 70),
|
||||||
|
(745, 79),
|
||||||
|
]
|
||||||
|
|
||||||
|
# Create the mask
|
||||||
|
mask_image = Image.new(
|
||||||
|
"L", (initial_image_array.shape[1], initial_image_array.shape[0]), 0
|
||||||
|
)
|
||||||
|
ImageDraw.Draw(mask_image).polygon(mask_polygon, outline=1, fill=1)
|
||||||
|
mask = numpy.array(mask_image)
|
||||||
|
|
||||||
|
# create a new empty image
|
||||||
|
extracted_image_array = numpy.empty(initial_image_array.shape, dtype="uint8")
|
||||||
|
|
||||||
|
# copy the colours from the first 3 columns
|
||||||
|
extracted_image_array[:, :, :3] = initial_image_array[:, :, :3]
|
||||||
|
|
||||||
|
# apply transparency to the alpha channel (4th column)
|
||||||
|
extracted_image_array[:, :, 3] = mask * 255
|
||||||
|
|
||||||
|
# convert back to an image
|
||||||
|
extracted_image = Image.fromarray(extracted_image_array, "RGBA")
|
||||||
|
|
||||||
|
# crop
|
||||||
|
extracted_image = extracted_image.crop((533, 57, 769, 512))
|
||||||
|
|
||||||
|
# save the image
|
||||||
|
extracted_image.save(f"{output_path}/{filename.split('/')[-1].split('.')[-2]}.png")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
for image in glob.glob(
|
||||||
|
"/Users/dtomlinson/git-repos/web-dev/onmyoji-deck-builder/."
|
||||||
|
"image-extraction/images/characters/*.*"
|
||||||
|
):
|
||||||
|
print(image)
|
||||||
|
extract_image(
|
||||||
|
image,
|
||||||
|
"/Users/dtomlinson/git-repos/web-dev/onmyoji-deck-builder/."
|
||||||
|
"image-extraction/images/characters/out",
|
||||||
|
)
|
||||||
70
.image-extraction/extract_combat.py
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
import numpy
|
||||||
|
from PIL import Image, ImageDraw
|
||||||
|
|
||||||
|
|
||||||
|
def extract_image(filename: str, output_path: str, shikigami_name: str) -> None:
|
||||||
|
"""
|
||||||
|
Extract a combat card from a screenshot from a device. Screenshot for each card
|
||||||
|
taken from the Hyakabun scrollery. Image will be resized and the card extracted.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
filename (str): Full path to the input image.
|
||||||
|
output_path (str): Full path to the directory where the image should be saved.
|
||||||
|
"""
|
||||||
|
# Open the image, add alpha channel for transparency
|
||||||
|
initial_image = Image.open(filename).convert("RGBA")
|
||||||
|
|
||||||
|
# Check for size
|
||||||
|
if initial_image.size[0] != 1304:
|
||||||
|
basewidth = 1304
|
||||||
|
wpercent = basewidth / float(initial_image.size[0])
|
||||||
|
hsize = int((float(initial_image.size[1]) * float(wpercent)))
|
||||||
|
initial_image = initial_image.resize((basewidth, hsize), Image.ANTIALIAS)
|
||||||
|
|
||||||
|
# Convert to numpy array
|
||||||
|
initial_image_array = numpy.asarray(initial_image)
|
||||||
|
|
||||||
|
# Create mask polygon using points of the card border
|
||||||
|
mask_polygon = [
|
||||||
|
(788, 90),
|
||||||
|
(788, 567),
|
||||||
|
(515, 567),
|
||||||
|
(515, 130),
|
||||||
|
(496, 110),
|
||||||
|
(496, 89),
|
||||||
|
(513, 76),
|
||||||
|
(523, 76),
|
||||||
|
(528, 76),
|
||||||
|
(536, 81),
|
||||||
|
(651, 39),
|
||||||
|
(652, 39),
|
||||||
|
]
|
||||||
|
|
||||||
|
# Create the mask
|
||||||
|
mask_image = Image.new(
|
||||||
|
"L", (initial_image_array.shape[1], initial_image_array.shape[0]), 0
|
||||||
|
)
|
||||||
|
ImageDraw.Draw(mask_image).polygon(mask_polygon, outline=1, fill=1)
|
||||||
|
mask = numpy.array(mask_image)
|
||||||
|
|
||||||
|
# create a new empty image
|
||||||
|
extracted_image_array = numpy.empty(initial_image_array.shape, dtype="uint8")
|
||||||
|
|
||||||
|
# copy the colours from the first 3 columns
|
||||||
|
extracted_image_array[:, :, :3] = initial_image_array[:, :, :3]
|
||||||
|
|
||||||
|
# apply transparency to the alpha channel (4th column)
|
||||||
|
extracted_image_array[:, :, 3] = mask * 255
|
||||||
|
|
||||||
|
# convert back to an image
|
||||||
|
extracted_image = Image.fromarray(extracted_image_array, "RGBA")
|
||||||
|
print(extracted_image.size)
|
||||||
|
|
||||||
|
# crop
|
||||||
|
extracted_image = extracted_image.crop((495, 38, 788, 567))
|
||||||
|
|
||||||
|
# save the image
|
||||||
|
extracted_image.save(
|
||||||
|
f"{output_path}/{shikigami_name}-"
|
||||||
|
f"{filename.split('/')[-1].split('.')[-2]}.png"
|
||||||
|
)
|
||||||
101
.image-extraction/extract_field.py
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
import glob
|
||||||
|
|
||||||
|
import numpy
|
||||||
|
from PIL import Image, ImageDraw
|
||||||
|
|
||||||
|
|
||||||
|
def extract_image(filename: str, output_path: str) -> None:
|
||||||
|
"""
|
||||||
|
Extract a field card from a screenshot from a device. Screenshot for each card
|
||||||
|
taken from the Hyakabun scrollery. Image will be resized and the card extracted.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
filename (str): Full path to the input image.
|
||||||
|
output_path (str): Full path to the directory where the image should be saved.
|
||||||
|
"""
|
||||||
|
# Open the image, add alpha channel for transparency
|
||||||
|
initial_image = Image.open(filename).convert("RGBA")
|
||||||
|
|
||||||
|
# Check for size
|
||||||
|
if initial_image.size[0] != 1304:
|
||||||
|
basewidth = 1304
|
||||||
|
wpercent = basewidth / float(initial_image.size[0])
|
||||||
|
hsize = int((float(initial_image.size[1]) * float(wpercent)))
|
||||||
|
initial_image = initial_image.resize((basewidth, hsize), Image.ANTIALIAS)
|
||||||
|
# initial_image.save(f"{output_path}/{filename.split('/')[-1]}")
|
||||||
|
# raise SystemExit
|
||||||
|
|
||||||
|
# Convert to numpy array
|
||||||
|
initial_image_array = numpy.asarray(initial_image)
|
||||||
|
|
||||||
|
# Create mask polygon using points of the card border
|
||||||
|
mask_polygon = [
|
||||||
|
(788, 68),
|
||||||
|
(788, 568),
|
||||||
|
(515, 568),
|
||||||
|
(515, 130),
|
||||||
|
(495, 112),
|
||||||
|
(491, 104),
|
||||||
|
(491, 96),
|
||||||
|
(495, 88),
|
||||||
|
(515, 72),
|
||||||
|
(515, 68),
|
||||||
|
(500, 46),
|
||||||
|
(499, 46),
|
||||||
|
(499, 43),
|
||||||
|
(502, 43),
|
||||||
|
(512, 47),
|
||||||
|
(523, 49),
|
||||||
|
(534, 51),
|
||||||
|
(550, 52),
|
||||||
|
(567, 52),
|
||||||
|
(584, 53),
|
||||||
|
(719, 53),
|
||||||
|
(736, 52),
|
||||||
|
(753, 52),
|
||||||
|
(769, 51),
|
||||||
|
(774, 50),
|
||||||
|
(779, 49),
|
||||||
|
(785, 48),
|
||||||
|
(790, 47),
|
||||||
|
(794, 46),
|
||||||
|
(803, 43),
|
||||||
|
]
|
||||||
|
|
||||||
|
# Create the mask
|
||||||
|
mask_image = Image.new(
|
||||||
|
"L", (initial_image_array.shape[1], initial_image_array.shape[0]), 0
|
||||||
|
)
|
||||||
|
ImageDraw.Draw(mask_image).polygon(mask_polygon, outline=1, fill=1)
|
||||||
|
mask = numpy.array(mask_image)
|
||||||
|
|
||||||
|
# create a new empty image
|
||||||
|
extracted_image_array = numpy.empty(initial_image_array.shape, dtype="uint8")
|
||||||
|
|
||||||
|
# copy the colours from the first 3 columns
|
||||||
|
extracted_image_array[:, :, :3] = initial_image_array[:, :, :3]
|
||||||
|
|
||||||
|
# apply transparency to the alpha channel (4th column)
|
||||||
|
extracted_image_array[:, :, 3] = mask * 255
|
||||||
|
|
||||||
|
# convert back to an image
|
||||||
|
extracted_image = Image.fromarray(extracted_image_array, "RGBA")
|
||||||
|
|
||||||
|
# crop
|
||||||
|
extracted_image = extracted_image.crop((490, 42, 803, 568))
|
||||||
|
|
||||||
|
# save the image
|
||||||
|
extracted_image.save(f"{output_path}/{filename.split('/')[-1].split('.')[-2]}.png")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
for image in glob.glob(
|
||||||
|
"/Users/dtomlinson/git-repos/web-dev/onmyoji-deck-builder/."
|
||||||
|
"image-extraction/images/fields/*.*"
|
||||||
|
):
|
||||||
|
print(image)
|
||||||
|
extract_image(
|
||||||
|
image,
|
||||||
|
"/Users/dtomlinson/git-repos/web-dev/onmyoji-deck-builder/."
|
||||||
|
"image-extraction/images/fields/out",
|
||||||
|
)
|
||||||
73
.image-extraction/extract_form.py
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
import numpy
|
||||||
|
from PIL import Image, ImageDraw
|
||||||
|
|
||||||
|
|
||||||
|
def extract_image(filename: str, output_path: str, shikigami_name: str) -> None:
|
||||||
|
"""
|
||||||
|
Extract a form card from a screenshot from a device. Screenshot for each card
|
||||||
|
taken from the Hyakabun scrollery. Image will be resized and the card extracted.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
filename (str): Full path to the input image.
|
||||||
|
output_path (str): Full path to the directory where the image should be saved.
|
||||||
|
"""
|
||||||
|
# Open the image, add alpha channel for transparency
|
||||||
|
initial_image = Image.open(filename).convert("RGBA")
|
||||||
|
|
||||||
|
# Check for size
|
||||||
|
if initial_image.size[0] != 1304:
|
||||||
|
basewidth = 1304
|
||||||
|
wpercent = basewidth / float(initial_image.size[0])
|
||||||
|
hsize = int((float(initial_image.size[1]) * float(wpercent)))
|
||||||
|
initial_image = initial_image.resize((basewidth, hsize), Image.ANTIALIAS)
|
||||||
|
|
||||||
|
# Convert to numpy array
|
||||||
|
initial_image_array = numpy.asarray(initial_image)
|
||||||
|
|
||||||
|
# Create mask polygon using points of the card border
|
||||||
|
mask_polygon = [
|
||||||
|
(788, 85),
|
||||||
|
(788, 567),
|
||||||
|
(515, 567),
|
||||||
|
(515, 130),
|
||||||
|
(496, 110),
|
||||||
|
(496, 89),
|
||||||
|
(513, 76),
|
||||||
|
(523, 76),
|
||||||
|
(528, 76),
|
||||||
|
(539, 66),
|
||||||
|
(581, 49),
|
||||||
|
(624, 40),
|
||||||
|
(679, 40),
|
||||||
|
(722, 49),
|
||||||
|
(764, 66),
|
||||||
|
(775, 74),
|
||||||
|
]
|
||||||
|
|
||||||
|
# Create the mask
|
||||||
|
mask_image = Image.new(
|
||||||
|
"L", (initial_image_array.shape[1], initial_image_array.shape[0]), 0
|
||||||
|
)
|
||||||
|
ImageDraw.Draw(mask_image).polygon(mask_polygon, outline=1, fill=1)
|
||||||
|
mask = numpy.array(mask_image)
|
||||||
|
|
||||||
|
# create a new empty image
|
||||||
|
extracted_image_array = numpy.empty(initial_image_array.shape, dtype="uint8")
|
||||||
|
|
||||||
|
# copy the colours from the first 3 columns
|
||||||
|
extracted_image_array[:, :, :3] = initial_image_array[:, :, :3]
|
||||||
|
|
||||||
|
# apply transparency to the alpha channel (4th column)
|
||||||
|
extracted_image_array[:, :, 3] = mask * 255
|
||||||
|
|
||||||
|
# convert back to an image
|
||||||
|
extracted_image = Image.fromarray(extracted_image_array, "RGBA")
|
||||||
|
|
||||||
|
# crop
|
||||||
|
extracted_image = extracted_image.crop((495, 39, 789, 567))
|
||||||
|
|
||||||
|
# save the image
|
||||||
|
extracted_image.save(
|
||||||
|
f"{output_path}/{shikigami_name}-"
|
||||||
|
f"{filename.split('/')[-1].split('.')[-2]}.png"
|
||||||
|
)
|
||||||
67
.image-extraction/extract_spell.py
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
import numpy
|
||||||
|
from PIL import Image, ImageDraw
|
||||||
|
|
||||||
|
|
||||||
|
def extract_image(filename: str, output_path: str, shikigami_name: str) -> None:
|
||||||
|
"""
|
||||||
|
Extract a spell card from a screenshot from a device. Mask is valid for 1304x603
|
||||||
|
screenshot from an iPhone 12 Pro.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
filename (str): Full path to the input image.
|
||||||
|
output_path (str): Full path where the image should be saved.
|
||||||
|
"""
|
||||||
|
# Open the image, add alpha channel for transparency
|
||||||
|
initial_image = Image.open(filename).convert("RGBA")
|
||||||
|
|
||||||
|
# Check for size
|
||||||
|
if initial_image.size[0] != 1304:
|
||||||
|
basewidth = 1304
|
||||||
|
wpercent = basewidth / float(initial_image.size[0])
|
||||||
|
hsize = int((float(initial_image.size[1]) * float(wpercent)))
|
||||||
|
initial_image = initial_image.resize((basewidth, hsize), Image.ANTIALIAS)
|
||||||
|
|
||||||
|
# Convert to numpy array
|
||||||
|
initial_image_array = numpy.asarray(initial_image)
|
||||||
|
|
||||||
|
# Create mask polygon using points of the card border (iPhone 12 Pro screenshot)
|
||||||
|
mask_polygon = [
|
||||||
|
(535, 60),
|
||||||
|
(768, 60),
|
||||||
|
(788, 85),
|
||||||
|
(788, 567),
|
||||||
|
(515, 567),
|
||||||
|
(515, 130),
|
||||||
|
(496, 110),
|
||||||
|
(496, 91),
|
||||||
|
(513, 73),
|
||||||
|
(523, 73),
|
||||||
|
]
|
||||||
|
|
||||||
|
# Create the mask
|
||||||
|
mask_image = Image.new(
|
||||||
|
"L", (initial_image_array.shape[1], initial_image_array.shape[0]), 0
|
||||||
|
)
|
||||||
|
ImageDraw.Draw(mask_image).polygon(mask_polygon, outline=1, fill=1)
|
||||||
|
mask = numpy.array(mask_image)
|
||||||
|
|
||||||
|
# create a new empty image
|
||||||
|
extracted_image_array = numpy.empty(initial_image_array.shape, dtype="uint8")
|
||||||
|
|
||||||
|
# copy the colours from the first 3 columns
|
||||||
|
extracted_image_array[:, :, :3] = initial_image_array[:, :, :3]
|
||||||
|
|
||||||
|
# apply transparency to the alpha channel (4th column)
|
||||||
|
extracted_image_array[:, :, 3] = mask * 255
|
||||||
|
|
||||||
|
# convert back to an image
|
||||||
|
extracted_image = Image.fromarray(extracted_image_array, "RGBA")
|
||||||
|
|
||||||
|
# crop
|
||||||
|
extracted_image = extracted_image.crop((496, 59, 788, 567))
|
||||||
|
|
||||||
|
# save the image
|
||||||
|
extracted_image.save(
|
||||||
|
f"{output_path}/{shikigami_name}-"
|
||||||
|
f"{filename.split('/')[-1].split('.')[-2]}.png"
|
||||||
|
)
|
||||||
215
.infrastructure/Makefile
Normal file
@@ -0,0 +1,215 @@
|
|||||||
|
# Copyright 2016 Philip G. Porada
|
||||||
|
#
|
||||||
|
# Licensed 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.
|
||||||
|
|
||||||
|
.ONESHELL:
|
||||||
|
.SHELL := /usr/bin/bash
|
||||||
|
.PHONY: apply destroy-backend destroy destroy-target plan-destroy plan plan-target prep
|
||||||
|
|
||||||
|
-include Makefile.env
|
||||||
|
# VARS="variables/$(ENV)-$(REGION).tfvars"
|
||||||
|
VARS="$(ENV)-$(REGION).tfvars"
|
||||||
|
CURRENT_FOLDER=$(shell basename "$$(pwd)")
|
||||||
|
S3_BUCKET="$(ENV)-$(REGION)-$(PROJECT)-terraform"
|
||||||
|
DYNAMODB_TABLE="$(ENV)-$(REGION)-$(PROJECT)-terraform"
|
||||||
|
WORKSPACE="$(ENV)-$(REGION)"
|
||||||
|
BOLD=$(shell tput bold)
|
||||||
|
RED=$(shell tput setaf 1)
|
||||||
|
GREEN=$(shell tput setaf 2)
|
||||||
|
YELLOW=$(shell tput setaf 3)
|
||||||
|
RESET=$(shell tput sgr0)
|
||||||
|
|
||||||
|
help:
|
||||||
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||||
|
|
||||||
|
set-env:
|
||||||
|
@if [ -z $(ENV) ]; then \
|
||||||
|
echo "$(BOLD)$(RED)ENV was not set$(RESET)"; \
|
||||||
|
ERROR=1; \
|
||||||
|
fi
|
||||||
|
@if [ -z $(REGION) ]; then \
|
||||||
|
echo "$(BOLD)$(RED)REGION was not set$(RESET)"; \
|
||||||
|
ERROR=1; \
|
||||||
|
fi
|
||||||
|
@if [ -z $(AWS_PROFILE) ]; then \
|
||||||
|
echo "$(BOLD)$(RED)AWS_PROFILE was not set.$(RESET)"; \
|
||||||
|
ERROR=1; \
|
||||||
|
fi
|
||||||
|
@if [ ! -z $${ERROR} ] && [ $${ERROR} -eq 1 ]; then \
|
||||||
|
echo "$(BOLD)Example usage: \`AWS_PROFILE=whatever ENV=demo REGION=us-east-2 make plan\`$(RESET)"; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
@if [ ! -f "$(VARS)" ]; then \
|
||||||
|
echo "$(BOLD)$(RED)Could not find variables file: $(VARS)$(RESET)"; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
prep: set-env ## Prepare a new workspace (environment) if needed, configure the tfstate backend, update any modules, and switch to the workspace
|
||||||
|
@echo "$(BOLD)Verifying that the S3 bucket $(S3_BUCKET) for remote state exists$(RESET)"
|
||||||
|
@if ! aws --profile $(AWS_PROFILE) s3api head-bucket --region $(REGION) --bucket $(S3_BUCKET) > /dev/null 2>&1 ; then \
|
||||||
|
echo "$(BOLD)S3 bucket $(S3_BUCKET) was not found, creating new bucket with versioning enabled to store tfstate$(RESET)"; \
|
||||||
|
aws --profile $(AWS_PROFILE) s3api create-bucket \
|
||||||
|
--bucket $(S3_BUCKET) \
|
||||||
|
--acl private \
|
||||||
|
--region $(REGION) \
|
||||||
|
--create-bucket-configuration LocationConstraint=$(REGION) > /dev/null 2>&1 ; \
|
||||||
|
aws --profile $(AWS_PROFILE) s3api put-bucket-versioning \
|
||||||
|
--bucket $(S3_BUCKET) \
|
||||||
|
--versioning-configuration Status=Enabled > /dev/null 2>&1 ; \
|
||||||
|
echo "$(BOLD)$(GREEN)S3 bucket $(S3_BUCKET) created$(RESET)"; \
|
||||||
|
else
|
||||||
|
echo "$(BOLD)$(GREEN)S3 bucket $(S3_BUCKET) exists$(RESET)"; \
|
||||||
|
fi
|
||||||
|
@echo "$(BOLD)Verifying that the DynamoDB table exists for remote state locking$(RESET)"
|
||||||
|
@if ! aws --profile $(AWS_PROFILE) --region $(REGION) dynamodb describe-table --table-name $(DYNAMODB_TABLE) > /dev/null 2>&1 ; then \
|
||||||
|
echo "$(BOLD)DynamoDB table $(DYNAMODB_TABLE) was not found, creating new DynamoDB table to maintain locks$(RESET)"; \
|
||||||
|
aws --profile $(AWS_PROFILE) dynamodb create-table \
|
||||||
|
--region $(REGION) \
|
||||||
|
--table-name $(DYNAMODB_TABLE) \
|
||||||
|
--attribute-definitions AttributeName=LockID,AttributeType=S \
|
||||||
|
--key-schema AttributeName=LockID,KeyType=HASH \
|
||||||
|
--provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 > /dev/null 2>&1 ; \
|
||||||
|
echo "$(BOLD)$(GREEN)DynamoDB table $(DYNAMODB_TABLE) created$(RESET)"; \
|
||||||
|
echo "Sleeping for 10 seconds to allow DynamoDB state to propagate through AWS"; \
|
||||||
|
sleep 10; \
|
||||||
|
else
|
||||||
|
echo "$(BOLD)$(GREEN)DynamoDB Table $(DYNAMODB_TABLE) exists$(RESET)"; \
|
||||||
|
fi
|
||||||
|
@aws ec2 --profile=$(AWS_PROFILE) describe-key-pairs | jq -r '.KeyPairs[].KeyName' | grep "$(ENV)_infra_key" > /dev/null 2>&1; \
|
||||||
|
if [ $$? -ne 0 ]; then \
|
||||||
|
echo "$(BOLD)$(RED)EC2 Key Pair $(INFRA_KEY)_infra_key was not found$(RESET)"; \
|
||||||
|
read -p '$(BOLD)Do you want to generate a new keypair? [y/Y]: $(RESET)' ANSWER && \
|
||||||
|
if [ "$${ANSWER}" == "y" ] || [ "$${ANSWER}" == "Y" ]; then \
|
||||||
|
mkdir -p ~/.ssh; \
|
||||||
|
ssh-keygen -t rsa -b 4096 -N '' -f ~/.ssh/$(ENV)_infra_key; \
|
||||||
|
aws ec2 --profile=$(AWS_PROFILE) import-key-pair --key-name "$(ENV)_infra_key" --public-key-material "file://~/.ssh/$(ENV)_infra_key.pub"; \
|
||||||
|
fi; \
|
||||||
|
else \
|
||||||
|
echo "$(BOLD)$(GREEN)EC2 Key Pair $(ENV)_infra_key exists$(RESET)";\
|
||||||
|
fi
|
||||||
|
@echo "$(BOLD)Configuring the terraform backend$(RESET)"
|
||||||
|
@terraform init \
|
||||||
|
-input=false \
|
||||||
|
-force-copy \
|
||||||
|
-lock=true \
|
||||||
|
-upgrade \
|
||||||
|
-verify-plugins=true \
|
||||||
|
-backend=true \
|
||||||
|
-backend-config="profile=$(AWS_PROFILE)" \
|
||||||
|
-backend-config="region=$(REGION)" \
|
||||||
|
-backend-config="bucket=$(S3_BUCKET)" \
|
||||||
|
-backend-config="key=$(ENV)/$(CURRENT_FOLDER)/terraform.tfstate" \
|
||||||
|
-backend-config="dynamodb_table=$(DYNAMODB_TABLE)"\
|
||||||
|
-backend-config="acl=private"
|
||||||
|
@echo "$(BOLD)Switching to workspace $(WORKSPACE)$(RESET)"
|
||||||
|
@terraform workspace select $(WORKSPACE) || terraform workspace new $(WORKSPACE)
|
||||||
|
|
||||||
|
plan: prep ## Show what terraform thinks it will do
|
||||||
|
@terraform plan \
|
||||||
|
-lock=true \
|
||||||
|
-input=false \
|
||||||
|
-refresh=true \
|
||||||
|
-var-file="$(VARS)"
|
||||||
|
|
||||||
|
format: prep ## Rewrites all Terraform configuration files to a canonical format.
|
||||||
|
@terraform fmt \
|
||||||
|
-write=true \
|
||||||
|
-recursive
|
||||||
|
|
||||||
|
# https://github.com/terraform-linters/tflint
|
||||||
|
lint: prep ## Check for possible errors, best practices, etc in current directory!
|
||||||
|
@tflint
|
||||||
|
|
||||||
|
# https://github.com/liamg/tfsec
|
||||||
|
check-security: prep ## Static analysis of your terraform templates to spot potential security issues.
|
||||||
|
@tfsec .
|
||||||
|
|
||||||
|
documentation: prep ## Generate README.md for a module
|
||||||
|
@terraform-docs \
|
||||||
|
markdown table \
|
||||||
|
--sort-by-required . > README.md
|
||||||
|
|
||||||
|
plan-target: prep ## Shows what a plan looks like for applying a specific resource
|
||||||
|
@echo "$(YELLOW)$(BOLD)[INFO] $(RESET)"; echo "Example to type for the following question: module.rds.aws_route53_record.rds-master"
|
||||||
|
@read -p "PLAN target: " DATA && \
|
||||||
|
terraform plan \
|
||||||
|
-lock=true \
|
||||||
|
-input=true \
|
||||||
|
-refresh=true \
|
||||||
|
-var-file="$(VARS)" \
|
||||||
|
-target=$$DATA
|
||||||
|
|
||||||
|
plan-destroy: prep ## Creates a destruction plan.
|
||||||
|
@terraform plan \
|
||||||
|
-input=false \
|
||||||
|
-refresh=true \
|
||||||
|
-destroy \
|
||||||
|
-var-file="$(VARS)"
|
||||||
|
|
||||||
|
apply: prep ## Have terraform do the things. This will cost money.
|
||||||
|
@terraform apply \
|
||||||
|
-lock=true \
|
||||||
|
-input=false \
|
||||||
|
-refresh=true \
|
||||||
|
-var-file="$(VARS)"
|
||||||
|
|
||||||
|
destroy: prep ## Destroy the things
|
||||||
|
@terraform destroy \
|
||||||
|
-lock=true \
|
||||||
|
-input=false \
|
||||||
|
-refresh=true \
|
||||||
|
-var-file="$(VARS)"
|
||||||
|
|
||||||
|
destroy-target: prep ## Destroy a specific resource. Caution though, this destroys chained resources.
|
||||||
|
@echo "$(YELLOW)$(BOLD)[INFO] Specifically destroy a piece of Terraform data.$(RESET)"; echo "Example to type for the following question: module.rds.aws_route53_record.rds-master"
|
||||||
|
@read -p "Destroy target: " DATA && \
|
||||||
|
terraform destroy \
|
||||||
|
-lock=true \
|
||||||
|
-input=false \
|
||||||
|
-refresh=true \
|
||||||
|
-var-file=$(VARS) \
|
||||||
|
-target=$$DATA
|
||||||
|
|
||||||
|
destroy-backend: ## Destroy S3 bucket and DynamoDB table
|
||||||
|
@if ! aws --profile $(AWS_PROFILE) dynamodb delete-table \
|
||||||
|
--region $(REGION) \
|
||||||
|
--table-name $(DYNAMODB_TABLE) > /dev/null 2>&1 ; then \
|
||||||
|
echo "$(BOLD)$(RED)Unable to delete DynamoDB table $(DYNAMODB_TABLE)$(RESET)"; \
|
||||||
|
else
|
||||||
|
echo "$(BOLD)$(RED)DynamoDB table $(DYNAMODB_TABLE) does not exist.$(RESET)"; \
|
||||||
|
fi
|
||||||
|
@if ! aws --profile $(AWS_PROFILE) s3api delete-objects \
|
||||||
|
--region $(REGION) \
|
||||||
|
--bucket $(S3_BUCKET) \
|
||||||
|
--delete "$$(aws --profile $(AWS_PROFILE) s3api list-object-versions \
|
||||||
|
--region $(REGION) \
|
||||||
|
--bucket $(S3_BUCKET) \
|
||||||
|
--output=json \
|
||||||
|
--query='{Objects: Versions[].{Key:Key,VersionId:VersionId}}')" > /dev/null 2>&1 ; then \
|
||||||
|
echo "$(BOLD)$(RED)Unable to delete objects in S3 bucket $(S3_BUCKET)$(RESET)"; \
|
||||||
|
fi
|
||||||
|
@if ! aws --profile $(AWS_PROFILE) s3api delete-objects \
|
||||||
|
--region $(REGION) \
|
||||||
|
--bucket $(S3_BUCKET) \
|
||||||
|
--delete "$$(aws --profile $(AWS_PROFILE) s3api list-object-versions \
|
||||||
|
--region $(REGION) \
|
||||||
|
--bucket $(S3_BUCKET) \
|
||||||
|
--output=json \
|
||||||
|
--query='{Objects: DeleteMarkers[].{Key:Key,VersionId:VersionId}}')" > /dev/null 2>&1 ; then \
|
||||||
|
echo "$(BOLD)$(RED)Unable to delete markers in S3 bucket $(S3_BUCKET)$(RESET)"; \
|
||||||
|
fi
|
||||||
|
@if ! aws --profile $(AWS_PROFILE) s3api delete-bucket \
|
||||||
|
--region $(REGION) \
|
||||||
|
--bucket $(S3_BUCKET) > /dev/null 2>&1 ; then \
|
||||||
|
echo "$(BOLD)$(RED)Unable to delete S3 bucket $(S3_BUCKET) itself$(RESET)"; \
|
||||||
|
fi
|
||||||
5
.infrastructure/Makefile.env
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# ENV="prod"
|
||||||
|
ENV="dev"
|
||||||
|
REGION="eu-west-1"
|
||||||
|
PROJECT="onmyojideckbuilder"
|
||||||
|
AWS_PROFILE="admin"
|
||||||
19
.infrastructure/dev-eu-west-1.tfvars
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# module
|
||||||
|
name = "onmyojideckbuilder"
|
||||||
|
region = "eu-west-1"
|
||||||
|
stage = "dev"
|
||||||
|
profile = "admin"
|
||||||
|
|
||||||
|
# cloudfront
|
||||||
|
acm_certificate_arn = "arn:aws:acm:us-east-1:745437999005:certificate/11502ff4-7851-426f-92ac-27db7c44825f"
|
||||||
|
parent_zone_id = "Z0511918V1SF3MCG22JU"
|
||||||
|
aliases = ["dev.onmyojideckbuilder.com"]
|
||||||
|
allowed_origins = ["*.onmyojideckbuilder.com"]
|
||||||
|
|
||||||
|
# s3 & lambda
|
||||||
|
acl = "private"
|
||||||
|
lambda_key = "main.zip"
|
||||||
|
source_file = "./lambda/main.js"
|
||||||
|
handler = "main.handler"
|
||||||
|
runtime = "nodejs12.x"
|
||||||
|
s3_region = "us-east-1"
|
||||||
29
.infrastructure/lambda/main.js
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
exports.handler = (event, context, callback) => {
|
||||||
|
// Extract the request from the Cloudfront event that is sent to Lambda@Edge
|
||||||
|
var request = event.Records[0].cf.request;
|
||||||
|
|
||||||
|
// Extract the URI from the request
|
||||||
|
var oldURI = request.uri;
|
||||||
|
|
||||||
|
// Match any '/' that occurs at the end of a URI. Replace it with a default index
|
||||||
|
function replace_uri(uri) {
|
||||||
|
uri = uri.replace(/\/$/, "/index.html");
|
||||||
|
// uri = uri.replace(/\.io\/search\?q\=(.*)/, ".io/search/index.html?q=$1");
|
||||||
|
// console.log(uri)
|
||||||
|
return uri;
|
||||||
|
}
|
||||||
|
// var newURI = oldURI.replace(/\/$/, "/index.html");
|
||||||
|
var newURI = replace_uri(oldURI);
|
||||||
|
|
||||||
|
// Log the URI as received by Cloudfront and the new URI to be used to fetch from the origin
|
||||||
|
console.log(`Old URI: ${oldURI}`);
|
||||||
|
console.log(`New URI: ${newURI}`);
|
||||||
|
|
||||||
|
// Replace the received URI with the URI that includes the index page
|
||||||
|
request.uri = newURI;
|
||||||
|
|
||||||
|
// Return to Cloudfront
|
||||||
|
return callback(null, request);
|
||||||
|
};
|
||||||
BIN
.infrastructure/lambda/main.js.zip
Normal file
136
.infrastructure/main.tf
Normal file
@@ -0,0 +1,136 @@
|
|||||||
|
# aws config
|
||||||
|
provider "aws" {
|
||||||
|
region = var.region
|
||||||
|
profile = var.profile
|
||||||
|
version = "~> 2.66"
|
||||||
|
}
|
||||||
|
|
||||||
|
provider "aws" {
|
||||||
|
alias = "us_east_1"
|
||||||
|
profile = var.profile
|
||||||
|
region = "us-east-1"
|
||||||
|
}
|
||||||
|
|
||||||
|
# tags
|
||||||
|
locals {
|
||||||
|
tags = {
|
||||||
|
"Project" = "onmyoji-deck-builder"
|
||||||
|
"Description" = "website to build and share onmyoji decks"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# cloudfront
|
||||||
|
module "cloudfront_s3_cdn" {
|
||||||
|
source = "git::https://github.com/cloudposse/terraform-aws-cloudfront-s3-cdn.git?ref=tags/0.52.0"
|
||||||
|
stage = var.stage
|
||||||
|
name = var.name
|
||||||
|
parent_zone_id = var.parent_zone_id
|
||||||
|
dns_alias_enabled = true
|
||||||
|
acm_certificate_arn = var.acm_certificate_arn
|
||||||
|
use_regional_s3_endpoint = true
|
||||||
|
origin_force_destroy = true
|
||||||
|
compress = true
|
||||||
|
cors_allowed_headers = ["*"]
|
||||||
|
cors_allowed_methods = ["GET", "HEAD", "PUT", "POST"]
|
||||||
|
cors_allowed_origins = var.allowed_origins
|
||||||
|
tags = local.tags
|
||||||
|
aliases = var.aliases
|
||||||
|
index_document = "index.html"
|
||||||
|
error_document = "index.html"
|
||||||
|
website_enabled = true
|
||||||
|
# lambda_function_association = [
|
||||||
|
# {
|
||||||
|
# event_type : "origin-request",
|
||||||
|
# lambda_arn : aws_lambda_function.directory_indexes.qualified_arn,
|
||||||
|
# include_body : false
|
||||||
|
# }
|
||||||
|
# ]
|
||||||
|
|
||||||
|
# this policy sets the bucket to be public for all newly created files
|
||||||
|
additional_bucket_policy = <<-EOT
|
||||||
|
{
|
||||||
|
"Version": "2012-10-17",
|
||||||
|
"Statement": [
|
||||||
|
{
|
||||||
|
"Sid":"PublicRead",
|
||||||
|
"Effect":"Allow",
|
||||||
|
"Principal":"*",
|
||||||
|
"Action":["s3:GetObject"],
|
||||||
|
"Resource":"arn:aws:s3:::${module.cloudfront_s3_cdn.s3_bucket}/*"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
EOT
|
||||||
|
}
|
||||||
|
|
||||||
|
# data "archive_file" "lambda_main" {
|
||||||
|
# type = "zip"
|
||||||
|
# source_file = var.source_file
|
||||||
|
# output_path = "${var.source_file}.zip"
|
||||||
|
# }
|
||||||
|
|
||||||
|
# resource "aws_lambda_function" "directory_indexes" {
|
||||||
|
# provider = aws.us_east_1
|
||||||
|
# function_name = "${var.stage}-${var.name}-directory_indexes"
|
||||||
|
# filename = "${var.source_file}.zip"
|
||||||
|
# source_code_hash = data.archive_file.lambda_main.output_base64sha256
|
||||||
|
# # s3_bucket = aws_s3_bucket.lambda_s3.id
|
||||||
|
# # s3_key = var.lambda_key
|
||||||
|
# handler = var.handler
|
||||||
|
# runtime = var.runtime
|
||||||
|
# role = aws_iam_role.lambda_role.arn
|
||||||
|
# publish = true
|
||||||
|
# tags = local.tags
|
||||||
|
|
||||||
|
# depends_on = [aws_iam_role_policy_attachment.lambda_logging]
|
||||||
|
# }
|
||||||
|
|
||||||
|
# ## Lambda iam role & policies
|
||||||
|
|
||||||
|
# resource "aws_iam_role" "lambda_role" {
|
||||||
|
# name = "${var.stage}-${var.name}-lambda"
|
||||||
|
# tags = local.tags
|
||||||
|
|
||||||
|
# assume_role_policy = <<-EOT
|
||||||
|
# {
|
||||||
|
# "Version": "2012-10-17",
|
||||||
|
# "Statement": [
|
||||||
|
# {
|
||||||
|
# "Effect": "Allow",
|
||||||
|
# "Principal": {
|
||||||
|
# "Service": [
|
||||||
|
# "lambda.amazonaws.com",
|
||||||
|
# "edgelambda.amazonaws.com"
|
||||||
|
# ]
|
||||||
|
# },
|
||||||
|
# "Action": "sts:AssumeRole"
|
||||||
|
# }
|
||||||
|
# ]
|
||||||
|
# }
|
||||||
|
# EOT
|
||||||
|
# }
|
||||||
|
|
||||||
|
# resource "aws_iam_policy" "lambda_logging" {
|
||||||
|
# name = "${var.stage}-${var.name}-lambda_logging"
|
||||||
|
# policy = <<-EOT
|
||||||
|
# {
|
||||||
|
# "Version": "2012-10-17",
|
||||||
|
# "Statement": [
|
||||||
|
# {
|
||||||
|
# "Action": [
|
||||||
|
# "logs:CreateLogGroup",
|
||||||
|
# "logs:CreateLogStream",
|
||||||
|
# "logs:PutLogEvents"
|
||||||
|
# ],
|
||||||
|
# "Resource": "arn:aws:logs:*:*:*",
|
||||||
|
# "Effect": "Allow"
|
||||||
|
# }
|
||||||
|
# ]
|
||||||
|
# }
|
||||||
|
# EOT
|
||||||
|
# }
|
||||||
|
|
||||||
|
# resource "aws_iam_role_policy_attachment" "lambda_logging" {
|
||||||
|
# role = aws_iam_role.lambda_role.name
|
||||||
|
# policy_arn = aws_iam_policy.lambda_logging.arn
|
||||||
|
# }
|
||||||
39
.infrastructure/outputs.tf
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
output "cf_id" {
|
||||||
|
value = module.cloudfront_s3_cdn.cf_id
|
||||||
|
description = "ID of AWS CloudFront distribution"
|
||||||
|
}
|
||||||
|
|
||||||
|
output "cf_arn" {
|
||||||
|
value = module.cloudfront_s3_cdn.cf_arn
|
||||||
|
description = "ARN of AWS CloudFront distribution"
|
||||||
|
}
|
||||||
|
|
||||||
|
output "cf_status" {
|
||||||
|
value = module.cloudfront_s3_cdn.cf_status
|
||||||
|
description = "Current status of the distribution"
|
||||||
|
}
|
||||||
|
|
||||||
|
output "cf_domain_name" {
|
||||||
|
value = module.cloudfront_s3_cdn.cf_domain_name
|
||||||
|
description = "Domain name corresponding to the distribution"
|
||||||
|
}
|
||||||
|
|
||||||
|
output "cf_etag" {
|
||||||
|
value = module.cloudfront_s3_cdn.cf_etag
|
||||||
|
description = "Current version of the distribution's information"
|
||||||
|
}
|
||||||
|
|
||||||
|
output "cf_hosted_zone_id" {
|
||||||
|
value = module.cloudfront_s3_cdn.cf_hosted_zone_id
|
||||||
|
description = "CloudFront Route 53 zone ID"
|
||||||
|
}
|
||||||
|
|
||||||
|
output "s3_bucket" {
|
||||||
|
value = module.cloudfront_s3_cdn.s3_bucket
|
||||||
|
description = "Name of S3 bucket"
|
||||||
|
}
|
||||||
|
|
||||||
|
output "s3_bucket_domain_name" {
|
||||||
|
value = module.cloudfront_s3_cdn.s3_bucket_domain_name
|
||||||
|
description = "Domain of S3 bucket"
|
||||||
|
}
|
||||||
19
.infrastructure/prod-eu-west-1.tfvars
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# module
|
||||||
|
name = "onmyojideckbuilder"
|
||||||
|
region = "eu-west-1"
|
||||||
|
stage = "prod"
|
||||||
|
profile = "admin"
|
||||||
|
|
||||||
|
# cloudfront
|
||||||
|
acm_certificate_arn = "arn:aws:acm:us-east-1:745437999005:certificate/11502ff4-7851-426f-92ac-27db7c44825f"
|
||||||
|
parent_zone_id = "Z0511918V1SF3MCG22JU"
|
||||||
|
aliases = ["onmyojideckbuilder.com"]
|
||||||
|
allowed_origins = ["*.onmyojideckbuilder.com"]
|
||||||
|
|
||||||
|
# s3 & lambda
|
||||||
|
acl = "private"
|
||||||
|
lambda_key = "main.zip"
|
||||||
|
source_file = "./lambda/main.js"
|
||||||
|
handler = "main.handler"
|
||||||
|
runtime = "nodejs12.x"
|
||||||
|
s3_region = "us-east-1"
|
||||||
@@ -0,0 +1,757 @@
|
|||||||
|
{
|
||||||
|
"version": 4,
|
||||||
|
"terraform_version": "0.13.5",
|
||||||
|
"serial": 49,
|
||||||
|
"lineage": "9232bec8-e306-d87e-d0ff-5f5901d34c76",
|
||||||
|
"outputs": {
|
||||||
|
"cf_arn": {
|
||||||
|
"value": "arn:aws:cloudfront::745437999005:distribution/E26NAB6HJPHQMZ",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"cf_domain_name": {
|
||||||
|
"value": "d1dkwcezyo6np1.cloudfront.net",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"cf_etag": {
|
||||||
|
"value": "ECAIV649D3TA1",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"cf_hosted_zone_id": {
|
||||||
|
"value": "Z2FDTNDATAQYW2",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"cf_id": {
|
||||||
|
"value": "E26NAB6HJPHQMZ",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"cf_status": {
|
||||||
|
"value": "Deployed",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"s3_bucket": {
|
||||||
|
"value": "dev-onmyojideckbuilder-origin",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"s3_bucket_domain_name": {
|
||||||
|
"value": "dev-onmyojideckbuilder-origin.s3-website.eu-west-1.amazonaws.com",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"resources": [
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn",
|
||||||
|
"mode": "data",
|
||||||
|
"type": "aws_iam_policy_document",
|
||||||
|
"name": "origin",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"id": "1888516152",
|
||||||
|
"json": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"S3GetObjectForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:GetObject\",\n \"Resource\": \"arn:aws:s3:::${bucket_name}${origin_path}*\",\n \"Principal\": {\n \"AWS\": \"${cloudfront_origin_access_identity_iam_arn}\"\n }\n },\n {\n \"Sid\": \"S3ListBucketForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:ListBucket\",\n \"Resource\": \"arn:aws:s3:::${bucket_name}\",\n \"Principal\": {\n \"AWS\": \"${cloudfront_origin_access_identity_iam_arn}\"\n }\n },\n {\n \"Sid\": \"PublicRead\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"s3:GetObject\"\n ],\n \"Resource\": \"arn:aws:s3:::dev-onmyojideckbuilder-origin/*\",\n \"Principal\": \"*\"\n }\n ]\n}",
|
||||||
|
"override_json": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\":\"PublicRead\",\n \"Effect\":\"Allow\",\n \"Principal\":\"*\",\n \"Action\":[\"s3:GetObject\"],\n \"Resource\":\"arn:aws:s3:::dev-onmyojideckbuilder-origin/*\"\n }\n ]\n}\n",
|
||||||
|
"policy_id": null,
|
||||||
|
"source_json": null,
|
||||||
|
"statement": [
|
||||||
|
{
|
||||||
|
"actions": [
|
||||||
|
"s3:GetObject"
|
||||||
|
],
|
||||||
|
"condition": [],
|
||||||
|
"effect": "Allow",
|
||||||
|
"not_actions": [],
|
||||||
|
"not_principals": [],
|
||||||
|
"not_resources": [],
|
||||||
|
"principals": [
|
||||||
|
{
|
||||||
|
"identifiers": [
|
||||||
|
"${cloudfront_origin_access_identity_iam_arn}"
|
||||||
|
],
|
||||||
|
"type": "AWS"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"resources": [
|
||||||
|
"arn:aws:s3:::${bucket_name}${origin_path}*"
|
||||||
|
],
|
||||||
|
"sid": "S3GetObjectForCloudFront"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actions": [
|
||||||
|
"s3:ListBucket"
|
||||||
|
],
|
||||||
|
"condition": [],
|
||||||
|
"effect": "Allow",
|
||||||
|
"not_actions": [],
|
||||||
|
"not_principals": [],
|
||||||
|
"not_resources": [],
|
||||||
|
"principals": [
|
||||||
|
{
|
||||||
|
"identifiers": [
|
||||||
|
"${cloudfront_origin_access_identity_iam_arn}"
|
||||||
|
],
|
||||||
|
"type": "AWS"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"resources": [
|
||||||
|
"arn:aws:s3:::${bucket_name}"
|
||||||
|
],
|
||||||
|
"sid": "S3ListBucketForCloudFront"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": "2012-10-17"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn",
|
||||||
|
"mode": "data",
|
||||||
|
"type": "aws_iam_policy_document",
|
||||||
|
"name": "origin_website",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"id": "1923286579",
|
||||||
|
"json": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"S3GetObjectForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:GetObject\",\n \"Resource\": \"arn:aws:s3:::${bucket_name}${origin_path}*\",\n \"Principal\": {\n \"AWS\": \"*\"\n }\n },\n {\n \"Sid\": \"PublicRead\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"s3:GetObject\"\n ],\n \"Resource\": \"arn:aws:s3:::dev-onmyojideckbuilder-origin/*\",\n \"Principal\": \"*\"\n }\n ]\n}",
|
||||||
|
"override_json": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\":\"PublicRead\",\n \"Effect\":\"Allow\",\n \"Principal\":\"*\",\n \"Action\":[\"s3:GetObject\"],\n \"Resource\":\"arn:aws:s3:::dev-onmyojideckbuilder-origin/*\"\n }\n ]\n}\n",
|
||||||
|
"policy_id": null,
|
||||||
|
"source_json": null,
|
||||||
|
"statement": [
|
||||||
|
{
|
||||||
|
"actions": [
|
||||||
|
"s3:GetObject"
|
||||||
|
],
|
||||||
|
"condition": [],
|
||||||
|
"effect": "Allow",
|
||||||
|
"not_actions": [],
|
||||||
|
"not_principals": [],
|
||||||
|
"not_resources": [],
|
||||||
|
"principals": [
|
||||||
|
{
|
||||||
|
"identifiers": [
|
||||||
|
"*"
|
||||||
|
],
|
||||||
|
"type": "AWS"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"resources": [
|
||||||
|
"arn:aws:s3:::${bucket_name}${origin_path}*"
|
||||||
|
],
|
||||||
|
"sid": "S3GetObjectForCloudFront"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": "2012-10-17"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn",
|
||||||
|
"mode": "data",
|
||||||
|
"type": "aws_s3_bucket",
|
||||||
|
"name": "selected",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"arn": "arn:aws:s3:::dev-onmyojideckbuilder-origin",
|
||||||
|
"bucket": "dev-onmyojideckbuilder-origin",
|
||||||
|
"bucket_domain_name": "dev-onmyojideckbuilder-origin.s3.amazonaws.com",
|
||||||
|
"bucket_regional_domain_name": "dev-onmyojideckbuilder-origin.s3.eu-west-1.amazonaws.com",
|
||||||
|
"hosted_zone_id": "Z1BKCTXD74EZPE",
|
||||||
|
"id": "dev-onmyojideckbuilder-origin",
|
||||||
|
"region": "eu-west-1",
|
||||||
|
"website_domain": "s3-website-eu-west-1.amazonaws.com",
|
||||||
|
"website_endpoint": "dev-onmyojideckbuilder-origin.s3-website-eu-west-1.amazonaws.com"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn",
|
||||||
|
"mode": "data",
|
||||||
|
"type": "template_file",
|
||||||
|
"name": "default",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/template\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"filename": null,
|
||||||
|
"id": "8de579f1267cb043b75ce0d0ec7c7438cfe63eb53e5f5526712c645342ab2104",
|
||||||
|
"rendered": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"S3GetObjectForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:GetObject\",\n \"Resource\": \"arn:aws:s3:::dev-onmyojideckbuilder-origin/*\",\n \"Principal\": {\n \"AWS\": \"*\"\n }\n },\n {\n \"Sid\": \"PublicRead\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"s3:GetObject\"\n ],\n \"Resource\": \"arn:aws:s3:::dev-onmyojideckbuilder-origin/*\",\n \"Principal\": \"*\"\n }\n ]\n}",
|
||||||
|
"template": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"S3GetObjectForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:GetObject\",\n \"Resource\": \"arn:aws:s3:::${bucket_name}${origin_path}*\",\n \"Principal\": {\n \"AWS\": \"*\"\n }\n },\n {\n \"Sid\": \"PublicRead\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"s3:GetObject\"\n ],\n \"Resource\": \"arn:aws:s3:::dev-onmyojideckbuilder-origin/*\",\n \"Principal\": \"*\"\n }\n ]\n}",
|
||||||
|
"vars": {
|
||||||
|
"bucket_name": "dev-onmyojideckbuilder-origin",
|
||||||
|
"cloudfront_origin_access_identity_iam_arn": "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E1N6NEL2NFYLEC",
|
||||||
|
"origin_path": "/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn",
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "aws_cloudfront_distribution",
|
||||||
|
"name": "default",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 1,
|
||||||
|
"attributes": {
|
||||||
|
"active_trusted_signers": {
|
||||||
|
"enabled": "false",
|
||||||
|
"items.#": "0"
|
||||||
|
},
|
||||||
|
"aliases": [
|
||||||
|
"dev.onmyojideckbuilder.com"
|
||||||
|
],
|
||||||
|
"arn": "arn:aws:cloudfront::745437999005:distribution/E26NAB6HJPHQMZ",
|
||||||
|
"cache_behavior": [],
|
||||||
|
"caller_reference": "terraform-20210319043915752700000002",
|
||||||
|
"comment": "Managed by Terraform",
|
||||||
|
"custom_error_response": [],
|
||||||
|
"default_cache_behavior": [
|
||||||
|
{
|
||||||
|
"allowed_methods": [
|
||||||
|
"DELETE",
|
||||||
|
"GET",
|
||||||
|
"HEAD",
|
||||||
|
"OPTIONS",
|
||||||
|
"PATCH",
|
||||||
|
"POST",
|
||||||
|
"PUT"
|
||||||
|
],
|
||||||
|
"cached_methods": [
|
||||||
|
"GET",
|
||||||
|
"HEAD"
|
||||||
|
],
|
||||||
|
"compress": true,
|
||||||
|
"default_ttl": 60,
|
||||||
|
"field_level_encryption_id": "",
|
||||||
|
"forwarded_values": [
|
||||||
|
{
|
||||||
|
"cookies": [
|
||||||
|
{
|
||||||
|
"forward": "none",
|
||||||
|
"whitelisted_names": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"headers": [
|
||||||
|
"Access-Control-Request-Headers",
|
||||||
|
"Access-Control-Request-Method",
|
||||||
|
"Origin"
|
||||||
|
],
|
||||||
|
"query_string": false,
|
||||||
|
"query_string_cache_keys": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"lambda_function_association": [],
|
||||||
|
"max_ttl": 31536000,
|
||||||
|
"min_ttl": 0,
|
||||||
|
"smooth_streaming": false,
|
||||||
|
"target_origin_id": "dev-onmyojideckbuilder",
|
||||||
|
"trusted_signers": [],
|
||||||
|
"viewer_protocol_policy": "redirect-to-https"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"default_root_object": "index.html",
|
||||||
|
"domain_name": "d1dkwcezyo6np1.cloudfront.net",
|
||||||
|
"enabled": true,
|
||||||
|
"etag": "ECAIV649D3TA1",
|
||||||
|
"hosted_zone_id": "Z2FDTNDATAQYW2",
|
||||||
|
"http_version": "http2",
|
||||||
|
"id": "E26NAB6HJPHQMZ",
|
||||||
|
"in_progress_validation_batches": 0,
|
||||||
|
"is_ipv6_enabled": true,
|
||||||
|
"last_modified_time": "2021-03-19 04:39:18.131 +0000 UTC",
|
||||||
|
"logging_config": [
|
||||||
|
{
|
||||||
|
"bucket": "dev-onmyojideckbuilder-logs.s3.amazonaws.com",
|
||||||
|
"include_cookies": false,
|
||||||
|
"prefix": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ordered_cache_behavior": [],
|
||||||
|
"origin": [
|
||||||
|
{
|
||||||
|
"custom_header": [],
|
||||||
|
"custom_origin_config": [
|
||||||
|
{
|
||||||
|
"http_port": 80,
|
||||||
|
"https_port": 443,
|
||||||
|
"origin_keepalive_timeout": 5,
|
||||||
|
"origin_protocol_policy": "http-only",
|
||||||
|
"origin_read_timeout": 30,
|
||||||
|
"origin_ssl_protocols": [
|
||||||
|
"TLSv1",
|
||||||
|
"TLSv1.1",
|
||||||
|
"TLSv1.2"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"domain_name": "dev-onmyojideckbuilder-origin.s3-website.eu-west-1.amazonaws.com",
|
||||||
|
"origin_id": "dev-onmyojideckbuilder",
|
||||||
|
"origin_path": "",
|
||||||
|
"s3_origin_config": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"origin_group": [],
|
||||||
|
"price_class": "PriceClass_100",
|
||||||
|
"restrictions": [
|
||||||
|
{
|
||||||
|
"geo_restriction": [
|
||||||
|
{
|
||||||
|
"locations": null,
|
||||||
|
"restriction_type": "none"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"retain_on_delete": false,
|
||||||
|
"status": "Deployed",
|
||||||
|
"tags": {
|
||||||
|
"Description": "website to build and share onmyoji decks",
|
||||||
|
"Name": "dev-onmyojideckbuilder",
|
||||||
|
"Project": "onmyoji-deck-builder",
|
||||||
|
"Stage": "dev"
|
||||||
|
},
|
||||||
|
"viewer_certificate": [
|
||||||
|
{
|
||||||
|
"acm_certificate_arn": "arn:aws:acm:us-east-1:745437999005:certificate/11502ff4-7851-426f-92ac-27db7c44825f",
|
||||||
|
"cloudfront_default_certificate": false,
|
||||||
|
"iam_certificate_id": "",
|
||||||
|
"minimum_protocol_version": "TLSv1",
|
||||||
|
"ssl_support_method": "sni-only"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"wait_for_deployment": true,
|
||||||
|
"web_acl_id": ""
|
||||||
|
},
|
||||||
|
"private": "eyJzY2hlbWFfdmVyc2lvbiI6IjEifQ==",
|
||||||
|
"dependencies": [
|
||||||
|
"module.cloudfront_s3_cdn.aws_cloudfront_origin_access_identity.default",
|
||||||
|
"module.cloudfront_s3_cdn.aws_s3_bucket.origin",
|
||||||
|
"module.cloudfront_s3_cdn.data.aws_s3_bucket.selected",
|
||||||
|
"module.cloudfront_s3_cdn.module.logs.aws_s3_bucket.default"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn",
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "aws_cloudfront_origin_access_identity",
|
||||||
|
"name": "default",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"index_key": 0,
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"caller_reference": "terraform-20210319043839499500000001",
|
||||||
|
"cloudfront_access_identity_path": "origin-access-identity/cloudfront/E1N6NEL2NFYLEC",
|
||||||
|
"comment": "dev-onmyojideckbuilder",
|
||||||
|
"etag": "E1DPF7M9GL23MB",
|
||||||
|
"iam_arn": "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E1N6NEL2NFYLEC",
|
||||||
|
"id": "E1N6NEL2NFYLEC",
|
||||||
|
"s3_canonical_user_id": "501de5fa8b08f19123f2333f616fcfe27d5308a3a2e9bba045758f8d911f3561d3d036204c5b518255cff676cd72a45b"
|
||||||
|
},
|
||||||
|
"private": "bnVsbA=="
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn",
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "aws_s3_bucket",
|
||||||
|
"name": "origin",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"index_key": 0,
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"acceleration_status": "",
|
||||||
|
"acl": "private",
|
||||||
|
"arn": "arn:aws:s3:::dev-onmyojideckbuilder-origin",
|
||||||
|
"bucket": "dev-onmyojideckbuilder-origin",
|
||||||
|
"bucket_domain_name": "dev-onmyojideckbuilder-origin.s3.amazonaws.com",
|
||||||
|
"bucket_prefix": null,
|
||||||
|
"bucket_regional_domain_name": "dev-onmyojideckbuilder-origin.s3.eu-west-1.amazonaws.com",
|
||||||
|
"cors_rule": [
|
||||||
|
{
|
||||||
|
"allowed_headers": [
|
||||||
|
"*"
|
||||||
|
],
|
||||||
|
"allowed_methods": [
|
||||||
|
"GET",
|
||||||
|
"HEAD",
|
||||||
|
"PUT",
|
||||||
|
"POST"
|
||||||
|
],
|
||||||
|
"allowed_origins": [
|
||||||
|
"*.onmyojideckbuilder.com"
|
||||||
|
],
|
||||||
|
"expose_headers": [
|
||||||
|
"ETag"
|
||||||
|
],
|
||||||
|
"max_age_seconds": 3600
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allowed_headers": [
|
||||||
|
"*"
|
||||||
|
],
|
||||||
|
"allowed_methods": [
|
||||||
|
"GET",
|
||||||
|
"HEAD",
|
||||||
|
"PUT",
|
||||||
|
"POST"
|
||||||
|
],
|
||||||
|
"allowed_origins": [
|
||||||
|
"dev.onmyojideckbuilder.com"
|
||||||
|
],
|
||||||
|
"expose_headers": [
|
||||||
|
"ETag"
|
||||||
|
],
|
||||||
|
"max_age_seconds": 3600
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"force_destroy": true,
|
||||||
|
"grant": [],
|
||||||
|
"hosted_zone_id": "Z1BKCTXD74EZPE",
|
||||||
|
"id": "dev-onmyojideckbuilder-origin",
|
||||||
|
"lifecycle_rule": [],
|
||||||
|
"logging": [],
|
||||||
|
"object_lock_configuration": [],
|
||||||
|
"policy": null,
|
||||||
|
"region": "eu-west-1",
|
||||||
|
"replication_configuration": [],
|
||||||
|
"request_payer": "BucketOwner",
|
||||||
|
"server_side_encryption_configuration": [
|
||||||
|
{
|
||||||
|
"rule": [
|
||||||
|
{
|
||||||
|
"apply_server_side_encryption_by_default": [
|
||||||
|
{
|
||||||
|
"kms_master_key_id": "",
|
||||||
|
"sse_algorithm": "AES256"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"tags": {
|
||||||
|
"Attributes": "origin",
|
||||||
|
"Description": "website to build and share onmyoji decks",
|
||||||
|
"Name": "dev-onmyojideckbuilder-origin",
|
||||||
|
"Project": "onmyoji-deck-builder",
|
||||||
|
"Stage": "dev"
|
||||||
|
},
|
||||||
|
"versioning": [
|
||||||
|
{
|
||||||
|
"enabled": true,
|
||||||
|
"mfa_delete": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"website": [
|
||||||
|
{
|
||||||
|
"error_document": "index.html",
|
||||||
|
"index_document": "index.html",
|
||||||
|
"redirect_all_requests_to": "",
|
||||||
|
"routing_rules": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"website_domain": "s3-website-eu-west-1.amazonaws.com",
|
||||||
|
"website_endpoint": "dev-onmyojideckbuilder-origin.s3-website-eu-west-1.amazonaws.com"
|
||||||
|
},
|
||||||
|
"private": "bnVsbA=="
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn",
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "aws_s3_bucket_policy",
|
||||||
|
"name": "default",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"index_key": 0,
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"bucket": "dev-onmyojideckbuilder-origin",
|
||||||
|
"id": "dev-onmyojideckbuilder-origin",
|
||||||
|
"policy": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"S3GetObjectForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:GetObject\",\n \"Resource\": \"arn:aws:s3:::dev-onmyojideckbuilder-origin/*\",\n \"Principal\": {\n \"AWS\": \"*\"\n }\n },\n {\n \"Sid\": \"PublicRead\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"s3:GetObject\"\n ],\n \"Resource\": \"arn:aws:s3:::dev-onmyojideckbuilder-origin/*\",\n \"Principal\": \"*\"\n }\n ]\n}"
|
||||||
|
},
|
||||||
|
"private": "bnVsbA==",
|
||||||
|
"dependencies": [
|
||||||
|
"module.cloudfront_s3_cdn.aws_cloudfront_origin_access_identity.default",
|
||||||
|
"module.cloudfront_s3_cdn.aws_s3_bucket.origin",
|
||||||
|
"module.cloudfront_s3_cdn.data.aws_iam_policy_document.origin",
|
||||||
|
"module.cloudfront_s3_cdn.data.aws_iam_policy_document.origin_website",
|
||||||
|
"module.cloudfront_s3_cdn.data.template_file.default"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn.module.dns",
|
||||||
|
"mode": "data",
|
||||||
|
"type": "aws_route53_zone",
|
||||||
|
"name": "default",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"index_key": 0,
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"caller_reference": "481ca519-c2ac-4885-b585-8283334987f7",
|
||||||
|
"comment": "",
|
||||||
|
"id": "Z0511918V1SF3MCG22JU",
|
||||||
|
"linked_service_description": null,
|
||||||
|
"linked_service_principal": null,
|
||||||
|
"name": "onmyojideckbuilder.com.",
|
||||||
|
"name_servers": [
|
||||||
|
"ns-1501.awsdns-59.org",
|
||||||
|
"ns-1652.awsdns-14.co.uk",
|
||||||
|
"ns-176.awsdns-22.com",
|
||||||
|
"ns-530.awsdns-02.net"
|
||||||
|
],
|
||||||
|
"private_zone": false,
|
||||||
|
"resource_record_set_count": 5,
|
||||||
|
"tags": {},
|
||||||
|
"vpc_id": null,
|
||||||
|
"zone_id": "Z0511918V1SF3MCG22JU"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn.module.dns",
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "aws_route53_record",
|
||||||
|
"name": "default",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"index_key": 0,
|
||||||
|
"schema_version": 2,
|
||||||
|
"attributes": {
|
||||||
|
"alias": [
|
||||||
|
{
|
||||||
|
"evaluate_target_health": false,
|
||||||
|
"name": "d1dkwcezyo6np1.cloudfront.net",
|
||||||
|
"zone_id": "Z2FDTNDATAQYW2"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"allow_overwrite": false,
|
||||||
|
"failover_routing_policy": [],
|
||||||
|
"fqdn": "dev.onmyojideckbuilder.com",
|
||||||
|
"geolocation_routing_policy": [],
|
||||||
|
"health_check_id": null,
|
||||||
|
"id": "Z0511918V1SF3MCG22JU_dev.onmyojideckbuilder.com_A",
|
||||||
|
"latency_routing_policy": [],
|
||||||
|
"multivalue_answer_routing_policy": null,
|
||||||
|
"name": "dev.onmyojideckbuilder.com",
|
||||||
|
"records": null,
|
||||||
|
"set_identifier": null,
|
||||||
|
"ttl": null,
|
||||||
|
"type": "A",
|
||||||
|
"weighted_routing_policy": [],
|
||||||
|
"zone_id": "Z0511918V1SF3MCG22JU"
|
||||||
|
},
|
||||||
|
"private": "eyJzY2hlbWFfdmVyc2lvbiI6IjIifQ==",
|
||||||
|
"dependencies": [
|
||||||
|
"module.cloudfront_s3_cdn.aws_cloudfront_distribution.default",
|
||||||
|
"module.cloudfront_s3_cdn.aws_cloudfront_origin_access_identity.default",
|
||||||
|
"module.cloudfront_s3_cdn.aws_s3_bucket.origin",
|
||||||
|
"module.cloudfront_s3_cdn.data.aws_s3_bucket.selected",
|
||||||
|
"module.cloudfront_s3_cdn.module.dns.data.aws_route53_zone.default",
|
||||||
|
"module.cloudfront_s3_cdn.module.logs.aws_s3_bucket.default"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn.module.dns",
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "aws_route53_record",
|
||||||
|
"name": "ipv6",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"index_key": 0,
|
||||||
|
"schema_version": 2,
|
||||||
|
"attributes": {
|
||||||
|
"alias": [
|
||||||
|
{
|
||||||
|
"evaluate_target_health": false,
|
||||||
|
"name": "d1dkwcezyo6np1.cloudfront.net",
|
||||||
|
"zone_id": "Z2FDTNDATAQYW2"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"allow_overwrite": false,
|
||||||
|
"failover_routing_policy": [],
|
||||||
|
"fqdn": "dev.onmyojideckbuilder.com",
|
||||||
|
"geolocation_routing_policy": [],
|
||||||
|
"health_check_id": null,
|
||||||
|
"id": "Z0511918V1SF3MCG22JU_dev.onmyojideckbuilder.com_AAAA",
|
||||||
|
"latency_routing_policy": [],
|
||||||
|
"multivalue_answer_routing_policy": null,
|
||||||
|
"name": "dev.onmyojideckbuilder.com",
|
||||||
|
"records": null,
|
||||||
|
"set_identifier": null,
|
||||||
|
"ttl": null,
|
||||||
|
"type": "AAAA",
|
||||||
|
"weighted_routing_policy": [],
|
||||||
|
"zone_id": "Z0511918V1SF3MCG22JU"
|
||||||
|
},
|
||||||
|
"private": "eyJzY2hlbWFfdmVyc2lvbiI6IjIifQ==",
|
||||||
|
"dependencies": [
|
||||||
|
"module.cloudfront_s3_cdn.aws_cloudfront_distribution.default",
|
||||||
|
"module.cloudfront_s3_cdn.aws_cloudfront_origin_access_identity.default",
|
||||||
|
"module.cloudfront_s3_cdn.aws_s3_bucket.origin",
|
||||||
|
"module.cloudfront_s3_cdn.data.aws_s3_bucket.selected",
|
||||||
|
"module.cloudfront_s3_cdn.module.dns.data.aws_route53_zone.default",
|
||||||
|
"module.cloudfront_s3_cdn.module.logs.aws_s3_bucket.default"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn.module.logs",
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "aws_s3_bucket",
|
||||||
|
"name": "default",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"index_key": 0,
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"acceleration_status": "",
|
||||||
|
"acl": "log-delivery-write",
|
||||||
|
"arn": "arn:aws:s3:::dev-onmyojideckbuilder-logs",
|
||||||
|
"bucket": "dev-onmyojideckbuilder-logs",
|
||||||
|
"bucket_domain_name": "dev-onmyojideckbuilder-logs.s3.amazonaws.com",
|
||||||
|
"bucket_prefix": null,
|
||||||
|
"bucket_regional_domain_name": "dev-onmyojideckbuilder-logs.s3.eu-west-1.amazonaws.com",
|
||||||
|
"cors_rule": [],
|
||||||
|
"force_destroy": true,
|
||||||
|
"grant": [],
|
||||||
|
"hosted_zone_id": "Z1BKCTXD74EZPE",
|
||||||
|
"id": "dev-onmyojideckbuilder-logs",
|
||||||
|
"lifecycle_rule": [
|
||||||
|
{
|
||||||
|
"abort_incomplete_multipart_upload_days": 5,
|
||||||
|
"enabled": true,
|
||||||
|
"expiration": [
|
||||||
|
{
|
||||||
|
"date": "",
|
||||||
|
"days": 90,
|
||||||
|
"expired_object_delete_marker": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"id": "dev-onmyojideckbuilder-logs",
|
||||||
|
"noncurrent_version_expiration": [
|
||||||
|
{
|
||||||
|
"days": 90
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"noncurrent_version_transition": [
|
||||||
|
{
|
||||||
|
"days": 30,
|
||||||
|
"storage_class": "GLACIER"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"prefix": "",
|
||||||
|
"tags": null,
|
||||||
|
"transition": [
|
||||||
|
{
|
||||||
|
"date": "",
|
||||||
|
"days": 30,
|
||||||
|
"storage_class": "STANDARD_IA"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": "",
|
||||||
|
"days": 60,
|
||||||
|
"storage_class": "GLACIER"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"logging": [],
|
||||||
|
"object_lock_configuration": [],
|
||||||
|
"policy": "",
|
||||||
|
"region": "eu-west-1",
|
||||||
|
"replication_configuration": [],
|
||||||
|
"request_payer": "BucketOwner",
|
||||||
|
"server_side_encryption_configuration": [
|
||||||
|
{
|
||||||
|
"rule": [
|
||||||
|
{
|
||||||
|
"apply_server_side_encryption_by_default": [
|
||||||
|
{
|
||||||
|
"kms_master_key_id": "",
|
||||||
|
"sse_algorithm": "AES256"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"tags": {
|
||||||
|
"Attributes": "logs",
|
||||||
|
"Description": "website to build and share onmyoji decks",
|
||||||
|
"Name": "dev-onmyojideckbuilder-logs",
|
||||||
|
"Project": "onmyoji-deck-builder",
|
||||||
|
"Stage": "dev"
|
||||||
|
},
|
||||||
|
"versioning": [
|
||||||
|
{
|
||||||
|
"enabled": false,
|
||||||
|
"mfa_delete": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"website": [],
|
||||||
|
"website_domain": null,
|
||||||
|
"website_endpoint": null
|
||||||
|
},
|
||||||
|
"private": "bnVsbA=="
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn.module.logs",
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "aws_s3_bucket_public_access_block",
|
||||||
|
"name": "default",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"index_key": 0,
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"block_public_acls": true,
|
||||||
|
"block_public_policy": true,
|
||||||
|
"bucket": "dev-onmyojideckbuilder-logs",
|
||||||
|
"id": "dev-onmyojideckbuilder-logs",
|
||||||
|
"ignore_public_acls": true,
|
||||||
|
"restrict_public_buckets": true
|
||||||
|
},
|
||||||
|
"private": "bnVsbA==",
|
||||||
|
"dependencies": [
|
||||||
|
"module.cloudfront_s3_cdn.module.logs.aws_s3_bucket.default"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,168 @@
|
|||||||
|
{
|
||||||
|
"version": 4,
|
||||||
|
"terraform_version": "0.13.5",
|
||||||
|
"serial": 32,
|
||||||
|
"lineage": "9232bec8-e306-d87e-d0ff-5f5901d34c76",
|
||||||
|
"outputs": {
|
||||||
|
"s3_bucket": {
|
||||||
|
"value": "",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"resources": [
|
||||||
|
{
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "aws_iam_policy",
|
||||||
|
"name": "lambda_logging",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"arn": "arn:aws:iam::745437999005:policy/dev-onmyojideckbuilder-lambda_logging",
|
||||||
|
"description": "",
|
||||||
|
"id": "arn:aws:iam::745437999005:policy/dev-onmyojideckbuilder-lambda_logging",
|
||||||
|
"name": "dev-onmyojideckbuilder-lambda_logging",
|
||||||
|
"name_prefix": null,
|
||||||
|
"path": "/",
|
||||||
|
"policy": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Action\": [\n \"logs:CreateLogGroup\",\n \"logs:CreateLogStream\",\n \"logs:PutLogEvents\"\n ],\n \"Resource\": \"arn:aws:logs:*:*:*\",\n \"Effect\": \"Allow\"\n }\n ]\n}\n"
|
||||||
|
},
|
||||||
|
"private": "bnVsbA=="
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "aws_iam_role",
|
||||||
|
"name": "lambda_role",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"arn": "arn:aws:iam::745437999005:role/dev-onmyojideckbuilder-lambda",
|
||||||
|
"assume_role_policy": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"Service\":[\"lambda.amazonaws.com\",\"edgelambda.amazonaws.com\"]},\"Action\":\"sts:AssumeRole\"}]}",
|
||||||
|
"create_date": "2021-03-19T03:02:49Z",
|
||||||
|
"description": "",
|
||||||
|
"force_detach_policies": false,
|
||||||
|
"id": "dev-onmyojideckbuilder-lambda",
|
||||||
|
"max_session_duration": 3600,
|
||||||
|
"name": "dev-onmyojideckbuilder-lambda",
|
||||||
|
"name_prefix": null,
|
||||||
|
"path": "/",
|
||||||
|
"permissions_boundary": null,
|
||||||
|
"tags": {
|
||||||
|
"Description": "website to build and share onmyoji decks",
|
||||||
|
"Project": "onmyoji-deck-builder"
|
||||||
|
},
|
||||||
|
"unique_id": "AROA23D4RF6O5CZILWBI3"
|
||||||
|
},
|
||||||
|
"private": "bnVsbA=="
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "aws_iam_role_policy_attachment",
|
||||||
|
"name": "lambda_logging",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"id": "dev-onmyojideckbuilder-lambda-20210319030251359100000002",
|
||||||
|
"policy_arn": "arn:aws:iam::745437999005:policy/dev-onmyojideckbuilder-lambda_logging",
|
||||||
|
"role": "dev-onmyojideckbuilder-lambda"
|
||||||
|
},
|
||||||
|
"private": "bnVsbA==",
|
||||||
|
"dependencies": [
|
||||||
|
"aws_iam_policy.lambda_logging",
|
||||||
|
"aws_iam_role.lambda_role"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "aws_lambda_function",
|
||||||
|
"name": "directory_indexes",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"].us_east_1",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"arn": "arn:aws:lambda:us-east-1:745437999005:function:dev-onmyojideckbuilder-directory_indexes",
|
||||||
|
"dead_letter_config": [],
|
||||||
|
"description": "",
|
||||||
|
"environment": [],
|
||||||
|
"file_system_config": [],
|
||||||
|
"filename": "./lambda/main.js.zip",
|
||||||
|
"function_name": "dev-onmyojideckbuilder-directory_indexes",
|
||||||
|
"handler": "main.handler",
|
||||||
|
"id": "dev-onmyojideckbuilder-directory_indexes",
|
||||||
|
"invoke_arn": "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:745437999005:function:dev-onmyojideckbuilder-directory_indexes/invocations",
|
||||||
|
"kms_key_arn": "",
|
||||||
|
"last_modified": "2021-03-19T03:02:57.785+0000",
|
||||||
|
"layers": [],
|
||||||
|
"memory_size": 128,
|
||||||
|
"publish": true,
|
||||||
|
"qualified_arn": "arn:aws:lambda:us-east-1:745437999005:function:dev-onmyojideckbuilder-directory_indexes:1",
|
||||||
|
"reserved_concurrent_executions": -1,
|
||||||
|
"role": "arn:aws:iam::745437999005:role/dev-onmyojideckbuilder-lambda",
|
||||||
|
"runtime": "nodejs12.x",
|
||||||
|
"s3_bucket": null,
|
||||||
|
"s3_key": null,
|
||||||
|
"s3_object_version": null,
|
||||||
|
"source_code_hash": "5EVmwQDkgGfYMpMXNaWHUz3cmb/dSssoWl8mM8o3aMs=",
|
||||||
|
"source_code_size": 601,
|
||||||
|
"tags": {
|
||||||
|
"Description": "website to build and share onmyoji decks",
|
||||||
|
"Project": "onmyoji-deck-builder"
|
||||||
|
},
|
||||||
|
"timeout": 3,
|
||||||
|
"timeouts": null,
|
||||||
|
"tracing_config": [
|
||||||
|
{
|
||||||
|
"mode": "PassThrough"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": "1",
|
||||||
|
"vpc_config": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn.module.dns",
|
||||||
|
"mode": "data",
|
||||||
|
"type": "aws_route53_zone",
|
||||||
|
"name": "default",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"index_key": 0,
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"caller_reference": "481ca519-c2ac-4885-b585-8283334987f7",
|
||||||
|
"comment": "",
|
||||||
|
"id": "Z0511918V1SF3MCG22JU",
|
||||||
|
"linked_service_description": null,
|
||||||
|
"linked_service_principal": null,
|
||||||
|
"name": "onmyojideckbuilder.com.",
|
||||||
|
"name_servers": [
|
||||||
|
"ns-1501.awsdns-59.org",
|
||||||
|
"ns-1652.awsdns-14.co.uk",
|
||||||
|
"ns-176.awsdns-22.com",
|
||||||
|
"ns-530.awsdns-02.net"
|
||||||
|
],
|
||||||
|
"private_zone": false,
|
||||||
|
"resource_record_set_count": 5,
|
||||||
|
"tags": {},
|
||||||
|
"vpc_id": null,
|
||||||
|
"zone_id": "Z0511918V1SF3MCG22JU"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,757 @@
|
|||||||
|
{
|
||||||
|
"version": 4,
|
||||||
|
"terraform_version": "0.13.5",
|
||||||
|
"serial": 75,
|
||||||
|
"lineage": "baf13f49-a91e-4ef3-40f8-b010f53cf030",
|
||||||
|
"outputs": {
|
||||||
|
"cf_arn": {
|
||||||
|
"value": "arn:aws:cloudfront::745437999005:distribution/E5L0TBPLNYZX7",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"cf_domain_name": {
|
||||||
|
"value": "daws4um51qzk4.cloudfront.net",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"cf_etag": {
|
||||||
|
"value": "EJ2IXAOH2KIVR",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"cf_hosted_zone_id": {
|
||||||
|
"value": "Z2FDTNDATAQYW2",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"cf_id": {
|
||||||
|
"value": "E5L0TBPLNYZX7",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"cf_status": {
|
||||||
|
"value": "Deployed",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"s3_bucket": {
|
||||||
|
"value": "prod-onmyojideckbuilder-origin",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"s3_bucket_domain_name": {
|
||||||
|
"value": "prod-onmyojideckbuilder-origin.s3-website.eu-west-1.amazonaws.com",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"resources": [
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn",
|
||||||
|
"mode": "data",
|
||||||
|
"type": "aws_iam_policy_document",
|
||||||
|
"name": "origin",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"id": "637012258",
|
||||||
|
"json": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"S3GetObjectForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:GetObject\",\n \"Resource\": \"arn:aws:s3:::${bucket_name}${origin_path}*\",\n \"Principal\": {\n \"AWS\": \"${cloudfront_origin_access_identity_iam_arn}\"\n }\n },\n {\n \"Sid\": \"S3ListBucketForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:ListBucket\",\n \"Resource\": \"arn:aws:s3:::${bucket_name}\",\n \"Principal\": {\n \"AWS\": \"${cloudfront_origin_access_identity_iam_arn}\"\n }\n },\n {\n \"Sid\": \"PublicRead\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"s3:GetObject\"\n ],\n \"Resource\": \"arn:aws:s3:::prod-onmyojideckbuilder-origin/*\",\n \"Principal\": \"*\"\n }\n ]\n}",
|
||||||
|
"override_json": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\":\"PublicRead\",\n \"Effect\":\"Allow\",\n \"Principal\":\"*\",\n \"Action\":[\"s3:GetObject\"],\n \"Resource\":\"arn:aws:s3:::prod-onmyojideckbuilder-origin/*\"\n }\n ]\n}\n",
|
||||||
|
"policy_id": null,
|
||||||
|
"source_json": null,
|
||||||
|
"statement": [
|
||||||
|
{
|
||||||
|
"actions": [
|
||||||
|
"s3:GetObject"
|
||||||
|
],
|
||||||
|
"condition": [],
|
||||||
|
"effect": "Allow",
|
||||||
|
"not_actions": [],
|
||||||
|
"not_principals": [],
|
||||||
|
"not_resources": [],
|
||||||
|
"principals": [
|
||||||
|
{
|
||||||
|
"identifiers": [
|
||||||
|
"${cloudfront_origin_access_identity_iam_arn}"
|
||||||
|
],
|
||||||
|
"type": "AWS"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"resources": [
|
||||||
|
"arn:aws:s3:::${bucket_name}${origin_path}*"
|
||||||
|
],
|
||||||
|
"sid": "S3GetObjectForCloudFront"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"actions": [
|
||||||
|
"s3:ListBucket"
|
||||||
|
],
|
||||||
|
"condition": [],
|
||||||
|
"effect": "Allow",
|
||||||
|
"not_actions": [],
|
||||||
|
"not_principals": [],
|
||||||
|
"not_resources": [],
|
||||||
|
"principals": [
|
||||||
|
{
|
||||||
|
"identifiers": [
|
||||||
|
"${cloudfront_origin_access_identity_iam_arn}"
|
||||||
|
],
|
||||||
|
"type": "AWS"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"resources": [
|
||||||
|
"arn:aws:s3:::${bucket_name}"
|
||||||
|
],
|
||||||
|
"sid": "S3ListBucketForCloudFront"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": "2012-10-17"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn",
|
||||||
|
"mode": "data",
|
||||||
|
"type": "aws_iam_policy_document",
|
||||||
|
"name": "origin_website",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"id": "2989024212",
|
||||||
|
"json": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"S3GetObjectForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:GetObject\",\n \"Resource\": \"arn:aws:s3:::${bucket_name}${origin_path}*\",\n \"Principal\": {\n \"AWS\": \"*\"\n }\n },\n {\n \"Sid\": \"PublicRead\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"s3:GetObject\"\n ],\n \"Resource\": \"arn:aws:s3:::prod-onmyojideckbuilder-origin/*\",\n \"Principal\": \"*\"\n }\n ]\n}",
|
||||||
|
"override_json": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\":\"PublicRead\",\n \"Effect\":\"Allow\",\n \"Principal\":\"*\",\n \"Action\":[\"s3:GetObject\"],\n \"Resource\":\"arn:aws:s3:::prod-onmyojideckbuilder-origin/*\"\n }\n ]\n}\n",
|
||||||
|
"policy_id": null,
|
||||||
|
"source_json": null,
|
||||||
|
"statement": [
|
||||||
|
{
|
||||||
|
"actions": [
|
||||||
|
"s3:GetObject"
|
||||||
|
],
|
||||||
|
"condition": [],
|
||||||
|
"effect": "Allow",
|
||||||
|
"not_actions": [],
|
||||||
|
"not_principals": [],
|
||||||
|
"not_resources": [],
|
||||||
|
"principals": [
|
||||||
|
{
|
||||||
|
"identifiers": [
|
||||||
|
"*"
|
||||||
|
],
|
||||||
|
"type": "AWS"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"resources": [
|
||||||
|
"arn:aws:s3:::${bucket_name}${origin_path}*"
|
||||||
|
],
|
||||||
|
"sid": "S3GetObjectForCloudFront"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": "2012-10-17"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn",
|
||||||
|
"mode": "data",
|
||||||
|
"type": "aws_s3_bucket",
|
||||||
|
"name": "selected",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"arn": "arn:aws:s3:::prod-onmyojideckbuilder-origin",
|
||||||
|
"bucket": "prod-onmyojideckbuilder-origin",
|
||||||
|
"bucket_domain_name": "prod-onmyojideckbuilder-origin.s3.amazonaws.com",
|
||||||
|
"bucket_regional_domain_name": "prod-onmyojideckbuilder-origin.s3.eu-west-1.amazonaws.com",
|
||||||
|
"hosted_zone_id": "Z1BKCTXD74EZPE",
|
||||||
|
"id": "prod-onmyojideckbuilder-origin",
|
||||||
|
"region": "eu-west-1",
|
||||||
|
"website_domain": "s3-website-eu-west-1.amazonaws.com",
|
||||||
|
"website_endpoint": "prod-onmyojideckbuilder-origin.s3-website-eu-west-1.amazonaws.com"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn",
|
||||||
|
"mode": "data",
|
||||||
|
"type": "template_file",
|
||||||
|
"name": "default",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/template\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"filename": null,
|
||||||
|
"id": "d2728ff6ec7bcb2e66ffe5cd0e8a610cec902d51af8660f5da737b296b07277c",
|
||||||
|
"rendered": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"S3GetObjectForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:GetObject\",\n \"Resource\": \"arn:aws:s3:::prod-onmyojideckbuilder-origin/*\",\n \"Principal\": {\n \"AWS\": \"*\"\n }\n },\n {\n \"Sid\": \"PublicRead\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"s3:GetObject\"\n ],\n \"Resource\": \"arn:aws:s3:::prod-onmyojideckbuilder-origin/*\",\n \"Principal\": \"*\"\n }\n ]\n}",
|
||||||
|
"template": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"S3GetObjectForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:GetObject\",\n \"Resource\": \"arn:aws:s3:::${bucket_name}${origin_path}*\",\n \"Principal\": {\n \"AWS\": \"*\"\n }\n },\n {\n \"Sid\": \"PublicRead\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"s3:GetObject\"\n ],\n \"Resource\": \"arn:aws:s3:::prod-onmyojideckbuilder-origin/*\",\n \"Principal\": \"*\"\n }\n ]\n}",
|
||||||
|
"vars": {
|
||||||
|
"bucket_name": "prod-onmyojideckbuilder-origin",
|
||||||
|
"cloudfront_origin_access_identity_iam_arn": "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E1T3NXW4C57SNI",
|
||||||
|
"origin_path": "/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn",
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "aws_cloudfront_distribution",
|
||||||
|
"name": "default",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 1,
|
||||||
|
"attributes": {
|
||||||
|
"active_trusted_signers": {
|
||||||
|
"enabled": "false",
|
||||||
|
"items.#": "0"
|
||||||
|
},
|
||||||
|
"aliases": [
|
||||||
|
"onmyojideckbuilder.com"
|
||||||
|
],
|
||||||
|
"arn": "arn:aws:cloudfront::745437999005:distribution/E5L0TBPLNYZX7",
|
||||||
|
"cache_behavior": [],
|
||||||
|
"caller_reference": "terraform-20210319041540786500000002",
|
||||||
|
"comment": "Managed by Terraform",
|
||||||
|
"custom_error_response": [],
|
||||||
|
"default_cache_behavior": [
|
||||||
|
{
|
||||||
|
"allowed_methods": [
|
||||||
|
"DELETE",
|
||||||
|
"GET",
|
||||||
|
"HEAD",
|
||||||
|
"OPTIONS",
|
||||||
|
"PATCH",
|
||||||
|
"POST",
|
||||||
|
"PUT"
|
||||||
|
],
|
||||||
|
"cached_methods": [
|
||||||
|
"GET",
|
||||||
|
"HEAD"
|
||||||
|
],
|
||||||
|
"compress": true,
|
||||||
|
"default_ttl": 60,
|
||||||
|
"field_level_encryption_id": "",
|
||||||
|
"forwarded_values": [
|
||||||
|
{
|
||||||
|
"cookies": [
|
||||||
|
{
|
||||||
|
"forward": "none",
|
||||||
|
"whitelisted_names": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"headers": [
|
||||||
|
"Access-Control-Request-Headers",
|
||||||
|
"Access-Control-Request-Method",
|
||||||
|
"Origin"
|
||||||
|
],
|
||||||
|
"query_string": false,
|
||||||
|
"query_string_cache_keys": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"lambda_function_association": [],
|
||||||
|
"max_ttl": 31536000,
|
||||||
|
"min_ttl": 0,
|
||||||
|
"smooth_streaming": false,
|
||||||
|
"target_origin_id": "prod-onmyojideckbuilder",
|
||||||
|
"trusted_signers": [],
|
||||||
|
"viewer_protocol_policy": "redirect-to-https"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"default_root_object": "index.html",
|
||||||
|
"domain_name": "daws4um51qzk4.cloudfront.net",
|
||||||
|
"enabled": true,
|
||||||
|
"etag": "EJ2IXAOH2KIVR",
|
||||||
|
"hosted_zone_id": "Z2FDTNDATAQYW2",
|
||||||
|
"http_version": "http2",
|
||||||
|
"id": "E5L0TBPLNYZX7",
|
||||||
|
"in_progress_validation_batches": 0,
|
||||||
|
"is_ipv6_enabled": true,
|
||||||
|
"last_modified_time": "2021-03-19 04:15:43.087 +0000 UTC",
|
||||||
|
"logging_config": [
|
||||||
|
{
|
||||||
|
"bucket": "prod-onmyojideckbuilder-logs.s3.amazonaws.com",
|
||||||
|
"include_cookies": false,
|
||||||
|
"prefix": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ordered_cache_behavior": [],
|
||||||
|
"origin": [
|
||||||
|
{
|
||||||
|
"custom_header": [],
|
||||||
|
"custom_origin_config": [
|
||||||
|
{
|
||||||
|
"http_port": 80,
|
||||||
|
"https_port": 443,
|
||||||
|
"origin_keepalive_timeout": 5,
|
||||||
|
"origin_protocol_policy": "http-only",
|
||||||
|
"origin_read_timeout": 30,
|
||||||
|
"origin_ssl_protocols": [
|
||||||
|
"TLSv1",
|
||||||
|
"TLSv1.1",
|
||||||
|
"TLSv1.2"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"domain_name": "prod-onmyojideckbuilder-origin.s3-website.eu-west-1.amazonaws.com",
|
||||||
|
"origin_id": "prod-onmyojideckbuilder",
|
||||||
|
"origin_path": "",
|
||||||
|
"s3_origin_config": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"origin_group": [],
|
||||||
|
"price_class": "PriceClass_100",
|
||||||
|
"restrictions": [
|
||||||
|
{
|
||||||
|
"geo_restriction": [
|
||||||
|
{
|
||||||
|
"locations": null,
|
||||||
|
"restriction_type": "none"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"retain_on_delete": false,
|
||||||
|
"status": "Deployed",
|
||||||
|
"tags": {
|
||||||
|
"Description": "website to build and share onmyoji decks",
|
||||||
|
"Name": "prod-onmyojideckbuilder",
|
||||||
|
"Project": "onmyoji-deck-builder",
|
||||||
|
"Stage": "prod"
|
||||||
|
},
|
||||||
|
"viewer_certificate": [
|
||||||
|
{
|
||||||
|
"acm_certificate_arn": "arn:aws:acm:us-east-1:745437999005:certificate/11502ff4-7851-426f-92ac-27db7c44825f",
|
||||||
|
"cloudfront_default_certificate": false,
|
||||||
|
"iam_certificate_id": "",
|
||||||
|
"minimum_protocol_version": "TLSv1",
|
||||||
|
"ssl_support_method": "sni-only"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"wait_for_deployment": true,
|
||||||
|
"web_acl_id": ""
|
||||||
|
},
|
||||||
|
"private": "eyJzY2hlbWFfdmVyc2lvbiI6IjEifQ==",
|
||||||
|
"dependencies": [
|
||||||
|
"module.cloudfront_s3_cdn.aws_cloudfront_origin_access_identity.default",
|
||||||
|
"module.cloudfront_s3_cdn.aws_s3_bucket.origin",
|
||||||
|
"module.cloudfront_s3_cdn.data.aws_s3_bucket.selected",
|
||||||
|
"module.cloudfront_s3_cdn.module.logs.aws_s3_bucket.default"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn",
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "aws_cloudfront_origin_access_identity",
|
||||||
|
"name": "default",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"index_key": 0,
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"caller_reference": "terraform-20210319041535137100000001",
|
||||||
|
"cloudfront_access_identity_path": "origin-access-identity/cloudfront/E1T3NXW4C57SNI",
|
||||||
|
"comment": "prod-onmyojideckbuilder",
|
||||||
|
"etag": "E68AOIVG56N5A",
|
||||||
|
"iam_arn": "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E1T3NXW4C57SNI",
|
||||||
|
"id": "E1T3NXW4C57SNI",
|
||||||
|
"s3_canonical_user_id": "682642153922ad412e294e6f379b5ae0ae60c161e20e0fd5dc47d5fb1051d3282ab7d7edd050d78e448363fcde4e0a31"
|
||||||
|
},
|
||||||
|
"private": "bnVsbA=="
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn",
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "aws_s3_bucket",
|
||||||
|
"name": "origin",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"index_key": 0,
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"acceleration_status": "",
|
||||||
|
"acl": "private",
|
||||||
|
"arn": "arn:aws:s3:::prod-onmyojideckbuilder-origin",
|
||||||
|
"bucket": "prod-onmyojideckbuilder-origin",
|
||||||
|
"bucket_domain_name": "prod-onmyojideckbuilder-origin.s3.amazonaws.com",
|
||||||
|
"bucket_prefix": null,
|
||||||
|
"bucket_regional_domain_name": "prod-onmyojideckbuilder-origin.s3.eu-west-1.amazonaws.com",
|
||||||
|
"cors_rule": [
|
||||||
|
{
|
||||||
|
"allowed_headers": [
|
||||||
|
"*"
|
||||||
|
],
|
||||||
|
"allowed_methods": [
|
||||||
|
"GET",
|
||||||
|
"HEAD",
|
||||||
|
"PUT",
|
||||||
|
"POST"
|
||||||
|
],
|
||||||
|
"allowed_origins": [
|
||||||
|
"*.onmyojideckbuilder.com"
|
||||||
|
],
|
||||||
|
"expose_headers": [
|
||||||
|
"ETag"
|
||||||
|
],
|
||||||
|
"max_age_seconds": 3600
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allowed_headers": [
|
||||||
|
"*"
|
||||||
|
],
|
||||||
|
"allowed_methods": [
|
||||||
|
"GET",
|
||||||
|
"HEAD",
|
||||||
|
"PUT",
|
||||||
|
"POST"
|
||||||
|
],
|
||||||
|
"allowed_origins": [
|
||||||
|
"onmyojideckbuilder.com"
|
||||||
|
],
|
||||||
|
"expose_headers": [
|
||||||
|
"ETag"
|
||||||
|
],
|
||||||
|
"max_age_seconds": 3600
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"force_destroy": true,
|
||||||
|
"grant": [],
|
||||||
|
"hosted_zone_id": "Z1BKCTXD74EZPE",
|
||||||
|
"id": "prod-onmyojideckbuilder-origin",
|
||||||
|
"lifecycle_rule": [],
|
||||||
|
"logging": [],
|
||||||
|
"object_lock_configuration": [],
|
||||||
|
"policy": null,
|
||||||
|
"region": "eu-west-1",
|
||||||
|
"replication_configuration": [],
|
||||||
|
"request_payer": "BucketOwner",
|
||||||
|
"server_side_encryption_configuration": [
|
||||||
|
{
|
||||||
|
"rule": [
|
||||||
|
{
|
||||||
|
"apply_server_side_encryption_by_default": [
|
||||||
|
{
|
||||||
|
"kms_master_key_id": "",
|
||||||
|
"sse_algorithm": "AES256"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"tags": {
|
||||||
|
"Attributes": "origin",
|
||||||
|
"Description": "website to build and share onmyoji decks",
|
||||||
|
"Name": "prod-onmyojideckbuilder-origin",
|
||||||
|
"Project": "onmyoji-deck-builder",
|
||||||
|
"Stage": "prod"
|
||||||
|
},
|
||||||
|
"versioning": [
|
||||||
|
{
|
||||||
|
"enabled": true,
|
||||||
|
"mfa_delete": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"website": [
|
||||||
|
{
|
||||||
|
"error_document": "index.html",
|
||||||
|
"index_document": "index.html",
|
||||||
|
"redirect_all_requests_to": "",
|
||||||
|
"routing_rules": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"website_domain": "s3-website-eu-west-1.amazonaws.com",
|
||||||
|
"website_endpoint": "prod-onmyojideckbuilder-origin.s3-website-eu-west-1.amazonaws.com"
|
||||||
|
},
|
||||||
|
"private": "bnVsbA=="
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn",
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "aws_s3_bucket_policy",
|
||||||
|
"name": "default",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"index_key": 0,
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"bucket": "prod-onmyojideckbuilder-origin",
|
||||||
|
"id": "prod-onmyojideckbuilder-origin",
|
||||||
|
"policy": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"S3GetObjectForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:GetObject\",\n \"Resource\": \"arn:aws:s3:::prod-onmyojideckbuilder-origin/*\",\n \"Principal\": {\n \"AWS\": \"*\"\n }\n },\n {\n \"Sid\": \"PublicRead\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"s3:GetObject\"\n ],\n \"Resource\": \"arn:aws:s3:::prod-onmyojideckbuilder-origin/*\",\n \"Principal\": \"*\"\n }\n ]\n}"
|
||||||
|
},
|
||||||
|
"private": "bnVsbA==",
|
||||||
|
"dependencies": [
|
||||||
|
"module.cloudfront_s3_cdn.aws_cloudfront_origin_access_identity.default",
|
||||||
|
"module.cloudfront_s3_cdn.aws_s3_bucket.origin",
|
||||||
|
"module.cloudfront_s3_cdn.data.aws_iam_policy_document.origin",
|
||||||
|
"module.cloudfront_s3_cdn.data.aws_iam_policy_document.origin_website",
|
||||||
|
"module.cloudfront_s3_cdn.data.template_file.default"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn.module.dns",
|
||||||
|
"mode": "data",
|
||||||
|
"type": "aws_route53_zone",
|
||||||
|
"name": "default",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"index_key": 0,
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"caller_reference": "481ca519-c2ac-4885-b585-8283334987f7",
|
||||||
|
"comment": "",
|
||||||
|
"id": "Z0511918V1SF3MCG22JU",
|
||||||
|
"linked_service_description": null,
|
||||||
|
"linked_service_principal": null,
|
||||||
|
"name": "onmyojideckbuilder.com.",
|
||||||
|
"name_servers": [
|
||||||
|
"ns-1501.awsdns-59.org",
|
||||||
|
"ns-1652.awsdns-14.co.uk",
|
||||||
|
"ns-176.awsdns-22.com",
|
||||||
|
"ns-530.awsdns-02.net"
|
||||||
|
],
|
||||||
|
"private_zone": false,
|
||||||
|
"resource_record_set_count": 3,
|
||||||
|
"tags": {},
|
||||||
|
"vpc_id": null,
|
||||||
|
"zone_id": "Z0511918V1SF3MCG22JU"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn.module.dns",
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "aws_route53_record",
|
||||||
|
"name": "default",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"index_key": 0,
|
||||||
|
"schema_version": 2,
|
||||||
|
"attributes": {
|
||||||
|
"alias": [
|
||||||
|
{
|
||||||
|
"evaluate_target_health": false,
|
||||||
|
"name": "daws4um51qzk4.cloudfront.net",
|
||||||
|
"zone_id": "Z2FDTNDATAQYW2"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"allow_overwrite": false,
|
||||||
|
"failover_routing_policy": [],
|
||||||
|
"fqdn": "onmyojideckbuilder.com",
|
||||||
|
"geolocation_routing_policy": [],
|
||||||
|
"health_check_id": null,
|
||||||
|
"id": "Z0511918V1SF3MCG22JU_onmyojideckbuilder.com_A",
|
||||||
|
"latency_routing_policy": [],
|
||||||
|
"multivalue_answer_routing_policy": null,
|
||||||
|
"name": "onmyojideckbuilder.com",
|
||||||
|
"records": null,
|
||||||
|
"set_identifier": null,
|
||||||
|
"ttl": null,
|
||||||
|
"type": "A",
|
||||||
|
"weighted_routing_policy": [],
|
||||||
|
"zone_id": "Z0511918V1SF3MCG22JU"
|
||||||
|
},
|
||||||
|
"private": "eyJzY2hlbWFfdmVyc2lvbiI6IjIifQ==",
|
||||||
|
"dependencies": [
|
||||||
|
"module.cloudfront_s3_cdn.aws_cloudfront_distribution.default",
|
||||||
|
"module.cloudfront_s3_cdn.aws_cloudfront_origin_access_identity.default",
|
||||||
|
"module.cloudfront_s3_cdn.aws_s3_bucket.origin",
|
||||||
|
"module.cloudfront_s3_cdn.data.aws_s3_bucket.selected",
|
||||||
|
"module.cloudfront_s3_cdn.module.dns.data.aws_route53_zone.default",
|
||||||
|
"module.cloudfront_s3_cdn.module.logs.aws_s3_bucket.default"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn.module.dns",
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "aws_route53_record",
|
||||||
|
"name": "ipv6",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"index_key": 0,
|
||||||
|
"schema_version": 2,
|
||||||
|
"attributes": {
|
||||||
|
"alias": [
|
||||||
|
{
|
||||||
|
"evaluate_target_health": false,
|
||||||
|
"name": "daws4um51qzk4.cloudfront.net",
|
||||||
|
"zone_id": "Z2FDTNDATAQYW2"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"allow_overwrite": false,
|
||||||
|
"failover_routing_policy": [],
|
||||||
|
"fqdn": "onmyojideckbuilder.com",
|
||||||
|
"geolocation_routing_policy": [],
|
||||||
|
"health_check_id": null,
|
||||||
|
"id": "Z0511918V1SF3MCG22JU_onmyojideckbuilder.com_AAAA",
|
||||||
|
"latency_routing_policy": [],
|
||||||
|
"multivalue_answer_routing_policy": null,
|
||||||
|
"name": "onmyojideckbuilder.com",
|
||||||
|
"records": null,
|
||||||
|
"set_identifier": null,
|
||||||
|
"ttl": null,
|
||||||
|
"type": "AAAA",
|
||||||
|
"weighted_routing_policy": [],
|
||||||
|
"zone_id": "Z0511918V1SF3MCG22JU"
|
||||||
|
},
|
||||||
|
"private": "eyJzY2hlbWFfdmVyc2lvbiI6IjIifQ==",
|
||||||
|
"dependencies": [
|
||||||
|
"module.cloudfront_s3_cdn.aws_cloudfront_distribution.default",
|
||||||
|
"module.cloudfront_s3_cdn.aws_cloudfront_origin_access_identity.default",
|
||||||
|
"module.cloudfront_s3_cdn.aws_s3_bucket.origin",
|
||||||
|
"module.cloudfront_s3_cdn.data.aws_s3_bucket.selected",
|
||||||
|
"module.cloudfront_s3_cdn.module.dns.data.aws_route53_zone.default",
|
||||||
|
"module.cloudfront_s3_cdn.module.logs.aws_s3_bucket.default"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn.module.logs",
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "aws_s3_bucket",
|
||||||
|
"name": "default",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"index_key": 0,
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"acceleration_status": "",
|
||||||
|
"acl": "log-delivery-write",
|
||||||
|
"arn": "arn:aws:s3:::prod-onmyojideckbuilder-logs",
|
||||||
|
"bucket": "prod-onmyojideckbuilder-logs",
|
||||||
|
"bucket_domain_name": "prod-onmyojideckbuilder-logs.s3.amazonaws.com",
|
||||||
|
"bucket_prefix": null,
|
||||||
|
"bucket_regional_domain_name": "prod-onmyojideckbuilder-logs.s3.eu-west-1.amazonaws.com",
|
||||||
|
"cors_rule": [],
|
||||||
|
"force_destroy": true,
|
||||||
|
"grant": [],
|
||||||
|
"hosted_zone_id": "Z1BKCTXD74EZPE",
|
||||||
|
"id": "prod-onmyojideckbuilder-logs",
|
||||||
|
"lifecycle_rule": [
|
||||||
|
{
|
||||||
|
"abort_incomplete_multipart_upload_days": 5,
|
||||||
|
"enabled": true,
|
||||||
|
"expiration": [
|
||||||
|
{
|
||||||
|
"date": "",
|
||||||
|
"days": 90,
|
||||||
|
"expired_object_delete_marker": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"id": "prod-onmyojideckbuilder-logs",
|
||||||
|
"noncurrent_version_expiration": [
|
||||||
|
{
|
||||||
|
"days": 90
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"noncurrent_version_transition": [
|
||||||
|
{
|
||||||
|
"days": 30,
|
||||||
|
"storage_class": "GLACIER"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"prefix": "",
|
||||||
|
"tags": null,
|
||||||
|
"transition": [
|
||||||
|
{
|
||||||
|
"date": "",
|
||||||
|
"days": 30,
|
||||||
|
"storage_class": "STANDARD_IA"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": "",
|
||||||
|
"days": 60,
|
||||||
|
"storage_class": "GLACIER"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"logging": [],
|
||||||
|
"object_lock_configuration": [],
|
||||||
|
"policy": "",
|
||||||
|
"region": "eu-west-1",
|
||||||
|
"replication_configuration": [],
|
||||||
|
"request_payer": "BucketOwner",
|
||||||
|
"server_side_encryption_configuration": [
|
||||||
|
{
|
||||||
|
"rule": [
|
||||||
|
{
|
||||||
|
"apply_server_side_encryption_by_default": [
|
||||||
|
{
|
||||||
|
"kms_master_key_id": "",
|
||||||
|
"sse_algorithm": "AES256"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"tags": {
|
||||||
|
"Attributes": "logs",
|
||||||
|
"Description": "website to build and share onmyoji decks",
|
||||||
|
"Name": "prod-onmyojideckbuilder-logs",
|
||||||
|
"Project": "onmyoji-deck-builder",
|
||||||
|
"Stage": "prod"
|
||||||
|
},
|
||||||
|
"versioning": [
|
||||||
|
{
|
||||||
|
"enabled": false,
|
||||||
|
"mfa_delete": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"website": [],
|
||||||
|
"website_domain": null,
|
||||||
|
"website_endpoint": null
|
||||||
|
},
|
||||||
|
"private": "bnVsbA=="
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"module": "module.cloudfront_s3_cdn.module.logs",
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "aws_s3_bucket_public_access_block",
|
||||||
|
"name": "default",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"index_key": 0,
|
||||||
|
"schema_version": 0,
|
||||||
|
"attributes": {
|
||||||
|
"block_public_acls": true,
|
||||||
|
"block_public_policy": true,
|
||||||
|
"bucket": "prod-onmyojideckbuilder-logs",
|
||||||
|
"id": "prod-onmyojideckbuilder-logs",
|
||||||
|
"ignore_public_acls": true,
|
||||||
|
"restrict_public_buckets": true
|
||||||
|
},
|
||||||
|
"private": "bnVsbA==",
|
||||||
|
"dependencies": [
|
||||||
|
"module.cloudfront_s3_cdn.module.logs.aws_s3_bucket.default"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"version": 4,
|
||||||
|
"terraform_version": "0.13.5",
|
||||||
|
"serial": 62,
|
||||||
|
"lineage": "baf13f49-a91e-4ef3-40f8-b010f53cf030",
|
||||||
|
"outputs": {},
|
||||||
|
"resources": []
|
||||||
|
}
|
||||||
55
.infrastructure/variables.tf
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
variable "name" {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "region" {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "stage" {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "profile" {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "acm_certificate_arn" {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "parent_zone_id" {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "aliases" {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "allowed_origins" {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "acl" {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "lambda_key" {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "source_file" {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "handler" {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "runtime" {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "s3_region" {
|
||||||
|
|
||||||
|
}
|
||||||
21
commands.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# Commands
|
||||||
|
|
||||||
|
## Adding new cards to json
|
||||||
|
|
||||||
|
- Increase prettier line width to 200
|
||||||
|
- Quote Props to persistent
|
||||||
|
- Sort lines by natural
|
||||||
|
- Add `"id": ""`
|
||||||
|
- Generate GUID and remove the tails
|
||||||
|
|
||||||
|
## Deploy to S3
|
||||||
|
|
||||||
|
<https://github.com/bep/s3deploy>
|
||||||
|
|
||||||
|
### prod
|
||||||
|
|
||||||
|
`s3deploy -source=./dist -region=eu-west-1 -bucket=prod-onmyojideckbuilder-origin -distribution-id=E8811LTEVQX71`
|
||||||
|
|
||||||
|
### dev
|
||||||
|
|
||||||
|
`s3deploy -source=./dist -region=eu-west-1 -bucket=dev-onmyojideckbuilder-origin -distribution-id=E26QN6RRQRWYWL`
|
||||||
@@ -5,13 +5,14 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service serve",
|
"serve": "vue-cli-service serve",
|
||||||
"build": "vue-cli-service build",
|
"build": "vue-cli-service build",
|
||||||
"lint": "vue-cli-service lint"
|
"lint": "vue-cli-service lint",
|
||||||
|
"deploy": "aws s3 sync ./dist s3://prod-onmyojideckbuilder-origin --profile admin"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"core-js": "^3.6.5",
|
"core-js": "^3.6.5",
|
||||||
"vue": "^2.6.11",
|
"vue": "^2.6.11",
|
||||||
"vue-router": "^3.2.0",
|
"vue-router": "^3.2.0",
|
||||||
"vuetify": "^2.2.11",
|
"vuetify": "^2.4",
|
||||||
"vuex": "^3.4.0"
|
"vuex": "^3.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 15 KiB |
5
snippets
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
:ma-0="$vuetify.breakpoint.mdAndDown"
|
||||||
|
|
||||||
|
@media #{map-get($display-breakpoints, 'md-and-down')}
|
||||||
|
.custom-class
|
||||||
|
display: none
|
||||||
26
src/App.vue
@@ -8,7 +8,7 @@
|
|||||||
app
|
app
|
||||||
:expand-on-hover="true"
|
:expand-on-hover="true"
|
||||||
overflow
|
overflow
|
||||||
color="#070042"
|
color="#272935"
|
||||||
>
|
>
|
||||||
<v-list>
|
<v-list>
|
||||||
<v-list-item
|
<v-list-item
|
||||||
@@ -18,17 +18,20 @@
|
|||||||
:to="item.link"
|
:to="item.link"
|
||||||
>
|
>
|
||||||
<v-list-item-icon>
|
<v-list-item-icon>
|
||||||
<v-icon >{{ item.icon }}</v-icon>
|
<!-- <v-icon>{{ item.icon }}</v-icon> -->
|
||||||
|
<v-img :src="item.icon" width="50"></v-img>
|
||||||
</v-list-item-icon>
|
</v-list-item-icon>
|
||||||
|
|
||||||
<v-list-item-content>
|
<v-list-item-content>
|
||||||
<v-list-item-title>{{ item.title }}</v-list-item-title>
|
<v-list-item-title class="text-button">{{
|
||||||
|
item.title
|
||||||
|
}}</v-list-item-title>
|
||||||
</v-list-item-content>
|
</v-list-item-content>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
</v-list>
|
</v-list>
|
||||||
</v-navigation-drawer>
|
</v-navigation-drawer>
|
||||||
|
|
||||||
<v-app-bar :clipped-left="false" app color="#070042" >
|
<v-app-bar :clipped-left="false" app color="#272935">
|
||||||
<v-app-bar-nav-icon
|
<v-app-bar-nav-icon
|
||||||
@click.stop="primaryDrawer.model = !primaryDrawer.model"
|
@click.stop="primaryDrawer.model = !primaryDrawer.model"
|
||||||
></v-app-bar-nav-icon>
|
></v-app-bar-nav-icon>
|
||||||
@@ -39,7 +42,7 @@
|
|||||||
<router-view></router-view>
|
<router-view></router-view>
|
||||||
</v-main>
|
</v-main>
|
||||||
|
|
||||||
<v-footer :inset="false" color="#04002E" app>
|
<v-footer :inset="false" color="#272935" app>
|
||||||
<!-- <span class="px-4"
|
<!-- <span class="px-4"
|
||||||
>© {{ new Date().getFullYear() }} Daniel Tomlinson</span
|
>© {{ new Date().getFullYear() }} Daniel Tomlinson</span
|
||||||
>
|
>
|
||||||
@@ -53,12 +56,13 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
mdiViewDashboard,
|
|
||||||
mdiCalculator,
|
|
||||||
mdiHelpBox,
|
|
||||||
mdiGithub,
|
mdiGithub,
|
||||||
} from "@mdi/js";
|
} from "@mdi/js";
|
||||||
|
|
||||||
|
const home_icon = require(`@/assets/navbar/0000034a.png`);
|
||||||
|
const deck_icon = require(`@/assets/navbar/00000047.png`);
|
||||||
|
const help_icon = require(`@/assets/navbar/00000121.png`);
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "App",
|
name: "App",
|
||||||
|
|
||||||
@@ -66,9 +70,9 @@ export default {
|
|||||||
primaryDrawer: {
|
primaryDrawer: {
|
||||||
model: true,
|
model: true,
|
||||||
items: [
|
items: [
|
||||||
{ title: "Home", icon: mdiViewDashboard, link: "/" },
|
{ title: "Home", icon: home_icon, link: "/" },
|
||||||
{ title: "Deck Builder", icon: mdiCalculator, link: "deck-builder" },
|
{ title: "Deck Builder", icon: deck_icon, link: "deck-builder" },
|
||||||
{ title: "Help", icon: mdiHelpBox, link: "help" },
|
{ title: "Help", icon: help_icon, link: "help" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
icons: {
|
icons: {
|
||||||
|
|||||||
BIN
src/assets/000000c6.png
Normal file
|
After Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 6.7 KiB |
@@ -1 +0,0 @@
|
|||||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 87.5 100"><defs><style>.cls-1{fill:#1697f6;}.cls-2{fill:#7bc6ff;}.cls-3{fill:#1867c0;}.cls-4{fill:#aeddff;}</style></defs><title>Artboard 46</title><polyline class="cls-1" points="43.75 0 23.31 0 43.75 48.32"/><polygon class="cls-2" points="43.75 62.5 43.75 100 0 14.58 22.92 14.58 43.75 62.5"/><polyline class="cls-3" points="43.75 0 64.19 0 43.75 48.32"/><polygon class="cls-4" points="64.58 14.58 87.5 14.58 43.75 100 43.75 62.5 64.58 14.58"/></svg>
|
|
||||||
|
Before Width: | Height: | Size: 539 B |
BIN
src/assets/navbar/00000047.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
src/assets/navbar/00000121.png
Normal file
|
After Width: | Height: | Size: 70 KiB |
BIN
src/assets/navbar/0000034a.png
Normal file
|
After Width: | Height: | Size: 68 KiB |
1235
src/data/chains.json
@@ -1,12 +0,0 @@
|
|||||||
[
|
|
||||||
{ "text": "Building", "value": "building", "groupable": false },
|
|
||||||
{ "text": "Number Needed", "value": "number_needed", "groupable": false },
|
|
||||||
{
|
|
||||||
"text": "Electricity Supplied?",
|
|
||||||
"value": "electricity_supplied",
|
|
||||||
"groupable": false
|
|
||||||
},
|
|
||||||
{ "text": "Chain", "value": "chain", "groupable": true },
|
|
||||||
{ "text": "Final Building?", "value": "final_building", "groupable": false },
|
|
||||||
{ "text": "Base Duration", "value": "base_duration", "groupable": false }
|
|
||||||
]
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
[
|
|
||||||
{ "text": "Building", "value": "building", "groupable": false },
|
|
||||||
{
|
|
||||||
"text": "Electricity Supplied?",
|
|
||||||
"value": "electricity_supplied",
|
|
||||||
"groupable": false
|
|
||||||
},
|
|
||||||
{ "text": "Feeds Into", "value": "feeds_into", "groupable": false },
|
|
||||||
{ "text": "Chain", "value": "chain", "groupable": true },
|
|
||||||
{ "text": "Tier", "value": "tier", "groupable": false },
|
|
||||||
{ "text": "Final Building?", "value": "final_building", "groupable": false },
|
|
||||||
{
|
|
||||||
"text": "Improved By Electricity?",
|
|
||||||
"value": "improved_by_electricity",
|
|
||||||
"groupable": false
|
|
||||||
},
|
|
||||||
{ "text": "Base Duration", "value": "base_duration", "groupable": false },
|
|
||||||
]
|
|
||||||
166
src/data/shikigami_cards.json
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"header": "Group 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Hakuro",
|
||||||
|
"character_card": "hakuro/hakuro-char.png",
|
||||||
|
"cards": [
|
||||||
|
{ "id": "23c8ab29", "name": "Hanare", "url": "hakuro/hakuro-hanare.png" },
|
||||||
|
{ "id": "58472d92", "name": "Hanare", "url": "hakuro/hakuro-hanare.png" },
|
||||||
|
{ "id": "4210b5bb", "name": "Protection", "url": "hakuro/hakuro-protection.png" },
|
||||||
|
{ "id": "1d512961", "name": "Protection", "url": "hakuro/hakuro-protection.png" },
|
||||||
|
{ "id": "345fcb75", "name": "Perfect Shot", "url": "hakuro/hakuro-perfect_shot.png" },
|
||||||
|
{ "id": "1d6b91ab", "name": "Perfect Shot", "url": "hakuro/hakuro-perfect_shot.png" },
|
||||||
|
{ "id": "5aa61d05", "name": "Non Self", "url": "hakuro/hakuro-non_self.png" },
|
||||||
|
{ "id": "006ebea2", "name": "Non Self", "url": "hakuro/hakuro-non_self.png" },
|
||||||
|
{ "id": "cc861795", "name": "Evolved: Hakuro", "url": "hakuro/hakuro-evolved.png" },
|
||||||
|
{ "id": "c34695f0", "name": "Evolved: Hakuro", "url": "hakuro/hakuro-evolved.png" },
|
||||||
|
{ "id": "8086ded8", "name": "Kai", "url": "hakuro/hakuro-kai.png" },
|
||||||
|
{ "id": "d0df74c2", "name": "Kai", "url": "hakuro/hakuro-kai.png" },
|
||||||
|
{ "id": "b8dfe5be", "name": "Zanshin", "url": "hakuro/hakuro-zanshin.png" },
|
||||||
|
{ "id": "d72b3867", "name": "Zanshin", "url": "hakuro/hakuro-zanshin.png" },
|
||||||
|
{ "id": "e715a175", "name": "Sharpshot", "url": "hakuro/hakuro-sharpshot.png" },
|
||||||
|
{ "id": "0b19a276", "name": "Sharpshot", "url": "hakuro/hakuro-sharpshot.png" }
|
||||||
|
],
|
||||||
|
"avatar": "hakuro/hakuro-avatar.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Samurai X",
|
||||||
|
"character_card": "samurai_x/samurai_x-char.png",
|
||||||
|
"cards": [
|
||||||
|
{ "id": "1a89af30", "name": "Evovled", "url": "samurai_x/samurai_x-evolved.png" },
|
||||||
|
{ "id": "21265148", "name": "Evovled", "url": "samurai_x/samurai_x-evolved.png" },
|
||||||
|
{ "id": "7d7b03d2", "name": "Bull Rush", "url": "samurai_x/samurai_x-bull_rush.png" },
|
||||||
|
{ "id": "c74548ce", "name": "Bull Rush", "url": "samurai_x/samurai_x-bull_rush.png" },
|
||||||
|
{ "id": "1d34d24e", "name": "Immovable", "url": "samurai_x/samurai_x-immovable.png" },
|
||||||
|
{ "id": "a16d701b", "name": "Immovable", "url": "samurai_x/samurai_x-immovable.png" },
|
||||||
|
{ "id": "6dc6da5d", "name": "Dust Blade", "url": "samurai_x/samurai_x-dust_blade.png" },
|
||||||
|
{ "id": "b614c409", "name": "Dust Blade", "url": "samurai_x/samurai_x-dust_blade.png" },
|
||||||
|
{ "id": "868fed7d", "name": "Binding Array", "url": "samurai_x/samurai_x-binding_array.png" },
|
||||||
|
{ "id": "e91253e9", "name": "Binding Array", "url": "samurai_x/samurai_x-binding_array.png" },
|
||||||
|
{ "id": "2a6f5c24", "name": "Shield of Dust", "url": "samurai_x/samurai_x-shield_of_dust.png" },
|
||||||
|
{ "id": "64a837a5", "name": "Shield of Dust", "url": "samurai_x/samurai_x-shield_of_dust.png" },
|
||||||
|
{ "id": "834f18b4", "name": "Moving Fortress", "url": "samurai_x/samurai_x-moving_fortress.png" },
|
||||||
|
{ "id": "97239b92", "name": "Moving Fortress", "url": "samurai_x/samurai_x-moving_fortress.png" },
|
||||||
|
{ "id": "7a0c5657", "name": "Wall of the Ancients", "url": "samurai_x/samurai_x-wall_of_the_ancients.png" },
|
||||||
|
{ "id": "40ac9ae2", "name": "Wall of the Ancients", "url": "samurai_x/samurai_x-wall_of_the_ancients.png" }
|
||||||
|
],
|
||||||
|
"avatar": "samurai_x/samurai_x-avatar.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Ibaraki Doji",
|
||||||
|
"character_card": "ibaraki_doji/ibaraki_doji-char.png",
|
||||||
|
"cards": [
|
||||||
|
{ "id": "7eb59ee9", "name": "Black Flame Hand", "url": "ibaraki_doji/ibaraki_doji-black_flame_hand.png" },
|
||||||
|
{ "id": "58281234", "name": "Black Flame Hand", "url": "ibaraki_doji/ibaraki_doji-black_flame_hand.png" },
|
||||||
|
{ "id": "ec9012fa", "name": "Blazing Fist", "url": "ibaraki_doji/ibaraki_doji-blazing_fist.png" },
|
||||||
|
{ "id": "90857399", "name": "Blazing Fist", "url": "ibaraki_doji/ibaraki_doji-blazing_fist.png" },
|
||||||
|
{ "id": "ebb48e83", "name": "Demon of Rashomon", "url": "ibaraki_doji/ibaraki_doji-demon_of_rashomon.png" },
|
||||||
|
{ "id": "d48dead8", "name": "Demon of Rashomon", "url": "ibaraki_doji/ibaraki_doji-demon_of_rashomon.png" },
|
||||||
|
{ "id": "a78431d8", "name": "Demon's Hand", "url": "ibaraki_doji/ibaraki_doji-demons_hand.png" },
|
||||||
|
{ "id": "f84c61e2", "name": "Demon's Hand", "url": "ibaraki_doji/ibaraki_doji-demons_hand.png" },
|
||||||
|
{ "id": "103ef376", "name": "Evolved: Ibaraki Doji", "url": "ibaraki_doji/ibaraki_doji-evolved.png" },
|
||||||
|
{ "id": "cf4b7b59", "name": "Evolved: Ibaraki Doji", "url": "ibaraki_doji/ibaraki_doji-evolved.png" },
|
||||||
|
{ "id": "caf967df", "name": "Infernal Hand", "url": "ibaraki_doji/ibaraki_doji-infernal_hand.png" },
|
||||||
|
{ "id": "5d1c9ab7", "name": "Infernal Hand", "url": "ibaraki_doji/ibaraki_doji-infernal_hand.png" },
|
||||||
|
{ "id": "c2f7660b", "name": "Rage Outlet", "url": "ibaraki_doji/ibaraki_doji-rage_outlet.png" },
|
||||||
|
{ "id": "c29e48de", "name": "Rage Outlet", "url": "ibaraki_doji/ibaraki_doji-rage_outlet.png" },
|
||||||
|
{ "id": "9f63acfb", "name": "Sever Arm", "url": "ibaraki_doji/ibaraki_doji-sever_arm.png" },
|
||||||
|
{ "id": "f9380f3b", "name": "Sever Arm", "url": "ibaraki_doji/ibaraki_doji-sever_arm.png" }
|
||||||
|
],
|
||||||
|
"avatar": "ibaraki_doji/ibaraki_doji-avatar.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Ootengu",
|
||||||
|
"character_card": "ootengu/ootengu-char.png",
|
||||||
|
"cards": [
|
||||||
|
{ "id": "9af464b1", "name": "Dark Featherblade", "url": "ootengu/ootengu-dark_featherblade.png" },
|
||||||
|
{ "id": "027ef4c6", "name": "Dark Featherblade", "url": "ootengu/ootengu-dark_featherblade.png" },
|
||||||
|
{ "id": "68c8f118", "name": "Evolved: Ootengu", "url": "ootengu/ootengu-evolved.png" },
|
||||||
|
{ "id": "f731fca9", "name": "Evolved: Ootengu", "url": "ootengu/ootengu-evolved.png" },
|
||||||
|
{ "id": "bc39f712", "name": "Featherblade Storm", "url": "ootengu/ootengu-featherblade_storm.png" },
|
||||||
|
{ "id": "90990cd5", "name": "Featherblade Storm", "url": "ootengu/ootengu-featherblade_storm.png" },
|
||||||
|
{ "id": "eb20d335", "name": "I am Justice", "url": "ootengu/ootengu-i_am_justice.png" },
|
||||||
|
{ "id": "52a5c6ea", "name": "I am Justice", "url": "ootengu/ootengu-i_am_justice.png" },
|
||||||
|
{ "id": "8213c9c6", "name": "Lord of the Storm", "url": "ootengu/ootengu-lord_of_the_storm.png" },
|
||||||
|
{ "id": "e11e2fba", "name": "Lord of the Storm", "url": "ootengu/ootengu-lord_of_the_storm.png" },
|
||||||
|
{ "id": "2ab5bf45", "name": "Shield of Storm", "url": "ootengu/ootengu-shield_of_storm.png" },
|
||||||
|
{ "id": "77c724c2", "name": "Shield of Storm", "url": "ootengu/ootengu-shield_of_storm.png" },
|
||||||
|
{ "id": "b37a9e12", "name": "Tengu's Fury", "url": "ootengu/ootengu-tengus_fury.png" },
|
||||||
|
{ "id": "d39da094", "name": "Tengu's Fury", "url": "ootengu/ootengu-tengus_fury.png" },
|
||||||
|
{ "id": "6ad67909", "name": "Wind Blast", "url": "ootengu/ootengu-wind_blast.png" },
|
||||||
|
{ "id": "f800c894", "name": "Wind Blast", "url": "ootengu/ootengu-wind_blast.png" }
|
||||||
|
],
|
||||||
|
"avatar": "ootengu/ootengu-avatar.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Hououka",
|
||||||
|
"character_card": "hououka/hououka-char.png",
|
||||||
|
"cards": [
|
||||||
|
{ "id": "f98d894b", "name": "Ascension", "url": "hououka/hououka-ascension.png" },
|
||||||
|
{ "id": "f08efb12", "name": "Ascension", "url": "hououka/hououka-ascension.png" },
|
||||||
|
{ "id": "0882462a", "name": "Evolved: Hououka", "url": "hououka/hououka-evolved.png" },
|
||||||
|
{ "id": "27fd5685", "name": "Evolved: Hououka", "url": "hououka/hououka-evolved.png" },
|
||||||
|
{ "id": "4775e033", "name": "Ignite", "url": "hououka/hououka-ignite.png" },
|
||||||
|
{ "id": "a789f8ef", "name": "Ignite", "url": "hououka/hououka-ignite.png" },
|
||||||
|
{ "id": "534a788c", "name": "Immolating Quill", "url": "hououka/hououka-immolating_quill.png" },
|
||||||
|
{ "id": "2d149086", "name": "Immolating Quill", "url": "hououka/hououka-immolating_quill.png" },
|
||||||
|
{ "id": "21301dae", "name": "Phoenix Cry", "url": "hououka/hououka-phoenix_cry.png" },
|
||||||
|
{ "id": "a8432c45", "name": "Phoenix Cry", "url": "hououka/hououka-phoenix_cry.png" },
|
||||||
|
{ "id": "635f2c7f", "name": "Phoenix Flame", "url": "hououka/hououka-phoenix_flame.png" },
|
||||||
|
{ "id": "bd23f1aa", "name": "Phoenix Flame", "url": "hououka/hououka-phoenix_flame.png" },
|
||||||
|
{ "id": "b1be2ed1", "name": "Soar", "url": "hououka/hououka-soar.png" },
|
||||||
|
{ "id": "8ebec60e", "name": "Soar", "url": "hououka/hououka-soar.png" },
|
||||||
|
{ "id": "f51520ba", "name": "Swaying Blaze", "url": "hououka/hououka-swaying_blaze.png" },
|
||||||
|
{ "id": "787ae817", "name": "Swaying Blaze", "url": "hououka/hououka-swaying_blaze.png" }
|
||||||
|
],
|
||||||
|
"avatar": "hououka/hououka-avatar.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Ubume",
|
||||||
|
"character_card": "ubume/ubume-char.png",
|
||||||
|
"cards": [
|
||||||
|
{ "id": "72c28428", "name": "Crane Dance", "url": "ubume/ubume-crane_dance.png" },
|
||||||
|
{ "id": "59ab7011", "name": "Crane Dance", "url": "ubume/ubume-crane_dance.png" },
|
||||||
|
{ "id": "8be4fd04", "name": "Evolved: Ubume", "url": "ubume/ubume-evolved.png" },
|
||||||
|
{ "id": "eebee280", "name": "Evolved: Ubume", "url": "ubume/ubume-evolved.png" },
|
||||||
|
{ "id": "434e4b48", "name": "Golden Bird", "url": "ubume/ubume-golden_bird.png" },
|
||||||
|
{ "id": "0126bfed", "name": "Golden Bird", "url": "ubume/ubume-golden_bird.png" },
|
||||||
|
{ "id": "cf49b739", "name": "Hack and Slash", "url": "ubume/ubume-hack_and_slash.png" },
|
||||||
|
{ "id": "28a57d58", "name": "Hack and Slash", "url": "ubume/ubume-hack_and_slash.png" },
|
||||||
|
{ "id": "8676b212", "name": "Motherhood", "url": "ubume/ubume-motherhood.png" },
|
||||||
|
{ "id": "74f8c877", "name": "Motherhood", "url": "ubume/ubume-motherhood.png" },
|
||||||
|
{ "id": "df51b49a", "name": "Raid", "url": "ubume/ubume-raid.png" },
|
||||||
|
{ "id": "d55089f0", "name": "Raid", "url": "ubume/ubume-raid.png" },
|
||||||
|
{ "id": "81edb5cf", "name": "Shadow Wing", "url": "ubume/ubume-shadow_wing.png" },
|
||||||
|
{ "id": "99cb69ec", "name": "Shadow Wing", "url": "ubume/ubume-shadow_wing.png" },
|
||||||
|
{ "id": "1f19fa8e", "name": "Umbrella Sword", "url": "ubume/ubume-umbrella_sword.png" },
|
||||||
|
{ "id": "ad56eae2", "name": "Umbrella Sword", "url": "ubume/ubume-umbrella_sword.png" }
|
||||||
|
],
|
||||||
|
"avatar": "ubume/ubume-avatar.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Umibozu",
|
||||||
|
"character_card": "umibozu/umibozu-char.png",
|
||||||
|
"cards": [
|
||||||
|
{ "id": "5930f94b", "name": "Blessed Water", "url": "umibozu/umibozu-blessed_water.png" },
|
||||||
|
{ "id": "c0753f17", "name": "Blessed Water", "url": "umibozu/umibozu-blessed_water.png" },
|
||||||
|
{ "id": "43d92212", "name": "Evolved: Umibozu", "url": "umibozu/umibozu-evolved.png" },
|
||||||
|
{ "id": "c6be9e57", "name": "Evolved: Umibozu", "url": "umibozu/umibozu-evolved.png" },
|
||||||
|
{ "id": "ce402df1", "name": "Giant Waves", "url": "umibozu/umibozu-giant_waves.png" },
|
||||||
|
{ "id": "708d29b0", "name": "Giant Waves", "url": "umibozu/umibozu-giant_waves.png" },
|
||||||
|
{ "id": "b49275c6", "name": "Healing Water", "url": "umibozu/umibozu-healing_water.png" },
|
||||||
|
{ "id": "74e7bdc4", "name": "Healing Water", "url": "umibozu/umibozu-healing_water.png" },
|
||||||
|
{ "id": "38297f66", "name": "Master of the Sea", "url": "umibozu/umibozu-master_of_the_sea.png" },
|
||||||
|
{ "id": "621303f7", "name": "Master of the Sea", "url": "umibozu/umibozu-master_of_the_sea.png" },
|
||||||
|
{ "id": "135c520a", "name": "Shield of the Sea", "url": "umibozu/umibozu-shield_of_the_sea.png" },
|
||||||
|
{ "id": "4be79e70", "name": "Shield of the Sea", "url": "umibozu/umibozu-shield_of_the_sea.png" },
|
||||||
|
{ "id": "c73493d8", "name": "Spectral", "url": "umibozu/umibozu-spectral.png" },
|
||||||
|
{ "id": "bb14e042", "name": "Spectral", "url": "umibozu/umibozu-spectral.png" },
|
||||||
|
{ "id": "6c0aac31", "name": "Waterspout", "url": "umibozu/umibozu-waterspout.png" },
|
||||||
|
{ "id": "dad679e3", "name": "Waterspout", "url": "umibozu/umibozu-waterspout.png" }
|
||||||
|
],
|
||||||
|
"avatar": "umibozu/umibozu-avatar.png"
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -30,6 +30,7 @@ const routes = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const router = new VueRouter({
|
const router = new VueRouter({
|
||||||
|
mode: 'history',
|
||||||
routes,
|
routes,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
$material-dark: (
|
$material-dark: (
|
||||||
'background': #04002E
|
'background': #16192B
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<!-- <v-container fluid px-16 pb-10> -->
|
||||||
<v-container>
|
<v-container>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col cols="12">
|
<v-col cols="12">
|
||||||
@@ -9,6 +10,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
<v-row>
|
||||||
|
<v-textarea
|
||||||
|
v-model="deck_title"
|
||||||
|
label="Deck Title"
|
||||||
|
class="user-deck-title"
|
||||||
|
rows="1"
|
||||||
|
row-height="80"
|
||||||
|
></v-textarea>
|
||||||
|
</v-row>
|
||||||
|
<v-row>
|
||||||
|
<v-textarea v-model="deck_description" label="Deck Description">
|
||||||
|
</v-textarea>
|
||||||
|
</v-row>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col cols="12">
|
<v-col cols="12">
|
||||||
<v-select
|
<v-select
|
||||||
@@ -31,10 +45,12 @@
|
|||||||
x-large
|
x-large
|
||||||
@click="data.select"
|
@click="data.select"
|
||||||
@click:close="remove_shikigami(data.item)"
|
@click:close="remove_shikigami(data.item)"
|
||||||
color="#070042"
|
color="#C0B094"
|
||||||
>
|
>
|
||||||
<v-avatar size="90" left>
|
<v-avatar size="90" left>
|
||||||
<v-img :src="data.item.avatar"></v-img>
|
<v-img
|
||||||
|
:src="require(`@/assets/cards/${data.item.avatar}`)"
|
||||||
|
></v-img>
|
||||||
</v-avatar>
|
</v-avatar>
|
||||||
{{ data.item.name }}
|
{{ data.item.name }}
|
||||||
</v-chip>
|
</v-chip>
|
||||||
@@ -42,7 +58,7 @@
|
|||||||
<template v-slot:item="data">
|
<template v-slot:item="data">
|
||||||
<template>
|
<template>
|
||||||
<v-list-item-avatar>
|
<v-list-item-avatar>
|
||||||
<img :src="data.item.avatar" />
|
<img :src="require(`@/assets/cards/${data.item.avatar}`)" />
|
||||||
</v-list-item-avatar>
|
</v-list-item-avatar>
|
||||||
<v-list-item-content>
|
<v-list-item-content>
|
||||||
<v-list-item-title v-html="data.item.name"></v-list-item-title>
|
<v-list-item-title v-html="data.item.name"></v-list-item-title>
|
||||||
@@ -54,38 +70,45 @@
|
|||||||
</template>
|
</template>
|
||||||
</v-select>
|
</v-select>
|
||||||
</v-col>
|
</v-col>
|
||||||
selected_shikigami_names: {{ selected_shikigami_names }} <br />
|
<!-- selected_shikigami_names: {{ selected_shikigami_names }} <br /> -->
|
||||||
selected_shikigami_data: {{ selected_shikigami_data }} <br />
|
<!-- selected_shikigami_data: {{ selected_shikigami_data }} <br /> -->
|
||||||
selected_shikigami_decks: {{ selected_shikigami_decks }}
|
<!-- selected_shikigami_decks: {{ selected_shikigami_decks }} -->
|
||||||
|
<!-- deck_title: {{ deck_title }} -->
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row v-for="(_, index) in selected_shikigami_names" :key="index">
|
<v-row v-for="(_, index) in selected_shikigami_names" :key="index">
|
||||||
<v-card elevation="2" width="100%" class="py-4" flat tile color="#070042">
|
<v-card elevation="2" width="100%" class="pa-3" flat tile color="#171D29">
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col cols="2">
|
<v-col cols="2">
|
||||||
<div cols="12">
|
<div cols="12">
|
||||||
<div cols="12" class="text-h5 text-center">
|
<div cols="12" class="text-h5 text-center">
|
||||||
{{ `${selected_shikigami_data[index].name}` }}
|
<!-- {{ `${selected_shikigami_data[index].name}` }} -->
|
||||||
</div>
|
</div>
|
||||||
<div cols="12">
|
<div cols="12">
|
||||||
<v-img
|
<v-img
|
||||||
:src="`${selected_shikigami_data[index].avatar}`"
|
:src="
|
||||||
aspect-ratio="1"
|
require(`@/assets/cards/${selected_shikigami_data[index].character_card}`)
|
||||||
|
"
|
||||||
width="100%"
|
width="100%"
|
||||||
></v-img>
|
></v-img>
|
||||||
</div>
|
</div>
|
||||||
<div cols="12">
|
</div>
|
||||||
{{ index }}
|
</v-col>
|
||||||
|
<v-col cols="10" class="d-flex flex-column"
|
||||||
|
><v-row cols="12">
|
||||||
|
<!-- {{ index }} -->
|
||||||
|
<!-- {{ selected_shikigami_decks[index][index].length }} -->
|
||||||
<v-select
|
<v-select
|
||||||
v-model="selected_shikigami_decks[index][index]"
|
v-model="selected_shikigami_decks[index][index]"
|
||||||
v-on:input="limit_decks"
|
v-on:input="limit_decks"
|
||||||
:items="double_cards(index)"
|
:items="selected_shikigami_data[index].cards"
|
||||||
item-text="card.name"
|
item-text="name"
|
||||||
item-value="id"
|
item-value="id"
|
||||||
chips
|
chips
|
||||||
multiple
|
multiple
|
||||||
hint="Choose 8 cards for your deck."
|
hint="Choose 8 cards for your deck."
|
||||||
persistent-hint
|
persistent-hint
|
||||||
return-object
|
return-object
|
||||||
|
clearable
|
||||||
>
|
>
|
||||||
<template v-slot:selection="data">
|
<template v-slot:selection="data">
|
||||||
<v-chip
|
<v-chip
|
||||||
@@ -93,130 +116,53 @@
|
|||||||
:input-value="data.selected"
|
:input-value="data.selected"
|
||||||
close
|
close
|
||||||
label
|
label
|
||||||
x-small
|
|
||||||
@click="data.select"
|
@click="data.select"
|
||||||
@click:close="remove_decks(index, data.index)"
|
@click:close="remove_decks(index, data.index)"
|
||||||
color="#04002E"
|
color="#C0B094"
|
||||||
>{{ data.item.card.name }}</v-chip
|
>{{ data.item.name }}</v-chip
|
||||||
></template
|
></template
|
||||||
>
|
>
|
||||||
</v-select>
|
</v-select>
|
||||||
</div>
|
</v-row>
|
||||||
</div>
|
<!-- <div cols="12">
|
||||||
</v-col>
|
{{ selected_shikigami_decks[index][index] }}
|
||||||
<v-col cols="10">{{ selected_shikigami_decks[index][index] }}</v-col>
|
</div> -->
|
||||||
|
<v-row cols="12" class="d-flex align-end pb-3">
|
||||||
|
<v-card
|
||||||
|
v-for="i in selected_shikigami_decks[index][index]"
|
||||||
|
:key="i.id"
|
||||||
|
width="12.3%"
|
||||||
|
color="#171D29"
|
||||||
|
>
|
||||||
|
<!-- <div class="text-center">
|
||||||
|
{{ i.name }}
|
||||||
|
</div> -->
|
||||||
|
<div class="">
|
||||||
|
<v-img
|
||||||
|
:src="require(`@/assets/cards/${i.url}`)"
|
||||||
|
class="deck-card"
|
||||||
|
></v-img></div
|
||||||
|
></v-card> </v-row
|
||||||
|
></v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-container grid-list-xl>
|
<v-row>
|
||||||
<v-select
|
<!-- <v-textarea :value="construct_url()" color="teal"> </v-textarea> -->
|
||||||
v-model="color"
|
</v-row>
|
||||||
:items="colors"
|
|
||||||
item-text="title"
|
|
||||||
item-value="id"
|
|
||||||
multiple
|
|
||||||
return-object
|
|
||||||
>
|
|
||||||
</v-select>
|
|
||||||
colors: {{ color }}<br />
|
|
||||||
computed: {{ getColors }}
|
|
||||||
</v-container>
|
|
||||||
</v-container>
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import shikigami from "../data/shikigami_cards.json";
|
||||||
export default {
|
export default {
|
||||||
data: () => ({
|
data: () => ({
|
||||||
selected_shikigami_names: [],
|
selected_shikigami_names: [],
|
||||||
selected_shikigami_data: [],
|
selected_shikigami_data: [],
|
||||||
selected_shikigami_decks: [{ 0: [] }, { 1: [] }, { 2: [] }, { 3: [] }],
|
selected_shikigami_decks: [{ 0: [] }, { 1: [] }, { 2: [] }, { 3: [] }],
|
||||||
shikigami: [
|
shikigami: shikigami,
|
||||||
{
|
deck_title: "",
|
||||||
header: "Group 1",
|
deck_description: "",
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Shiki_0",
|
|
||||||
cards: [
|
|
||||||
{ name: "shiki_0_card_0", url: "https://shiki_0_card_0.png" },
|
|
||||||
{ name: "shiki_0_card_1", url: "https://shiki_0_card_1.png" },
|
|
||||||
{ name: "shiki_0_card_2", url: "https://shiki_0_card_2.png" },
|
|
||||||
{ name: "shiki_0_card_3", url: "https://shiki_0_card_3.png" },
|
|
||||||
{ name: "shiki_0_card_4", url: "https://shiki_0_card_4.png" },
|
|
||||||
{ name: "shiki_0_card_5", url: "https://shiki_0_card_5.png" },
|
|
||||||
{ name: "shiki_0_card_6", url: "https://shiki_0_card_6.png" },
|
|
||||||
{ name: "shiki_0_card_7", url: "https://shiki_0_card_7.png" },
|
|
||||||
],
|
|
||||||
avatar: "https://cdn.vuetifyjs.com/images/lists/1.jpg",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Shiki_1",
|
|
||||||
cards: [
|
|
||||||
{ name: "shiki_1_card_0", url: "https://shiki_1_card_0.png" },
|
|
||||||
{ name: "shiki_1_card_1", url: "https://shiki_1_card_1.png" },
|
|
||||||
{ name: "shiki_1_card_2", url: "https://shiki_1_card_2.png" },
|
|
||||||
{ name: "shiki_1_card_3", url: "https://shiki_1_card_3.png" },
|
|
||||||
{ name: "shiki_1_card_4", url: "https://shiki_1_card_4.png" },
|
|
||||||
{ name: "shiki_1_card_5", url: "https://shiki_1_card_5.png" },
|
|
||||||
{ name: "shiki_1_card_6", url: "https://shiki_1_card_6.png" },
|
|
||||||
{ name: "shiki_1_card_7", url: "https://shiki_1_card_7.png" },
|
|
||||||
],
|
|
||||||
avatar: "https://cdn.vuetifyjs.com/images/lists/2.jpg",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Shiki_2",
|
|
||||||
cards: [
|
|
||||||
{ name: "shiki_2_card_0", url: "https://shiki_2_card_0.png" },
|
|
||||||
{ name: "shiki_2_card_1", url: "https://shiki_2_card_1.png" },
|
|
||||||
{ name: "shiki_2_card_2", url: "https://shiki_2_card_2.png" },
|
|
||||||
{ name: "shiki_2_card_3", url: "https://shiki_2_card_3.png" },
|
|
||||||
{ name: "shiki_2_card_4", url: "https://shiki_2_card_4.png" },
|
|
||||||
{ name: "shiki_2_card_5", url: "https://shiki_2_card_5.png" },
|
|
||||||
{ name: "shiki_2_card_6", url: "https://shiki_2_card_6.png" },
|
|
||||||
{ name: "shiki_2_card_7", url: "https://shiki_2_card_7.png" },
|
|
||||||
],
|
|
||||||
avatar: "https://cdn.vuetifyjs.com/images/lists/3.jpg",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
header: "Group 2",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
divider: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Shiki_3",
|
|
||||||
cards: [
|
|
||||||
{ name: "shiki_3_card_0", url: "https://shiki_3_card_0.png" },
|
|
||||||
{ name: "shiki_3_card_1", url: "https://shiki_3_card_1.png" },
|
|
||||||
{ name: "shiki_3_card_2", url: "https://shiki_3_card_2.png" },
|
|
||||||
{ name: "shiki_3_card_3", url: "https://shiki_3_card_3.png" },
|
|
||||||
{ name: "shiki_3_card_4", url: "https://shiki_3_card_4.png" },
|
|
||||||
{ name: "shiki_3_card_5", url: "https://shiki_3_card_5.png" },
|
|
||||||
{ name: "shiki_3_card_6", url: "https://shiki_3_card_6.png" },
|
|
||||||
{ name: "shiki_3_card_7", url: "https://shiki_3_card_7.png" },
|
|
||||||
],
|
|
||||||
avatar: "https://cdn.vuetifyjs.com/images/lists/4.jpg",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Shiki_4",
|
|
||||||
cards: [
|
|
||||||
{ name: "shiki_4_card_0", url: "https://shiki_4_card_0.png" },
|
|
||||||
{ name: "shiki_4_card_1", url: "https://shiki_4_card_1.png" },
|
|
||||||
{ name: "shiki_4_card_2", url: "https://shiki_4_card_2.png" },
|
|
||||||
{ name: "shiki_4_card_3", url: "https://shiki_4_card_3.png" },
|
|
||||||
{ name: "shiki_4_card_4", url: "https://shiki_4_card_4.png" },
|
|
||||||
{ name: "shiki_4_card_5", url: "https://shiki_4_card_5.png" },
|
|
||||||
{ name: "shiki_4_card_6", url: "https://shiki_4_card_6.png" },
|
|
||||||
{ name: "shiki_4_card_7", url: "https://shiki_4_card_7.png" },
|
|
||||||
],
|
|
||||||
avatar: "https://cdn.vuetifyjs.com/images/lists/5.jpg",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
colors: [
|
|
||||||
{ id: 1, title: "red" },
|
|
||||||
{ id: 2, title: "blue" },
|
|
||||||
{ id: 3, title: "red" },
|
|
||||||
],
|
|
||||||
color: [],
|
|
||||||
}),
|
}),
|
||||||
methods: {
|
methods: {
|
||||||
get_chosen_shikigami_data: function (shikigami_name) {
|
get_chosen_shikigami_data: function (shikigami_name) {
|
||||||
@@ -242,7 +188,28 @@ export default {
|
|||||||
},
|
},
|
||||||
remove_shikigami(item) {
|
remove_shikigami(item) {
|
||||||
const index = this.selected_shikigami_names.indexOf(item.name);
|
const index = this.selected_shikigami_names.indexOf(item.name);
|
||||||
if (index >= 0) this.selected_shikigami_names.splice(index, 1);
|
if (index >= 0) {
|
||||||
|
this.selected_shikigami_names.splice(index, 1);
|
||||||
|
this.selected_shikigami_decks[index][index].splice(0);
|
||||||
|
// shuffle shikigami down by 1
|
||||||
|
if (index <= 3) {
|
||||||
|
for (let j = index; j <= 2; j++) {
|
||||||
|
for (
|
||||||
|
let i = 0;
|
||||||
|
i < this.selected_shikigami_decks[j + 1][j + 1].length;
|
||||||
|
i++
|
||||||
|
) {
|
||||||
|
// this if is optional?
|
||||||
|
if (index < 3) {
|
||||||
|
this.selected_shikigami_decks[j][j].push(
|
||||||
|
this.selected_shikigami_decks[j + 1][j + 1][i]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.selected_shikigami_decks[j + 1][j + 1] = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
remove_decks(shiki_index, card_index) {
|
remove_decks(shiki_index, card_index) {
|
||||||
``;
|
``;
|
||||||
@@ -253,28 +220,98 @@ export default {
|
|||||||
console.log(this.selected_shikigami_decks[shiki_index].shiki_index);
|
console.log(this.selected_shikigami_decks[shiki_index].shiki_index);
|
||||||
console.log(shiki_index, card_index);
|
console.log(shiki_index, card_index);
|
||||||
},
|
},
|
||||||
double_cards(index) {
|
construct_url: function () {
|
||||||
const doubled_cards = [];
|
const saved_selected_shikigami_names = btoa(
|
||||||
this.selected_shikigami_data[index].cards.forEach(function (el) {
|
JSON.stringify(this.selected_shikigami_names)
|
||||||
let id_0 = Math.random().toString(36).slice(6);
|
);
|
||||||
let id_1 = Math.random().toString(36).slice(6);
|
const saved_selected_shikigami_decks = btoa(
|
||||||
doubled_cards.push({ id: id_0, card: el }, { id: id_1, card: el });
|
JSON.stringify(this.selected_shikigami_decks)
|
||||||
});
|
);
|
||||||
console.log(doubled_cards);
|
const saved_deck_title = btoa(JSON.stringify(this.deck_title));
|
||||||
return doubled_cards;
|
const saved_deck_description = btoa(
|
||||||
|
JSON.stringify(this.deck_description)
|
||||||
|
);
|
||||||
|
const url = `?deck_title=${saved_deck_title}&deck_description=${saved_deck_description}&selected_shikigami_names=${saved_selected_shikigami_names}&selected_shikigami_decks=${saved_selected_shikigami_decks}`;
|
||||||
|
return url;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
mounted() {
|
||||||
|
if (this.$route.query.selected_shikigami_names) {
|
||||||
|
const saved_selected_shikigami_names = JSON.parse(
|
||||||
|
atob(this.$route.query.selected_shikigami_names)
|
||||||
|
);
|
||||||
|
|
||||||
// return this.selected_shikigami_data[index].cards.concat.apply(
|
if (typeof saved_selected_shikigami_names != "object") {
|
||||||
// [],
|
this.selected_shikigami_names = [];
|
||||||
// this.selected_shikigami_data[index].cards.map(function (el) {
|
} else {
|
||||||
// return [el, el];
|
this.selected_shikigami_names = [];
|
||||||
// })
|
for (let i = 0; i < saved_selected_shikigami_names.length; i++) {
|
||||||
// );
|
this.selected_shikigami_names.push(saved_selected_shikigami_names[i]);
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
computed: {
|
} else {
|
||||||
getColors() {
|
this.selected_shikigami_names = [];
|
||||||
return this.color.map((c) => c.title);
|
}
|
||||||
},
|
|
||||||
|
if (this.$route.query.selected_shikigami_decks) {
|
||||||
|
const saved_selected_shikigami_decks = JSON.parse(
|
||||||
|
atob(this.$route.query.selected_shikigami_decks)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (typeof saved_selected_shikigami_decks != "object") {
|
||||||
|
this.selected_shikigami_decks = [
|
||||||
|
{ 0: [] },
|
||||||
|
{ 1: [] },
|
||||||
|
{ 2: [] },
|
||||||
|
{ 3: [] },
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
this.selected_shikigami_decks = [];
|
||||||
|
for (let i = 0; i < saved_selected_shikigami_decks.length; i++) {
|
||||||
|
this.selected_shikigami_decks.push(saved_selected_shikigami_decks[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.selected_shikigami_decks = [
|
||||||
|
{ 0: [] },
|
||||||
|
{ 1: [] },
|
||||||
|
{ 2: [] },
|
||||||
|
{ 3: [] },
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.$route.query.deck_title) {
|
||||||
|
const saved_deck_title = JSON.parse(atob(this.$route.query.deck_title));
|
||||||
|
|
||||||
|
if (typeof saved_deck_title != "string") {
|
||||||
|
this.deck_title = "";
|
||||||
|
} else {
|
||||||
|
this.deck_title = "";
|
||||||
|
for (let i = 0; i < saved_deck_title.length; i++) {
|
||||||
|
this.deck_title = saved_deck_title;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.deck_title = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.$route.query.deck_description) {
|
||||||
|
const saved_deck_description = JSON.parse(
|
||||||
|
atob(this.$route.query.deck_description)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (typeof saved_deck_description != "string") {
|
||||||
|
this.deck_description = "";
|
||||||
|
} else {
|
||||||
|
this.deck_description = "";
|
||||||
|
for (let i = 0; i < saved_deck_description.length; i++) {
|
||||||
|
this.deck_description = saved_deck_description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.deck_description = "";
|
||||||
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
selected_shikigami_names: function () {
|
selected_shikigami_names: function () {
|
||||||
@@ -300,4 +337,32 @@ export default {
|
|||||||
height: 60px !important;
|
height: 60px !important;
|
||||||
width: 60px !important;
|
width: 60px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.deck-card:hover {
|
||||||
|
position: relative;
|
||||||
|
animation: card-zoom 500ms ease-in-out 0s forwards;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes card-zoom {
|
||||||
|
100% {
|
||||||
|
transform: scale(1.45);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-textarea textarea {
|
||||||
|
padding: 50px 0px 0px 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-deck-title {
|
||||||
|
font-size: 50px !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.user-deck-title textarea {
|
||||||
|
padding-top: 10px !important;
|
||||||
|
padding-bottom: 15px !important;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -3,25 +3,24 @@
|
|||||||
<v-row class="text-center">
|
<v-row class="text-center">
|
||||||
<v-col cols="12">
|
<v-col cols="12">
|
||||||
<v-img
|
<v-img
|
||||||
:src="require('../assets/logo.svg')"
|
:src="require('../assets/000000c6.png')"
|
||||||
class="my-3"
|
class="my-3"
|
||||||
contain
|
contain
|
||||||
height="200"
|
height="500"
|
||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
<v-col class="mb-4">
|
<v-col class="mb-4">
|
||||||
<h1 class="display-2 font-weight-bold mb-3">Onymoji Deck Builder</h1>
|
<h1 class="display-2 font-weight-bold mb-3">Onmyoji Deck Builder</h1>
|
||||||
|
<p class="subheading font-weight-regular">Build and share decks.</p>
|
||||||
<p class="subheading font-weight-regular">Share and build decks.</p>
|
<router-link
|
||||||
<v-btn elevation="1" x-large color="#EA6F1A">Get started</v-btn>
|
to="/deck-builder"
|
||||||
|
style="text-decoration: none;"
|
||||||
|
><v-btn elevation="2" x-large color="#C0B094"
|
||||||
|
>Get started</v-btn
|
||||||
|
></router-link
|
||||||
|
>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<!-- <v-row class="text-center">
|
|
||||||
<v-col cols="12">
|
|
||||||
What next?
|
|
||||||
</v-col>
|
|
||||||
</v-row> -->
|
|
||||||
</v-container>
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -8743,10 +8743,10 @@ vuetify-loader@^1.3.0:
|
|||||||
file-loader "^6.2.0"
|
file-loader "^6.2.0"
|
||||||
loader-utils "^2.0.0"
|
loader-utils "^2.0.0"
|
||||||
|
|
||||||
vuetify@^2.2.11:
|
vuetify@^2.4:
|
||||||
version "2.4.6"
|
version "2.4.7"
|
||||||
resolved "https://registry.yarnpkg.com/vuetify/-/vuetify-2.4.6.tgz#127b37bd36c7a63f61615e0cd6f97e8b203e7a07"
|
resolved "https://registry.yarnpkg.com/vuetify/-/vuetify-2.4.7.tgz#341f16950475466a7fa43f4cb507cc8c3ef170b9"
|
||||||
integrity sha512-oqAWKAin07ip/QuT/p4bL1LegE3MYPbfojrOcj80RATZDSnJyco2PZD8QuIzd0RhYfdAuSTkY8elvHsLu90RuQ==
|
integrity sha512-4RvdZ+BO23fPq8JCEdo9ENjE1AoMqDe1bm+4M57wNTfvW4djScxQnVYeUSE/7PHuzdSW/nROR5oyLQnGDB+DIA==
|
||||||
|
|
||||||
vuex@^3.4.0:
|
vuex@^3.4.0:
|
||||||
version "3.6.2"
|
version "3.6.2"
|
||||||
|
|||||||