2
0
jomo 8 жил өмнө
parent
commit
305ed1c65f

+ 1 - 0
.gitignore

@@ -6,3 +6,4 @@ coverage/
 *.rdb
 *.sublime-*
 config.js
+lib/public/images/sponsor.png

+ 5 - 1
config.example.js

@@ -30,7 +30,11 @@ var config = {
     http_timeout: 2000,                           // ms until connection to Mojang is dropped
     debug_enabled: false,                         // enables logging.debug & editing index page
     log_time: true                                // set to false if you use an external logger that provides timestamps
-  }
+  },
+  sponsor: {
+    sidebar: '<hr><div class="list-group"><a class="list-group-item sponsor-item" href="https://akliz.net/crafatar" target="_blank" title="Applies to all modpacks and plans for the first billing cycle only.">Save 20% on a Minecraft server with Akliz.</a></div>',
+    top_right: '<a href="https://akliz.net/crafatar" target="_blank" title="Crafatar is sponsored by Akliz" class="sponsor"><img src="/images/sponsor.png" alt="Akliz"></a>'
+  },
 };
 
 module.exports = config;

BIN
lib/public/images/akliz.png


+ 11 - 0
lib/public/stylesheets/style.css

@@ -43,6 +43,17 @@ a.sponsor {
   margin: 5px;
 }
 
+a.sponsor-item {
+  color: #aa7100 !important;
+  font-weight: initial;
+  background: #fff3de;
+  border-color: #fcd794;
+}
+
+.sponsor-item:hover {
+  background: #fff8ec !important;
+}
+
 .alert {
   font-size: 1rem;
 }

+ 6 - 2
lib/views/index.html.ejs

@@ -25,8 +25,9 @@
 </head>
 <body lang="en-US">
   <a href="https://github.com/crafatar/crafatar" target="_blank" class="forkme">Fork me on GitHub</a>
-  <a href="https://akliz.net/crafatar" target="_blank" title="Crafatar is sponsored by Akliz" class="sponsor">
-  <img src="/images/akliz.png" alt="Akliz"></a>
+  <% if (config.sponsor.top_right) { %>
+    <%- config.sponsor.top_right %>
+  <% } %>
   <div class="jumbotron">
     <div class="container">
       <h1>Crafatar</h1>
@@ -291,6 +292,9 @@
         <a rel="nofollow" href="https://github.com/sk89q/Plumeria" target="_blank" class="list-group-item">Plumeria <i>(Discord)</i></a>
         <a href="https://github.com/crafatar/crafatar/wiki/Who-uses-crafatar%3F#other-services-using-crafatar" target="_blank" class="list-group-item">and many more…</a>
       </div>
+      <% if (config.sponsor.sidebar) { %>
+        <%- config.sponsor.sidebar %>
+      <% } %>
     </div>
   </div>