목차
Happy Valentine's Day
헤드라인 2020 발렌타인데이 고백 페이지 (코드 공유)

2020 발렌타인데이 고백 페이지 (코드 공유)

Feb 14, 2020 am 11:48 AM
발렌타인 데이

趁此单身汪伤心之日,作为一名前端程序猿的我也按捺不住了,撸个表白页面送给广大想表白的人儿。

话不多说,先看效果(网页地址):

2020 발렌타인데이 고백 페이지 (코드 공유)

2020 발렌타인데이 고백 페이지 (코드 공유)

功能

一个网页输入名称,生成带参数的网址。

浏览器输入该网址,即可打开带有该名字的网页,图片轮播,还带有音乐哟

(简单实现,本文不是技术软文,而是小工具推荐啊啊哈哈)

(ps: 已经做了移动端适配,手机打开效果更加哦)

代码

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

// name.html

<!DOCTYPE html>

<html>

  <head>

    <meta charset="UTF-8" />

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <meta http-equiv="X-UA-Compatible" content="ie=edge" />

    <title>输入名字</title>

    <style>

      body {

        min-height: 100vh;

        background: linear-gradient(#1d2b64, #f8cdda);

        color: #fff;

        font-family: PingFangSC-Regular;

        padding: 0;

        margin: 0;

      }

      input {

        display: inline-block;

        width: 80%;

        height: 32px;

        line-height: 1.5;

        padding: 4px 7px;

        margin: 20px auto 0 auto;

        font-size: 16px;

        border: 1px solid #dcdee2;

        border-radius: 4px;

        color: #515a6e;

        background-color: #fff;

        background-image: none;

        position: relative;

        cursor: text;

        -webkit-transition: border 0.2s ease-in-out, background 0.2s ease-in-out,

          -webkit-box-shadow 0.2s ease-in-out;

        transition: border 0.2s ease-in-out, background 0.2s ease-in-out,

          -webkit-box-shadow 0.2s ease-in-out;

        transition: border 0.2s ease-in-out, background 0.2s ease-in-out,

          box-shadow 0.2s ease-in-out;

        transition: border 0.2s ease-in-out, background 0.2s ease-in-out,

          box-shadow 0.2s ease-in-out, -webkit-box-shadow 0.2s ease-in-out;

      }

      .button {

        display: flex;

        align-items: center;

        justify-content: center;

        position: relative;

        z-index: 10;

        width: 80%;

        height: 40px;

        background: rgba(89, 126, 247, 1);

        border-radius: 44px;

        font-size: 14px;

        font-weight: 500;

        color: rgba(255, 255, 255, 1);

        line-height: 20px;

        cursor: pointer;

      }

      .button-shadow {

        width: 80%;

        height: 40px;

        background: rgba(106, 140, 253, 1);

        border-radius: 44px;

        opacity: 0.3081;

        -webkit-filter: blur(4px);

        filter: blur(4px);

        margin-top: -36px;

      }

      #card {

        width: 80%;

        box-sizing: border-box;

        padding: 20px 12px;

        word-wrap: break-word;

      }

      @media screen and (min-width: 800px) {

        .container {

          width: 350px;

          margin: 0 auto;

        }

      }

    </style>

  </head>

  <body>

    <div>

      <div style="text-align: center; margin-top: 40px">

        <h2 id="Happy-nbsp-Valentine-s-nbsp-Day">Happy Valentine&#39;s Day</h2>

        <input type="text" id="name" />

      </div>

      <script>

        window.onload = function() {

          document.getElementById("btn").addEventListener("click", function() {

            let name = document.getElementById("name").value;

            if (name === "") {

              alert("请输入姓名");

              return;

            }

            let url =

              "https://zxpsuper.github.io/Demo/valentine_day/index.html?name=" +

              encodeURIComponent(encodeURIComponent(name));

            document.getElementById("card").innerHTML = url;

          });

        };

      </script>

      <div

        style="display: flex;margin-top: 40px;  flex-direction:column;align-items: center "

      >

        <div id="btn">确定</div>

        <div></div>

        <div id="card"></div>

        <p id="copy-btn">复制以上网址发给他人吧</p>

      </div>

    </div>

  </body>

</html>

------------

//index.html

<!DOCTYPE html>

