본문 바로가기

웹디자인기능사-실기/웹디실기-A유형

웹디자인기능사 실기 코드 A-2 Green복지재단

웹디자인기능사 실기 코드 A-2 Green복지재단

HTML

<!DOCTYPE html>
<html lang="ko">
<head>
  <meta charset="UTF-8">
  <title>A-2 Green복지재단</title>
  <link href="./css/style.css" type="text/css" rel="stylesheet">
  <script src="./js/jquery-1.12.3.js"></script>
  <script src="./js/script.js"></script>
</head>
<body>
  <main>
    <!-- header 메뉴 -->
    <header>
        <a class="logo" href="#">
          <img src="./img/logo.png" alt="로고">
        </a>
        <nav class="mainMenu">
          <a href="#">재단소개</a>
          <a href="#">후원하기</a>
          <a href="#">자료실</a>
          <a href="#">스토리</a>
        </nav>
    </header><!-- // END headerWrap -->

    <!-- 서브메뉴 -->
    <div class="subMenu">
      <nav class="subMenuWrap">
        <ul>
          <li><a href="#">설립취지</a></li>
          <li><a href="#">연혁</a></li>
          <li><a href="#">찾아오시는길</a></li>
        </ul>
        <ul>
          <li><a href="#">국내후원</a></li>
          <li><a href="#">국외후원</a></li>
          <li><a href="#">맞춤후원</a></li>
        </ul>
        <ul>
          <li><a href="#">서식자료실</a></li>
          <li><a href="#">사진자료실</a></li>
          <li><a href="#">후원양식</a></li>
        </ul>
        <ul>
          <li><a href="#">웹진</a></li>
          <li><a href="#">보고서</a></li>
          <li><a href="#">나의후원</a></li>
        </ul>
      </nav>
    </div><!-- //END subMenu -->
    <!-- 이미지슬라이드  -->
    <div class="imgSlide">
      <a href="#"><img src="./img/img1.jpg" alt="Green 복지재단1"><span class="imgText">Green 복지재단1</span></a>
      <a href="#"><img src="./img/img2.jpg" alt="Green 복지재단2"><span class="imgText">Green 복지재단2</span></a>
      <a href="#"><img src="./img/img3.jpg" alt="Green 복지재단3"><span class="imgText">Green 복지재단3</span></a>
    </div>
    <!-- 컨텐츠 -->
    <div class="contents">
      <div class="notice">
        <h4>공지사항</h4>
        <ul>
          <li><a href="#">Green 복지재단 공지사항1<span>2020.11.23</span></a></li>
          <li><a href="#">Green 복지재단 공지사항2<span>2020.11.23</span></a></li>
          <li><a href="#">Green 복지재단 공지사항3<span>2020.11.23</span></a></li>
          <li><a href="#">Green 복지재단 공지사항4<span>2020.11.23</span></a></li>
        </ul>
      </div>
      <div class="gallery">
        <h4>갤러리</h4>
        <ul>
          <li><a href="#"><img src="./img/icon1.png" alt="Green 복지재단1"></a></li>
          <li><a href="#"><img src="./img/icon2.png" alt="Green 복지재단2"></a></li>
          <li><a href="#"><img src="./img/icon3.png" alt="Green 복지재단3"></a></li>
        </ul>
      </div>
      <div class="banner">
        <a href="#">바로가기</a>
      </div>
    </div>
    <!-- footer 하단-->
    <footer>
      <div><img src="./img/logo.png" alt="로고"></div>
      <div>COPYRIGHT © by WEBDESIGN. ALL RIGHTS RESERVED</div>
      <div>
        <a href="#"><img src="./img/sns1.jpg" alt="SNS 이미지1"></a>
        <a href="#"><img src="./img/sns2.jpg" alt="SNS 이미지2"></a>
        <a href="#"><img src="./img/sns3.jpg" alt="SNS 이미지3"></a>
      </div>
    </footer>
  </main>

  <div id="modalWrap">
    <div class="modal">
      <h1>복지재단 공지사항</h1>
      <p>
        동해물과 백두산이 마르고 닳도록 하느님이 보우하사 우리나라만세.
        무궁화 삼천리 화려강 대한 사람 대한으로 길이 보전하세.
        남산 위에 저 소나무, 철갑을 두른 듯 바람서리 불변함은 우리 기상일세.
      </p>
      <button class="btn">닫기</button>
    </div>
  </div>
</body>
</html>

javascript & jQuery

$(document).ready(function(){
  // 서브메뉴 숨기고 시작.
  $('.subMenu').hide();
// 마우스오버 메뉴
  $('nav').mouseover(function(){
    $('.subMenu').stop().slideDown(300);
  }).mouseout(function(){
    $('.subMenu').stop().slideUp(300);
  });

  //이미지슬라이드 좌우
    var imgs = 2;
    var now = 0;

    start();

    function start(){
      $(".imgSlide>a").eq(0).siblings().animate({width:"-1200px"});

      setInterval(function(){
        now = now==imgs ? 0 : now+=1;
        $(".imgSlide>a").eq(now-1).animate({width:"-1200px"});
        $(".imgSlide>a").eq(now).animate({width:"1200px"});
      },3000);
    }

  // 팝업
  $('.notice li:first').click(function(){
    // alert('test');
    $('#modalWrap').addClass('active');
  });
  $('.btn').click(function(){
    $('#modalWrap').removeClass('active');
  });

});

CSS

@charset "UTF-8";

/* 초기설정 */
*{
  margin:0;
  padding:0;
  list-style:none;
  box-sizing: border-box;
}
body{
  background: #ffffff;
  color:#333333;
}
a{
  text-decoration:none;
  display: block;
}

