Skip to content

Commit fb97608

Browse files
committed
homepage at a certain point
1 parent 0e0c050 commit fb97608

File tree

3 files changed

+66
-6
lines changed

3 files changed

+66
-6
lines changed

homepage-assets/homepage.js

+26-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
var baseURL = "https://raw.githubusercontent.com/theanam/css-only-loaders/master/spinners/";
2-
3-
2+
var base_css = "";
43
function getDefination(cssClass,callback){
54
$.get(`${baseURL}/${cssClass}/${cssClass}.css`)
65
.then(data=>{
@@ -11,11 +10,35 @@ function getDefination(cssClass,callback){
1110
});
1211
}
1312

13+
function prepareSourceCode(data){
14+
console.log(data);
15+
$(".sourceholder").css("display","flex");
16+
$(".actual-code").text(base_css + "\n\n" + data);
17+
}
18+
1419
$(".spinner,.ripple").on("click",function(e){
1520
var classes = $(this).attr("class");
1621
var defName = classes.split(" ")[1];
1722
if(!defName) return console.log("Defination class missing");
1823
getDefination(defName,function(data){
19-
console.log(data);
24+
prepareSourceCode(data);
2025
});
26+
});
27+
28+
$(".source").on("click",function(e){
29+
e.stopPropagation();
30+
});
31+
32+
$(".sourceholder").on("click",function(){
33+
$(this).css("display","none");
34+
});
35+
36+
$(function(){
37+
$.get(`${baseURL}/vars.css`)
38+
.then(data=>{
39+
base_css = data;
40+
})
41+
.catch(e=>{
42+
console.log("Failed to load base CSS");
43+
})
2144
})

homepage-assets/style.css

+31
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,35 @@
11
.spinner,.ripple{
22
display: inline-block;
33
margin: 100px;
4+
cursor: pointer;
5+
background: #fff;
6+
}
7+
8+
.sourceholder{
9+
width:100%;
10+
height:100%;
11+
left:0px;
12+
top:0px;
13+
position: fixed;
14+
background: rgba(0,0,0,0.2);
15+
display: none;
16+
z-index: 10000;
17+
align-items: center;
18+
justify-content: center;
19+
}
20+
.source{
21+
width:70vw;
22+
height:70vh;
23+
background: #222;
24+
padding:20px;
25+
z-index: 30000;
26+
border-radius:4px;
27+
overflow:scroll;
28+
}
29+
.actual-code{
30+
z-index:800000000;
31+
font-size: 12px;
32+
color: #fff;
33+
display: block;
34+
overflow: scroll;
435
}

index.html

+9-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<meta http-equiv="X-UA-Compatible" content="ie=edge">
77
<title>CSS Only Loaders</title>
88
<link rel="stylesheet" href="homepage-assets/style.css">
9-
<link rel="stylesheet" href="homepage-assets/prism.css">
109
<!-- spinners -->
1110
<link rel="stylesheet" href="spinners/vars.css">
1211
<link rel="stylesheet" href="spinners/circle/circle.css">
@@ -17,7 +16,10 @@
1716
<link rel="stylesheet" href="spinners/color-pulse-ball/color-pulse-ball.css">
1817
</head>
1918
<body>
20-
<h1>This is just a sample page, Homepage is under construction</h1>
19+
<h1>Click on the Spinners to see CSS Styles</h1>
20+
<p>
21+
Homepage Under construction
22+
</p>
2123
<div class="spinner circle"></div>
2224
<div class="spinner blasting-circle"></div>
2325
<div class="spinner rotating-plane"></div>
@@ -32,8 +34,12 @@ <h1>This is just a sample page, Homepage is under construction</h1>
3234
All the attributes are in the <code>/spinners/values.css</code> file. you need to include that file before the spinner CSS file.
3335
see the source code to this file <code>/index.html</code> for example usage.
3436
</p>
37+
<div class="sourceholder">
38+
<pre class="source">
39+
<code class="actual-code"></code>
40+
</pre>
41+
</div>
3542
<script src="homepage-assets/jquery-3.4.1.min.js"></script>
36-
<script src="homepage-assets/prism.js"></script>
3743
<script src="homepage-assets/homepage.js"></script>
3844
</body>
3945
</html>

0 commit comments

Comments
 (0)