-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
68 lines (52 loc) · 2.18 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="https://helpme.vodka/r/jscolor.min.js"></script>
<script>
$(document).ready(function() {
$("button").click(function() {
WebFontConfig = {
google: {
families: [$("input").val().split(' ').join('+') + '::latin']
}
};
(function() {
var wf = document.createElement('script');
wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
$('body').append(" <style type='text/css'>" +
" .cssClass {" +
" font-family: " + $('#fontfam').val() + "!important;" +
" text-shadow: " + $('#fontshadow').val() + "!important;" +
" background-color: " + $('#fontbackground').val() + "!important;" +
" font-weight: " + $('#fontweight').val() + "!important;" +
" color: #" + $('#fontcolor').val() + "!important;" +
" }" +
" </style>"
);
});
});
</script>
</head>
<body>
<p class="cssClass">Cool Text Style</p>
<p>
Font Family:
<input id="fontfam" value="Special Elite">
<br><br> Font Color:
<input id="fontcolor" class="jscolor" value="FFEC00">
<br><br> Font Weight:
<input id="fontweight" value="900">
<br><br> Background Color:
<input id="fontbackground" value="transparent" title="Set to transparent for no background">
<br><br> Text Shadow:
<input id="fontshadow" value="rgba(34, 34, 34, 0.498039) 0px 0px 4px"> <a href="http://css3gen.com/text-shadow/" target="_blank">help?</a>
</p>
<button>Change Style!</button>
</body>
</html>