Browse Source

本番環境からコピー

pull/5/head
Gitea 1 year ago
commit
249a665557
70 changed files with 157 additions and 0 deletions
  1. +3
    -0
      .gitignore
  2. BIN
      assets/bg.jpg
  3. BIN
      assets/kita/041.png
  4. BIN
      assets/kita/042.png
  5. BIN
      assets/kita/043.png
  6. BIN
      assets/kita/044.png
  7. BIN
      assets/kita/045.png
  8. BIN
      assets/kita/046.png
  9. BIN
      assets/kita/047.png
  10. BIN
      assets/kita/048.png
  11. BIN
      assets/kita/049.png
  12. BIN
      assets/kita/050.png
  13. BIN
      assets/kita/051.png
  14. BIN
      assets/kita/052.png
  15. BIN
      assets/kita/053.png
  16. BIN
      assets/kita/054.png
  17. BIN
      assets/kita/055.png
  18. BIN
      assets/kita/056.png
  19. BIN
      assets/kita/057.png
  20. BIN
      assets/kita/058.png
  21. BIN
      assets/kita/059.png
  22. BIN
      assets/kita/060.png
  23. BIN
      assets/kita/061.png
  24. BIN
      assets/kita/062.png
  25. BIN
      assets/kita/063.png
  26. BIN
      assets/kita/064.png
  27. BIN
      assets/kita/065.png
  28. BIN
      assets/kita/066.png
  29. BIN
      assets/kita/067.png
  30. BIN
      assets/kita/068.png
  31. BIN
      assets/kita/069.png
  32. BIN
      assets/kita/070.png
  33. BIN
      assets/kita/071.png
  34. BIN
      assets/kita/072.png
  35. BIN
      assets/kita/073.png
  36. BIN
      assets/kita/074.png
  37. BIN
      assets/kita/075.png
  38. BIN
      assets/kita/076.png
  39. BIN
      assets/kita/077.png
  40. BIN
      assets/kita/078.png
  41. BIN
      assets/kita/079.png
  42. BIN
      assets/kita/080.png
  43. BIN
      assets/nizika/001.png
  44. BIN
      assets/nizika/002.png
  45. BIN
      assets/nizika/003.png
  46. BIN
      assets/nizika/004.png
  47. BIN
      assets/nizika/005.png
  48. BIN
      assets/nizika/006.png
  49. BIN
      assets/nizika/007.png
  50. BIN
      assets/nizika/008.png
  51. BIN
      assets/nizika/009.png
  52. BIN
      assets/nizika/010.png
  53. BIN
      assets/nizika/011.png
  54. BIN
      assets/nizika/012.png
  55. BIN
      assets/nizika/013.png
  56. BIN
      assets/nizika/014.png
  57. BIN
      assets/nizika/015.png
  58. BIN
      assets/nizika/016.png
  59. BIN
      assets/nizika/017.png
  60. BIN
      assets/nizika/018.png
  61. BIN
      assets/nizika/019.png
  62. BIN
      assets/nizika/020.png
  63. BIN
      assets/nizika/021.png
  64. BIN
      assets/nizika/022.png
  65. BIN
      assets/nizika/023.png
  66. BIN
      assets/nizika/024.png
  67. +13
    -0
      forms/index.frm.php
  68. +4
    -0
      index.php
  69. +128
    -0
      scripts/main.js
  70. +9
    -0
      styles/index.css

+ 3
- 0
.gitignore View File

@@ -0,0 +1,3 @@
/nizika
/nml


BIN
assets/bg.jpg View File

Before After
Width: 1920  |  Height: 1080  |  Size: 1.8 MiB

BIN
assets/kita/041.png View File

Before After
Width: 428  |  Height: 240  |  Size: 101 KiB

BIN
assets/kita/042.png View File

Before After
Width: 428  |  Height: 240  |  Size: 100 KiB

BIN
assets/kita/043.png View File

Before After
Width: 428  |  Height: 240  |  Size: 100 KiB

BIN
assets/kita/044.png View File

Before After
Width: 428  |  Height: 240  |  Size: 100 KiB

BIN
assets/kita/045.png View File

Before After
Width: 428  |  Height: 240  |  Size: 100 KiB

BIN
assets/kita/046.png View File

Before After
Width: 428  |  Height: 240  |  Size: 100 KiB

BIN
assets/kita/047.png View File

Before After
Width: 428  |  Height: 240  |  Size: 100 KiB

BIN
assets/kita/048.png View File

Before After
Width: 428  |  Height: 240  |  Size: 100 KiB

BIN
assets/kita/049.png View File

Before After
Width: 428  |  Height: 240  |  Size: 96 KiB

BIN
assets/kita/050.png View File

Before After
Width: 428  |  Height: 240  |  Size: 95 KiB

