snippets Archives - csshint - A designer hub https://csshint.com/category/snippets/ Fri, 02 Sep 2022 17:31:27 +0000 en-US hourly 1 https://wordpress.org/?v=6.3.4 Bootstrap Responsive Pricing Table Snippet https://csshint.com/bootstrap-responsive-pricing-table/ Fri, 02 Sep 2022 17:08:56 +0000 http://csshint.com/?p=7552 Amazing Bootstrap Responsive Pricing Table Snippet with Custom Hover Effects and Buttons created by startbootstrap.

The post Bootstrap Responsive Pricing Table Snippet appeared first on csshint - A designer hub.

]]>
Amazing Bootstrap Responsive Pricing Table Snippet with Custom Hover Effects and Buttons created by startbootstrap.

The post Bootstrap Responsive Pricing Table Snippet appeared first on csshint - A designer hub.

]]>
Bootstrap Login Form with Floating Labels https://csshint.com/bootstrap-login-form-with-floating-labels/ Fri, 02 Sep 2022 16:24:34 +0000 http://csshint.com/?p=7549 Look at this amazing Bootstrap Login Form with Floating Labels and Social Login Buttons Created By startbootstrap.

The post Bootstrap Login Form with Floating Labels appeared first on csshint - A designer hub.

]]>
Look at this amazing Bootstrap Login Form with Floating Labels and Social Login Buttons Created By startbootstrap.

The post Bootstrap Login Form with Floating Labels appeared first on csshint - A designer hub.

]]>
Bootstrap Contact Form Split Image Layout https://csshint.com/bootstrap-contact-form-split-image-layout/ Fri, 02 Sep 2022 16:19:36 +0000 http://csshint.com/?p=7542 Look at this A Creative bootstrap Contact Form Split Image Layout template and integrate it into your website.

The post Bootstrap Contact Form Split Image Layout appeared first on csshint - A designer hub.

]]>
Look at this A Creative bootstrap Contact Form Split Image Layout template and integrate it into your website.

The post Bootstrap Contact Form Split Image Layout appeared first on csshint - A designer hub.

]]>
Simple Flipping Counter Timer https://csshint.com/simple-flipping-counter-timer/ Thu, 06 Aug 2020 08:23:59 +0000 http://csshint.com/?p=3112 This is Simple flipping counter timer that you can use in your promotional landing pages. Designed by Peter Schmalfeldt. Simple Flipping Counter Timer See the Pen Happy New Year by Peter Schmalfeldt (@manifestinteractive) on CodePen.

The post Simple Flipping Counter Timer appeared first on csshint - A designer hub.

]]>
This is Simple flipping counter timer that you can use in your promotional landing pages. Designed by Peter Schmalfeldt.

Simple Flipping Counter Timer

Simple Flipping Counter Timer


Simple Flipping Counter Timer

The post Simple Flipping Counter Timer appeared first on csshint - A designer hub.

]]>
Simple Upload Button Animation https://csshint.com/simple-upload-button-animation/ Mon, 03 Aug 2020 15:34:41 +0000 http://csshint.com/?p=3016 Check out this cool upload button animation using css and js, designed by Eva Lettner. The Html [code language=”html”] <body> <div class="upload"> <span class="glyphicon glyphicon-arrow-up arrow" aria-hidden="true"></span> <span class="glyphicon glyphicon-ok ok" aria-hidden="true"></span> </div> <div class="button" data-text-swap="reset">upload</div> </body> [/code] CSS / SCSS [code language=”css”] body{ background-color: #d4c2f2; } .upload{ text-align: center; color: #fff; text-shadow: 0 2px […]

The post Simple Upload Button Animation appeared first on csshint - A designer hub.

]]>
Check out this cool upload button animation using css and js, designed by Eva Lettner.

Upload Button Animation

Demo : Upload Button Animation


The Html

[code language=”html”]
<body>

<div class="upload">
<span class="glyphicon glyphicon-arrow-up arrow" aria-hidden="true"></span>
<span class="glyphicon glyphicon-ok ok" aria-hidden="true"></span>
</div>
<div class="button" data-text-swap="reset">upload</div>

</body>
[/code]

CSS / SCSS

[code language=”css”]
body{
background-color: #d4c2f2;
}

