askbot-dragon 0.6.22 → 0.6.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "askbot-dragon",
3
- "version": "0.6.22",
3
+ "version": "0.6.26",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
package/public/index.html CHANGED
@@ -7,7 +7,7 @@
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" />
8
8
  <link rel="icon" href="<%= BASE_URL %>favicon.ico">
9
9
  <title><%= htmlWebpackPlugin.options.title %></title>
10
- <link href="//at.alicdn.com/t/font_1566110_eump2lzv89s.css"/>
10
+ <link rel="stylesheet" href="//at.alicdn.com/t/font_1566110_eump2lzv89s.css"/>
11
11
  <script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
12
12
  <script src="https://static.guoranbot.com/ckeditor5-build-classic/0.3.7/build/ckeditor.js"></script>
13
13
  <style>
package/src/App.vue CHANGED
@@ -15,7 +15,8 @@ export default {
15
15
  }
16
16
  </script>
17
17
 
18
- <style>
18
+ <style lang="less">
19
+ @import "assets/less/converSationContainer/common.less";
19
20
  /*#app {
20
21
  font-family: Avenir, Helvetica, Arial, sans-serif;
21
22
  -webkit-font-smoothing: antialiased;
@@ -0,0 +1,37 @@
1
+ const displays = document.querySelectorAll('.note-display');
2
+ const transitionDuration = 900;
3
+ function displasss(){
4
+ displays.forEach(display => {
5
+ let note = parseFloat(display.dataset.note);
6
+ let [int, dec] = display.dataset.note.split('.');
7
+ [int, dec] = [Number(int), Number(dec)];
8
+ strokeTransition(display, note);
9
+ increaseNumber(display, int, 'int');
10
+ increaseNumber(display, dec, 'dec');
11
+ })
12
+ }
13
+
14
+ function strokeTransition(display, note) {
15
+ let progress = display.querySelector('.circle__progress--fill');
16
+ let radius = progress.r.baseVal.value;
17
+ let circumference = 2 * Math.PI * radius;
18
+ let offset = circumference * (10 - note) / 10;
19
+ progress.style.setProperty('--initialStroke', circumference);
20
+ progress.style.setProperty('--transitionDuration', `${transitionDuration}ms`);
21
+
22
+ setTimeout(() => progress.style.strokeDashoffset = offset, 100);
23
+ }
24
+ function increaseNumber(display, number, className) {
25
+ let element = display.querySelector(`.percent__${className}`),
26
+ decPoint = className === 'int' ? '.' : '',
27
+ interval = transitionDuration / number,
28
+ counter = 0;
29
+
30
+ let increaseInterval = setInterval(() => {
31
+ if (counter === number) { window.clearInterval(increaseInterval); }
32
+
33
+ element.textContent = counter + decPoint;
34
+ counter++;
35
+ }, interval);
36
+ }
37
+ export {displasss}