/********본문시작*********/
/* 모든 컨텐츠를 감싸는 main */
main{
  width:1200px;
  margin:0 auto;
  position:relative; /* 서브 메뉴 때문에 반드시 필요함   */
}

/* 메뉴와 로고가 들어가는 header */
header{
  width:100%;
  height:100px;
  background:#3cb149;
  display:flex;
  justify-content: space-between;
  align-items: center;
}
.logo{
  width:20%;
  height:100%;
  display: flex; /*로고 이미지를 중앙에 위치 시키기 위해 flex로 지정하여 수평, 수직 정렬이 되도록 하기 위해.*/
  justify-content: center; /* 수평 가운데 정렬 */
  align-items: center; /* 수직 가운데 정렬 */
}
.logo > img {
  width:200px; /*지시사항에 적힌대로 width값 */
  height:40px; /*지시사항에 적힌대로 height값 */
}

/*메인메뉴*/
.mainMenu {
  width:70%;
  height:100%;
  display:flex;
  justify-content: space-around;
  align-items: center;
}
.mainMenu > a {
  padding:30px 0;
  font-weight:bold;
  width:100%;
  text-align: center;
  color:#333333;
}
.mainMenu > a:hover {
  background:rgba(255,255,255, 0.2);
}

/*서브메뉴*/
.subMenu{
  width:100%;
  display:flex;
  justify-content:flex-end;
  background:#222222;
  position:absolute;
  z-index: 1;
}
.subMenuWrap{
  width:70%; /*메인메뉴 위치랑 동일하게*/
  height:100%;
  display:flex;
  justify-content: space-around;
}
.subMenuWrap > ul {
  width:100%;
}
.subMenuWrap > ul > li > a{
  text-align: center;
  padding:10px 0;
  color:#dddddd;
}
.subMenuWrap > ul > li > a:hover{
  background:rgba(255,255,255, 0.1);
  color:#ffffff;
}

/*이미지슬라이드*/
.imgSlide{
  position:relative;
  width:100%;
  height:300px;
  overflow: hidden;
  background: #eeeeee;
}

.imgSlide > a{
  position:absolute;
  top:0;
  left:0;
  overflow: hidden; /* 이미지슬라이드가 좌우로 움직일때는 반드시 필요 */
}
.imgSlide a > img {height:100%;}
.imgText{
  position:absolute;
  top:50%;
  left:50%;
  margin: -10px -180px;
  background: rgba(0,199,60, 0.4) ;
	color:#ffffff;
  padding: 20px 100px;
  font-weight: bold;
}

/* 컨텐츠 영역 */
.contents{
  width: 100%;
  height:200px;
  padding:0;
  margin:10px 0;
  display:flex;
	justify-content: space-between;
  overflow: hidden;
}
/* 각각 컨텐츠 박스의 영역 */
.contents div{ width:33.3%;}
.contents > div:nth-of-type(2){margin:0 10px;}

/* 공지사항과 갤러리 공통 */
.contents h4{
  width:30%;
  padding:6px 10px;
  background:#333333;
  color:#eeeeee;
  font-weight: bold;
  text-align: center;
  cursor:pointer;
}
.contents h4:hover{
  background:#1d8844;
  color:#222328;
}
.contents ul{
  height:167px; /* chrome inspect(검사) 보고 수치 계산 */
  background:#ffffff;
  border:1px solid #dddddd;
  box-sizing: border-box;
  font-size:12px;
  line-height: 40px;
}

/* 컨텐츠 첫번째 : 공지사항 */
.notice li{padding:0 10px;}
.notice li:nth-child(even){background:#eeeeee;}
.notice li:hover{color:#222328;background:#dddddd;}
.notice li span {float:right;}

/* 컨텐츠 두번째 : 갤러리 */
.gallery ul{
  display:flex;
  justify-content: space-around;
  align-items: center;
}
.gallery img:hover{opacity: 0.7;}

/* 컨텐츠 세번째 : 바로가기 */
.banner{
  overflow: hidden;
	display: flex;
	justify-content: center;
	align-items: center;
  background: url("../img/banner.jpg") center center ;
  }
.banner a{
	width:50%;
  padding:10px 0;
	text-align:center;
	color:#ffffff;
	font-weight:bold;
	background:rgba(29,136,68,0.5);
}

.banner a:hover{
  background:rgba(255,255,255,0.5);
  color:#333333;
}

/* Footer 하단  */
footer {
  width:100%;
  height:100px;
  display:flex;
  background: #222328;
}
/* 하단 공통 */
footer div{display: flex; justify-content: center; align-items: center;}
/* 로고 */
footer div:nth-child(1){width: 20%; opacity: 0.2;}
/* copyright */
footer div:nth-child(2){width: 60%; color: #777777;}
/* SNS */
footer div:nth-child(3){width: 20%; justify-content: space-around;}
footer div:nth-child(3) img{border-radius: 50%;}

/* 모달 팝업  */
#modalWrap{
  display:none;
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:rgba(0,0,0, 0.7);
  z-index: 1;
}
#modalWrap.active{
  display:block;
}
.modal{
  position:fixed;
  width:350px;
  padding:20px;
  top:40%;
  left:40%;
  background:#ffffff;
}
.modal > h1{
  margin:10px 0;
  text-align: center;
}
.modal > p{
  text-align:justify;
}
.btn{
  width:100%;
  padding:10px;
  margin-top:20px;
  background: #00C73C;
  color:#ffffff;
  border:0;
  font-weight: bold;
  cursor:pointer;
}
.btn:hover{background:rgba(0,199,60, 0.2); color:#00C73C;}
728x90
300x250