/ daemon / HTTPServerResources.h
HTTPServerResources.h
  1  /*
  2  * Copyright (c) 2013-2023, The PurpleI2P Project
  3  *
  4  * This file is part of Purple i2pd project and licensed under BSD3
  5  *
  6  * See full license text in LICENSE file at top of project tree
  7  */
  8  
  9  #ifndef HTTP_SERVER_RESOURCES_H__
 10  #define HTTP_SERVER_RESOURCES_H__
 11  
 12  namespace i2p
 13  {
 14  namespace http
 15  {
 16  	const std::string itoopieFavicon =
 17  		"data:image/png;base64,"
 18  		"iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACx"
 19  		"jwv8YQUAAAAJcEhZcwAALiIAAC4iAari3ZIAAAAHdElNRQfgCQsUNSZrkhi1AAAAGXRFWHRTb2Z0"
 20  		"d2FyZQBwYWludC5uZXQgNC4wLjEyQwRr7AAAAoJJREFUOE9jwAUqi4Q1oEwwcDTV1+5sETaBclGB"
 21  		"vb09C5QJB6kWpvFQJoOCeLC5kmjEHCgXE2SlyETLi3h6QrkM4VL+ssWSCZUgtopITLKqaOotRTEn"
 22  		"cbAkLqAkGtOqLBLVAWLXyWSVFkkmRiqLxuaqiWb/VBYJMAYrwgckJY25VEUzniqKhjU2y+RtCRSP"
 23  		"6lUXy/1jIBV5tlYxZUaFVMq2NInwIi9hO8fSfOEAqDZUoCwal6MulvOvyS7gi69K4j9zxZT/m0ps"
 24  		"/28ptvvvquXXryIa7QYMMdTwqi0WNtVi0GIDseXl7TnUxFKfnGlxAGp0+D8j2eH/8Ub7/9e7nf7X"
 25  		"+Af/B7rwt6pI0h0l0WhQADOC9DBkhSirpImHNVZKp24ukkyoshGLnN8d5fA/y13t/44Kq/8hlnL/"
 26  		"z7fZ/58f6vcxSNpbVUVFhV1RLNBVTsQzVYZPSwhsCAhkiIfpNMrkbO6TLf071Sfk/5ZSi/+7q6z/"
 27  		"P5ns+v9mj/P/CpuI/20y+aeNGYxZoVoYGmsF3aFMBAAZlCwftnF9ke3//bU2//fXWP8/UGv731Am"
 28  		"+V+DdNblSqnUYqhSTKAiYSOqJBrVqiaa+S3UNPr/gmyH/xuKXf63hnn/B8bIP0UxHfEyyeSNQKVM"
 29  		"EB1AEB2twhcTLp+gIBJUoyKasEpVJHmqskh8qryovUG/ffCHHRU2q/Tk/YuB6eGPsbExa7ZkpLu1"
 30  		"oLEcVDtuUCgV1w60rQzElpRUE1EVSX0BYidHiInXF4nagNhYQW60EF+ApH1ktni0A1SIITSUgVlZ"
 31  		"JHYnlIsfzJjIp9xZKswL5YKBHL+coKJoRDaUSzoozxHVrygQU4JykQADAwAT5b1NHtwZugAAAABJ"
 32  		"RU5ErkJggg==";
 33  
 34  	// bundled style sheet
 35  	const std::string internalCSS =
 36  		"<style>\r\n"
 37  		":root { --main-bg-color: #fafafa; --main-text-color: #103456; --main-link-color: #894c84; --main-link-hover-color: #fafafa; }\r\n"
 38  		"@media (prefers-color-scheme: dark) { :root { --main-bg-color: #242424; --main-text-color: #17ab5c; --main-link-color: #bf64b7; --main-link-hover-color: #000000; } }\r\n"
 39  		"body { font: 100%/1.5em sans-serif; margin: 0; padding: 1.5em; background: var(--main-bg-color); color: var(--main-text-color); }\r\n"
 40  		"a, .slide label { text-decoration: none; color: var(--main-link-color); }\r\n"
 41  		"a:hover, a.button.selected, .slide label:hover, button[type=submit]:hover { color: var(--main-link-hover-color); background: var(--main-link-color); }\r\n"
 42  		"a.button { appearance: button; text-decoration: none; padding: 0 5px; border: 1px solid var(--main-link-color); }\r\n"
 43  		".header { font-size: 2.5em; text-align: center; margin: 1em 0; color: var(--main-link-color); }\r\n"
 44  		".wrapper { margin: 0 auto; padding: 1em; max-width: 64em; }\r\n"
 45  		".menu { display: block; float: left; overflow: hidden; padding: 4px; max-width: 12em; white-space: nowrap; text-overflow: ellipsis ;}\r\n"
 46  		".listitem { display: block; font-family: monospace; font-size: 1.2em; white-space: nowrap; }\r\n"
 47  		".tableitem { font-family: monospace; font-size: 1.2em; white-space: nowrap; }\r\n"
 48  		".content { font-size: 1em; margin-left: 2em; padding: 4px; max-width: 50em; overflow: auto; position: absolute; left: 35%; }\r\n"
 49  		".tunnel.established { color: #56B734; }\r\n"
 50  		".tunnel.expiring { color: #D3AE3F; }\r\n"
 51  		".tunnel.failed { color: #D33F3F; }\r\n"
 52  		".tunnel.building { color: #434343; }\r\n"
 53  		".tcell_left { text-align: left; }\r\n"
 54  		".tcell_center { text-align:  center; }\r\n"
 55  		".tcell_right { text-align:  right; }\r\n"
 56  		"table th { padding-left: 0.25em; padding-right: 0.25em; }\r\n"
 57  		"table td { padding-left: 0.25em; padding-right: 0.25em; }\r\n"
 58  		"caption { font-size: 1.5em; text-align: center; color: var(--main-link-color); }\r\n"
 59  		"table { border-collapse: collapse; text-align: center; }\r\n"
 60  		"table.extaddr { text-align: left; }\r\n"
 61  		"table.extaddr td { padding: 0; }\r\n"
 62  		"table.services { width: 100%; }\r\n"
 63  		"table.services td { padding: 0; }\r\n"
 64  		"textarea { background-color: var(--main-bg-color); color: var(--main-text-color); word-break: break-all; }\r\n"
 65  		".streamdest { width: 120px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }\r\n"
 66  		".slide div.slidecontent, .slide [type=\"checkbox\"] { display: none; }\r\n"
 67  		".slide [type=\"checkbox\"]:checked ~ div.slidecontent { display: block; margin-top: 0; padding: 0; }\r\n"
 68  		".disabled { color: #D33F3F; }\r\n"
 69  		".enabled { color: #56B734; }\r\n"
 70  		"button[type=submit] { background-color: transparent; color: var(--main-link-color); text-decoration: none;\r\n"
 71  		"	padding: 5px; border: 1px solid var(--main-link-color); font-size: 14px; }\r\n"
 72  		"input, select, select option { background-color: var(--main-bg-color); color: var(--main-link-color); padding: 5px;\r\n"
 73  		"	border: 1px solid var(--main-link-color); font-size: 14px; }\r\n"
 74  		"input:focus, select:focus, select option:focus { outline: none; }\r\n"
 75  		"input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }\r\n"
 76  		"@media screen and (max-width: 1150px) { /* adaptive style */\r\n"
 77  		"	.wrapper { max-width: 58em; }\r\n"
 78  		"	.content { max-width: 40em; }\r\n"
 79  		"}\r\n"
 80  		"@media screen and (max-width: 980px) { body { font: 100%/1.2em sans-serif; padding: 1.2em 0 0 0; }\r\n"
 81  		"	.menu { width: 100%; max-width: unset; display: block; float: none; position: unset; font-size: 16px; text-align: center; }\r\n"
 82  		"	.menu a, .commands a { display: inline-block; padding: 4px; }\r\n"
 83  		"	.content { float: none; margin-left: unset; margin-top: 16px; max-width: 100%; width: 100%; text-align: center; position: absolute; left: 0; }\r\n"
 84  		"	a, .slide label { display: block; }\r\n"
 85  		"	.header { margin: unset; font-size: 1.5em; }\r\n"
 86  		"	small { display: block; }\r\n"
 87  		"	a.button { appearance: button; text-decoration: none; margin-top: 10px; padding: 6px; border: 2px solid var(--main-link-color);\r\n"
 88  		"		border-radius: 5px; width: -webkit-fill-available; }\r\n"
 89  		"	input, select { width: 35%; text-align: center; padding: 5px; border: 2px solid var(--main-link-color); border-radius: 5px; font-size: 18px; }\r\n"
 90  		"	table.extaddr { margin: auto; text-align: unset; }\r\n"
 91  		"	textarea { width: -webkit-fill-available; height: auto; padding: 5px; border: 2px solid var(--main-link-color);\r\n"
 92  		"		border-radius: 5px; font-size: 12px; }\r\n"
 93  		"	button[type=submit] { padding: 5px 15px; background: transparent; border: 2px solid var(--main-link-color); cursor: pointer;\r\n"
 94  		"		border-radius: 5px; position: relative; height: 36px; display: -webkit-inline-box; margin-top: 10px; }\r\n"
 95  		"}\r\n"
 96  		"</style>\r\n";
 97  
 98  	// for external style sheet
 99  	std::string externalCSS;
100  
101  } // http
102  } // i2p
103  
104  #endif /* HTTP_SERVER_RESOURCES_H__ */