louismichel commited on
Commit
bd6f239
1 Parent(s): ca716cd

Upload static with huggingface_hub

Browse files
Files changed (3) hide show
  1. static/ks.png +3 -0
  2. static/script.js +134 -0
  3. static/style.css +210 -0
static/ks.png ADDED

Git LFS Details

  • SHA256: 24604a920530b5aa58b14b40a02619278acb98cd384872df9f7da05df66b1649
  • Pointer size: 132 Bytes
  • Size of remote file: 4.09 MB
static/script.js ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ var i = 0,
3
+ minimizedWidth = new Array,
4
+ minimizedHeight = new Array,
5
+ windowTopPos = new Array,
6
+ windowLeftPos = new Array,
7
+ panel,
8
+ id;
9
+
10
+ function adjustFullScreenSize() {
11
+ $(".fullSizeWindow .wincontent").css("width", (window.innerWidth - 32));
12
+ $(".fullSizeWindow .wincontent").css("height", (window.innerHeight - 98));
13
+ }
14
+ function makeWindowActive(thisid) {
15
+ $(".window").each(function() {
16
+ $(this).css('z-index', $(this).css('z-index') - 1);
17
+ });
18
+ $("#window" + thisid).css('z-index',1000);
19
+ $(".window").removeClass("activeWindow");
20
+ $("#window" + thisid).addClass("activeWindow");
21
+
22
+ $(".taskbarPanel").removeClass('activeTab');
23
+
24
+ $("#minimPanel" + thisid).addClass("activeTab");
25
+ }
26
+
27
+ function minimizeWindow(id){
28
+ windowTopPos[id] = $("#window" + id).css("top");
29
+ windowLeftPos[id] = $("#window" + id).css("left");
30
+
31
+ $("#window" + id).animate({
32
+ top: 800,
33
+ left: 0
34
+ }, 200, function() { //animation complete
35
+ $("#window" + id).addClass('minimizedWindow');
36
+ $("#minimPanel" + id).addClass('minimizedTab');
37
+ $("#minimPanel" + id).removeClass('activeTab');
38
+ });
39
+ }
40
+
41
+ function openWindow(id) {
42
+ if ($('#window' + id).hasClass("minimizedWindow")) {
43
+ openMinimized(id);
44
+ } else {
45
+ makeWindowActive(id);
46
+ $("#window" + id).removeClass("closed");
47
+ $("#minimPanel" + id).removeClass("closed");
48
+ }
49
+ }
50
+ function closeWindwow(id) {
51
+ $("#window" + id).addClass("closed");
52
+ $("#minimPanel" + id).addClass("closed");
53
+ }
54
+
55
+ function openMinimized(id) {
56
+ $('#window' + id).removeClass("minimizedWindow");
57
+ $('#minimPanel' + id).removeClass("minimizedTab");
58
+ makeWindowActive(id);
59
+
60
+ $('#window' + id).animate({
61
+ top: windowTopPos[id],
62
+ left: windowLeftPos[id]
63
+ }, 200, function() {
64
+ });
65
+ }
66
+
67
+ $(document).ready(function(){
68
+ $(".window").each(function() { // window
69
+ $(this).css('z-index',1000)
70
+ $(this).attr('data-id', i);
71
+ minimizedWidth[i] = $(this).width();
72
+ minimizedHeight[i] = $(this).height();
73
+ windowTopPos[i] = $(this).css("top");
74
+ windowLeftPos[i] = $(this).css("left");
75
+ $("#taskbar").append('<div class="taskbarPanel" id="minimPanel' + i + '" data-id="' + i + '">' + $(this).attr("data-title") + '</div>');
76
+ if ($(this).hasClass("closed")) { $("#minimPanel" + i).addClass('closed'); }
77
+ $(this).attr('id', 'window' + (i++));
78
+ $(this).wrapInner('<div class="wincontent"></div>');
79
+ $(this).prepend('<div class="windowHeader"><strong>' + $(this).attr("data-title") + '</strong><span title="Minimize" class="winminimize"><span></span></span><span title="Maximize" class="winmaximize"><span></span><span></span></span><span title="Close" class="winclose">x</span></div>');
80
+ });
81
+
82
+ $("#minimPanel" + (i-1)).addClass('activeTab');
83
+ $("#window" + (i-1)).addClass('activeWindow');
84
+
85
+ $( ".wincontent" ).resizable(); // resizable
86
+ $( ".window" ).draggable({ cancel: ".wincontent" }); // draggable
87
+
88
+
89
+ $(".window").mousedown(function(){ // active window on top (z-index 1000)
90
+ makeWindowActive($(this).attr("data-id"));
91
+ });
92
+
93
+ $(".winclose").click(function(){ // close window
94
+ closeWindwow($(this).parent().parent().attr("data-id"));
95
+ });
96
+
97
+ $(".winminimize").click(function(){ // minimize window
98
+ minimizeWindow($(this).parent().parent().attr("data-id"));
99
+ });
100
+
101
+ $(".taskbarPanel").click(function(){ // taskbar click
102
+ id = $(this).attr("data-id");
103
+ if ($(this).hasClass("activeTab")) { // minimize if active
104
+ minimizeWindow($(this).attr("data-id"));
105
+ } else {
106
+ if ($(this).hasClass("minimizedTab")) { // open if minimized
107
+ openMinimized(id);
108
+ } else { // activate if inactive
109
+ makeWindowActive(id);
110
+ }
111
+ }
112
+ });
113
+
114
+ $(".openWindow").click(function(){ // open closed window
115
+ openWindow($(this).attr("data-id"));
116
+ });
117
+
118
+ $(".winmaximize").click(function(){
119
+ if ($(this).parent().parent().hasClass('fullSizeWindow')) { // minimize
120
+
121
+ $(this).parent().parent().removeClass('fullSizeWindow');
122
+ $(this).parent().parent().children(".wincontent").height(minimizedHeight[$(this).parent().parent().attr("data-id")]);
123
+ $(this).parent().parent().children(".wincontent").width(minimizedWidth[$(this).parent().parent().attr("data-id")]);
124
+ } else { // maximize
125
+ $(this).parent().parent().addClass('fullSizeWindow');
126
+
127
+ minimizedHeight[$(this).parent().parent().attr('data-id')] = $(this).parent().parent().children(".wincontent").height();
128
+ minimizedWidth[$(this).parent().parent().attr('data-id')] = $(this).parent().parent().children(".wincontent").width();
129
+
130
+ adjustFullScreenSize();
131
+ }
132
+ });
133
+ adjustFullScreenSize();
134
+ });
static/style.css ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,abbr,address,cite,code,del,dfn,em,img,ins,kbd,q,samp,small,strong,sub,sup,var,b,i,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}
2
+ body{line-height:1}
3
+ h1 {font-size: 1.5em;margin-bottom: 10px;}
4
+ p{font-size: 1em;line-height: 1.3em;margin-bottom: 10px;}
5
+ article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}
6
+ nav ul{list-style:none}
7
+ blockquote,q{quotes:none}
8
+ blockquote:before,blockquote:after,q:before,q:after{content:none}
9
+ a{margin:0;padding:0;font-size:100%;vertical-align:baseline;background:transparent}
10
+ ins{background-color:#ff9;color:#000;text-decoration:none}
11
+ mark{background-color:#ff9;color:#000;font-style:italic;font-weight:bold}
12
+ del{text-decoration:line-through}
13
+ abbr[title],dfn[title]{border-bottom:1px dotted;cursor:help}
14
+ table{border-collapse:collapse;border-spacing:0}
15
+ hr{display:block;height:1px;border:0;border-top:1px solid #ccc;margin:1em 0;padding:0}
16
+ input,select{vertical-align:middle}
17
+
18
+ #desktop {
19
+ font-family: Arial, Helvetica, sans-serif;
20
+ position: fixed;
21
+ height: 100%;
22
+ width: 100%;
23
+ background: #CCC;
24
+ overflow: hidden;
25
+ top: 0;
26
+ bottom: 0;
27
+ left: 0;
28
+ right: 0;
29
+ }
30
+ .window {
31
+ position: absolute;
32
+ border: 2px solid #000;
33
+ background: #EEE;
34
+ border-radius: 5px;
35
+ z-index: 1000;
36
+ }
37
+ .window.closed {
38
+ display: none;
39
+ }
40
+ .window.minimizedWindow {
41
+ display: none;
42
+ }
43
+ .window.fullSizeWindow {
44
+ top: 0 !important;
45
+ right: 0 !important;
46
+ left: 0 !important;
47
+ border-radius: 0;
48
+ bottom: 32px !important;
49
+ }
50
+ .fullSizeWindow .ui-resizable-handle {
51
+ display: none;
52
+ }
53
+ .windowHeader {
54
+ background-color: #b7b7e0;
55
+ text-align: right;
56
+ border-bottom: 2px solid #000;
57
+ padding: 2px;
58
+ cursor: move;
59
+ height: 28px;
60
+ }
61
+ .activeWindow .windowHeader {
62
+ background-color: #8888d6;
63
+ }
64
+ .windowHeader > span {
65
+ display: inline-block;
66
+ cursor: pointer;
67
+ border: 2px solid #000;
68
+ margin-left: 4px;
69
+ font-size: 19px;
70
+ padding: 2px 10px;
71
+ font-family: "Arial Black", Gadget, sans-serif;
72
+ border-radius: 5px;
73
+ line-height: 20px;
74
+ width: 12px;
75
+ height: 20px;
76
+ position: relative;
77
+ overflow: hidden;
78
+ }
79
+ .windowHeader > span:hover {
80
+ background: rgba(255,255,255,0.3);
81
+ }
82
+ .windowHeader > span.winclose:hover {
83
+ background: #f15454;
84
+ }
85
+ .windowHeader > span > span {
86
+ display: inline-block;
87
+ height: 8px;
88
+ width: 10px;
89
+ position: absolute;
90
+ top: 6px;
91
+ left: 10px;
92
+ }
93
+ .winminimize > span {
94
+ border-bottom: 3px solid #000;
95
+ }
96
+ .winmaximize > span {
97
+ border: 2px solid #000;
98
+ border-top: 3px solid #000;
99
+ }
100
+ .winmaximize > span:nth-child(2) {
101
+ display: none;
102
+ }
103
+ .fullSizeWindow .winmaximize > span:nth-child(1) {
104
+ margin: 2px 0 0 -4px;
105
+ }
106
+ .fullSizeWindow .winmaximize > span:nth-child(2) {
107
+ display: inline-block;
108
+ top: 3px;
109
+ left: 12px;
110
+ }
111
+ .wincontent {
112
+ padding: 10px;
113
+ min-width: 200px;
114
+ min-height: 140px;
115
+ border: 2px solid #000;
116
+ margin: 2px;
117
+ border-radius: 0 0 5px 5px;
118
+ }
119
+ .windowHeader > strong {
120
+ float: left;
121
+ margin: 0px 3px 0 10px;
122
+ line-height: 29px;
123
+ font-size: 17px;
124
+ }
125
+ .taskbarPanel {
126
+ display: inline-block;
127
+ border: 2px solid #000;
128
+ border-radius: 5px;
129
+ line-height: 24px;
130
+ margin: 2px 0 0 10px;
131
+ font-size: 17px;
132
+ padding: 0 10px;
133
+ background: #CCC;
134
+ font-weight: bold;
135
+ cursor: pointer;
136
+ }
137
+ .taskbarPanel.activeTab {
138
+ background: #FFF;
139
+ }
140
+ .taskbarPanel.minimizedTab {
141
+ background: #AAA;
142
+ }
143
+ .taskbarPanel.minimizedTab:hover {
144
+ background: #DDD;
145
+ }
146
+ .taskbarPanel.closed {
147
+ display: none;
148
+ }
149
+ #taskbar {
150
+ position: absolute;
151
+ height: 32px;
152
+ border-top: 2px solid #000;
153
+ bottom: 0;
154
+ left: 0;
155
+ right: 0;
156
+ background: #EEE;
157
+ }
158
+ #icons {
159
+ position: absolute;
160
+ z-index: 10;
161
+ top: 20px;
162
+ left: 20px;
163
+ }
164
+ #icons a {
165
+ display: block;
166
+ cursor: pointer;
167
+ padding: 2px 10px;
168
+ }
169
+ #icons a:hover {
170
+ background: #000;
171
+ color: #FFF;
172
+ }
173
+ #templateLink {
174
+ position: absolute;
175
+ display: inline-block;
176
+ bottom: 10px;
177
+ right: 20px;
178
+ font-weight: bold;
179
+ font-size: 15px;
180
+ color: #30478c;
181
+ }
182
+
183
+ /*Demo styles BEGIN*/
184
+ #window0 { top: 20px; left: 240px;}
185
+ #window1 { top: 400px; left: 120px;}
186
+ #window2 { top: 250px; left: 300px;}
187
+ #window3 { top: 125px; left: 420px;}
188
+ #window0 .wincontent { width: 660px; height: 400px; }
189
+ #window1 .wincontent { width: 500px; height: 300px; }
190
+ #window2 .wincontent { width: 400px; height: 350px; }
191
+ #window3 .wincontent { width: 400px; height: 350px; }
192
+ @media screen and (max-width:960px){
193
+ #window0 { left: 10px; }
194
+ #window3 { left: 50px; }
195
+ }
196
+ @media screen and (max-width:770px){
197
+ #window0 .wincontent { width: 460px; }
198
+ #window2 { left: 100px; }
199
+ #window1 { top: 190px; left: -5px; }
200
+ }
201
+ @media screen and (max-width:540px){
202
+ #window0 .wincontent { width: 230px; height: 200px; }
203
+ #window3 .wincontent {
204
+ width: 275px;
205
+ height: auto;
206
+ }
207
+ #window3 { top: 9px; left: 10px; }
208
+ #window2 { left: -118px; }
209
+ #window1 .wincontent { width: auto; height: 300px; }
210
+ }