Sfoglia il codice sorgente

Merge branch '留言板背景' of http://shvber.com/Git/YZXYH_202309U into 留言板背景

Yue 2 anni fa
parent
commit
d2687cb01c

+ 1 - 0
YZXYH2017/YZXYH2017/Views/LuckDraw/Index.cshtml

@@ -134,6 +134,7 @@
                 flex-direction: row;
                 justify-content: space-between;
                 flex-wrap: wrap;
+                font-weight: 600;
             }
 
                 .draw-list-box .list .item {

+ 9 - 5
YZXYH2017/YZXYH2017/Views/MessageWall/Index.cshtml

@@ -129,7 +129,7 @@
     </style>
 </head>
 <body class="">
-    @* <canvas id="canvas"></canvas> *@
+     <canvas id="canvas"></canvas> 
     <div id="msg-box"></div>
     <script src="~/Scripts/jquery.signalR-2.4.1.min.js"></script>
     <script src="~/signalr/hubs"></script>
@@ -347,14 +347,16 @@
         };
     </script>
 
-    <script>
+<script>
 
         ////Based on https://www.youtube.com/watch?v=3CycKKJiwis
         var canvas = document.getElementById("canvas");
         var mobile = navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i);
-        canvas.width = window.innerWidth;
-        canvas.height = window.innerHeight; // Initialize the GL context
-
+        //canvas.width = window.innerWidth;
+        //canvas.height = window.innerHeight; // Initialize the GL context
+        // 背景调整为图片,canvas宽度为0
+        canvas.width = 0;
+        canvas.height = 0;
         var gl = canvas.getContext('webgl');
 
         if (!gl) {
@@ -379,6 +381,8 @@
         function onWindowResize() {
             canvas.width = window.innerWidth;
             canvas.height = window.innerHeight;
+            canvas.width = 0;
+            canvas.height = 0;
             gl.viewport(0, 0, canvas.width, canvas.height);
             gl.uniform1f(widthHandle, window.innerWidth);
             gl.uniform1f(heightHandle, window.innerHeight);