diff --git a/.gitignore b/.gitignore index 6f51f5e..573d61e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,6 @@ !*.html !*.md +!*.png +!*.py !*.woff2 diff --git a/back.png b/back.png new file mode 100644 index 0000000..88c1211 Binary files /dev/null and b/back.png differ diff --git a/bottom.png b/bottom.png new file mode 100644 index 0000000..ff7fe4c Binary files /dev/null and b/bottom.png differ diff --git a/front.png b/front.png new file mode 100644 index 0000000..dc29fd9 Binary files /dev/null and b/front.png differ diff --git a/generate_sides.py b/generate_sides.py new file mode 100644 index 0000000..9f9639e --- /dev/null +++ b/generate_sides.py @@ -0,0 +1,70 @@ +from PIL import Image, ImageDraw + +width, height = 1024, 1024 + +canvas = Image.new("RGB", (width, height)) +draw = ImageDraw.Draw(canvas) + +sides = { + "front": [ + (000, 255, 255), + (255, 255, 255), + (000, 000, 255), + (255, 000, 255), + ], + "top": [ + (000, 255, 000), + (255, 255, 000), + (000, 255, 255), + (255, 255, 255), + ], + "back": [ + (255, 255, 000), + (000, 255, 000), + (255, 000, 000), + (000, 000, 000), + ], + "bottom": [ + (000, 000, 255), + (255, 000, 255), + (000, 000, 000), + (255, 000, 000), + ], + "right": [ + (255, 255, 255), + (255, 255, 000), + (255, 000, 255), + (255, 000, 000), + ], + "left": [ + (000, 255, 000), + (000, 255, 255), + (000, 000, 000), + (000, 000, 255), + ], +} + +for side, colors in sides.items(): + top_left, top_right = colors[0], colors[1] + bottom_left, bottom_right = colors[2], colors[3] + + for y in range(height): + left = ( + int((bottom_left[0] - top_left[0]) * y / height) + top_left[0], + int((bottom_left[1] - top_left[1]) * y / height) + top_left[1], + int((bottom_left[2] - top_left[2]) * y / height) + top_left[2] + ) + right = ( + int((bottom_right[0] - top_right[0]) * y / height) + top_right[0], + int((bottom_right[1] - top_right[1]) * y / height) + top_right[1], + int((bottom_right[2] - top_right[2]) * y / height) + top_right[2] + ) + + for x in range(width): + r = int((right[0] - left[0]) * x / width) + left[0] + g = int((right[1] - left[1]) * x / width) + left[1] + b = int((right[2] - left[2]) * x / width) + left[2] + + draw.point((x, y), fill=(r, g, b)) + + canvas.save(f"{side}.png") diff --git a/index.html b/index.html index 62ecbf4..847246f 100644 --- a/index.html +++ b/index.html @@ -88,10 +88,8 @@ } .face { - /* REMOVE */ - opacity: 60%; - /* REMOVE */ - background-color: red; + background-size: cover; + background-position: center; width: 5em; height: 5em; @@ -106,26 +104,32 @@ .front { transform: rotateY(0deg) translateZ(2.5em); + background-image: url(front.png); } .top { transform: rotateX(90deg) translateZ(2.5em); + background-image: url(top.png); } .back { transform: rotateY(180deg) translateZ(2.5em); + background-image: url(back.png); } .bottom { transform: rotateX(-90deg) translateZ(2.5em); + background-image: url(bottom.png); } .right { transform: rotateY(90deg) translateZ(2.5em); + background-image: url(right.png); } .left { transform: rotateY(-90deg) translateZ(2.5em); + background-image: url(left.png); } diff --git a/left.png b/left.png new file mode 100644 index 0000000..ec4644f Binary files /dev/null and b/left.png differ diff --git a/right.png b/right.png new file mode 100644 index 0000000..2895be5 Binary files /dev/null and b/right.png differ diff --git a/top.png b/top.png new file mode 100644 index 0000000..9c72643 Binary files /dev/null and b/top.png differ