Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions api/temp_mail.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package api

import (
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
"net/http/httputil"
"net/url"

"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
)

func (config ApiConfig) ServeTempMail() {
Expand All @@ -13,6 +14,12 @@ func (config ApiConfig) ServeTempMail() {
// Add CORS middleware to allow all requests
corsConfig := cors.DefaultConfig()
corsConfig.AllowAllOrigins = true
corsConfig.AllowCredentials = true
corsConfig.AllowHeaders = []string{
"X-MailboxToken",
"Content-Type",
//"accept",
}
router.Use(cors.New(corsConfig))

// Reverse proxy to https://www.developermail.com/api/v1/
Expand Down
246 changes: 242 additions & 4 deletions web/css/tempmail.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* TOP NAV BAR */

.dd-nav-bar {
position: absolute;
top: 0;
Expand All @@ -6,10 +8,246 @@
background-color: var(--bg-bright);
background: linear-gradient(0deg, var(--bg-bright) 50%, var(--bg) 100%);
box-shadow: 0.3rem 0.3rem 0.6rem var(--shadow-1), -0.2rem -0.2rem 0.5rem var(--shadow-2);
display: flex;
align-content: center;
flex-wrap: wrap;
}

.tempmail-manage {
height: 6vh;
margin-bottom: unset;
justify-content: center;
width: fit-content;
}

#create-mail-btn,
#del-mail-btn {
width: 6.5rem;
height: 3.5rem;
font-size: 1.5rem;
justify-content: center;
margin: 0.5rem;
}

#show-current-mail {
position: absolute;
left: 50%;
display: flex;
align-items: center;
top: 50%;
-ms-transform: translateY(-50%) translateX(-50%);
transform: translateY(-50%) translateX(-50%);
}

#current-mail {
width: 28rem;
height: 4rem;
border: none;
border-radius: 1rem;
font-size: 1.4rem;
padding-left: 3.8rem;
box-shadow: var(--shadowPreset-2);
background: none;
font-family: inherit;
color: var(--textColor-1);
}

#current-mail::placeholder {
color: var(--textColor-1);
}

#current-mail::-moz-placeholder {
color: var(--textColor-1);
}

#current-mail:-ms-input-placeholder {
color: var(--textColor-1);
}

.tempmail-icon {
height: 2rem;
position: absolute;
font-size: 2rem;
padding: 0 1rem;
display: flex;
color: var(--textColor-1);
transition: 0.3s ease;
}

#mail-token {
width: 0;
height: 0;
color: transparent;
}

/* MAIL INBOX */

.tempmail-scroll-box {
overflow: hidden;
overflow-y: scroll;
align-items: unset;
}

.tempmail-scroll-box p {
display: flex;
}

.tempmail-scroll-box::-webkit-scrollbar {
width: 12px;
-webkit-appearance: none;
}

.tempmail-scroll-box::-webkit-scrollbar-thumb {
background: var(--bg);
border-radius: 3rem;
box-shadow: var(--shadowPreset-6);
}

#mail-view-scroll-box {
position: relative;
margin-top: 11vh;
width: 55%;
height: 87vh;
}

#content-view-scroll-box {
position: relative;
margin-top: 11vh;
width: 45%;
height: 87vh;
margin-right: 1.75rem;
}

#emails {
width: 100%;
display: flex;
flex-direction: column;
padding-top: 2rem;
}

#split-view {
display: flex;
flex-direction: row;
width: 100%;
height: 100%;
}

#content {
width: 100%;
display: flex;
padding-top: 2rem;
flex-direction: column;
}


.mail-chip {
width: 95.5%;
height: 6vh;
display: flex;
font-size: 1.6rem;
color: var(--textColor-1);
cursor: pointer;
align-items: unset;
transition: 0.3s ease;
margin-left: 2rem;
align-items: center;
flex-direction: row;
}

.mail-chip-detail {
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: block !important;
}

.mail-chip-detail.mail-header {
font-weight: bold;
margin-right: 2rem;
width: calc(35% - 2rem);
}

.mail-chip-detail.mail-sender {
margin-right: 2rem;
width: calc(45% - 2rem);
}

.mail-chip-detail.mail-date {
margin-left: 2rem;
width: calc(20% - 2rem);
}

.mail-header-chip {
width: 95%;
min-height: calc(12vh + 2rem);
display: flex;
font-size: 1.6rem;
color: var(--textColor-1);
align-items: unset;
transition: 0.3s ease;
padding: 1.5rem;
flex-direction: column;
height: fit-content;
max-height: 33.3%;
}

.mail-content-detail {
margin-bottom: 0.5rem;
}

.top-header {
flex-direction: column;
}

#content-mail-header {
margin-bottom: 0;
margin-left: 0;
margin-top: 0.5rem;
font-weight: bold;
font-size: 2rem;
display: block !important;
white-space: initial;
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
height: fit-content;
}

#mail-loading-spinner {
align-self: center;
position: unset;
margin-left: 1rem;
}

#refresh-loading-spinner {
align-self: center;
position: unset;
margin-left: 1rem;
position: absolute;
top: 0;
right: 0;
top: 50%;
-ms-transform: translateY(-50%) translateX(-50%);
transform: translateY(-50%) translateX(-50%);
}

#refresh-btn {
position: absolute;
top: 0;
right: 0;
width: 4rem;
height: 4rem;
border-radius: 4rem;
position: absolute;
display: flex;
align-items: center;
top: 50%;
-ms-transform: translateY(-50%) translateX(-50%);
transform: translateY(-50%) translateX(-50%);
margin: 0 !important;
}

.create-mail-btn {
width: 10vw;
height: 10vh;
margin: 9rem;
#refresh-icon {
font-size: 2rem;
}
6 changes: 3 additions & 3 deletions web/desktop.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
<div class="app-shortcut guide-icon" onclick="createGuideWindow()">
<img src="./images/guide.png" alt="Guide" class="app-icon">
</div>
<!-- <div class="app-shortcut guide-icon" onclick="createTempMailWindow()"> -->
<!-- <img src="./images/tempmail-gray.png" alt="TempMail" class="app-icon"> -->
<!-- </div> -->
<div class="app-shortcut guide-icon" onclick="createTempMailWindow()">
<img src="./images/tempmail-gray.png" alt="TempMail" class="app-icon">
</div>
<div class="app-shortcut whois-icon" onclick="createWhoisWindow()">
<img src="./images/whois.png" alt="WhoIs" class="app-icon">
</div>
Expand Down
Loading