Browse Source

헤더수정,앵커기능추가

master
geun1416(김지은) 3 years ago
parent
commit
a6c3e4ea6a
  1. 12
      html/css/common.css
  2. 16
      html/include/header.html
  3. 19
      html/index.html
  4. 33
      html/js/common.js
  5. 15
      html/js/scrolloverflow.min.js
  6. 225
      html/js/scrollspy.js

12
html/css/common.css

@ -10,7 +10,7 @@ body,html{
/*header*/
#hd {z-index:1000;position:fixed;width:100%; top:0;overflow:hidden; transition:0.6s ease; -webkit-transition:0.6s ease;}
#hd:hover{background:#fff; border-bottom:1px solid #ddd;}
#hd:hover{background:#fff; border-bottom:1px solid rgba(0, 0, 0, 0.5);}
#hd_h1 {position:absolute;font-size:0;line-height:0;overflow:hidden}
#logo a{display:block;padding:20px;}
#logo a img{width:200px;}
@ -24,12 +24,12 @@ body,html{
#gnb ul:after {display:block;visibility:hidden;clear:both;content:""}
#gnb .gnb_1dli{line-height:100px;position:relative;width:25%;max-width:220px;}
.gnb_1dli .bg{display:none;width:10px;height:10px;overflow:hidden;background:url(../img/gnb_bg2.gif) no-repeat 50% 50%;text-indent:-999px}
.gnb_1dli .bg{display:none;width:10px;height:10px;overflow:hidden;}
.gnb_1da {width:100%;display:inline-block;font-weight:500;color:#fff;text-decoration:none; font-size:20px;}
.gnb_2dli{line-height:36px; padding:0 0 10px; font-size:18px; font-weight:400;}
.gnb_2dli:first-child{border:0}
.gnb_2dul {display:block;padding: 0; height:0; overflow:hidden;}
.gnb_2da {color:#222;text-align:left;text-decoration:none}
.gnb_2da {color:rgba(255,255,255,0.7);text-align:left;text-decoration:none}
/*slidesNav*/
@ -41,11 +41,13 @@ body,html{
.main-bn h2{font-size:3rem;font-weight:500;color:rgba(255,255,255,0.8);}
.main-bn .big{display:block;font-size:6rem;color:#fff;font-weight:bold;}
.main-bn .sm{display:block;font-size:1.25rem;color:rgba(255,255,255,0.8);margin:10px 0 0 10px;}
.main-bn .txt-box{font-size:1.25rem;font-weight:300;color:rgba(255,255,255,0.8);line-height:1.5;}
.main-bn .txt-box b{font-size:3rem;}
.txt-box{font-size:1.25rem;font-weight:300;color:rgba(255,255,255,0.8);line-height:1.5;}
.txt-box b{font-size:3rem;}
.bg-canvas{position: absolute;top:0;opacity:0.3;}
.bg-square{display:block;border:20px solid rgba(255,255,255,0.2);width:250px;height:250px;position:absolute;top:-160px;}
.bg01{background:url('../images/bg01.jpg');}
.bg02{background:url('../images/bg02.jpg');}
.bg02 .txt-box{padding-left:134px;}
.scroll-animation {position:absolute;left:50%;transform: translateX(-50%);bottom:40px;}
.scroll-box span{display:block;text-align:center;color:rgba(255,255,255,0.8);font-size:0.875rem;font-weight:300;animation: updown 1s ease-in-out 0.3s infinite normal;}
.scroll-box span.scroll-icon{margin:10px auto;fill:#fff;width:30px;}

16
html/include/header.html

@ -2,19 +2,19 @@
//헤더 풀다운메뉴
$(document).ready(function () {
$('#hd').on('mouseenter', function () {
$('#hd').css('background', 'rgb(255, 255, 255, 1)');
$('#hd').css('background', 'rgba(0, 0, 0, 0.4)');
$('.gnb_2dul').stop().animate({ 'height': '220px' }, 250);
$('.gnb_1da').css('color', '#000');
$('.color_logo').css('display', 'block');
$('.wh_logo').css('display', 'none');
$('.gnb_1da').css('color', '#fff');
// $('.color_logo').css('display', 'block');
// $('.wh_logo').css('display', 'none');
});
$('#hd').on('mouseleave', function () {
$('#hd').css('background', 'rgb(255, 255, 255, 0)');
$('#hd').css('background', 'rgba(0, 0, 0, 0)');
$('.gnb_2dul').stop().animate({ 'height': '-100px' }, 250);
$('.gnb_1da').css('color', '#fff');
$('.wh_logo').css('display', 'block');
$('.color_logo').css('display', 'none');
// $('.wh_logo').css('display', 'block');
// $('.color_logo').css('display', 'none');
});
});
</script>
@ -29,7 +29,7 @@
<div id="logo">
<a href="index.html">
<img src="images/pal_logo_wh.png" class="wh_logo" style="display: block;">
<img src="images/pal_logo.png" class="color_logo" style="display: none;">
<!-- <img src="images/pal_logo.png" class="color_logo" style="display: none;"> -->
</a>
</div>

19
html/index.html

@ -24,6 +24,7 @@
<!-- js -->
<script src="js/jquery-3.6.0.min.js"></script>
<!-- <script src="js/scrolloverflow.min.js"></script> -->
<script src="js/fullpage.js"></script>
<script src="js/wow.min.js"></script>
<script src="js/aos.js"></script>
@ -57,29 +58,31 @@
<div class="section main-bn bg01">
<canvas id="canvas" class="bg-canvas"></canvas>
<div class="inner">
<h2 class="wow fadeInDown" data-wow-duration="2s">가치를 존중하며 신뢰를 바탕으로 실천하는 기업</h2>
<h2 class="wow fadeInUp" data-wow-duration="2s">가치를 존중하며 신뢰를 바탕으로 실천하는 기업</h2>
<span class="wow fadeInUp big" data-wow-duration="2s">PAL Networks</span>
<span class="wow fadeInUp sm" data-wow-duration="4s">항공·전문 IT산업분야의 소프트웨어 개발 전문 기업</span>
</div>
<div class="wow fadeIn scroll-animation" data-wow-duration="4s">
<div class="scroll-box">
<a href="#works" class="scroll-box">
<span>SCROLL DOWN</span>
<span class="scroll-icon"><img src="images/scroll_icon.svg"></span>
</a>
</div>
</div>
</div>
<div class="section main-bn bg02">
<div class="inner">
<p class="txt-box wow fadeIn" data-wow-duration="2s">
<span class="wow fadeInLeft bg-square"></span>
<p class="wow fadeInUp txt-box" data-wow-duration="2s">
<b>팔네트웍스</b><br/>
<b>‘인천 항공 산업 선도기업’</b> 유망기업으로 선정된<br/>&ensp;항공 소프트웨어 전문 기업입니다.
<b>‘인천 항공 산업 선도기업’</b> 유망기업으로 선정된 항공 소프트웨어 전문 기업입니다.
</p>
</div>
<div class="wow fadeIn scroll-animation" data-wow-duration="8s">
<div class="scroll-box">
<div class="wow fadeIn scroll-animation" data-wow-duration="4s">
<a href="#skills" class="scroll-box">
<span>SCROLL DOWN</span>
<span class="scroll-icon"><img src="images/scroll_icon.svg"></span>
</div>
</a>
</div>
</div>

33
html/js/common.js

@ -1,6 +1,27 @@
$(function(){
new WOW().init();
AOS.init();
$('[data-aos]').each(function(){ $(this).addClass("aos-init"); });
new fullpage('#fullpage', {
licenseKey: '13F1F552-6ACE43B7-95262729-9E0B4778',
//options here
anchors:['home', 'works', 'skills', 'contact'],
autoScrolling:true,
scrollHorizontally: true,
navigation:true,
navigationPosition:'right',
scrollBar: true,
onLeave: function(){
new WOW().init();
}
});
//methods
$.fn.fullpage.setAllowScrolling(false);
});
$(function(){
new Swiper('.swiper-container');
const swiper = new Swiper('.swiper-container', {
//기본 셋팅
@ -42,18 +63,6 @@ $(function(){
},
});
new fullpage('#fullpage', {
licenseKey: '13F1F552-6ACE43B7-95262729-9E0B4778',
//options here
autoScrolling:true,
scrollHorizontally: true,
navigation:true,
navigationPosition:'right',
scrollBar: true
});
//methods
$.fn.fullpage.setAllowScrolling(true);
});

15
html/js/scrolloverflow.min.js vendored

File diff suppressed because one or more lines are too long

225
html/js/scrollspy.js

@ -1,225 +0,0 @@
/**
* Extend jquery with a scrollspy plugin.
* This watches the window scroll and fires events when elements are scrolled into viewport.
*
* throttle() and getTime() taken from Underscore.js
* https://github.com/jashkenas/underscore
*
* @author Copyright 2013 John Smart
* @license https://raw.github.com/thesmart/jquery-scrollspy/master/LICENSE
* @see https://github.com/thesmart
* @version 0.1.2
*/
(function($) {
var jWindow = $(window);
var elements = [];
var elementsInView = [];
var isSpying = false;
var ticks = 0;
var offset = {
top : 0,
right : 0,
bottom : 0,
left : 0,
}
/**
* Find elements that are within the boundary
* @param {number} top
* @param {number} right
* @param {number} bottom
* @param {number} left
* @return {jQuery} A collection of elements
*/
function findElements(top, right, bottom, left) {
var hits = $();
$.each(elements, function(i, element) {
var elTop = element.offset().top,
elLeft = element.offset().left,
elRight = elLeft + element.width(),
elBottom = elTop + element.height();
var isIntersect = !(elLeft > right ||
elRight < left ||
elTop > bottom ||
elBottom < top);
if (isIntersect) {
hits.push(element);
}
});
return hits;
}
/**
* Called when the user scrolls the window
*/
function onScroll() {
// unique tick id
++ticks;
// viewport rectangle
var top = jWindow.scrollTop(),
left = jWindow.scrollLeft(),
right = left + jWindow.width(),
bottom = top + jWindow.height();
// determine which elements are in view
var intersections = findElements(top+offset.top, right+offset.right, bottom+offset.bottom, left+offset.left);
$.each(intersections, function(i, element) {
var lastTick = element.data('scrollSpy:ticks');
if (typeof lastTick != 'number') {
// entered into view
element.triggerHandler('scrollSpy:enter');
}
// update tick id
element.data('scrollSpy:ticks', ticks);
});
// determine which elements are no longer in view
$.each(elementsInView, function(i, element) {
var lastTick = element.data('scrollSpy:ticks');
if (typeof lastTick == 'number' && lastTick !== ticks) {
// exited from view
element.triggerHandler('scrollSpy:exit');
element.data('scrollSpy:ticks', null);
}
});
// remember elements in view for next tick
elementsInView = intersections;
}
/**
* Called when window is resized
*/
function onWinSize() {
jWindow.trigger('scrollSpy:winSize');
}
/**
* Get time in ms
* @license https://raw.github.com/jashkenas/underscore/master/LICENSE
* @type {function}
* @return {number}
*/
var getTime = (Date.now || function () {
return new Date().getTime();
});
/**
* Returns a function, that, when invoked, will only be triggered at most once
* during a given window of time. Normally, the throttled function will run
* as much as it can, without ever going more than once per `wait` duration;
* but if you'd like to disable the execution on the leading edge, pass
* `{leading: false}`. To disable execution on the trailing edge, ditto.
* @license https://raw.github.com/jashkenas/underscore/master/LICENSE
* @param {function} func
* @param {number} wait
* @param {Object=} options
* @returns {Function}
*/
function throttle(func, wait, options) {
var context, args, result;
var timeout = null;
var previous = 0;
options || (options = {});
var later = function () {
previous = options.leading === false ? 0 : getTime();
timeout = null;
result = func.apply(context, args);
context = args = null;
};
return function () {
var now = getTime();
if (!previous && options.leading === false) previous = now;
var remaining = wait - (now - previous);
context = this;
args = arguments;
if (remaining <= 0) {
clearTimeout(timeout);
timeout = null;
previous = now;
result = func.apply(context, args);
context = args = null;
} else if (!timeout && options.trailing !== false) {
timeout = setTimeout(later, remaining);
}
return result;
};
};
/**
* Enables ScrollSpy using a selector
* @param {jQuery|string} selector The elements collection, or a selector
* @param {Object=} options Optional.
throttle : number -> scrollspy throttling. Default: 100 ms
offsetTop : number -> offset from top. Default: 0
offsetRight : number -> offset from right. Default: 0
offsetBottom : number -> offset from bottom. Default: 0
offsetLeft : number -> offset from left. Default: 0
* @returns {jQuery}
*/
$.scrollSpy = function(selector, options) {
selector = $(selector);
selector.each(function(i, element) {
elements.push($(element));
});
options = options || {
throttle: 100
};
offset.top = options.offsetTop || 0;
offset.right = options.offsetRight || 0;
offset.bottom = options.offsetBottom || 0;
offset.left = options.offsetLeft || 0;
var throttledScroll = throttle(onScroll, options.throttle || 100);
var readyScroll = function(){
$(document).ready(throttledScroll);
};
if (!isSpying) {
jWindow.on('scroll', readyScroll);
jWindow.on('resize', readyScroll);
isSpying = true;
}
// perform a scan once, after current execution context, and after dom is ready
setTimeout(readyScroll, 0);
return selector;
};
/**
* Listen for window resize events
* @param {Object=} options Optional. Set { throttle: number } to change throttling. Default: 100 ms
* @returns {jQuery} $(window)
*/
$.winSizeSpy = function(options) {
$.winSizeSpy = function() { return jWindow; }; // lock from multiple calls
options = options || {
throttle: 100
};
return jWindow.on('resize', throttle(onWinSize, options.throttle || 100));
};
/**
* Enables ScrollSpy on a collection of elements
* e.g. $('.scrollSpy').scrollSpy()
* @param {Object=} options Optional.
throttle : number -> scrollspy throttling. Default: 100 ms
offsetTop : number -> offset from top. Default: 0
offsetRight : number -> offset from right. Default: 0
offsetBottom : number -> offset from bottom. Default: 0
offsetLeft : number -> offset from left. Default: 0
* @returns {jQuery}
*/
$.fn.scrollSpy = function(options) {
return $.scrollSpy($(this), options);
};
})(jQuery);
Loading…
Cancel
Save