BIN
assets/kita/051.png View File

Before After
Width: 428  |  Height: 240  |  Size: 95 KiB

BIN
assets/kita/052.png View File

Before After
Width: 428  |  Height: 240  |  Size: 96 KiB

BIN
assets/kita/053.png View File

Before After
Width: 428  |  Height: 240  |  Size: 96 KiB

BIN
assets/kita/054.png View File

Before After
Width: 428  |  Height: 240  |  Size: 96 KiB

BIN
assets/kita/055.png View File

Before After
Width: 428  |  Height: 240  |  Size: 96 KiB

BIN
assets/kita/056.png View File

Before After
Width: 428  |  Height: 240  |  Size: 96 KiB

BIN
assets/kita/057.png View File

Before After
Width: 428  |  Height: 240  |  Size: 96 KiB

BIN
assets/kita/058.png View File

Before After
Width: 428  |  Height: 240  |  Size: 96 KiB

BIN
assets/kita/059.png View File

Before After
Width: 428  |  Height: 240  |  Size: 96 KiB

BIN
assets/kita/060.png View File

Before After
Width: 428  |  Height: 240  |  Size: 94 KiB

BIN
assets/kita/061.png View File

Before After
Width: 428  |  Height: 240  |  Size: 93 KiB

BIN
assets/kita/062.png View File

Before After
Width: 428  |  Height: 240  |  Size: 94 KiB

BIN
assets/kita/063.png View File

Before After
Width: 428  |  Height: 240  |  Size: 93 KiB

BIN
assets/kita/064.png View File

Before After
Width: 428  |  Height: 240  |  Size: 94 KiB

BIN
assets/kita/065.png View File

Before After
Width: 428  |  Height: 240  |  Size: 94 KiB

BIN
assets/kita/066.png View File

Before After
Width: 428  |  Height: 240  |  Size: 94 KiB

BIN
assets/kita/067.png View File

Before After
Width: 428  |  Height: 240  |  Size: 94 KiB

BIN
assets/kita/068.png View File

Before After
Width: 428  |  Height: 240  |  Size: 94 KiB

BIN
assets/kita/069.png View File

Before After
Width: 428  |  Height: 240  |  Size: 94 KiB

BIN
assets/kita/070.png View File

Before After
Width: 428  |  Height: 240  |  Size: 94 KiB

BIN
assets/kita/071.png View File

Before After
Width: 428  |  Height: 240  |  Size: 94 KiB

BIN
assets/kita/072.png View File

Before After
Width: 428  |  Height: 240  |  Size: 95 KiB

BIN
assets/kita/073.png View File

Before After
Width: 428  |  Height: 240  |  Size: 94 KiB

BIN
assets/kita/074.png View File

Before After
Width: 428  |  Height: 240  |  Size: 95 KiB

BIN
assets/kita/075.png View File

Before After
Width: 428  |  Height: 240  |  Size: 94 KiB

BIN
assets/kita/076.png View File

Before After
Width: 428  |  Height: 240  |  Size: 94 KiB

BIN
assets/kita/077.png View File

Before After
Width: 428  |  Height: 240  |  Size: 94 KiB

BIN
assets/kita/078.png View File

Before After
Width: 428  |  Height: 240  |  Size: 94 KiB

BIN
assets/kita/079.png View File

Before After
Width: 428  |  Height: 240  |  Size: 95 KiB

BIN
assets/kita/080.png View File

Before After
Width: 428  |  Height: 240  |  Size: 95 KiB

BIN
assets/nizika/001.png View File

Before After
Width: 300  |  Height: 300  |  Size: 55 KiB

BIN
assets/nizika/002.png View File

Before After
Width: 300  |  Height: 300  |  Size: 56 KiB

BIN
assets/nizika/003.png View File

Before After
Width: 300  |  Height: 300  |  Size: 56 KiB

BIN
assets/nizika/004.png View File

Before After
Width: 300  |  Height: 300  |  Size: 56 KiB

BIN
assets/nizika/005.png View File

Before After
Width: 300  |  Height: 300  |  Size: 56 KiB

BIN
assets/nizika/006.png View File

Before After
Width: 300  |  Height: 300  |  Size: 56 KiB

BIN
assets/nizika/007.png View File

Before After
Width: 300  |  Height: 300  |  Size: 57 KiB

BIN
assets/nizika/008.png View File

Before After
Width: 300  |  Height: 300  |  Size: 57 KiB

BIN
assets/nizika/009.png View File

Before After
Width: 300  |  Height: 300  |  Size: 56 KiB

BIN
assets/nizika/010.png View File

Before After
Width: 300  |  Height: 300  |  Size: 56 KiB

BIN
assets/nizika/011.png View File

Before After
Width: 300  |  Height: 300  |  Size: 57 KiB

