시작페이지로 즐겨찾기추가
로그인
회원가입 l 출석체크 l 마이페이지 l CGIMALL
happycgi
자료실 사이트등록 랭킹100 프로그램리뷰 관리자추천자료 초보가이드
커뮤니티
전체 펼쳐보기
퀵메뉴링크 jquery , CSS , PHP , Javascript , 무료폰트 , ASP
상세검색
 > JAVASCRIPT > javascript 소스창고 > 게임 > Crossy Road with three 상세정보
사이트등록
클라우드태그
javascript
PHP
CSS
html
asp
API
jquery
mysql
image
Mobile
slide
게시판
메뉴
현재접속자 69 새로고침
Crossy Road with three
소스통계정보 오류신고 및 문의
해피팀
네티즌
트위터로 보내기 페이스북으로 보내기 네이버로공유
소스분류 게임
다운로드 횟수 2 회
간단설명 길건너 친구들 게임을 웹에서 구현하였습니다.
평가하기 훌륭함 매우좋음 좋음 괜찮음 보통 별로
홈페이지바로가기 소스다운로드 데모 미리보기 스크랩하기
웹에서 구현한 게임입니다.
HTML, CSS, JS로 제작되었습니다.
자세한 내용은 데모를 확인해 주시기 바랍니다.



HTML
<canvas class="game"></canvas>
<div id="controls">
  <div>
    <button id="forward">▲</button>
    <button id="left">◀</button>
    <button id="backward">▼</button>
    <button id="right">▶</button>
  </div>
</div>
<div id="score">0</div>
<div id="result-container">
  <div id="result">
    <h1>Game Over</h1>
    <p>Your score: <span id="final-score"></span></p>
    <button id="retry">Retry</button>
  </div>
</div>
 
<a id="youtube" target="_top" href="https://youtu.be/vNr3_hQ3Bws">
  <span>Learn Three.js while building this game on YouTube</span>
</a>
<div id="youtube-card">
  Learn Three.js while building this game on YouTube
</div>
 
CSS
@import url("https://fonts.googleapis.com/css?family=Press+Start+2P");
body {
  margin: 0;
  display: flex;
  font-family: "Press Start 2P", cursive;
}

#controls {
  position: absolute;
  bottom: 20px;
  min-width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

#controls div {
  display: grid;
  grid-template-columns: 50px 50px 50px;
  gap: 10px;
}

#controls button {
  width: 100%;
  height: 40px;
  background-color: white;
  border: 1px solid lightgray;
  box-shadow: 3px 5px 0px 0px rgba(0, 0, 0, 0.75);
  cursor: pointer;
  outline: none;
}

#controls button:first-of-type {
  grid-column: 1/-1;
}

#score {
  position: absolute;
  top: 20px;
  left: 20px;

  font-size: 2em;
  color: white;
}

#result-container {
  position: absolute;
  min-width: 100%;
  min-height: 100%;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;

  #result {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: white;
    padding: 20px;
  }

  button {
    background-color: red;
    padding: 20px 50px 20px 50px;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
  }
}


#youtube,
#youtube-card {
  display: none;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: black;
}

@media (min-height: 425px) {
  /** Youtube logo by https://codepen.io/alvaromontoro */
  #youtube {
    z-index: 50;
    width: 100px;
    display: block;
    height: 70px;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: red;
    border-radius: 50% / 11%;
    transform: scale(0.8);
    transition: transform 0.5s;
  }

  #youtube:hover,
  #youtube:focus {
    transform: scale(0.9);
    color: black;
  }

  #youtube::before {
    content: "";
    display: block;
    position: absolute;
    top: 7.5%;
    left: -6%;
    width: 112%;
    height: 85%;
    background: red;
    border-radius: 9% / 50%;
  }

  #youtube::after {
    content: "";
    display: block;
    position: absolute;
    top: 20px;
    left: 40px;
    width: 45px;
    height: 30px;
    border: 15px solid transparent;
    box-sizing: border-box;
    border-left: 30px solid white;
  }

  #youtube span {
    font-size: 0;
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
  }

  #youtube:hover + #youtube-card {
    z-index: 49;
    display: block;
    position: fixed;
    bottom: 12px;
    right: 10px;
    padding: 25px 130px 25px 25px;
    width: 300px;
    background-color: white;
  }
}
 


네티즌 의견   이용하신 자료의 후기를 자유롭게 작성하세요. (상업적인 광고 및 도배성 글 등은 사전통보없이 삭제될 수 있습니다.)
내용 아이디 의견남기기
등록된 의견이 없습니다.
1
이름
내용
:네맞아요: :화나는군요: :잠와: :우울해: :이건아냐: :왕하하: 왕웃음~ 놀램~
평가하기 훌륭함 매우좋음 좋음 괜찮음 보통 별로
도배방지키
 35345537 보이는 도배방지키를 입력하세요.