Преглед изворни кода

이스터에그 코드 추가

neo_yosoro에 맞춰서 만들자니 자꾸 끼워넣기 시전
hoparkgo9ma пре 7 година
родитељ
комит
145afa04f9
3 измењених фајлова са 36 додато и 3 уклоњено
  1. 0 1
      app.py
  2. 24 2
      func.py
  3. 12 0
      views/main_css/egg.css

+ 0 - 1
app.py

@@ -2310,7 +2310,6 @@ def manager(num = 1):
         return easy_minify(flask.render_template(skin_check(), 
             imp = [load_lang('admin') + ' ' + load_lang('tool'), wiki_set(), custom(), other2([0, 0])],
             data =  '''
-                    <script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script></head>
                     <script>
                     function config_easter_egg (target) {
                         if (target.checked === true) {

+ 24 - 2
func.py

@@ -399,6 +399,8 @@ def wiki_set(num = 1):
         db_data = curs.fetchall()
         if db_data:
             data_list[5] += '''
+            <link rel="stylesheet" href="/views/main_css/egg.css">
+            <script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script></head>
             <script>
             easter_count = 0;
 
@@ -408,13 +410,33 @@ def wiki_set(num = 1):
             function easter(e) {
                 easter_count++;
                 if (easter_count > 3) {
-                    console.log('easteregg')
+                    data = get_egg();
+                    console.log(data);
+                    egg_overlay = document.getElementById('egg');
+                    egg.innerHTML = data;
+                    egg.style.display = 'block';
                 }
             }
+
+            function get_egg(e) {
+                $.ajax({
+                    type: 'GET',
+                    url : '/request/egg',
+                    dataType : 'text',
+                    success : function(e) {
+                        return e.responseText;
+                    },
+                    error : function(e) {
+                        return e.responseText;
+                    }
+                })
+            }
             </script>
+
+            <div id="egg">
+            </div>
             '''
 
-        print(data_list)
         return data_list
 
     if num == 2:

+ 12 - 0
views/main_css/egg.css

@@ -0,0 +1,12 @@
+#egg {
+    position: fixed;
+    display: none;
+    width: 100%;
+    height: 100%;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    background-color: rgba(0,0,0,0.5);
+    z-index: 2;
+}