From 15c19df1e87e1e35ed657000b0c0303e95b9c8b2 Mon Sep 17 00:00:00 2001
From: ZiYi <1756318241@qq.com>
Date: Wed, 8 Sep 2021 12:49:21 +0800
Subject: [PATCH] fix bugs
---
debug2/demo.md | 1 -
debug2/test.py | 45 --------------------------------------------
static/css/index.css | 26 ++++++++++++++++---------
static/js/demo.js | 25 ------------------------
templates/dd.html | 0
templates/index.html | 4 +---
6 files changed, 18 insertions(+), 83 deletions(-)
delete mode 100644 debug2/demo.md
delete mode 100644 debug2/test.py
delete mode 100644 static/js/demo.js
delete mode 100644 templates/dd.html
diff --git a/debug2/demo.md b/debug2/demo.md
deleted file mode 100644
index 83c831f..0000000
--- a/debug2/demo.md
+++ /dev/null
@@ -1 +0,0 @@
-# test
diff --git a/debug2/test.py b/debug2/test.py
deleted file mode 100644
index b2ade2c..0000000
--- a/debug2/test.py
+++ /dev/null
@@ -1,45 +0,0 @@
-from tkinter import *
-
-
-def run1():
- a = float(inp1.get())
- b = float(inp2.get())
- s = '%0.2f+%0.2f=%0.2f\n' % (a, b, a + b)
- txt.insert(END, s) # 追加显示运算结果
- inp1.delete(0, END) # 清空输入
- inp2.delete(0, END) # 清空输入
-
-
-def run2(x, y):
- a = float(x)
- b = float(y)
- s = '%0.2f+%0.2f=%0.2f\n' % (a, b, a + b)
- txt.insert(END, s) # 追加显示运算结果
- inp1.delete(0, END) # 清空输入
- inp2.delete(0, END) # 清空输入
-
-
-root = Tk()
-root.geometry('460x240')
-root.title('简单加法器')
-
-lb1 = Label(root, text='请输入两个数,按下面两个按钮之一进行加法计算')
-lb1.place(relx=0.1, rely=0.1, relwidth=0.8, relheight=0.1)
-inp1 = Entry(root)
-inp1.place(relx=0.1, rely=0.2, relwidth=0.3, relheight=0.1)
-inp2 = Entry(root)
-inp2.place(relx=0.6, rely=0.2, relwidth=0.3, relheight=0.1)
-
-# 方法-直接调用 run1()
-btn1 = Button(root, text='方法一', command=run1)
-btn1.place(relx=0.1, rely=0.4, relwidth=0.3, relheight=0.1)
-'''
-# 方法二利用 lambda 传参数调用run2()
-btn2 = Button(root, text='方法二', command=lambda: run2(inp1.get(), inp2.get()))
-btn2.place(relx=0.6, rely=0.4, relwidth=0.3, relheight=0.1)
-'''
-# 在窗体垂直自上而下位置60%处起,布局相对窗体高度40%高的文本框
-txt = Text(root)
-txt.place(rely=0.6, relheight=0.4)
-
-root.mainloop()
diff --git a/static/css/index.css b/static/css/index.css
index f8097c9..ec430ec 100644
--- a/static/css/index.css
+++ b/static/css/index.css
@@ -5,10 +5,12 @@
html,body{
margin: 0px;
padding: 0;
- width: 100%;
- height: 90%;
- overflow: hidden;
- background: #c2ccd0;
+ overflow-y: hidden;
+ background: #c2ccd0e5;
+}
+body{
+ width: 100vw;
+ height: 100vh;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
@@ -29,17 +31,21 @@ h1{
box-shadow: 4px 4px 5px #888888;
}
ul{
- width: 60%;
+ display: block;
+ height: 50%;
+ min-width: 500px;
+ max-width: 50%;
position: relative;
- left: 20%;
+ left: 25%;
text-align: right;
border: 1px solid #bbcdc5;
box-shadow: 4px 4px 5px #888888;
+ overflow: auto;
}
li{
+ height: 10px;
margin: 5px;
padding: 10px;
- width: 80%;
list-style: none;
}
.notice{
@@ -55,14 +61,14 @@ li{
display: block;
margin: 10px;
padding: 10px;
- height: 25%;
+ height: 15%;
text-align: center;
font-size: large;
font-weight: bold;
background: #e0eee8;
}
.display{
- height: 90%;
+ height: 85%;
margin: 10px;
padding: 10px;
position: relative;
@@ -72,6 +78,8 @@ li{
font-weight: bold;
text-align: center;
background: #e0eee8;
+ overflow-y: auto;
+ overflow-x: hidden;
}
.result{
outline: none;
diff --git a/static/js/demo.js b/static/js/demo.js
deleted file mode 100644
index 1aa9652..0000000
--- a/static/js/demo.js
+++ /dev/null
@@ -1,25 +0,0 @@
-//计时器
-var intDiff = parseInt(15);//倒计时总秒数量
-function timer(intDiff) {
- window.setInterval(function () {
- var minute = 0,
- second = 0;//时间默认值
- if (intDiff > 0) {
- minute = Math.floor(intDiff / 60);
- second = Math.floor(intDiff) - (minute * 60);
- }
- if (minute <= 9) minute = '0' + minute;
- if (second <= 9) second = '0' + second;
- $('#minute').html('' + minute + '分');
- $('#second').html('' + second + '秒');
- intDiff++;
- if (intDiff >= 20) {
- clearInterval(timer); //定时器清除;
- history.back(-1);
- }
- }, 1000);
-
-}
-$(function () {
- timer(intDiff);
-});
diff --git a/templates/dd.html b/templates/dd.html
deleted file mode 100644
index e69de29..0000000
diff --git a/templates/index.html b/templates/index.html
index f06a174..6b89d7a 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -31,9 +31,7 @@