Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .idea/door.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

438 changes: 438 additions & 0 deletions .idea/workspace.xml

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ All code and art dedicated to the public domain.
If you'd like to help me keep making free, open-source playable silliness,
please check out [my Patreon!](http://patreon.com/ncase) Thank you. <3

** 由 liuyinxin 翻译
[my github](https://github.com/SuperLiuYinXin)

---

**Asset Credits:**
Expand All @@ -19,3 +22,4 @@ please check out [my Patreon!](http://patreon.com/ncase) Thank you. <3
* SFX Rewind: http://freesound.org/people/kasa90/sounds/174363/ (CC ZERO)
* SFX Unlock: http://freesound.org/people/keweldog/sounds/181140/ (CC ZERO)
* Social Media Icons: http://customizr.net/icons/

Binary file added assets/thumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ input#your_link{
#share_facebook{
background: url(../icons/facebook.png);
}
#share_qqzone{

width: 100%;
height: 100%;
background: url(../icons/qqzone.png) center no-repeat;
-webkit-background-size: 100%;
background-size: 100%;
}
#share_twitter{
background: url(../icons/twitter.png);
}
Expand Down
Binary file modified css/intro.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 icons/qqzone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 36 additions & 35 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
<!doctype>
<!DOCTYPE html>
<html>
<head>

<!-- Place this data between the <head> tags of your website -->
<title>it's a(door)able</title>
<meta name="description" content="a one-minute minigame."/>
<title>神奇的门! | it's a(door)able</title>
<meta name="description" content="一个一分钟小游戏"/>
<link rel="icon" type="image/png" href="favicon.png">
<meta charset=utf-8>

<!-- Schema.org markup for Google+ -->
<meta itemprop="name" content="it's a(door)able">
<meta itemprop="description" content="a one-minute minigame.">
<meta itemprop="image" content="http://ncase.me/door/thumbnail.png">
<meta itemprop="name" content="神奇的门">
<meta itemprop="description" content="一分钟小游戏">
<meta itemprop="image" content="http://door.intyut.cn/thumbnail.png">

<!-- Open Graph data -->
<meta property="og:title" content="it's a(door)able">
<meta property="og:title" content="神奇的门">
<meta property="og:type" content="website">
<meta property="og:url" content="http://ncase.me/door/">
<meta property="og:image" content="http://ncase.me/door/thumbnail.png">
<meta property="og:description" content="a one-minute minigame.">
<meta property="og:site_name" content="it's a(door)able">
<meta property="og:url" content="http://door.intyut.cn">
<meta property="og:image" content="http://door.intyut.cn/thumbnail.png">
<meta property="og:description" content="一分钟小游戏">
<meta property="og:site_name" content="神奇的门">

<!-- Style -->
<link rel="stylesheet" type="text/css" href="css/index.css">

</head>
<body>

<div id="loading"><div>LOADING</div></div>
<div id="loading"><div>加载中...</div></div>

<div id="whole_container">

Expand All @@ -43,8 +41,8 @@
<canvas id="canvas_3" width="300" height="380" style="margin:0"></canvas>

<div id="valentines_text"></div>
<div id="rewind_text">rewinding...</div>
<div id="replay_text">playing back...</div>
<div id="rewind_text">回溯中...</div>
<div id="replay_text">哒哒~</div>

</div>
</div>
Expand All @@ -53,38 +51,41 @@
<div id="screen_three">

<div id="bottom">
<a href="https://twitter.com/ncasenmare">made by @ncasenmare</a>
|
<a href="https://github.com/ncase/door">open source code</a>
<a href="https://twitter.com/ncasenmare">@ncasenmare 制作</a>
<a href="https://www.zhihu.com/people/liuyinxin/activities">@liuyinxin 翻译 </a>
<a href="https://github.com/ncase/door">开放源码: github</a>
</div>

<div id="end_container">

<span style="font-size:38px;">P.S: you can add your own personal message!</span>
<input id="your_message" placeholder="(enter lovely message)"></input>
<span style="font-size:38px;">在这里写下你想说的话</span>
<input id="your_message" placeholder="(留下你想说的话!)"></input>

<span>then just copy &amp; send this link to your lover(s):</span>
<span>复制下面的链接,分享给你的TA吧!</span>
<input id="your_link" readonly></input>

