JavaScript
を使うと隠しコマンドで遊べると聞いたので、試しに遊んで見ました。
また、fontBomb
という、テキスト(フォント)を時限爆弾で爆発させるスクリプトを使って遊んでも見たので、隠しコマンドがわかった人はそれでも遊んでみてください!!
ちなみに、隠しコマンドは僕の名前(Lastname
,Firstname
)です。(間に何もいりません。)
作ったもの
隠しコマンドを解けば、ここにある歌の歌詞が出てきます。その曲を選んだのは僕が好きだからですが、公式MVに出てくる女性はめちゃめちゃ鍛えた体してるのにボクシングのパンチがありえん棒立ちでちょっと残念なので、ぜひ見てみてください!(エドシーランは普通に上手です。)
ちなみに、僕は普通のものよりピッチやテンポを上げたアレンジ版の方が好きです。
Shape of You
Ed Sheeran
[Verse 1]
The club isn't the best place to find a loverSo the bar is where I go
Me and my friends at the table doing shots
Drinking fast and then we talk slow
And you come over and start up a conversation with just me
And trust me I'll give it a chance now
Take my hand, stop, put Van the Man on the jukebox
And then we start to dance, and now I'm singing like
[Pre-Chorus]
Girl, you know I want your loveYour love was handmade for somebody like me
Come on now, follow my lead
I may be crazy, don't mind me
Say, boy, let's not talk too much
Grab on my waist and put that body on me
Come on now, follow my lead
Come, come on now, follow my lead
[Chorus]
I'm in love with the shape of youWe push and pull like a magnet do
Although my heart is falling too
I'm in love with your body
And last night you were in my room
And now my bed sheets smell like you
Every day discovering something brand new
I'm in love with your body
Oh—I—oh—I—oh—I—oh—I
I'm in love with your body
Oh—I—oh—I—oh—I—oh—I
I'm in love with your body
Oh—I—oh—I—oh—I—oh—I
I'm in love with your body
Every day discovering something brand new
I'm in love with the shape of you
[Verse 2]
One week in we let the story beginWe're going out on our first date
You and me are thrifty, so go all you can eat
Fill up your bag and I fill up a plate
We talk for hours and hours about the sweet and the sour
And how your family is doing okay
Leave and get in a taxi, then kiss in the backseat
Tell the driver make the radio play, and I'm singing like
[Pre-Chorus]
Girl, you know I want your loveYour love was handmade for somebody like me
Come on now, follow my lead
I may be crazy, don't mind me
Say, boy, let's not talk too much
Grab on my waist and put that body on me
Come on now, follow my lead
Come, come on now, follow my lead
[Chorus]
I'm in love with the shape of youWe push and pull like a magnet do
Although my heart is falling too
I'm in love with your body
And last night you were in my room
And now my bed sheets smell like you
Every day discovering something brand new
I'm in love with your body
Oh—I—oh—I—oh—I—oh—I
I'm in love with your body
Oh—I—oh—I—oh—I—oh—I
I'm in love with your body
Oh—I—oh—I—oh—I—oh—I
I'm in love with your body
Every day discovering something brand new
I'm in love with the shape of you
[Bridge]
Come on, be my baby, come onCome on, be my baby, come on
Come on, be my baby, come on
Come on, be my baby, come on
Come on, be my baby, come on
Come on, be my baby, come on
Come on, be my baby, come on
Come on, be my baby, come on
[Chorus]
I'm in love with the shape of youWe push and pull like a magnet do
Although my heart is falling too
I'm in love with your body
Last night you were in my room
And now my bed sheets smell like you
Every day discovering something brand new
I'm in love with your body
Come on, be my baby, come on
Come on, be my baby, come on
I'm in love with your body
Come on, be my baby, come on
Come on, be my baby, come on
I'm in love with your body
Come on, be my baby, come on
Come on, be my baby, come on
I'm in love with your body
Every day discovering something brand new
I'm in love with the shape of you
コード
html
<div id="shape-of-you" style="visibility: hidden;">
<!-- ここに隠しコマンド後に表示させる要素をかく -->
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
JavaScript
$(function() {
var inputKey = [];
var Command = [73,87,65,83,65,75,73,83,72,85,84,79];
$(window).keyup(function(e) {
inputKey.push(e.keyCode);
// 入力配列にコマンドがあるかを調べる。存在しなければ-1を返す。
if (inputKey.toString().indexOf(Command) >= 0) {
//隠しコマンド成功時
alert("コマンド発動!!");
// cssにbackground-imageを記述したクラスを追加(これで背景を変える。)
$("#shape-of-you").addClass('shape-of-you');
document.querySelector('#shape-of-you').style.visibility = "visible";
// fontBombのスクリプトをコピー
var s = document.createElement('script');
s.setAttribute('src', 'http://fontbomb.ilex.ca/js/main.js');
document.body.appendChild(s);
//キー入力を初期化
inputKey = [];
}
if (inputKey.length >= 1000){
alert("かなり頑張ってますね笑\n処理速度を上げるために初期化しますね!");
inputKey = [];
}
});
css
.shape-of-you {
background-color: rgb(170, 220, 230);
background-size:contain;
width:100%;
}