.upload{
text-align: center;
color: #fff;
text-shadow: 0 2px 0 hsla(0,0%,0%,.075);
font-size: 30px;
background: {
image: linear-gradient(to bottom, #b6c5cc 50%, #c0e8b9 50%);
position: 0% 0%;
size: 230%;
}
background-color: #b6c5cc;
background-repeat: no-repeat;
border: 6px solid #fff;
border-radius: 50px;
box-shadow: inset 0 2px 0 hsla(0,0%,0%,.1), 0 3px 0 hsla(0,0%,0%,.075);
cursor: pointer;
height: 80px;
left: 50%;
margin: -43px;
margin-top: -100px;
position: absolute;
top: 50%;
width: 80px;
transition: background 3s ease-in-out;
}

.uploading{
background-position: 0% 100%;
}

span{
margin-top: 16px;
margin-left: -3px;
transition: 0.1s 2s ease-in-out;
}

.ok{
position: absolute;
left: 22px;
top: 50px;
opacity: 0;
}

.bounce{
animation: bounce 0.3s ease 2.5s forwards;
}

.arrow-out{
top: -20px;
visibility: hidden;
}

.button{
position: absolute;
width: 120px;
height: 30px;
background-color: #fff;
top: 50%;
left: 50%;
margin-left: -60px;
margin-top: 10px;
border-radius: 5px;
box-shadow: 0 3px 0 hsla(0,0%,0%,.075);
text-align: center;
line-height: 30px;
font-size: 16px;
text-transform: uppercase;
color: #888;
cursor: pointer;
transition: 0.2s;

&:active{
box-shadow: 0 0 0;
margin-top: 12px;
}
}

@keyframes bounce{
0%{
top: 50px;
opacity: 0;
}
80%{
top: -5px;
}
100%{
top: 0;
opacity: 1;
}
}
[/code]

JS

[code language=”js”]
var button = document.querySelector(‘.button’);
var upload = document.querySelector(‘.upload’);
var arrow = document.querySelector(‘.arrow’);
var ok = document.querySelector(‘.ok’);

button.addEventListener(‘click’, function() {
upload.classList.toggle(‘uploading’)
arrow.classList.toggle(‘arrow-out’)
if(arrow.classList.contains(‘arrow-out’)){
ok.classList.add(‘bounce’);
}else{
ok.classList.remove(‘bounce’);
}
if (button.getAttribute("data-text-swap") == button.innerHTML) {
button.innerHTML = button.getAttribute("data-text-original");
} else {
button.setAttribute("data-text-original", button.innerHTML);
button.innerHTML = button.getAttribute("data-text-swap");
}
});

[/code]

Upload Button

The post Simple Upload Button Animation appeared first on csshint - A designer hub.

]]>
Infinite Scrolling image Slider https://csshint.com/infinite-scrolling-image-slider/ Mon, 03 Aug 2020 15:24:36 +0000 http://csshint.com/?p=3011 if you are searching for Infinite Scrolling image Slider ? Then you are in right place. here we are going to show how to create Infinite Scrolling Slider using html and css. This cool Snippet Designed by Jake Albaugh. The html [code language=”html”] <div class="slider"> <div class="slider-row"></div> </div> [/code] CSS / SCSS [code language=”css”] $img-w: […]

The post Infinite Scrolling image Slider appeared first on csshint - A designer hub.

]]>
if you are searching for Infinite Scrolling image Slider ? Then you are in right place. here we are going to show how to create Infinite Scrolling Slider using html and css. This cool Snippet Designed by Jake Albaugh.

Infinite Scrolling image Slider

Demo : Infinite Scrolling image Slider


The html

[code language=”html”]
<div class="slider">
<div class="slider-row"></div>
</div>
[/code]

CSS / SCSS

[code language=”css”]
$img-w: 5912px;
$img-h: 389px;
$shrink: 2;
$ratio: 1 / $shrink;
$speed: 50s;

.slider {
position: absolute;
width: 100%;
top: calc(50% – #{$img-h * $ratio / 2});
overflow: hidden;
.slider-row {
width: $img-w * $ratio;
height: $img-h * $ratio;
background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/111863/ubiquity-summit-web-01.png);
background-size: $img-w * $ratio $img-h * $ratio;
animation: slide $speed linear infinite;
}
}

@keyframes slide {
from { background-position-x: 0; }
to { background-position-x: -$img-w * $ratio; }
}
[/code]

Infinite sliding image

The post Infinite Scrolling image Slider appeared first on csshint - A designer hub.

]]>
Contact button with hover effect https://csshint.com/contact-button-with-hover-effect/ Mon, 03 Aug 2020 15:11:21 +0000 http://csshint.com/?p=3005 Check out this really cool contact button on hover effect changes to email address. This amazing snippet Designed by Alberto Jerez. The Html [code language=”html”] <svg style="position: absolute; width: 0; height: 0;" width="0" height="0" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <symbol id="icon-paperplane" viewBox="0 0 1024 1024"> <title>paperplane</title> <path class="path1" d="M1009.376 5.12c-5.312-3.424-11.36-5.12-17.376-5.12-6.176 0-12.384 1.76-17.76 5.376l-960 640c-9.888 6.56-15.328 18.112-14.048 […]

The post Contact button with hover effect appeared first on csshint - A designer hub.

]]>
Check out this really cool contact button on hover effect changes to email address. This amazing snippet Designed by Alberto Jerez.

Contact button with hover effect

Demo : Contact button with hover effect


The Html