<span>or, if you wanna send your message out to everyone:</span>
<span>或者, 分享一下?</span>
<div id="share">
<div id="share_facebook" onclick="return socialShare.call(this,event,'facebook');"></div>
<div id="share_twitter" onclick="return socialShare.call(this,event,'twitter');"></div>
<div id="share_plus" onclick="return socialShare.call(this,event,'plus');"></div>
<div id="share_tumblr" onclick="return socialShare.call(this,event,'tumblr');"></div>
<div id="share_reddit" onclick="return socialShare.call(this,event,'reddit');"></div>
<div id="share_stumbleupon" onclick="return socialShare.call(this,event,'stumbleupon');"></div>
<!--<div id="share_facebook" onclick="return socialShare.call(this,event,'facebook');"></div>-->
<div onclick="return socialShare.call(this,event,'qqzone');">
<div id="share_qqzone"></div>
</div>
<!--<div id="share_twitter" onclick="return socialShare.call(this,event,'twitter');"></div>-->
<!--<div id="share_plus" onclick="return socialShare.call(this,event,'plus');"></div>-->
<!--<div id="share_tumblr" onclick="return socialShare.call(this,event,'tumblr');"></div>-->
<!--<div id="share_reddit" onclick="return socialShare.call(this,event,'reddit');"></div>-->
<!--<div id="share_stumbleupon" onclick="return socialShare.call(this,event,'stumbleupon');"></div>-->
</div>

<span style="font-size:10px;color: #999;">
<span style="font-size: 19px;">and lastly, if you wanna show this</span>
<span style="font-size: 19px;">在最后,如果你想</span>
<br>
<span style="font-size: 16px;">minigame's creator some love, you can</span>
<span style="font-size: 16px;">对这个小游戏的制作者表示一些心意,那就</span>
<br>
<a href="https://www.patreon.com/ncase" target="_blank" style="text-decoration: none;">
<div id="support">support me on patreon</div>
<div id="support">在patreon支持一下我吧</div>
</a>
<span style="font-size: 24px;">so I can keep making free</span>
<span style="font-size: 24px;">正是大家的支持,让我能做的更好、并让它能够继续免费</span>
<br>
<span style="font-size: 20px;">open-source playable silliness.</span>
</span>
Expand All @@ -93,7 +94,7 @@
<br>

<span style="font-size:30px">
thanks for playing! &lt;3
谢谢你们玩我的游戏
</span>

</div>
Expand Down
9 changes: 6 additions & 3 deletions js/Key.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,18 @@

// Event Handling
var onKeyDown = function(event){
var code = KEY_CODES[event.keyCode];
var code = KEY_CODES[event.which];
Key[code] = true;
if(window.STAGE==4) return;
event.stopPropagation();
console.log(code);

event.stopPropagation();
event.preventDefault();
}
var onKeyUp = function(event){
var code = KEY_CODES[event.keyCode];
var code = KEY_CODES[event.which];
Key[code] = false;
console.log(code);
if(window.STAGE==4) return;
event.stopPropagation();
event.preventDefault();
Expand Down
25 changes: 14 additions & 11 deletions js/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function addAsset(name,src){
images[name].src = src;
}
function addSound(name,src){

assetsLeft++;
createjs.Sound.addEventListener("fileload", onAssetLoaded);
createjs.Sound.registerSound({src:src, id:name});
Expand Down Expand Up @@ -743,7 +744,7 @@ function iHeartYou(){
if(window.location.hash){
vtext.textContent = encryptString(decodeURIComponent(window.location.hash).substring(1));
}else{
vtext.textContent = "a lovely message from me to you <3";
vtext.textContent = "我想对你说: 我爱你!";
}

setTimeout(function(){
Expand Down Expand Up @@ -789,6 +790,7 @@ function reset(){

// Simple XOR encryption (key = 1)
// The only purpose is to obscure it in the hash
//

function encryptString(string){
var result = "";
Expand All @@ -805,32 +807,33 @@ var yourMessage = document.getElementById("your_message");
var yourLink = document.getElementById("your_link");
function linkChangey(){
if(yourMessage.value==""){
yourLink.value = "http://ncase.me/door/";
yourLink.value = "http://door.intyut.cn/";
}else{
yourLink.value = "http://ncase.me/door/#"+encodeURIComponent(encryptString(yourMessage.value));
yourLink.value = "http://door.intyut.cn/#"+encodeURIComponent(encryptString(yourMessage.value));

}
};
yourMessage.onchange = linkChangey;
yourMessage.oninput = linkChangey;
// 获取一下
linkChangey();
yourLink.onclick = function(){
yourLink.select();
};

function socialShare(event,type){

var link = yourLink.value;
var title = "it's a(door)able";
var link = yourLink.value;
var title = "神奇的门";
var url = "";
var width = 640;
var height = 480;

switch(type){
case "facebook":
url += "https://www.facebook.com/sharer.php?u="+encodeURIComponent(link);
url += "&t="+encodeURIComponent("A lovely message for all my dear friends. This minigame only takes a minute to play, check it out! it's a(door)able --");
width = 626;
height = 436;
case "qqzone":
var url = 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?';
url += 'url=' + encodeURIComponent(link||document.location); //参数url设置分享的内容链接|默认当前页location
url += '&showcount=' + 0||0; //参数showcount是否显示分享总数,显示:'1',不显示:'0',默认不显示
url += '&desc=' + encodeURIComponent('神奇的门,一个一分钟小游戏!快来玩耍一下把'); //参数desc设置分享的描述,可选参数
break;
case "twitter":
url += "https://twitter.com/share?url="+encodeURIComponent(link);
Expand Down