* {
padding: 0;
margin: 0;
}
html, body {
background: #000;
color: #fff;
overflow: hidden;
touch-action: none;
-ms-touch-action: none;
height: 100%;
}
#app {
touch-action-delay: none;
touch-action: none;
-ms-touch-action: none;
width: 100%;
height: 100%;
position: relative;
}
.portrait .egg {
width: 8vw;
height: 12vw;
background: #ff0;
border-radius: 50% / 60% 60% 40% 40%;
position: absolute;
}
Layer 1Vue.component('chik', {
template: '#chik-template',
data: function() {
return {};
},
});
var app = new Vue({
el: '#app',
data: function() {
return {
appClass: '',
eggs: []
};
},
created: function() {
window.addEventListener('resize', this.onResize);
this.onResize();
},
methods: {
lay: function(evt) {
if (evt.touches) {
this.eggs.push({x: evt.touches[0].clientX, y: evt.touches[0].clientY});
return;
}
this.eggs.push({x: evt.clientX, y: evt.clientY});
},
onResize: function() {
if (window.screen.width > window.screen.height) {
this.appClass = 'landscape';
} else {
this.appClass = 'portrait'
}
}
}
});