[code language=”html”]
<svg style="position: absolute; width: 0; height: 0;" width="0" height="0" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<symbol id="icon-paperplane" viewBox="0 0 1024 1024">
<title>paperplane</title>
<path class="path1" d="M1009.376 5.12c-5.312-3.424-11.36-5.12-17.376-5.12-6.176 0-12.384 1.76-17.76 5.376l-960 640c-9.888 6.56-15.328 18.112-14.048 29.952 1.216 11.808 8.896 22.016 19.936 26.368l250.368 100.192 117.728 206.016c5.632 9.888 16.096 16 27.424 16.128 0.128 0 0.224 0 0.352 0 11.232 0 21.664-5.952 27.424-15.552l66.464-110.816 310.24 124.064c3.808 1.536 7.808 2.272 11.872 2.272 5.44 0 10.816-1.376 15.68-4.128 8.448-4.736 14.24-13.056 15.872-22.624l160-960c2.080-12.576-3.488-25.184-14.176-32.128zM100.352 664.864l741.6-494.432-539.2 577.184c-2.848-1.696-5.376-3.936-8.512-5.184l-193.888-77.568zM326.048 770.112c-0.064-0.128-0.16-0.192-0.224-0.32l606.176-648.8-516.768 805.184-89.184-156.064zM806.944 947.488l-273.312-109.312c-6.496-2.56-13.248-3.424-19.936-3.808l420.864-652.416-127.616 765.536z"></path>
</symbol>
</defs>
</svg>

<a href="http://www.ajerez.es/en/" target="_blank" class="contact-button">
Contact
<svg class="icon icon-paperplane"><use xlink:href="#icon-paperplane"></use></svg>
<span>alberto@ajerez.es</span>
</a>

<a href="https://dribbble.com/shots/2131627-Personal-Portfolio-Site/attachments/388736" target="_blank" class="inspiration">Inspiration: Dribbble</a>

<!– Link to my website –>
<a id="ajerez" href="http://www.ajerez.es/en/" target="_blank"><img src="https://i.imgur.com/AI4BS2I.png"/></a>

[/code]

CSS / SCSS

[code language=”css”]
@import url(https://fonts.googleapis.com/css?family=Raleway:400,300,500,700);

$color1: #EE283E;
$color2: #1F3944;
$color3: white;

html {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
background-color: $color2;
-webkit-font-smoothing: antialiased;
font-size: 18px;
}

*, *:before, *:after {
box-sizing: border-box;
}

.icon {
display: inline-block;
width: 1em;
height: 1em;
fill: currentColor;
}

.icon-paperplane {
font-size: 1em;
color: $color3;
margin-left: 1px;
margin-top: 5px;
}

.contact-button {
position: relative;
-webkit-perspective: 1000;
-webkit-backface-visibility: hidden;
-webkit-transform:translate3d(0,0,0);
color: $color3;
text-decoration: none;
text-transform: uppercase;
font-family: ‘Raleway’, sans-serif;
font-weight: 500;
font-size: 1.2em;
border: 2px solid $color3;
border-radius: 4px;
padding: 20px 60px 20px 55px;
transition: 0.3s ease-in-out;

span {
text-transform: none;
position: absolute;
color: $color1;
top: 20px;
left: 30px;
opacity: 0;
transition: all 0s ease 0s;
}
&:hover {
transition: 0.3s ease-in-out;
border: 2px solid $color3;
border-radius: 50px;
background-color: $color3;

&>span {
opacity: 1;
transition: all 0.25s ease-in-out 0.1s;
}

&:before {
transition: 0.3s ease-in-out;
background-color: $color1;
}
}

&:before, &:after {
content: "";
position: absolute;
top: -14px;
left: -12px;
width: 132px;
height: 25px;
}
&:before {
border: 2px solid $color1;
background-color: $color2;
transform: skew(-25deg);
transition: 0.3s ease-in-out;
}

&:after {
content: "Available for work";
font-size: 0.45em;
top: -7px;
left: 0px;
color: $color3;
}
}

.inspiration {
position: absolute;
width: 100%;
bottom: 0;
left: 0;
padding: 10px;
text-align: center;
text-decoration: none;
color: lighten($color2, 25%);
font-family: ‘Raleway’, sans-serif;
font-weight: 700;
font-size: 1em;
}
[/code]

Contact button

The post Contact button with hover effect appeared first on csshint - A designer hub.

]]>
Pure CSS Gooey Toggle Switch https://csshint.com/pure-css-gooey-toggle-switch/ Sun, 02 Aug 2020 16:25:00 +0000 http://csshint.com/?p=3000 In this post we are going to show you how to create Gooey Toggle Switch using css. this amazing snippet Designed by Vincent Durand. The Html [code language=”html”] <div class="form"> <input type="checkbox" id="bubble" /> <label class="bubble" for="bubble"></label> </div> [/code] CSS [code language=”css”] body{ color: #151B25; background-color: #2C4159; } .form { position: absolute; top: 50%; left: […]

The post Pure CSS Gooey Toggle Switch appeared first on csshint - A designer hub.

]]>
In this post we are going to show you how to create Gooey Toggle Switch using css. this amazing snippet Designed by Vincent Durand.

Gooey Toggle Switch using css

Demo : Gooey Toggle Switch using css


The Html

[code language=”html”]
<div class="form">
<input type="checkbox" id="bubble" />
<label class="bubble" for="bubble"></label>
</div>
[/code]

CSS