<html>

  <head>

    <meta charset="UTF-8" />

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <meta http-equiv="X-UA-Compatible" content="ie=edge" />

    <title>情人节快乐</title>

    <style>

      img {

        width: 100%;

      }

      body {

        min-height: 100vh;

        background: linear-gradient(#1d2b64, #f8cdda);

        color: #fff;

        font-family: PingFangSC-Regular;

        padding: 0;

        margin: 0;

      }

      .avatar {

        width: 44px;

        height: 44px;

        border-radius: 50%;

        border: 2px solid #fff;

      }

      .shadow {

        position: absolute;

        left: 0;

        z-index: -1;

        filter: blur(50px);

      }

      .btn-group {

        display: flex;

        margin-top: 40px;

        justify-content: space-between;

        align-items: center;

      }

      .btn-group div {

        flex: 1;

        text-align: center;

      }

      .sure {

        padding: 14px 0;

        background: linear-gradient(

          180deg,

          rgba(255, 127, 87, 1) 0%,

          rgba(221, 40, 39, 1) 100%

        );

        border-top-left-radius: 20px;

        border-bottom-left-radius: 20px;

      }

      .cancel {

        padding: 14px 0;

        background: #eee;

        color: #333;

        border-top-right-radius: 20px;

        border-bottom-right-radius: 20px;

      }

      marquee {

        background: none;

      }

      @media screen and (min-width: 800px) {

        .container {

          width: 350px;

          margin: 0 auto;

        }

      }

    </style>

  </head>

  <body>

    <div>

      <div style="padding: 12px">

        <div

          style="position: relative; display: flex; align-items: center; margin-bottom: 10px"

        >

          <img src="/static/imghw/default1.png"  data-src="avatar.jpg"  class="lazy"   alt="" />

          <img class="avatar shadow lazy"  src="/static/imghw/default1.png"  data-src="avatar.jpg"   alt=""  />

          <span style="margin-left: 10px" id="name">小皮咖</span>

        </div>

        <marquee scrolldelay="0" scrollamount="20">

          <img  src="/static/imghw/default1.png"  data-src="1.png"  class="lazy"   / alt="2020 발렌타인데이 고백 페이지 (코드 공유)" >

          <img  src="/static/imghw/default1.png"  data-src="2.png"  class="lazy"   / alt="2020 발렌타인데이 고백 페이지 (코드 공유)" >

          <img  src="/static/imghw/default1.png"  data-src="3.png"  class="lazy"   / alt="2020 발렌타인데이 고백 페이지 (코드 공유)" >

          <img  src="/static/imghw/default1.png"  data-src="4.png"  class="lazy"   / alt="2020 발렌타인데이 고백 페이지 (코드 공유)" >

          <img  src="/static/imghw/default1.png"  data-src="5.png"  class="lazy"   / alt="2020 발렌타인데이 고백 페이지 (코드 공유)" >

          <img  src="/static/imghw/default1.png"  data-src="6.png"  class="lazy"   / alt="2020 발렌타인데이 고백 페이지 (코드 공유)" >

          <img  src="/static/imghw/default1.png"  data-src="7.png"  class="lazy"   / alt="2020 발렌타인데이 고백 페이지 (코드 공유)" >

        </marquee>

        <audio

          src="http://att.chinauui.com/day_181211/20181211_8480d0323003455bd6de8CcQ3Eq28Mm9.mp3"

          autoplay

          loop

        >

          您的浏览器不支持 audio 标签。

        </audio>

        <div>

          <div onclick="alert(&#39;情人节快乐\\(^o^)/~&#39;)">

            确定

          </div>

          <div onclick="alert(&#39;取消无效,请重新选择&#39;)">取消</div>

        </div>

      </div>

    </div>

    <script>

      function getQueryString(name) {

        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");

        var r = window.location.search.substr(1).match(reg);

        if (r != null) {

          return r[2];

        }

        return null;

      }

      window.onload = function() {

        let name = getQueryString("name");

        document.getElementById("name").innerHTML = decodeURIComponent(

          decodeURIComponent(name)

        );

      };

    </script>

  </body>

</html>

로그인 후 복사

源码地址

2020 발렌타인데이 고백 페이지 (코드 공유)

最后祝大家情人节快乐!!

相关推荐

1.2018浪漫七夕:7款程序员必备表白源码(超炫酷)

2.浪漫程序员:情人节唯美表白代码

3.2019浪漫情人节:8款程序员必备表白源码

4.2019浪漫七夕:十款程序员必备表白源码

본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

AI Hentai Generator

AI Hentai Generator

AI Hentai를 무료로 생성하십시오.

인기 기사

R.E.P.O. 에너지 결정과 그들이하는 일 (노란색 크리스탈)
4 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 최고의 그래픽 설정
4 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 아무도들을 수없는 경우 오디오를 수정하는 방법
4 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 채팅 명령 및 사용 방법
4 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌

뜨거운 도구

메모장++7.3.1

메모장++7.3.1

사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전

SublimeText3 중국어 버전

중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기

스튜디오 13.0.1 보내기

강력한 PHP 통합 개발 환경

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구

SublimeText3 Mac 버전

SublimeText3 Mac 버전

신 수준의 코드 편집 소프트웨어(SublimeText3)