반응형

BootStrap cdn을 활용하여 네온사인 버튼을 만들어 봅니다.

 

Bootstrap-cdn을 활용한 버튼

 

index.html

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- Bootstrap-cdn 적용 -->
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="CheckButton.css" />
<title>CheckButton</title>
</head>
<body>
<ul>
	<li>
		<label>
			<input type="checkbox" name="">
			<div class="icon-box">
                <!-- 이미지 적용(비행기) -->
				<i class="fa fa-plane" aria-hidden="true"></i>
			</div>
		</label>	
	</li>
	<li>
		<label>
			<input type="checkbox" name="">
			<div class="icon-box">
                <!-- 이미지 적용(트위터) -->
				<i class="fa fa-twitter" aria-hidden="true"></i>
			</div>
		</label>	
	</li>
	<li>
		<label>
			<input type="checkbox" name="">
			<div class="icon-box">
                <!-- 이미지 적용(신용카드) -->
				<i class="fa fa-credit-card" aria-hidden="true"></i>
			</div>
		</label>	
	</li>
	<li>
		<label>
			<input type="checkbox" name="">
			<div class="icon-box">
                <!-- 이미지 적용(윈도우) -->
				<i class="fa fa-windows" aria-hidden="true"></i>
			</div>
		</label>	
	</li>
	<li>
		<label>
			<input type="checkbox" name="">
			<div class="icon-box">
                <!-- 이미지 적용(유튜브) -->
				<i class="fa fa-youtube" aria-hidden="true"></i>
			</div>
		</label>	
	</li>
	<li>
		<label>
			<input type="checkbox" name="">
			<div class="icon-box">
                <!-- 이미지 적용(인스타그램) -->
				<i class="fa fa-instagram" aria-hidden="true"></i>
			</div>
		</label>	
	</li>	
</ul>
</body>
</html>

 

 

CheckButton.css

*{
  margin: 0px;
  padding: 0px;
}
body{
	display: flex;
	justify-content: center;
	align-items: center;
	height: 100vh;
	background-color: #111; 
}
ul{
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	border: 3px solid #000;
	border-radius: 10px;
	padding: 20px 0;
	box-sizing: border-box;
	overflow: hidden;
	width: 240px;
	background: linear-gradient(0deg, #000000, #0c0c0c);
}

ul:before{
	content: '';
	position: absolute;
	width: 100%;
	height: 100%;
	background: rgba(255,255,255,.05);
	bottom: -50%;
	pointer-events: none;
	z-index: 1;
}
ul li{
	position: relative;
	list-style: none;
	text-align: center;
	margin: 15px;
}
ul li label{
	position: relative;
}
ul li label input[type="checkbox"]{
	position: absolute;
	opacity: 0;
	cursor: pointer;
}
ul li label .icon-box{
	width: 60px;
	height: 60px;
	background-color: #101010;
	display: flex;
	justify-content: center;
	align-items: center;
	border: 3px solid #000;
	border-radius: 10px;
	transition: 0.5s;
}

ul li label .icon-box .fa{
	font-size: 30px;
	color: #222;
	transition: 0.5s;
}
ul li label input[type="checkbox"]:checked ~ .icon-box{
	background-color: #000;
	border: 3px solid #fff;
	box-shadow: 0 0 10px rgba(33,156,243,.5),
				0 0 20px rgba(33,156,243,.5),
				0 0 30px rgba(33,156,243,.5);
	
}
ul li label input[type="checkbox"]:checked ~ .icon-box .fa{
	color: #fff;
	text-shadow: 0 0 10px rgba(33,156,243,.8),
				 0 0 10px rgba(33,156,243,1);
}

 

다른 아이콘들을 확인 하고 싶으면

https://fontawesome.com/v4.7.0/icons/

 

Font Awesome Icons

Get 1535 icons right now with FA Free, plus another 7020 icons with Pro, which also gets you another 53 icon category packs as we finish them! Our all-new SVG with JavaScript gives you all the power of SVG without the usual hassle. Ligatures for easier des

fontawesome.com

위 사이트로 접근하여 원하는 이미지로 적용시키면 된다.

 

아래 빨간색으로 처리된 class부분을 변경해주면 된다.

 

반응형
반응형

위의 gif와 같은 버튼을 만들어 보겠습니다.

 

See the Pen rotateBorderButton by myhappyman (@myhappyman) on CodePen.

반응형
반응형

HTML, CSS로만 구성된 사각형박스가 올라오면서 원형으로 변하고 사라지는 배경을 작성해보겠습니다.

HTML PAGE

 

index.html


<!doctype html>
<html>
<head>
<title>Bubbles Background</title>
<link rel="stylesheet" type="text/css" href="BubbleBackground.css" />
</head>
<body>
  <ul class="bubbles">
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
  </ul>

</body>
</html>

 

BubbleBackground.css


*{
  margin: 0px;
  padding: 0px;
}
body{
  background: #DDD;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.bubbles{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.bubbles li{
  position: absolute;
  list-style: none;
  display: block;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, .5);
  animation: animate 25s linear infinite;
  bottom: -150px;
}
.bubbles li:nth-child(1){
  left: 5%;
  width: 90px;
  height: 90px;
  animation-delay: 0s;
}
.bubbles li:nth-child(2){
  left: 15%;
  width: 20px;
  height: 20px;
  animation-delay: 2s;
  animation-duration: 12s;
}
.bubbles li:nth-child(3){
  left: 20%;
  width: 150px;
  height: 150px;
  animation-delay: 4s;
}
.bubbles li:nth-child(4){
  left: 30%;
  width: 35px;
  height: 35px;
  animation-delay: 0s;
  animation-duration: 18s;
}
.bubbles li:nth-child(5){
  left: 40%;
  width: 20px;
  height: 20px;
  animation-delay: 0s;
}
.bubbles li:nth-child(6){
  left: 50%;
  width: 110px;
  height: 110px;
  animation-delay: 3s;
}
.bubbles li:nth-child(7){
  left: 60%;
  width: 150px;
  height: 150px;
  animation-delay: 7s;
}
.bubbles li:nth-child(8){
  left: 65%;
  width: 25px;
  height: 25px;
  animation-delay: 15s;
  animation-duration: 45s;
}
.bubbles li:nth-child(9){
  left: 70%;
  width: 15px;
  height: 15px;
  animation-delay: 2s;
  animation-duration: 35s;
}
.bubbles li:nth-child(10){
  left: 80%;
  width: 150px;
  height: 150px;
  animation-delay: 0s;
  animation-duration: 11s;
}
.bubbles li:nth-child(11){
  left: 85%;
  width: 15px;
  height: 15px;
  animation-delay: 2s;
  animation-duration: 35s;
}
.bubbles li:nth-child(12){
  left: 95%;
  width: 20px;
  height: 20px;
  animation-delay: 0s;
  animation-duration: 8s;
}
@keyframes animate {
  0%{
    transform: translateY(0) rotate(0deg);
    opacity: 1;
    border-radius: 0;
  }
  100%{
    transform: translateY(-500px) rotate(360deg);
    opacity: 0.5;
    border-radius: 25%;
  }
  100%{
    transform: translateY(-1000px) rotate(720deg);
    opacity: 0;
    border-radius: 50%;
  }
}
 
반응형