[code language=”css”]
body{
color: #151B25;
background-color: #2C4159;
}
.form {
position: absolute; top: 50%; left: 50%; height: 100px;
padding: 10px 0;
width: 260px;
transform: translate3d(-50%,-50%,0);
}
.form:before {
content: ”;
position: absolute;
top: 0;
left: -5px;
height: 100%;
width: 120px;
background-color: #243548;
border-radius: 50%;
box-shadow: 75px 0 0 #243548, 150px 0 0 #243548;
}
.form:after {
content: ”;
position: absolute;
top: -94px;
left: 70px;
height: 100%;
width: 120px;
background-color: #2C4159;
border-radius: 50%;
box-shadow: 0 188px 0 #2C4159;
}

.form input {
position: absolute;
left: -9999px;
}
.bubble{
position:absolute;
z-index:2;
top:50%;
left:50%;
height:100px;
width:100px;
transform:translate3d(-75%,-50%,0);
margin-left:-50px;
background:#BBBBBB;
border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
border-right: 0px solid #BBBBBB;
border-left: 0px solid #BBBBBB;
animation: toggle-reverse 2s 1;
}
#bubble:checked + .bubble{
animation: toggle 2s 1;
transform:translate3d(75%,-50%,0);
background: #3CCC97;
}
.bubble:after {
content: ”;
position: absolute;
top: 50%;
margin-top: -15px;
margin-left: -2px;
height: 30px;
width: 4px;
background: #fff;
left: 50%;
transform: rotate(45deg);
border-radius: 2px;
transition: 500ms ease all 1.25s;
}
.bubble:before {
content: ”;
position: absolute;
top: 50%;
margin-top: -15px;
margin-left: -2px;
height: 30px;
width: 4px;
background: #fff;
left: 50%;
transform: rotate(-45deg);
border-radius: 2px;
transition: 500ms ease all 1.25s;
}

#bubble:checked + .bubble:after {
content: ”;
position: absolute;
top: 50%;
margin-top: -15px;
margin-left: 5px;
height: 30px;
width: 4px;
background: #fff;
left: 50%;
transform: rotate(225deg);
border-radius: 2px;
}
#bubble:checked + .bubble:before {
content: ”;
position: absolute;
top: 50%;
margin-top: -7px;
margin-left: -10px;
height: 20px;
width: 4px;
background: #fff;
left: 50%;
transform: rotate(-215deg);
border-radius: 2px;
}
@keyframes toggle {
0% {
transform:translate3d(-75%,-50%,0);
border-right: 0 solid #BBBBBB;
border-left: 0 solid #BBBBBB;
background:#BBBBBB;
border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
height: 100px;
}
20% {
border-right: 0 solid #BBBBBB;
border-left: 0 solid #BBBBBB;
border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
transform:translate3d(-75%,-50%,0);
height: 100px;
}
40% {
border-left: 0 solid #BBBBBB;
border-radius: 35% 65% 65% 35% / 50% 50% 50% 50%;
height: 90px;
}
50% {
transform:translate3d(0%,-50%,0);
border-right: 25px solid #BBBBBB;
border-left: 0 solid #BBBBBB;
background:#BBBBBB;
border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
height: 90px;
}
75% {
border-left: 25px solid #3CCC97;
border-color:#3CCC97;
background: #3CCC97;
border-radius: 65% 35% 35% 65% / 50% 50% 50% 50%;
height: 90px;
}
100% {
border-right: 0 solid #3CCC97;
border-left: 0 solid #3CCC97;
border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
transform:translate3d(75%,-50%,0);
height: 100px;
width:100px
}
}

@keyframes toggle-reverse {
0% {
transform:translate3d(75%,-50%,0);
background: #3CCC97;
border-right: 0 solid #3CCC97;
border-left: 0 solid #3CCC97;
border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
height: 100px;
}
20% {
border-right: 0 solid #3CCC97;
border-left: 0 solid #3CCC97;
border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
transform:translate3d(75%,-50%,0);
height: 100px;
}
40% {
border-right: 0 solid #3CCC97;
border-radius: 65% 35% 35% 65% / 50% 50% 50% 50%;
height: 90px;
}
50% {
transform:translate3d(0%,-50%,0);
border-left: 25px solid #3CCC97;
border-right: 0 solid #3CCC97;
background: #3CCC97;
border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
height: 90px;
}
75% {
border-right: 25px solid #BBBBBB;
border-color:#BBBBBB;
background:#BBBBBB;
border-radius: 35% 65% 65% 35% / 50% 50% 50% 50%;
height: 90px;
}
100% {
border-right: 0 solid #BBBBBB;
border-left: 0 solid #BBBBBB;
border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
transform:translate3d(-75%,-50%,0);
height: 100px;
width:100px
}
}
[/code]

Gooey toggle switch

The post Pure CSS Gooey Toggle Switch appeared first on csshint - A designer hub.

]]>
Sparkle Effect Using JQuery And Canvas https://csshint.com/sparkle-effect-using-jquery-and-canvas/ Sun, 02 Aug 2020 16:16:19 +0000 http://csshint.com/?p=2995 This is a cool Sparkle Effect Using JQuery And Canvas script to add magic to DOM elements!. Designed by Simon Goellner. The Html [code language=”html”] <h1>A little canvas script to <span>add magic</span> to DOM elements!</h1> <button class="sparkley">Everything’s better with sparkles!</button> <button class="sparkley last">I eat rainbows and poop butterflies!!</button> <div class="img"> <img id="image" src="http://www.twitrcovers.com/wp-content/uploads/2014/04/Macro-Nature-Rain-l.jpg"> </div> <p>It […]

