INTRODUCING
Source Code
Creating documentation sites or other pages that requires to display source codes? Here you go!
Design 1
CSS
.happy-addon,
.happy-addon * {
box-sizing: border-box
}
.happy-addon img {
max-width: 100%;
height: auto;
-o-object-fit: cover;
object-fit: cover
}
.happy-addon p:empty {
display: none
}
.ha-screen-reader-text {
position: absolute;
overflow: hidden;
clip: rect(1px, 1px, 1px, 1px);
margin: -1px;
padding: 0;
width: 1px;
height: 1px;
border: 0;
word-wrap: normal!important;
-webkit-clip-path: inset(50%);
clip-path: inset(50%)
}
.ha-has-background-overlay>.elementor-widget-container {
position: relative;
z-index: 1
}
.ha-has-background-overlay>.elementor-widget-container:before {
position: absolute;
top: 0;
left: 0;
z-index: -1;
width: 100%;
height: 100%;
content: ""
}
.ha-btn {
display: inline-block;
vertical-align: middle;
text-align: center;
text-decoration: none;
font-size: 14px;
line-height: 1;
-webkit-transition: all .3s;
transition: all .3s
}
.ha-btn:not(.ha-btn--link) {
padding: 15px 25px;
border-radius: .25rem;
background-color: #562dd4;
color: #fff
}
.ha-btn:not(.ha-btn--link):focus,
.ha-btn:not(.ha-btn--link):hover {
background-color: #e2498a
}
.ha-btn.ha-btn--link {
color: #562dd4
}
.ha-btn.ha-btn--link:focus,
.ha-btn.ha-btn--link:hover {
color: #e2498a
}
.ha-btn-icon {
-webkit-transition: all .3s;
transition: all .3s
}
.ha-btn-icon+.ha-btn-text,
.ha-btn-text+.ha-btn-icon {
margin-left: 5px
}
Design 2
HTML Markup
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="description" content="">
<meta name="author" content="HappyAddons Team">
<!--favicon icon-->
<link rel="icon" type="image/png" href="assets/img/favicon.png">
<title>Happy Addons</title>
<!--common style-->
<link href="assets/vendor/bs/css/bootstrap.min.css" rel="stylesheet">
<!--custom css-->
<link href="assets/css/main.css" rel="stylesheet">
</head>
<body>
<header class="header">
<div class="container">
<div class="row">
<div class="col-md-12">
....
</div>
</div>
</div>
</header>
<main>
<div class="container">
<div class="row">
<div class="col-md-12">
....
</div>
</div>
</div>
</main>
<footer class="footer">
<div class="container">
<div class="row">
<div class="col-md-12">
....
</div>
</div>
</div>
</footer>
<script src="assets/vendor/jquery-1.10.2.min.js"></script>
<script src="assets/vendor/bs/js/bootstrap.min.js"></script>
<!--init scripts-->
<script src="assets/js/scripts.min.js"></script>
</body>
</html>
Design 3
Javascript
$('.toggle').on('click', function() {
$('.container').stop().addClass('active');
});
$('.close').on('click', function() {
$('.container').stop().removeClass('active');
});
$('.toggle').on('click', function() {
$('.container').stop().addClass('active');
});
$('.close').on('click', function() {
$('.container').stop().removeClass('active');
});$('.toggle').on('click', function() {
$('.container').stop().addClass('active');
});
$('.close').on('click', function() {
$('.container').stop().removeClass('active');
});
Design 4
Php
<?php
$favcolor = "red";
switch ($favcolor) {
case "red":
echo "Your favorite color is red!";
break;
case "blue":
echo "Your favorite color is blue!";
break;
case "green":
echo "Your favorite color is green!";
break;
default:
echo "Your favorite color is neither red, blue, nor green!";
}
?>
Design 5
Python
# Iterator for next power of two.
class NextPowTwo:
def __init__(self, max_ele = 0):
self.max_ele = max_ele
def __iter__(self):
self.n = 0
return self
def __next__(self):
if self.n <= self.max_ele:
result = 2 ** self.n
self.n += 1
return result
else:
raise StopIteration
if __name__ == '__main__':
it = iter(NextPowTwo(20))
print (next(it)) # prints '1'
print (next(it)) # prints '2'
print (next(it)) # prints '4'
print (next(it)) # prints '8'
Design 6
SCSS
.ha-card {
word-wrap: break-word;
overflow-wrap: break-word;
background-color: #fff;
border-radius: .5rem;
&-figure {
position: relative;
}
&-img {
width: 100%;
border-top-left-radius: calc(.5rem - 1px);
border-top-right-radius: calc(.5rem - 1px);
object-fit: cover;
}
}
.ha-label {
background-color: #fff;
padding: .475rem 1.1rem;
border-radius: 50px;
position: absolute;
font-size: 14px;
font-weight: bold;
&--top-left {
left: 1rem;
top: 1rem;
}
&--top-center {
left: 50%;
transform: translateX(-50%);
top: 1rem;
}
&--top-right {
right: 1rem;
top: 1rem;
}
&--middle-left {
top: 50%;
transform: translateY(-50%);
left: 1rem;
}
&--middle-center {
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
}
&--middle-right {
top: 50%;
transform: translateY(-50%);
right: 1rem;
}
&--bottom-left {
left: 1rem;
bottom: 1rem;
}
&--bottom-center {
left: 50%;
transform: translateX(-50%);
bottom: 1rem;
}
&--bottom-right {
right: 1rem;
bottom: 1rem;
}
}
.ha-card {
&-body {
padding: 1.5rem;
}
&-title {
margin-top: 0;
margin-bottom: .75rem;
color: #151515;
font-size: 24px;
}
&-text {
margin-bottom: 2rem;
color: #616161;
font-size: 16px;
line-height: 1.7;
> p {
margin-top: 0;
margin-bottom: 0;
}
}
&-btn {
background-color: #8c8c8c;
color: #fff;
text-decoration: none;
padding: .575rem 1.3rem;
line-height: 1.5;
border-radius: .25rem;
text-align: center;
vertical-align: middle;
display: inline-block;
font-size: 14px;
font-weight: bold;
transition: all .3s;
&:hover,
&:focus {
background-color: #242424;
}
&--block {
display: block;
}
}
}
Design 7
Ruby
# & is the intersection operator
puts [1,2,3] & [3,4,5] # prints 3
# + is the addition operator
puts [1,2,3]+ [3,4,5] # prints 1,2,3,3,4,5
# - removes items from the first array that appear in the second
puts [1,2,3] - [3,4,5] # prints 1,2
# pop returns the last element and removes it from the array
alpha = ["a","b","c","d","e","f"]
puts "pop="+alpha.pop # pop=f
puts alpha.inspect # ["a", "b", "c", "d", "e"]
# push appends elements to the end of an array
alpha = ["a","b","c"]
alpha.push("x","y","z")
puts alpha.inspect # ["a", "b", "c", "x", "y", "z"]
# shift returns the first element and removes it from the array
alpha = ["a","b","c","d","e","f"]
puts "shift="+alpha.shift # shift=a
puts alpha.inspect # ["b", "c", "d", "e", "f"]
# unshift appends elements to the beginning of an array
alpha = ["a","b","c"]
alpha.unshift("x","y","z")
puts alpha.inspect # ["x", "y", "z", "a", "b", "c"]
Design 8
Ruby
# & is the intersection operator
puts [1,2,3] & [3,4,5] # prints 3
# + is the addition operator
puts [1,2,3]+ [3,4,5] # prints 1,2,3,3,4,5
# - removes items from the first array that appear in the second
puts [1,2,3] - [3,4,5] # prints 1,2
# pop returns the last element and removes it from the array
alpha = ["a","b","c","d","e","f"]
puts "pop="+alpha.pop # pop=f
puts alpha.inspect # ["a", "b", "c", "d", "e"]
# push appends elements to the end of an array
alpha = ["a","b","c"]
alpha.push("x","y","z")
puts alpha.inspect # ["a", "b", "c", "x", "y", "z"]
# shift returns the first element and removes it from the array
alpha = ["a","b","c","d","e","f"]
puts "shift="+alpha.shift # shift=a
puts alpha.inspect # ["b", "c", "d", "e", "f"]
# unshift appends elements to the beginning of an array
alpha = ["a","b","c"]
alpha.unshift("x","y","z")
puts alpha.inspect # ["x", "y", "z", "a", "b", "c"]
Design 9
Custom Theme
# & is the intersection operator
puts [1,2,3] & [3,4,5] # prints 3
# + is the addition operator
puts [1,2,3]+ [3,4,5] # prints 1,2,3,3,4,5
# - removes items from the first array that appear in the second
puts [1,2,3] - [3,4,5] # prints 1,2
# pop returns the last element and removes it from the array
alpha = ["a","b","c","d","e","f"]
puts "pop="+alpha.pop # pop=f
puts alpha.inspect # ["a", "b", "c", "d", "e"]
# push appends elements to the end of an array
alpha = ["a","b","c"]
alpha.push("x","y","z")
puts alpha.inspect # ["a", "b", "c", "x", "y", "z"]
# shift returns the first element and removes it from the array
alpha = ["a","b","c","d","e","f"]
puts "shift="+alpha.shift # shift=a
puts alpha.inspect # ["b", "c", "d", "e", "f"]
# unshift appends elements to the beginning of an array
alpha = ["a","b","c"]
alpha.unshift("x","y","z")
puts alpha.inspect # ["x", "y", "z", "a", "b", "c"]