<!-- JQUERY -->
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<style>
body, html {
    height: 100%;
}

#wrapper {
    height: 400%;
    background: none repeat scroll 0 0 #eee;
    text-align:center;
    padding-top:20px;
}


#tester {
    padding-top:1200px;    
    height: 600px;
    background: none repeat scroll 0 0 #000;
}
</style>
</head>
<body>
<div id="wrapper">
    scroll down to see the div
</div>
<div id="tester"></div>

<script>
var isVisible = false;

$(window).on('scroll',function() {
    if (checkVisible($('#tester'))&&!isVisible) {
        alert("Visible!!!");
        isVisible=true;
    }
});

function checkVisible( elm, eval ) {
    eval = eval || "object visible";
    var viewportHeight = $(window).height(), // Viewport Height
        scrolltop = $(window).scrollTop(), // Scroll Top
        y = $(elm).offset().top,
        elementHeight = $(elm).height();   
    
    if (eval == "object visible") return ((y < (viewportHeight + scrolltop)) && (y > (scrolltop - elementHeight)));
    if (eval == "above") return ((y < (viewportHeight + scrolltop)));
}
</script>
</body>
</html>

'WEB' 카테고리의 다른 글

[frontend] hover animation  (0) 2021.03.30
JQuery RegExp / css before after  (0) 2021.02.03
SVG / css / script  (0) 2021.01.28
웹폰트 반응형 레이아웃  (0) 2021.01.20
<html>

<head>
<style>
.box {
    border-style: solid;
    border-width: 1px;
    display: block;
    width: 100px;
    height: 100px;
    background-color: #0000FF;
    -webkit-transition:width 2s, height 2s, background-color 2s, -webkit-transform 2s;
    transition:width 2s, height 2s, background-color 2s, transform 2s;
}
.box:hover {
    background-color: #FFCCCC;
    width:200px;
    height:200px;
    -webkit-transform:rotate(180deg);
    transform:rotate(180deg);
}
.box2 {
    margin-top:100px;
    border-style: solid;
    border-width: 1px;
    display: block;
    width: 100px;
    height: 100px;
    background-color: #eee;
    animation: test 2s ease-in infinite alternate;
}