BIN
assets/nizika/012.png View File

Before After
Width: 300  |  Height: 300  |  Size: 57 KiB

BIN
assets/nizika/013.png View File

Before After
Width: 300  |  Height: 300  |  Size: 57 KiB

BIN
assets/nizika/014.png View File

Before After
Width: 300  |  Height: 300  |  Size: 57 KiB

BIN
assets/nizika/015.png View File

Before After
Width: 300  |  Height: 300  |  Size: 57 KiB

BIN
assets/nizika/016.png View File

Before After
Width: 300  |  Height: 300  |  Size: 57 KiB

BIN
assets/nizika/017.png View File

Before After
Width: 300  |  Height: 300  |  Size: 57 KiB

BIN
assets/nizika/018.png View File

Before After
Width: 300  |  Height: 300  |  Size: 58 KiB

BIN
assets/nizika/019.png View File

Before After
Width: 300  |  Height: 300  |  Size: 57 KiB

BIN
assets/nizika/020.png View File

Before After
Width: 300  |  Height: 300  |  Size: 58 KiB

BIN
assets/nizika/021.png View File

Before After
Width: 300  |  Height: 300  |  Size: 58 KiB

BIN
assets/nizika/022.png View File

Before After
Width: 300  |  Height: 300  |  Size: 57 KiB

BIN
assets/nizika/023.png View File

Before After
Width: 300  |  Height: 300  |  Size: 58 KiB

BIN
assets/nizika/024.png View File

Before After
Width: 300  |  Height: 300  |  Size: 57 KiB

+ 13
- 0
forms/index.frm.php View File

@@ -0,0 +1,13 @@
<html lang="ja">
<head>
<meta charset="utf8" />
<link rel="stylesheet" href="./styles/index.css" />
<script src="./scripts/main.js" defer="defer"></script>
<title>伊地知ニジカ - 鑑賞編</title>
</head>

<body>
<canvas id="canvas"></canvas>
</body>
</html>


+ 4
- 0
index.php View File

@@ -0,0 +1,4 @@
<?php

require_once './forms/index.frm.php';


+ 128
- 0
scripts/main.js View File

@@ -0,0 +1,128 @@
const canvas = document.getElementById ('canvas');
const ctx = canvas.getContext ('2d');

const bg = (function ()
{
const _ = document.createElement('canvas');
const img = new Image ();

_.width = 1920;
_.height = 1080;

const ctx = _.getContext ('2d');

img.onload = (function ()
{
ctx.drawImage (img, 0, 0);
});

img.src = './assets/bg.jpg';

return _;
}) ();

const nizikaList = Array (24).fill ().map (function (__, i)
{
const _ = document.createElement('canvas');
const img = new Image ();

_.width = 300;
_.height = 300;

const ctx = _.getContext ('2d');

img.onload = (function ()
{
ctx.drawImage (img, 0, 0);
replaceColorWithTransparent (_);
});

img.src = `./assets/nizika/${String (i + 1).padStart (3, '0')}.png`;

return _;
});

const kitaList = Array (40).fill ().map (function (__, i)
{
const _ = document.createElement('canvas');
const img = new Image ();

_.width = 428;
_.height = 240;

const ctx = _.getContext ('2d');

img.onload = (function ()
{
ctx.drawImage (img, 0, 0);
});

img.src = `./assets/kita/${String (i + 41).padStart (3, '0')}.png`;

return _;
});

let canvasX;
let canvasY;
let frame = 0;

let nizikaData = [];

preprocess ();

window.setInterval (() => reDraw (), 16);


function
preprocess ()
{
reDraw ();
}


function
reDraw ()
{
canvasX = window.innerWidth;
canvasY = window.innerHeight;

canvas.width = canvasX;
canvas.height = canvasY;

ctx.drawImage (bg, 0, 0, canvasX, canvasY);

nizikaData.push ({x: Math.random () * canvasX - 150,
y: Math.random () * canvasY - 150});

if (nizikaData.length > 100)
nizikaData.shift ();

nizikaData.forEach (function (nizika)
{
ctx.drawImage (nizikaList[frame % 24], nizika.x, nizika.y);
});

++frame;
}


function
replaceColorWithTransparent (canvas)
{
const context = canvas.getContext ('2d');
const imageData = context.getImageData (0, 0, canvas.width, canvas.height);
const pixels = imageData.data;

for (let i = 0; i < pixels.length; i += 4)
{
const r = pixels[i];
const g = pixels[i + 1];
const b = pixels[i + 2];

if (r < 64 && g >= 96 && b < 96)
pixels[i + 3] = 0;
}

context.putImageData (imageData, 0, 0);
}


+ 9
- 0
styles/index.css View File

@@ -0,0 +1,9 @@
html, body
{
height: 100%;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
}


Loading…
Cancel
Save