Skip to content

Commit

Permalink
Merge pull request #3 from mucahitkurtlar/dev
Browse files Browse the repository at this point in the history
Documentation and exit functionality
  • Loading branch information
mucahitkurtlar authored Mar 3, 2023
2 parents 67aa35f + 2285416 commit 041a068
Show file tree
Hide file tree
Showing 8 changed files with 116 additions and 76 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# limoni

ekşi sözlük favorilerinizi .docx formatında arşivleyin.

## İndirme

[buradaki](https://github.com/mucahitkurtlar/limoni/releases) adresten kullanmak istediğiniz platform için uygun sürümü indirin. Kullanmaya başlamadan önce arşiv dosyasını açın.

## Kullanım

limoni'yi indirdikten sonra klasör içerisindeki çalıştırılabilir dosyayı _(GNU/Linux ve macOS için `limoni`, Windows için `limoni.exe`)_ çalıştırın. Uygulama tarayıcınızda açılacaktır. Tarayıcınızda açılmazsa uygulama açıkken [buradaki](http://localhost:4455) adresi ziyaret edin. Sonrasında nick'inizi ilgili alana girin ve arşivlemek istediğiniz entryleri ayıklayın. Bitirmek istediğinizde `bitir` butonuna basarak arşivleme işlemini sonlandırabilir ve arşiv dosyasını indirebilirsiniz.
1 change: 1 addition & 0 deletions cmd/limoni/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func main() {
app.Get("/entry", router.EntryGetHandler(store, favCollector))
app.Post("/entry", router.EntryPostHandler(favCollector, favFile))
app.Get("/download", router.DownloadGetHandler(favFile))
app.Get("/exit", router.ExitGetHandler())

utils.OpenInBrowser(fmt.Sprintf("http://localhost:%v", config.Port))
log.Fatal(app.Listen(fmt.Sprintf(":%v", config.Port)))
Expand Down
8 changes: 8 additions & 0 deletions pkg/router/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,11 @@ func DownloadGetHandler(favFile *model.FavFile) func(c *fiber.Ctx) error {
return c.SendFile(favFile.GetFilePath())
}
}

func ExitGetHandler() func(c *fiber.Ctx) error {
return func(c *fiber.Ctx) error {
// exit the program
os.Exit(0)
return nil
}
}
5 changes: 5 additions & 0 deletions web/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ a {
font-size: 2em;
}

.exit {
margin-top: 1rem;
margin-right: 2rem;
}

.subtitle {
font-size: .5em;
}
Expand Down
80 changes: 40 additions & 40 deletions web/template/entry.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,51 @@
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="/static/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>limoni</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="/static/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>limoni</title>
</head>

<body>
{{template "header" .}}
<div class="container col center">
<div class="entry col">
<div class="entry-title row start gray-text">
{{.title}}
</div>
<div class="entry-content gray-text">
{{.content}}
</div>
<div class="favs row start">
<div class="fav-icon col center">
<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" class="eksico"
width="14" height="19">
<defs>
<symbol id="eksico-drop" viewBox="0 0 14 19">
<path
d="M6.71981 17.3999C3.55072 17.3999 1 14.8492 1 11.6801C1 8.58831 6.71981 1.3999 6.71981 1.3999C6.71981 1.3999 12.4396 8.58831 12.4396 11.6801C12.4396 14.8492 9.88889 17.3999 6.71981 17.3999ZM6.71981 17.3999C6.7971 17.3999 6.7971 17.3999 6.71981 17.3999Z"
stroke-width="1.3px"></path>
</symbol>
</defs>
<use xlink:href="#eksico-drop" fill="#BDBDBD"></use>
</svg>
</div>
<div class="fav-count gray-text">{{.favoriteCount}}</div>
</div>
<div class="author row end green-text">{{.author}}</div>
<div class="date row end pale-text"><a href="{{.url}}">{{.date}}</a></div>
</div>
<div class="actions">
<form method="post">
<input type="submit" class="negative-btn" name="action" value="boşver">
<input type="submit" class="positive-btn" name="action" value="arşivle">
<input type="submit" class="neutral-btn" name="action" value="bitir">
</form>
{{template "header" .}}
<div class="container col center">
<div class="entry col">
<div class="entry-title row start gray-text">
{{.title}}
</div>
<div class="entry-content gray-text">
{{.content}}
</div>
<div class="favs row start">
<div class="fav-icon col center">
<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" class="eksico" width="14"
height="19">
<defs>
<symbol id="eksico-drop" viewBox="0 0 14 19">
<path
d="M6.71981 17.3999C3.55072 17.3999 1 14.8492 1 11.6801C1 8.58831 6.71981 1.3999 6.71981 1.3999C6.71981 1.3999 12.4396 8.58831 12.4396 11.6801C12.4396 14.8492 9.88889 17.3999 6.71981 17.3999ZM6.71981 17.3999C6.7971 17.3999 6.7971 17.3999 6.71981 17.3999Z"
stroke-width="1.3px"></path>
</symbol>
</defs>
<use xlink:href="#eksico-drop" fill="#BDBDBD"></use>
</svg>
</div>
<div class="fav-count gray-text">{{.favoriteCount}}</div>
</div>
<div class="author row end green-text">{{.author}}</div>
<div class="date row end pale-text"><a href="{{.url}}">{{.date}}</a></div>
</div>
<div class="actions">
<form method="post">
<input type="submit" class="negative-btn" name="action" value="boşver">
<input type="submit" class="positive-btn" name="action" value="arşivle">
<input type="submit" class="neutral-btn" name="action" value="bitir">
</form>
</div>
{{template "footer" .}}
</div>
{{template "footer" .}}
</body>

</html>
29 changes: 14 additions & 15 deletions web/template/footer.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
{{ define "footer" }}
<footer>
<div class="footer pale-text">
🄯 2023 Mücahit KURTLAR
</div>
<div class="github">
<a href="https://github.com/mucahitkurtlar/limoni" target="_blank">
<div class="github-logo">
<svg width="25" height="25" viewBox="0 0 1024 1024" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M8 0C3.58 0 0 3.58 0 8C0 11.54 2.29 14.53 5.47 15.59C5.87 15.66 6.02 15.42 6.02 15.21C6.02 15.02 6.01 14.39 6.01 13.72C4 14.09 3.48 13.23 3.32 12.78C3.23 12.55 2.84 11.84 2.5 11.65C2.22 11.5 1.82 11.13 2.49 11.12C3.12 11.11 3.57 11.7 3.72 11.94C4.44 13.15 5.59 12.81 6.05 12.6C6.12 12.08 6.33 11.73 6.56 11.53C4.78 11.33 2.92 10.64 2.92 7.58C2.92 6.71 3.23 5.99 3.74 5.43C3.66 5.23 3.38 4.41 3.82 3.31C3.82 3.31 4.49 3.1 6.02 4.13C6.66 3.95 7.34 3.86 8.02 3.86C8.7 3.86 9.38 3.95 10.02 4.13C11.55 3.09 12.22 3.31 12.22 3.31C12.66 4.41 12.38 5.23 12.3 5.43C12.81 5.99 13.12 6.7 13.12 7.58C13.12 10.65 11.25 11.33 9.47 11.53C9.76 11.78 10.01 12.26 10.01 13.01C10.01 14.08 10 14.94 10 15.21C10 15.42 10.15 15.67 10.55 15.59C13.71 14.53 16 11.53 16 8C16 3.58 12.42 0 8 0Z"
transform="scale(64)" fill="#1B1F23" />
</svg>
</div>
</a>
</div>

<div class="footer pale-text">
🄯 2023 Mücahit KURTLAR
</div>
<div class="github">
<a href="https://github.com/mucahitkurtlar/limoni" target="_blank">
<div class="github-logo">
<svg width="25" height="25" viewBox="0 0 1024 1024" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M8 0C3.58 0 0 3.58 0 8C0 11.54 2.29 14.53 5.47 15.59C5.87 15.66 6.02 15.42 6.02 15.21C6.02 15.02 6.01 14.39 6.01 13.72C4 14.09 3.48 13.23 3.32 12.78C3.23 12.55 2.84 11.84 2.5 11.65C2.22 11.5 1.82 11.13 2.49 11.12C3.12 11.11 3.57 11.7 3.72 11.94C4.44 13.15 5.59 12.81 6.05 12.6C6.12 12.08 6.33 11.73 6.56 11.53C4.78 11.33 2.92 10.64 2.92 7.58C2.92 6.71 3.23 5.99 3.74 5.43C3.66 5.23 3.38 4.41 3.82 3.31C3.82 3.31 4.49 3.1 6.02 4.13C6.66 3.95 7.34 3.86 8.02 3.86C8.7 3.86 9.38 3.95 10.02 4.13C11.55 3.09 12.22 3.31 12.22 3.31C12.66 4.41 12.38 5.23 12.3 5.43C12.81 5.99 13.12 6.7 13.12 7.58C13.12 10.65 11.25 11.33 9.47 11.53C9.76 11.78 10.01 12.26 10.01 13.01C10.01 14.08 10 14.94 10 15.21C10 15.42 10.15 15.67 10.55 15.59C13.71 14.53 16 11.53 16 8C16 3.58 12.42 0 8 0Z"
transform="scale(64)" fill="#1B1F23" />
</svg>
</div>
</a>
</div>
</footer>
{{ end }}
30 changes: 23 additions & 7 deletions web/template/header.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
{{ define "header" }}
<div class="header">
<div class="header-container">
<div class="header">
<div class="col center">
<div class="title green-text row center">
<a href="/">limoni</a>
</div>
<div class="subtitle gray-text row center">
favorilerinizin arşivini oluşturun
</div>
<div class="title green-text row center">
<a href="/">limoni</a>
</div>
<div class="subtitle gray-text row center">
favorilerinizin arşivini oluşturun
</div>
</div>
</div>
<div class="exit-container row end">
<div class="exit">
<a href="/exit">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
x="0px" y="0px" width="1.5rem" height="1.5rem" viewBox="0 0 122.879 122.879"
enable-background="new 0 0 122.879 122.879" xml:space="preserve">
<g>
<path fill-rule="evenodd" clip-rule="evenodd" fill="#FF4141"
d="M61.44,0c33.933,0,61.439,27.507,61.439,61.439 s-27.506,61.439-61.439,61.439C27.507,122.879,0,95.372,0,61.439S27.507,0,61.44,0L61.44,0z M73.451,39.151 c2.75-2.793,7.221-2.805,9.986-0.027c2.764,2.776,2.775,7.292,0.027,10.083L71.4,61.445l12.076,12.249 c2.729,2.77,2.689,7.257-0.08,10.022c-2.773,2.765-7.23,2.758-9.955-0.013L61.446,71.54L49.428,83.728 c-2.75,2.793-7.22,2.805-9.986,0.027c-2.763-2.776-2.776-7.293-0.027-10.084L51.48,61.434L39.403,49.185 c-2.728-2.769-2.689-7.256,0.082-10.022c2.772-2.765,7.229-2.758,9.953,0.013l11.997,12.165L73.451,39.151L73.451,39.151z" />
</g>
</svg>
</a>
</div>
</div>
</div>
{{ end }}
28 changes: 14 additions & 14 deletions web/template/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/static/style.css">
<title>limoni</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/static/style.css">
<title>limoni</title>
</head>

<body>
{{ template "header" . }}
<div class="container col center">
<div class="search-container">
<form class="search-suser" method="post">
<input class="search-input" type="text" name="nick" placeholder="suser ara..."></input>
<button class="search-button" type="submit">başla</button>
</form>
</div>
{{ template "header" . }}
<div class="container col center">
<div class="search-container">
<form class="search-suser" method="post">
<input class="search-input" type="text" name="nick" placeholder="suser ara..."></input>
<button class="search-button" type="submit">başla</button>
</form>
</div>
{{ template "footer" .}}
</div>
{{ template "footer" .}}
</body>

</html>

0 comments on commit 041a068

Please sign in to comment.