-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
144 lines (124 loc) · 3.01 KB
/
index.js
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
$("#cosmic2").click(function(){
logo = $("#cosmic2").attr('src','https://media4.giphy.com/media/eNAsjO55tPbgaor7ma/giphy.gif').css({
width: '17%',
height:'9%',
position:'absolute',
top:'0%',
left: '63%',
})
});
$(document).ready(function(){
$("#container-here").daisyjs({
dotColor: 'cyan',
lineColor: 'grey'
});
});
$("#cosmic").click(function(){
logo = $("#cosmic").attr('src','https://media4.giphy.com/media/eNAsjO55tPbgaor7ma/giphy.gif').css({
width: '10%',
height:'15%',
position:'absolute',
top:'0%',
left: '21.5%'
})
});
function update()
{
let idoc = document.getElementById('iframe').contentWindow.document;
idoc.open();
idoc.write(editor.getValue());
idoc.close();
}
function setupEditor()
{
window.editor = ace.edit("editor");
theme = editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/html");
editor.setValue(`<!DOCTYPE html>
<!--Made By FonderElite
GitHub:https://github.com/FonderElite-->
<html>
<head>
<style>
</style>
</head>
<body>
</body>
</html>`,1); //1 = moves cursor to end
editor.getSession().on('change', function() {
update();
});
editor.focus();
editor.setOptions({
fontSize: "12pt",
showLineNumbers: false,
showGutter: false,
vScrollBarAlwaysVisible:true,
enableBasicAutocompletion: false, enableLiveAutocompletion: false
});
editor.setShowPrintMargin(true);
editor.setBehavioursEnabled(false);
}
setupEditor();
update();
const changeTheme = $("#chtheme").click(function(){
const codeThemes = ['monokai','cobalt','gob','terminal','chaos','ambiance','idle_fingers','iplastic'];
let randomizedTheme = parseInt(Math.random() * codeThemes.length);
// alert(randomizedTheme);
switch(randomizedTheme){
case 0:
editor.setTheme(`ace/theme/${codeThemes[0]}`);
break;
case 1:
editor.setTheme(`ace/theme/${codeThemes[1]}`);
break;
case 2:
editor.setTheme(`ace/theme/${codeThemes[2]}`);
break;
case 3:
editor.setTheme(`ace/theme/${codeThemes[3]}`);
break;
case 4:
editor.setTheme(`ace/theme/${codeThemes[4]}`);
break;
case 5:
editor.setTheme(`ace/theme/${codeThemes[5]}`);
break;
case 6:
editor.setTheme(`ace/theme/${codeThemes[6]}`);
break;
case 7:
editor.setTheme(`ace/theme/${codeThemes[7]}`);
break;
}
});
/*
const changeTheme = $("#chtheme").click(function(){
const codeThemes = ['monokai','cobalt','gob','terminal','chaos','ambiance','idle_fingers','iplastic'];
codeThemes.forEach(item =>{
})
})
*/
const mobileHamburger = $('#hamburger').click(function(){
let cover = $('#cover').slideToggle(1000);
let ul = $('ul');
ul.slideToggle(400);
first = $('#firstli').css({
backgroundColor: '#388E8E'
})
second = $('#secondli').css({
backgroundColor: '#2F4F4F'
})
third = $('#thirdli').css({
backgroundColor: '#2F4F4F'
})
fourth = $('#fourthli').css({
backgroundColor: '#2F4F4F'
})
let list = [
first,
second,
third,
fourth
]
})