Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Flashfyre committed Nov 24, 2021
0 parents commit 92df4a7
Show file tree
Hide file tree
Showing 22 changed files with 191 additions and 0 deletions.
Binary file added audio/door_2kki.wav
Binary file not shown.
Binary file added audio/door_effect.wav
Binary file not shown.
Binary file added audio/door_flow.wav
Binary file not shown.
Binary file added audio/door_lcddem.wav
Binary file not shown.
Binary file added audio/door_yume.wav
Binary file not shown.
Binary file added fonts/ms-pgothic.woff
Binary file not shown.
Binary file added fonts/ms-pgothic.woff2
Binary file not shown.
Binary file added images/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/door_2kki.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/door_flow.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/door_lcddem.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/door_open_2kki.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/door_open_flow.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/door_open_lcddem.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/door_open_yume.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/door_yume.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/logo_2kki.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/logo_flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/logo_lcddem.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/logo_yume.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
117 changes: 117 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<!doctype html>
<html lang="en">
<head>
<title>Multiplayer Yume Nikki Fangame Nexus</title>
<meta charset="utf-8">
<meta name="description" content="Play Yume Nikki and Yume Nikki Fangames online with your friends, no downloads required.">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="nexus.css">
</head>
<body>
<div id="nexus">
<div id="doors">
<div class="doorRow">
<div class="spacer"></div>
<div id="door2kki" class="door" data-game-id="2kki">
<img class="logo" src="images/logo_2kki.png" />
<img class="doorImg" width="68" height="120" src="images/door_2kki.gif" />
</div>
<div id="doorLcddem" class="door" data-game-id="lcddem">
<img class="logo" src="images/logo_lcddem.png" />
<img class="doorImg" width="78" height="111" src="images/door_lcddem.gif" style="margin-bottom: 8px;" />
</div>
<div class="spacer"></div>
</div>
<div class="doorRow">
<div id="doorYume" class="door" data-game-id="yume">
<img class="logo" src="images/logo_yume.png" />
<img class="doorImg" width="68" height="120" src="images/door_yume.gif" />
</div>
<div class="spacer"></div>
<div class="spacer"></div>
<div id="doorFlow" class="door" data-game-id="flow">
<img class="logo" src="images/logo_flow.png" />
<img class="doorImg" width="68" height="120" src="images/door_flow.gif" />
</div>
</div>
</div>
</div>
<svg id="zoom">
<rect id="bg" width="100%" height="100%" fill="black" mask="url(#zoomMask)" />
<mask id="zoomMask">
<rect id="maskBg" width="100%" height="100%" fill="black" />
<circle id="circle" fill="black" />
</mask>
</svg>
<script>
const nexus = document.getElementById('nexus');
const doors = document.querySelectorAll('.door');
for (let door of doors) {
door.onclick = function () {
if (!this.classList.contains('active')) {
door.classList.add('active');
doDoorAnim(nexus, door);
}
};
}

function doDoorAnim(nexus, door) {
const overlay = document.getElementById('overlay');
const circle = document.getElementById('circle');
const initialRadius = Math.max(nexus.offsetWidth, nexus.offsetHeight) * 0.75;
const rect = door.getBoundingClientRect();
const centerX = ((rect.x + door.offsetWidth / 2) / nexus.offsetWidth) * 100;
const centerY = ((rect.y + door.offsetHeight / 2) / nexus.offsetHeight) * 100;
circle.setAttribute('r', initialRadius);
circle.setAttribute('cx', `${centerX}%`);
circle.setAttribute('cy', `${centerY}%`);
circle.style.transformOrigin = `calc(${centerX}% + 64px) calc(${centerY}% + 8px)`;

const cssAnim = document.createElement('style');
cssAnim.type = 'text/css';
const rules = document.createTextNode(`
@keyframes maskAnim {
from {
fill: black;
}
to {
fill: white;
}
}
@keyframes zoomAnim {
from {
r: ${initialRadius};
transform: rotate(0deg);
}
to {
r: 128px;
transform: rotate(360deg);
}
}
`);
cssAnim.appendChild(rules);
document.querySelector('head').appendChild(cssAnim);

playAudio('door_effect.wav');

const gameId = door.dataset.gameId;

window.setTimeout(function () {
playAudio(`door_${gameId}.wav`, 0.5);
const doorImg = door.querySelector('.doorImg');
doorImg.src = doorImg.src.replace('door_', 'door_open_');
window.setTimeout(function () {
window.location.href = `/${gameId}/`;
}, 1500);
}, 1000);
}

function playAudio(filename, volume) {
const audio = new Audio(`audio/${filename}`);
audio.volume = volume || 1;
audio.play();
}
</script>
</body>
</html>
74 changes: 74 additions & 0 deletions nexus.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
html {
height: 100%;
}

body {
margin: 0;
height: 100%;
background-color: black;
}

#nexus {
display: flex;
flex-direction: column;
justify-content: center;
height: 100%;
background: url(images/bg.png);
background-repeat: no-repeat;
background-size: cover;
}

#zoom {
position: absolute;
top: 0;
width: 100%;
height: 100%;
pointer-events: none;
}

#maskBg {
animation: 1s 1 ease-in maskAnim forwards;
}

#circle {
animation: 1s 1 ease-in zoomAnim forwards;
}

#doors {
display: flex;
flex-direction: column;
}

.doorRow {
display: flex;
justify-content: space-evenly;
width: 100%;
}

.door {
cursor: pointer;
display: flex;
flex-basis: min-content;
flex-direction: column;
justify-content: space-between;
align-items: center;
max-width: 20%;
height: 188px;
}

.logo {
height: 60px;
}

.spacer {
width: 15%;
}

img {
image-rendering: crisp-edges;
image-rendering: pixelated;
pointer-events: none;
-webkit-touch-callout: none;
-webkit-user-select: none;
user-select: none;
}

0 comments on commit 92df4a7

Please sign in to comment.