svg { width:200px; height:200px;}
.st0{
fill:#000;animation: cart 2s ease-in infinite alternate;}
    @-webkit-keyframes cart {
  	from {
    		opacity:0.1;
  	}
  	to {
    		opacity:1;
  	}
}
test {
  	from {
    		transform: none;
  	}
  	to {
    		transform: translateX(10px) rotate(10deg) translateY(5px);
  	}
}
.slidein {
  -moz-animation-duration: 3s;
  -webkit-animation-duration: 3s;
  animation-duration: 3s;
  -moz-animation-name: slidein;
  -webkit-animation-name: slidein;
  animation-name: slidein;
  -moz-animation-iteration-count: 3;
  -webkit-animation-iteration-count: 3;
  animation-iteration-count: 3;
  -moz-animation-direction: alternate;
  -webkit-animation-direction: alternate;
  animation-direction: alternate;
}

@-moz-keyframes slidein {
  from {
    margin-left:100%;
    width:300%
  }

  to {
    margin-left:0%;
    width:100%;
  }
}

@-webkit-keyframes slidein {
  from {
    margin-left:100%;
    width:300%
  }

  to {
   margin-left:0%;
   width:100%;
 }
}

@keyframes slidein {
  from {
    margin-left:100%;
    width:300%
  }

  to {
   margin-left:0%;
   width:100%;
 }
}
</style>
</head>
<body onload="setup()">
  <h1 id="watchme">Watch me move</h1>
  <p>This example shows how to use CSS animations to make <code>h1</code> elements
  move across the page.</p>
  <p>In addition, we output some text each time an animation event fires, so you can see them in action.</p>
  <ul id="output">
  </ul>


<p>아래 박스는 width, height, background-color, transform을 위한 트랜지션을 결합합니다. 박스 위에 마우스를 올려 속성들의 애니메이션을 보세요.</p>
    <div class="box"></div>
    <div class="box2"></div>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="0 0 40 40" style="enable-background:new 0 0 40 40;" xml:space="preserve">
<g>
	<path class="st0" d="M14.9,30.8c1.8,0,3.3,1.5,3.3,3.3c0,1.8-1.5,3.3-3.3,3.3c-1.8,0-3.3-1.5-3.3-3.3
		C11.6,32.3,13.1,30.8,14.9,30.8z"/>
	<path class="st0" d="M29.5,30.8c1.8,0,3.3,1.5,3.3,3.3c0,1.8-1.5,3.3-3.3,3.3c-1.8,0-3.3-1.5-3.3-3.3
		C26.1,32.3,27.6,30.8,29.5,30.8z"/>
	<path class="st0" d="M37.9,12.6c-4.2,0-20.5,0-20.5,0s-1.2,0.3-1.2,1.6c0,1.3,1.2,1.7,1.2,1.7h18.4l-1,3.5c-5,0-18.1,0-18.1,0
		s-1.1,0.3-1.1,1.5c0,1.2,1.1,1.6,1.1,1.6h17.1h0l-1,3.3H14.2L13,15.9l-0.4-3.3c0,0-0.4-3.1-0.6-4.3C11.8,6.9,8.6,5.3,1.8,2.1
		c-1.6-0.7-3,2.3,0,3.8l5.4,2.5c0,0,1.3,0.7,1.4,1.7c0.1,1,2.3,17.3,2.3,17.3s0.1,2.3,2.1,2.3c2.1,0,18.9,0,20.6,0
		c1.7,0,2.1-1.8,2.1-1.8l4.1-12.1C39.8,15.7,41,12.6,37.9,12.6z"/>
</g>
</svg>
<script>
function setup() {
  var e = document.getElementById("watchme");
  e.addEventListener("animationstart", listener, false);
  e.addEventListener("animationend", listener, false);
  e.addEventListener("animationiteration", listener, false);

  var e = document.getElementById("watchme");
  e.className = "slidein";
}
function listener(e) {
  var l = document.createElement("li");
  switch(e.type) {
    case "animationstart":
      l.innerHTML = "Started: elapsed time is " + e.elapsedTime;
      break;
    case "animationend":
      l.innerHTML = "Ended: elapsed time is " + e.elapsedTime;
      break;
    case "animationiteration":
      l.innerHTML = "New loop started at time " + e.elapsedTime;
      break;
  }
  document.getElementById("output").appendChild(l);
}
</script>
</body>
</html>
<!-- https://developer.mozilla.org/ko/docs/Web/CSS/CSS_Animations/Using_CSS_animations 에니메이션 --> 
<!-- https://developer.mozilla.org/ko/docs/Web/CSS/CSS_Transitions/Using_CSS_transitions 트랜지션 -->
<!-- https://developer.mozilla.org/ko/docs/Web/CSS/transform 트랜스폼 -->

'WEB' 카테고리의 다른 글

[frontend] JQUERY 스크롤 이벤트  (0) 2021.03.30
JQuery RegExp / css before after  (0) 2021.02.03
SVG / css / script  (0) 2021.01.28
웹폰트 반응형 레이아웃  (0) 2021.01.20

www.w3schools.com/js/js_regexp.asp

 

JavaScript RegExp Object

JavaScript Regular Expressions A regular expression is a sequence of characters that forms a search pattern. The search pattern can be used for text search and text replace operations. What Is a Regular Expression? A regular expression is a sequence of cha

www.w3schools.com

goddino.tistory.com/43?category=902116

 

[css] 가상요소 ::before, ::after 사용법

오늘은 홈페이지를 만들 때 또는 블로그에 포스팅할 때 내용, 특히 타이틀에 은근히 자주 사용되는 ::before, ::after 사용법을 알아보겠습니다. ::before, ::after이 필요한 경우: · 홈페이지 헤더: 로그

goddino.tistory.com

 

'WEB' 카테고리의 다른 글

[frontend] JQUERY 스크롤 이벤트  (0) 2021.03.30
[frontend] hover animation  (0) 2021.03.30
SVG / css / script  (0) 2021.01.28
웹폰트 반응형 레이아웃  (0) 2021.01.20

벡터이미지 + CSS 마우스오버 

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
<style type="text/css">
	.st0{fill:#EEEEEE;  transition: all 1s;}
	.st0:hover{fill:#cdcdcd; }
	.st1{fill:none;stroke:#000000;stroke-width:5;stroke-linejoin:round;stroke-miterlimit:10;}
	.st2{fill:none;stroke:#000000;stroke-width:5;stroke-linecap:round;stroke-miterlimit:10;}
	.st3{fill:none;stroke:#000000;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
</style>
<g>
	<circle class="st0" cx="256" cy="256" r="256"/>
</g>
<path class="st1" d="M-324.4,195c-7.5-2.5-20.6,6.1-25.8,18.4c-5.2,12.2,0.3,36.3,4.5,47.5c11,29.6,43.6,75.4,90.5,86.5
	c23.9,5.7,30.4,4.9,38.9,0c5.8-3.3,14.2-11.5,16.5-21.4c2.2-10-55-28-58-26c-3,2-7.1,15.2-16.2,10.2c-9-5.1-18.5-16.2-24.6-22.5
	c-14.2-14.5-16.8-20.7-14.6-25.6c2.1-4.5,10.9-7.1,12.3-11.9C-298.6,242.8-315.5,198-324.4,195z"/>
<path class="st2" d="M-272.4,227.9c0,0,42.6-10.7,38.9,39.8"/>
<path class="st2" d="M-272.4,205.3c0,0,70.2-17.4,64,64.8"/>
<path class="st2" d="M-273.1,173.9c0,0,101.7-26.8,92.8,99.5"/>
<path class="st3" d="M837.8,314.2h-53.3l-16.2,50.4l-18.1-50.4h-51.4c-10.5,0-19-8.8-19-19.8v-77.1c0-10.9,8.5-19.8,19-19.8h139
	c10.5,0,19,8.8,19,19.8v77.1C856.9,305.3,848.4,314.2,837.8,314.2z"/>
<line class="st3" x1="702.6" y1="221.3" x2="824.5" y2="221.3"/>
<line class="st3" x1="702.6" y1="245" x2="795" y2="245"/>
<line class="st3" x1="702.6" y1="267.7" x2="791.2" y2="267.7"/>
<line class="st3" x1="702.6" y1="292.4" x2="824.5" y2="292.4"/>
<path class="st3" d="M245.5,345.4h-55.2c-9.5,0-17.2-7.8-17.2-17.4V167.9c0-9.6,7.7-17.4,17.2-17.4h110.4c9.5,0,17.2,7.8,17.2,17.4
	V248"/>
<line class="st3" x1="173.1" y1="174.2" x2="317.8" y2="174.2"/>
<line class="st3" x1="188" y1="197.5" x2="304.9" y2="197.5"/>
<line class="st3" x1="188" y1="220.8" x2="284.7" y2="220.8"/>
<line class="st3" x1="188" y1="243.3" x2="249.9" y2="243.3"/>
<line class="st3" x1="188" y1="264.1" x2="238.2" y2="264.1"/>
<line class="st3" x1="188" y1="285.4" x2="225.6" y2="285.4"/>
<line class="st3" x1="188" y1="308.6" x2="225.6" y2="308.6"/>
<ellipse class="st3" cx="278.6" cy="301.5" rx="53" ry="53.5"/>
<line class="st3" x1="315.6" y1="339.8" x2="352.2" y2="374.8"/>
<line class="st3" x1="206.8" y1="162.8" x2="213.1" y2="162.8"/>
<line class="st3" x1="245.1" y1="162.8" x2="251.3" y2="162.8"/>
<line class="st3" x1="283.3" y1="162.8" x2="289.5" y2="162.8"/>
</svg>

 

 

별이미지 + 에니메이션 효과

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="0 0 80 80" style="enable-background:new 0 0 80 80;" xml:space="preserve">
<style type="text/css">
	.st0{fill:#FFCE39;animation: star 1s ease-in infinite alternate;}
    @-webkit-keyframes star {
  from {
    opacity:0.1;
  }
  to {
    opacity:1;
  }
}
</style>
<g>
	<polygon class="st0" points="40.4,19.2 62.7,7.5 58.4,32.3 76.4,49.9 51.6,53.5 40.4,76 29.3,53.5 4.4,49.9 22.4,32.3 18.2,7.5 	
		"/>
</g>
</svg>

 

javascript

 

'WEB' 카테고리의 다른 글

[frontend] JQUERY 스크롤 이벤트  (0) 2021.03.30
[frontend] hover animation  (0) 2021.03.30
JQuery RegExp / css before after  (0) 2021.02.03
웹폰트 반응형 레이아웃  (0) 2021.01.20

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<style>

@font-face {
 font-family: 'NanumBarunGothic';
 font-style: normal;
 font-weight: 300;
 src: url('//cdn.jsdelivr.net/font-nanumlight/1.0/NanumBarunGothicWebLight.eot');
 src: url('//cdn.jsdelivr.net/font-nanumlight/1.0/NanumBarunGothicWebLight.eot?#iefix') format('embedded-opentype'), url('//cdn.jsdelivr.net/font-nanumlight/1.0/NanumBarunGothicWebLight.woff') format('woff'), url('//cdn.jsdelivr.net/font-nanumlight/1.0/NanumBarunGothicWebLight.ttf') format('truetype');
}

body, input, textarea, select, button, table, p {
    font-family: 'NanumBarunGothic','나눔고딕',NanumGothic,'맑은고딕',MalgunGothic,'돋움',Dotum,Helvetica,'Apple SD Gothic Neo',Sans-serif;
   
    -webkit-font-smoothing: subpixel-antialiased;
    line-height: 1.9;
    font-size: 19px;
    box-sizing: border-box;
}

#container, #footer, #header {
margin: 0 auto;
max-width: 768px;
min-width: 460px;
}

@media screen and (max-width: 450px){}
@media screen and (max-width: 768px) and (min-width: 451px) {}
@media screen and (min-width:994px) {}

</style>


// Break Point
$tablet: 768px;
$laptop: 1020px;
$desktop: 1400px;
 
 
// Mixins
@mixin tablet {
  @media (min-width: #{$tablet}) {
    @content;
  }
}
 
@mixin laptop {
  @media (min-width: #{$laptop}) {
    @content;
  }
}
 
 
@mixin desktop {
  @media (min-width: #{$desktop}) {
    @content;
  }
}

'WEB' 카테고리의 다른 글

[frontend] JQUERY 스크롤 이벤트  (0) 2021.03.30
[frontend] hover animation  (0) 2021.03.30
JQuery RegExp / css before after  (0) 2021.02.03
SVG / css / script  (0) 2021.01.28

+ Recent posts