The post Sparkle Effect Using JQuery And Canvas appeared first on csshint - A designer hub.

]]>
This is a cool Sparkle Effect Using JQuery And Canvas script to add magic to DOM elements!. Designed by Simon Goellner.

Sparkle Effect Using JQuery And Canvas

Sparkle Effect Using JQuery And Canvas


The Html

[code language=”html”]

<h1>A little canvas script to <span>add magic</span> to DOM elements!</h1>

<button class="sparkley">Everything’s better with sparkles!</button>
<button class="sparkley last">I eat rainbows and poop butterflies!!</button>

<div class="img">
<img id="image" src="http://www.twitrcovers.com/wp-content/uploads/2014/04/Macro-Nature-Rain-l.jpg">
</div>
<p>It won’t work on images or DOM elements which cannot contain other elements, unless we wrap them.</p>
[/code]

CSS / SCSS

[code language=”css”]
@import url(https://fonts.googleapis.com/css?family=Lato:400,900|Montez);

$buttonBackground: #2c3e50;
$buttonColor: rgba(255,255,255,1);

.sparkley {

background: lighten( $buttonBackground , 10% );
color: $buttonColor;
border: none;

padding: 16px 36px;
font-weight: normal;

border-radius: 3px;
transition: all 0.25s ease;

box-shadow: 0 38px 32px -23px black;
margin: 0 1em 1em;

&:hover {

background: $buttonBackground;
color: transparentize( $buttonColor,0.8 );

}
}

html {

font-family: Lato;
font-weight: 200;
font-size: 1em;
text-align: center;
color: #ddd;

min-height: 100%;

// awesome background from: https://codepen.io/bosscause/pen/BkxbC <3

background: #092756;
background: -moz-radial-gradient(0% 100%, ellipse cover, rgba(35, 24, 82, 0.22) 10%,rgba(138,114,76,0) 40%),-moz-linear-gradient(top, rgba(57,173,219,.25) 0%, rgba(42,60,87,.4) 100%), -moz-linear-gradient(-45deg, #670d10 0%, #092756 100%);
background: -webkit-radial-gradient(0% 100%, ellipse cover, rgba(35, 24, 82, 0.22) 10%,rgba(138,114,76,0) 40%), -webkit-linear-gradient(top, rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), -webkit-linear-gradient(-45deg, #670d10 0%,#092756 100%);
background: -o-radial-gradient(0% 100%, ellipse cover, rgba(35, 24, 82, 0.22) 10%,rgba(138,114,76,0) 40%), -o-linear-gradient(top, rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), -o-linear-gradient(-45deg, #670d10 0%,#092756 100%);
background: -ms-radial-gradient(0% 100%, ellipse cover, rgba(35, 24, 82, 0.22) 10%,rgba(138,114,76,0) 40%), -ms-linear-gradient(top, rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), -ms-linear-gradient(-45deg, #670d10 0%,#092756 100%);
background: -webkit-radial-gradient(0% 100%, ellipse cover, rgba(35, 24, 82, 0.22) 10%,rgba(138,114,76,0) 40%), linear-gradient(to bottom, rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), linear-gradient(135deg, #670d10 0%,#092756 100%);

body {
padding: 50px;
}

}

h1,h2,h3 {

span {
font-family: Montez;
font-size: 1.9em;
font-weight: 300;
margin: 0 0.3em;
color: #ff0080;
}

}

h1 {
font-size: 1.9em;
width: 900px;
margin: 0 auto 1em;
text-shadow: 0 2px 1px black;
}

.img {

margin: 40px auto 0;
width: 500px;
display: block;

img {
width: 100%;
border-radius: 5px;
}

}

p {

padding: 5px 10px;
display: inline-block;
margin: 10px auto;

}
[/code]

js

[code language=”js”]

$(function() {

// default is varying levels of transparent white sparkles
$(".sparkley:first").sparkleh();

// rainbow as a color generates random rainbow colros
// count determines number of sparkles
// overlap allows sparkles to migrate… watch out for other dom elements though.
$(".sparkley:last").sparkleh({
color: "rainbow",
count: 100,
overlap: 10
});

// here we create fuscia sparkles
$("h1").sparkleh({
count: 80,
color: ["#ff0080","#ff0080","#0000FF"]
});

$("p").sparkleh({
count: 20,
color: "#00ff00",
speed: 0.05
});

// an array can be passed, too for colours
// for an image, the image needs to be fully loaded to set
// the canvas to it’s height/width.
// speed allows us to control… the … velocity
$("#image").imagesLoaded( function() {
$(".img").sparkleh({
count: 25,
color: ["#f3edc4","#253943","#659e3f"],
speed: 0.4
});
});

});

$.fn.sparkleh = function( options ) {

return this.each( function(k,v) {

var $this = $(v).css("position","relative");

var settings = $.extend({
width: $this.outerWidth(),
height: $this.outerHeight(),
color: "#FFFFFF",
count: 30,
overlap: 0,
speed: 1
}, options );

var sparkle = new Sparkle( $this, settings );

$this.on({
"mouseover focus" : function(e) {
sparkle.over();
},
"mouseout blur" : function(e) {
sparkle.out();
}
});

});

}

function Sparkle( $parent, options ) {
this.options = options;
this.init( $parent );
}

Sparkle.prototype = {

"init" : function( $parent ) {

var _this = this;

this.$canvas =
$("<canvas>")
.addClass("sparkle-canvas")
.css({
position: "absolute",
top: "-"+_this.options.overlap+"px",
left: "-"+_this.options.overlap+"px",
"pointer-events": "none"
})
.appendTo($parent);

this.canvas = this.$canvas[0];
this.context = this.canvas.getContext("2d");

this.sprite = new Image();
this.sprites = [0,6,13,20];
this.sprite.src = this.datauri;

this.canvas.width = this.options.width + ( this.options.overlap * 2);
this.canvas.height = this.options.height + ( this.options.overlap * 2);

this.particles = this.createSparkles( this.canvas.width , this.canvas.height );

this.anim = null;
this.fade = false;

},

"createSparkles" : function( w , h ) {

var holder = [];

for( var i = 0; i < this.options.count; i++ ) {

var color = this.options.color;

if( this.options.color == "rainbow" ) {
color = ‘#’+ (‘000000’ + Math.floor(Math.random()*16777215).toString(16)).slice(-6);
} else if( $.type(this.options.color) === "array" ) {
color = this.options.color[ Math.floor(Math.random()*this.options.color.length) ];
}

holder[i] = {
position: {
x: Math.floor(Math.random()*w),
y: Math.floor(Math.random()*h)
},
style: this.sprites[ Math.floor(Math.random()*4) ],
delta: {
x: Math.floor(Math.random() * 1000) – 500,
y: Math.floor(Math.random() * 1000) – 500
},
size: parseFloat((Math.random()*2).toFixed(2)),
color: color
};

}

return holder;

},

"draw" : function( time, fade ) {

var ctx = this.context;

ctx.clearRect( 0, 0, this.canvas.width, this.canvas.height );

for( var i = 0; i < this.options.count; i++ ) {

var derpicle = this.particles[i];
var modulus = Math.floor(Math.random()*7);

if( Math.floor(time) % modulus === 0 ) {
derpicle.style = this.sprites[ Math.floor(Math.random()*4) ];
}

ctx.save();
ctx.globalAlpha = derpicle.opacity;
ctx.drawImage(this.sprite, derpicle.style, 0, 7, 7, derpicle.position.x, derpicle.position.y, 7, 7);

if( this.options.color ) {

ctx.globalCompositeOperation = "source-atop";
ctx.globalAlpha = 0.5;
ctx.fillStyle = derpicle.color;
ctx.fillRect(derpicle.position.x, derpicle.position.y, 7, 7);

}

ctx.restore();

}

},

"update" : function() {

var _this = this;

this.anim = window.requestAnimationFrame( function(time) {

for( var i = 0; i < _this.options.count; i++ ) {

var u = _this.particles[i];

var randX = ( Math.random() > Math.random()*2 );
var randY = ( Math.random() > Math.random()*3 );

if( randX ) {
u.position.x += ((u.delta.x * _this.options.speed) / 1500);
}

if( !randY ) {
u.position.y -= ((u.delta.y * _this.options.speed) / 800);
}

if( u.position.x > _this.canvas.width ) {
u.position.x = -7;
} else if ( u.position.x < -7 ) {
u.position.x = _this.canvas.width;
}

if( u.position.y > _this.canvas.height ) {
u.position.y = -7;
u.position.x = Math.floor(Math.random()*_this.canvas.width);
} else if ( u.position.y < -7 ) {
u.position.y = _this.canvas.height;
u.position.x = Math.floor(Math.random()*_this.canvas.width);
}

if( _this.fade ) {
u.opacity -= 0.02;
} else {
u.opacity -= 0.005;
}

if( u.opacity <= 0 ) {
u.opacity = ( _this.fade ) ? 0 : 1;
}

}

_this.draw( time );

if( _this.fade ) {
_this.fadeCount -= 1;
if( _this.fadeCount < 0 ) {
window.cancelAnimationFrame( _this.anim );
} else {
_this.update();
}
} else {
_this.update();
}

});

},

"cancel" : function() {

this.fadeCount = 100;

},

"over" : function() {

window.cancelAnimationFrame( this.anim );

for( var i = 0; i < this.options.count; i++ ) {
this.particles[i].opacity = Math.random();
}

this.fade = false;
this.update();

},

"out" : function() {

this.fade = true;
this.cancel();

},

"datauri" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAHCAYAAAD5wDa1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNDNFMzM5REEyMkUxMUUzOEE3NEI3Q0U1QUIzMTc4NiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNDNFMzM5RUEyMkUxMUUzOEE3NEI3Q0U1QUIzMTc4NiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjM0M0UzMzlCQTIyRTExRTM4QTc0QjdDRTVBQjMxNzg2IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM0M0UzMzlDQTIyRTExRTM4QTc0QjdDRTVBQjMxNzg2Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+jzOsUQAAANhJREFUeNqsks0KhCAUhW/Sz6pFSc1AD9HL+OBFbdsVOKWLajH9EE7GFBEjOMxcUNHD8dxPBCEE/DKyLGMqraoqcd4j0ChpUmlBEGCFRBzH2dbj5JycJAn90CEpy1J2SK4apVSM4yiKonhePYwxMU2TaJrm8BpykpWmKQ3D8FbX9SOO4/tOhDEG0zRhGAZo2xaiKDLyPGeSyPM8sCxr868+WC/mvu9j13XBtm1ACME8z7AsC/R9r0fGOf+arOu6jUwS7l6tT/B+xo+aDFRo5BykHfav3/gSYAAtIdQ1IT0puAAAAABJRU5ErkJggg=="

};

// $(‘img.photo’,this).imagesLoaded(myFunction)
// execute a callback when all images have loaded.
// needed because .load() doesn’t work on cached images

// mit license. paul irish. 2010.
// webkit fix from Oren Solomianik. thx!

// callback function is passed the last image to load
// as an argument, and the collection as `this`

$.fn.imagesLoaded = function(callback){
var elems = this.filter(‘img’),
len = elems.length,
blank = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";

elems.bind(‘load.imgloaded’,function(){
if (–len <= 0 && this.src !== blank){
elems.unbind(‘load.imgloaded’);
callback.call(elems,this);
}
}).each(function(){
// cached images don’t fire load sometimes, so we reset src.
if (this.complete || this.complete === undefined){
var src = this.src;
// webkit hack from https://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f
// data uri bypasses webkit log warning (thx doug jones)
this.src = blank;
this.src = src;
}
});

return this;
};

[/code]

Add a little magic!

The post Sparkle Effect Using JQuery And Canvas appeared first on csshint - A designer hub.

]]>
Colorful CSS Underline Effects https://csshint.com/colorful-css-underline-effects/ Sun, 02 Aug 2020 16:01:55 +0000 http://csshint.com/?p=2991 CSS Link Underline effects : In this tutorial we’re going to show how to create Colorful CSS Underline Effects. This amazing effects designed by Jordan Marshall. The Html [code language=”html”] <p>Cool Underlines With CSS Gradients</p> <h1><span class="rainbow">Standard Rainbow</span></h1> <h1><span class="rainbow-energetic">Energetic Rainbow</span></h1> <h1><span class="tapered">This One is Tapered!</span></h1> <h1><span class="tapered2">This One Grows!</span></h1> <h1><span class="double">Double Underline</span></h1> <h1><span class="triple">Rare […]

The post Colorful CSS Underline Effects appeared first on csshint - A designer hub.

]]>
CSS Link Underline effects : In this tutorial we’re going to show how to create Colorful CSS Underline Effects. This amazing effects designed by Jordan Marshall.

Colorful CSS Underline Effects

Colorful CSS Underline Effects


The Html

[code language=”html”]
<p>Cool Underlines With CSS Gradients</p>

<h1><span class="rainbow">Standard Rainbow</span></h1>
<h1><span class="rainbow-energetic">Energetic Rainbow</span></h1>

<h1><span class="tapered">This One is Tapered!</span></h1>
<h1><span class="tapered2">This One Grows!</span></h1>

<h1><span class="double">Double Underline</span></h1>
<h1><span class="triple">Rare Triple Underline</span></h1>

<h1><span class="graph-paper">Graph Paper</span></h1>
<h1><span class="weave">Blue Weave</span></h1>

<h1><span class="green">Shades of Green</span></h1>
<h1><span class="purple">Shades of Purple</span></h1>

<h1><span class="purple-orange">Purple and Orange</span></h1>
<h1><span class="yellow-orange">Yellow to Orange</span></h1>

<footer>
Made with <a href="http://www.gradientmagic.com" target="_blank">Gradient Magic</a>, inspired by <a href="https://codepen.io/chriscoyier/pen/qBBMYYb" target="_blank">this pen</a>.
</footer>
[/code]

CSS / SCSS

[code language=”css”]
body {
font-weight: 900;
font-size: 36px;
font-family: system-ui, -apple-system, sans-serif;
letter-spacing: -1px;
padding: 0 0 2rem 2rem;
}

p {
margin-bottom: 4rem;
}

h1 {
margin-bottom: 3.5rem;
span {
background-size: 100% 15%;
background-repeat: repeat-x;
background-position: left 0% bottom 10%;
}
}

.rainbow {
background-image: linear-gradient(90deg, hsl(284,91%,69%) 0%, hsl(284,91%,69%) 12.5%,hsl(329,91%,69%) 12.5%, hsl(329,91%,69%) 25%,hsl(14,91%,69%) 25%, hsl(14,91%,69%) 37.5%,hsl(59,91%,69%) 37.5%, hsl(59,91%,69%) 50%,hsl(104,91%,69%) 50%, hsl(104,91%,69%) 62.5%,hsl(149,91%,69%) 62.5%, hsl(149,91%,69%) 75%,hsl(194,91%,69%) 75%, hsl(194,91%,69%) 87.5%,hsl(239,91%,69%) 87.5%, hsl(239,91%,69%) 100%);
}

.rainbow-energetic {
background-image: repeating-linear-gradient(135deg, hsl(46,80%,67%) 0px, hsl(46,80%,67%) 14px,hsl(91,80%,67%) 14px, hsl(91,80%,67%) 28px,hsl(136,80%,67%) 28px, hsl(136,80%,67%) 42px,hsl(181,80%,67%) 42px, hsl(181,80%,67%) 56px,hsl(226,80%,67%) 56px, hsl(226,80%,67%) 70px,hsl(271,80%,67%) 70px, hsl(271,80%,67%) 84px,hsl(316,80%,67%) 84px, hsl(316,80%,67%) 98px,hsl(1,80%,67%) 98px, hsl(1,80%,67%) 112px);
}

.tapered {
background-image: linear-gradient(179deg,rgb(254, 97, 158) 0%, rgb(254, 97, 158) 50%,transparent 54%, transparent 100%);
}

.tapered2 {
background-image: linear-gradient(181deg, #ffa620 0%, #fba11a 50%, transparent 54%, transparent 100%);
}

.double {
background-image: repeating-linear-gradient(0deg, rgb(246, 96, 94) 0px, rgb(246, 96, 94) 4px,transparent 4px, transparent 8px,rgb(249, 139, 40) 8px, rgb(249, 139, 40) 12px,transparent 12px, transparent 16px),linear-gradient(90deg, #FFF,#FFF);
}

.triple {
background-image: repeating-linear-gradient(0deg, rgb(42, 166, 224) 0px, rgb(42, 166, 224) 4px,transparent 4px, transparent 8px,rgb(48, 200, 159) 8px, rgb(48, 200, 159) 12px,transparent 12px, transparent 16px,rgb(53, 234, 94) 16px, rgb(53, 234, 94) 20px,transparent 20px, transparent 24px),linear-gradient(90deg, #FFF,#FFF);
background-size: 100% 24%;
background-position: 100% 98%;
}

.graph-paper {
background-image: repeating-linear-gradient(0deg, hsl(144,66%,90%) 0px, hsl(144,66%,90%) 2px,transparent 2px, transparent 7px),repeating-linear-gradient(90deg, hsl(144,66%,90%) 0px, hsl(144,66%,90%) 2px,transparent 2px, transparent 7px),linear-gradient(90deg, hsl(218,79%,50%),hsl(218,79%,50%));
}

.weave {
background-image: repeating-linear-gradient(135deg, rgb(99, 171, 222) 0px, rgb(99, 171, 222) 7px,transparent 7px, transparent 14px),repeating-linear-gradient(45deg, rgb(38, 95, 221) 0px, rgb(38, 95, 221) 7px,transparent 7px, transparent 14px),repeating-linear-gradient(135deg, #FFF 0px, #FFF 7px,#FFF 7px, #FFF 14px);
}

.green {
background-image: repeating-linear-gradient(90deg, rgb(79, 191, 86) 0px, rgb(79, 191, 86) 16px,rgb(59, 180, 83) 16px, rgb(59, 180, 83) 32px,rgb(30, 162, 80) 32px, rgb(30, 162, 80) 48px,rgb(40, 168, 81) 48px, rgb(40, 168, 81) 64px,rgb(88, 197, 87) 64px, rgb(88, 197, 87) 80px,rgb(98, 203, 88) 80px, rgb(98, 203, 88) 96px,rgb(49, 174, 82) 96px, rgb(49, 174, 82) 112px,rgb(69, 185, 85) 112px, rgb(69, 185, 85) 128px)
}

.purple {
background-image: repeating-linear-gradient(135deg, rgb(180, 96, 226) 0px, rgb(180, 96, 226) 45px,rgb(196, 124, 232) 45px, rgb(196, 124, 232) 76px,rgb(165, 69, 221) 76px, rgb(165, 69, 221) 114px,rgb(211, 151, 237) 114px, rgb(211, 151, 237) 127px,rgb(242, 206, 248) 127px, rgb(242, 206, 248) 139px,rgb(227, 179, 243) 139px, rgb(227, 179, 243) 170px);
}

.purple-orange {
background-image: linear-gradient(90deg, rgb(246, 137, 24) 0%, rgb(246, 137, 24) 31%,rgb(174, 62, 159) 31%, rgb(174, 62, 159) 42%,rgb(210, 100, 92) 42%, rgb(210, 100, 92) 49%,rgb(138, 25, 227) 49%, rgb(138, 25, 227) 100%);
}

.yellow-orange {
background-image: linear-gradient(90deg, rgb(218, 230, 1) 0%, rgb(218, 230, 1) 7%,rgb(226, 203, 7) 7%, rgb(226, 203, 7) 14%,rgb(234, 176, 13) 14%, rgb(234, 176, 13) 21%,rgb(242, 148, 18) 21%, rgb(242, 148, 18) 28%,rgb(250, 121, 24) 28%, rgb(250, 121, 24) 100%);
background-size: 100% 18%;
}

footer {
font-size: 24px;
font-weight: 500;
a {
color: #007bff;
text-decoration: none;
}
}
[/code]

Cool CSS Underline Effects

The post Colorful CSS Underline Effects appeared first on csshint - A designer hub.

]]>