entry.js 820 B

123456789101112131415161718192021222324252627282930313233
  1. import '../scss/entry.scss'
  2. import util from './until'
  3. var attachFastClick = require('fastclick');
  4. class Enter {
  5. constructor() {
  6. this.entryGame()
  7. }
  8. entryGame() {
  9. $(document).click(function(e) {
  10. var top = $('.aim-glass').css('top')
  11. top = top.replace('px','')
  12. var origin = top
  13. top = Number(top) - 100
  14. document.getElementById('hunt-audio').play()
  15. $('.aim-glass').animate({top: top + 'px'}, 50).animate({top: origin + 'px'}, 400, function() {
  16. let link = $('.entry-text').attr('data-href')
  17. localStorage.setItem('entry', 'index');
  18. window.location.href = link
  19. });
  20. })
  21. }
  22. }
  23. new Enter
  24. $(function() {
  25. attachFastClick(document.body);
  26. });